From 9b8752be34ecf6e93a736624100212b5b5550814 Mon Sep 17 00:00:00 2001 From: Christian Stefanescu Date: Thu, 3 May 2012 19:54:20 +0200 Subject: [PATCH] Added Scenario "XML parsing" and untangle lib. --- docs/contents.rst.inc | 1 + docs/scenarios/xml.rst | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 docs/scenarios/xml.rst diff --git a/docs/contents.rst.inc b/docs/contents.rst.inc index 5af8c0f..ca36983 100644 --- a/docs/contents.rst.inc +++ b/docs/contents.rst.inc @@ -54,6 +54,7 @@ different scenarios. scenarios/speed scenarios/scientific scenarios/imaging + scenarios/xml Shipping Great Code diff --git a/docs/scenarios/xml.rst b/docs/scenarios/xml.rst new file mode 100644 index 0000000..df89d58 --- /dev/null +++ b/docs/scenarios/xml.rst @@ -0,0 +1,34 @@ +XML parsing +=========== + +untangle +-------- + +`untangle `_ is a simple library which takes +an XML document and returns a Python object which mirrors the nodes and +attributes in its structure. + +For example, an xml file like this: + +.. code-block:: xml + + + + + + +can be loaded like this: + +.. code-block:: python + + import untangle + obj = untangle.parse('path/to/file.xml') + +and then you can get the child elements name like this: + +.. code-block:: python + + obj.root.child['name'] + +untangle also supports loading XML from a string or an URL. +