xml.etree.ElementTree.tostringlist(element, encoding="us-ascii", method="xml", *, short_empty_elements=True)
Generates a string representation of an XML element, including all subelements. element is an Element
instance. encoding [1] is the output encoding (default is US-ASCII). Use encoding="unicode"
to generate a Unicode string (otherwise, a bytestring is generated). method is either "xml"
, "html"
or "text"
(default is "xml"
). short_empty_elements has the same meaning as in ElementTree.write()
. Returns a list of (optionally) encoded strings containing the XML data. It does not guarantee any specific sequence, except that b"".join(tostringlist(element)) == tostring(element)
.
New in version 3.2.
New in version 3.4: The short_empty_elements parameter.
Please login to continue.