Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
9e189f0a
Commit
9e189f0a
authored
Jan 13, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Cleanup the docs ElementTree a bit.
parents
e9af827f
f1b045f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
Doc/library/xml.etree.elementtree.rst
Doc/library/xml.etree.elementtree.rst
+6
-6
Lib/xml/etree/ElementTree.py
Lib/xml/etree/ElementTree.py
+8
-8
No files found.
Doc/library/xml.etree.elementtree.rst
View file @
9e189f0a
...
...
@@ -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,8 @@ ElementTree Objects
section root element.
.. method:: write(file, encoding="us-ascii", xml_declaration=None,\
default_namespace=None, method="xml", *,\
.. 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
...
...
@@ -761,9 +761,9 @@ ElementTree Objects
*xml_declaration* controls if an XML declaration should be added to the
file. Use ``False`` for never, ``True`` for always, ``None``
for only if not US-ASCII or UTF-8 or Unicode (default is ``None``).
*default_namespace* sets the default XML namespace (for "xmlns").
*method* is either ``"xml"``, ``"html"`` or ``"text"`` (default is
``"xml"``). *default_namespace* sets the default XML namespace (for
"xmlns").
``"xml"``).
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
...
...
Lib/xml/etree/ElementTree.py
View file @
9e189f0a
...
...
@@ -785,16 +785,16 @@ class ElementTree:
default_namespace
=
None
,
method
=
None
,
*
,
short_empty_elements
=
True
):
"""Write the element tree to a file, as XML. 'file_or_filename' is a
file name or a file object opened for writing. 'encoding' is the
output encoding (default is US-ASCII). 'xml_declaration' controls
if an XML declaration should be added to the output. 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"
(default), "html", "text" or "c14n".
"""Write the element tree to a file, as XML. 'file_or_filename' is a
file name or a file object opened for writing.
'encoding' is the output encoding (default is US-ASCII).
'xml_declaration' controls if an XML declaration should be added
to the output. Use False for never, True for always, None for only
if not US-ASCII or UTF-8 or Unicode (default is None).
'default_namespace' sets the default XML namespace (for "xmlns").
'method' is either "xml" (default), "html", "text" or "c14n".
The keyword-only 'short_empty_elements' parameter controls the
formatting of elements that contain no content. If True (default),
formatting of elements that contain no content.
If True (default),
they are emitted as a single self-closed tag, otherwise they are
emitted as a pair of start/end tags.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment