09.12.11 17:09, Dirkjan Ochtman wrote:
On Fri, Dec 9, 2011 at 09:02, Stefan Behnel<stefan...@behnel.de> wrote:
An at least somewhat informed +1 from me. The ElementTree API is a
very good way to deal with XML from Python, and it deserves to be
promoted over the included alternatives.
Let's deprecate the NiCad batteries and try to guide users toward the
Li-Ion ones.
I use xml.dom.minidom for XML canonization and convertion:
doc = xml.dom.minidom.parse( io.BytesIO( data0 ) )
encoding = forceEncoding or doc.encoding or str( 'UTF-8' )
writer = io.BytesIO()
writer = codecs.getwriter( encoding )( writer, 'xmlcharrefreplace' )
doc.writexml( writer, encoding = encoding )
data = writer.getvalue()
How to do this with xml.etree.ElementTree?
--
http://mail.python.org/mailman/listinfo/python-list