[issue9522] xml.etree.ElementTree forgets the encoding

Stefan Behnel report at bugs.python.org
Thu Aug 12 10:05:18 CEST 2010


Stefan Behnel <scoder at users.sourceforge.net> added the comment:

lxml.etree has encapsulated this in a 'docinfo' property which also holds the XML 'version', the 'standalone' state and the DOCTYPE (if available).

Note that this information is readily available in lxml.etree for any parsed Element (by wrapping it in a new ElementTree), but not in ET where it can only be associated to the ElementTree instance that did the parsing, not one that just wraps a parsed tree of Element objects. I would expect that this is still enough to handle this use case, though.

Stefan

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9522>
_______________________________________


More information about the Python-bugs-list mailing list