mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 23:00:18 +00:00
More typo, grammar, and style fixes
This commit is contained in:
@@ -30,13 +30,13 @@ can be loaded like this:
|
||||
import untangle
|
||||
obj = untangle.parse('path/to/file.xml')
|
||||
|
||||
and then you can get the child elements name like this:
|
||||
and then you can get the child element's name attribute like this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
obj.root.child['name']
|
||||
|
||||
untangle also supports loading XML from a string or an URL.
|
||||
untangle also supports loading XML from a string or a URL.
|
||||
|
||||
|
||||
*********
|
||||
@@ -69,7 +69,7 @@ can be loaded into a Python dict like this:
|
||||
with open('path/to/file.xml') as fd:
|
||||
doc = xmltodict.parse(fd.read())
|
||||
|
||||
and then you can access elements, attributes and values like this:
|
||||
and then you can access elements, attributes, and values like this:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -79,5 +79,5 @@ and then you can access elements, attributes and values like this:
|
||||
doc['mydocument']['plus']['#text'] # == u'element as well'
|
||||
|
||||
xmltodict also lets you roundtrip back to XML with the unparse function,
|
||||
has a streaming mode suitable for handling files that don't fit in memory
|
||||
and supports namespaces.
|
||||
has a streaming mode suitable for handling files that don't fit in memory,
|
||||
and supports XML namespaces.
|
||||
|
||||
Reference in New Issue
Block a user