mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Minor documentation updates for xml.etree.
This commit is contained in:
parent
02b3f0ab0d
commit
88db6f402e
2 changed files with 16 additions and 14 deletions
|
@ -617,7 +617,7 @@ def parsefile():
|
|||
"""
|
||||
|
||||
def parseliteral():
|
||||
r"""
|
||||
"""
|
||||
>>> element = ET.XML("<html><body>text</body></html>")
|
||||
>>> ET.ElementTree(element).write(sys.stdout)
|
||||
<html><body>text</body></html>
|
||||
|
@ -631,7 +631,7 @@ def parseliteral():
|
|||
>>> print "".join(ET.tostringlist(element))
|
||||
<html><body>text</body></html>
|
||||
>>> ET.tostring(element, "ascii")
|
||||
"<?xml version='1.0' encoding='ascii'?>\n<html><body>text</body></html>"
|
||||
"<?xml version='1.0' encoding='ascii'?>\\n<html><body>text</body></html>"
|
||||
>>> _, ids = ET.XMLID("<html><body>text</body></html>")
|
||||
>>> len(ids)
|
||||
0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue