diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-14 01:28:07 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-14 01:28:07 (GMT) |
commit | dddd5e909895508b67b92156bc13ba68329d0d24 (patch) | |
tree | ab169c784d37633cb320f20c6cecad82b6b9b3be /Doc | |
parent | 37f31521e4b5b98334bb1ef421e10e001ba4927e (diff) | |
download | cpython-dddd5e909895508b67b92156bc13ba68329d0d24.zip cpython-dddd5e909895508b67b92156bc13ba68329d0d24.tar.gz cpython-dddd5e909895508b67b92156bc13ba68329d0d24.tar.bz2 |
Merged revisions 78944 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78944 | florent.xicluna | 2010-03-14 02:22:09 +0100 (dim, 14 mar 2010) | 2 lines
Minor documentation updates for xml.etree.
........
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/xml.etree.elementtree.rst | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst index d9e1b59..b99dec5 100644 --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -69,8 +69,8 @@ Functions .. function:: fromstring(text) - Parses an XML section from a string constant. Same as XML. *text* is a - string containing XML data. Returns an :class:`Element` instance. + Parses an XML section from a string constant. Same as :func:`XML`. *text* + is a string containing XML data. Returns an :class:`Element` instance. .. function:: fromstringlist(sequence, parser=None) @@ -148,22 +148,24 @@ Functions arguments. Returns an element instance. -.. function:: tostring(element, encoding=None, method=None) +.. function:: tostring(element, encoding=None, method="xml") Generates a string representation of an XML element, including all - subelements. *element* is an :class:`Element` instance. *encoding* is the - output encoding (default is None). *method* is either ``"xml"``, + subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is + the output encoding (default is None). *method* is either ``"xml"``, ``"html"`` or ``"text"`` (default is ``"xml"``). Returns an (optionally) encoded string containing the XML data. -.. function:: tostringlist(element, encoding=None, method=None) +.. function:: tostringlist(element, encoding=None, method="xml") Generates a string representation of an XML element, including all - subelements. *element* is an :class:`Element` instance. *encoding* is the - output encoding (default is None). *method* is either ``"xml"``, - ``"html"`` or ``"text"`` (default is ``"xml"``). Returns a sequence object - containing the XML data. + subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is + the output encoding (default is None). *method* is either ``"xml"``, + ``"html"`` or ``"text"`` (default is ``"xml"``). Returns a list of + (optionally) encoded strings containing the XML data. It does not guarantee + any specific sequence, except that ``"".join(tostringlist(element)) == + tostring(element)``. .. versionadded:: 2.7 @@ -455,7 +457,7 @@ ElementTree Objects root element. - .. method:: write(file, encoding=None, xml_declaration=None, method=None) + .. method:: write(file, encoding=None, xml_declaration=None, method="xml") Writes the element tree to a file, as XML. *file* is a file name, or a file object opened for writing. *encoding* [1]_ is the output encoding |