Added Scenario "XML parsing" and untangle lib.
authorChristian Stefanescu <st.chris@gmail.com>
Thu, 3 May 2012 17:54:20 +0000 (19:54 +0200)
committerChristian Stefanescu <st.chris@gmail.com>
Thu, 3 May 2012 17:54:20 +0000 (19:54 +0200)
docs/contents.rst.inc
docs/scenarios/xml.rst [new file with mode: 0644]

index 5af8c0f..ca36983 100644 (file)
@@ -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 (file)
index 0000000..df89d58
--- /dev/null
@@ -0,0 +1,34 @@
+XML parsing
+===========
+
+untangle
+--------
+
+`untangle <http://0chris.com/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
+
+    <?xml version="1.0"?>
+    <root>
+        <child name="child1">
+    </root>
+
+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.
+