diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-01-13 14:27:51 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-01-13 14:27:51 (GMT) |
commit | e9af827fb1682a2378d189b4e7cb8ead405a991b (patch) | |
tree | b2100d6308f74a95507583435381a732cc824572 /Doc | |
parent | 31efc746d5bdb82247ee44b8e16b6837342dc6e2 (diff) | |
download | cpython-e9af827fb1682a2378d189b4e7cb8ead405a991b.zip cpython-e9af827fb1682a2378d189b4e7cb8ead405a991b.tar.gz cpython-e9af827fb1682a2378d189b4e7cb8ead405a991b.tar.bz2 |
Cleanup the docs ElementTree a bit and describe the default_namespace parameter. In the code, replace the old outdated Doxygen-ish comment above ElementTree.write by a proper docstring.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/xml.etree.elementtree.rst | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst index 267ab07..88855d9 100644 --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -428,7 +428,7 @@ Functions arguments. Returns an element instance. -.. function:: tostring(element, encoding="us-ascii", method="xml", *, \ +.. function:: tostring(element, encoding="us-ascii", method="xml", *,\ short_empty_elements=True) Generates a string representation of an XML element, including all @@ -443,7 +443,7 @@ Functions The *short_empty_elements* parameter. -.. function:: tostringlist(element, encoding="us-ascii", method="xml", *, \ +.. function:: tostringlist(element, encoding="us-ascii", method="xml", *,\ short_empty_elements=True) Generates a string representation of an XML element, including all @@ -751,8 +751,9 @@ ElementTree Objects section root element. - .. method:: write(file, encoding="us-ascii", xml_declaration=None, \ - method="xml", *, short_empty_elements=True) + .. method:: write(file, encoding="us-ascii", xml_declaration=None,\ + default_namespace=None, method="xml", *,\ + short_empty_elements=True) Writes the element tree to a file, as XML. *file* is a file name, or a :term:`file object` opened for writing. *encoding* [1]_ is the output @@ -761,7 +762,8 @@ ElementTree Objects file. Use ``False`` for never, ``True`` for always, ``None`` for only if not US-ASCII or UTF-8 or Unicode (default is ``None``). *method* is either ``"xml"``, ``"html"`` or ``"text"`` (default is - ``"xml"``). + ``"xml"``). *default_namespace* sets the default XML namespace (for + "xmlns"). The keyword-only *short_empty_elements* parameter controls the formatting of elements that contain no content. If *True* (the default), they are emitted as a single self-closed tag, otherwise they are emitted as a pair |