File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ different scenarios.
5454 scenarios/speed
5555 scenarios/scientific
5656 scenarios/imaging
57+ scenarios/xml
5758
5859
5960Shipping Great Code
Original file line number Diff line number Diff line change 1+ XML parsing
2+ ===========
3+
4+ untangle
5+ --------
6+
7+ `untangle <http://0chris.com/untangle >`_ is a simple library which takes
8+ an XML document and returns a Python object which mirrors the nodes and
9+ attributes in its structure.
10+
11+ For example, an xml file like this:
12+
13+ .. code-block :: xml
14+
15+ <?xml version =" 1.0" ?>
16+ <root >
17+ <child name =" child1" >
18+ </root >
19+
20+ can be loaded like this:
21+
22+ .. code-block :: python
23+
24+ import untangle
25+ obj = untangle.parse(' path/to/file.xml' )
26+
27+ and then you can get the child elements name like this:
28+
29+ .. code-block :: python
30+
31+ obj.root.child[' name' ]
32+
33+ untangle also supports loading XML from a string or an URL.
34+
You can’t perform that action at this time.
0 commit comments