[issue5752] xml.dom.minidom does not escape CR, LF and TAB characters within attribute values

Amaury Forgeot d'Arc report at bugs.python.org
Thu Mar 28 10:47:39 CET 2013


Amaury Forgeot d'Arc added the comment:

minidom may be broken, but what's the issue with ElementTree?

>>> import xml.etree.cElementTree as etree
>>> doc = etree.fromstring('<xml />')
>>> doc.set('attr', "multiline\nvalue")
>>> etree.tostring(doc)
'<xml attr="multiline
value" />'

----------
nosy: +amaury.forgeotdarc

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


More information about the Python-bugs-list mailing list