Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/contents.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ different scenarios.
scenarios/speed
scenarios/scientific
scenarios/imaging
scenarios/xml


Shipping Great Code
Expand Down
34 changes: 34 additions & 0 deletions docs/scenarios/xml.rst
Original file line number Diff line number Diff line change
@@ -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.