Tomalak <[email protected]> added the comment:
@Francesco Sechi: Would it not just require a minimal change to the
_write_data() method? Something along the lines of (sorry, no Python
expert, maybe I am way off):
def _write_data(writer, data, is_attrib=False):
"Writes datachars to writer."
if is_attrib:
data = data.replace("\r", " ").replace("\n", " ")
data = data.replace("&", "&").replace("<", "<")
data = data.replace("\"", """).replace(">", ">")
writer.write(data)
and in Element.writexml():
#[...]
for a_name in a_names:
writer.write(" %s=\"" % a_name)
_write_data(writer, attrs[a_name].value, True)
#[...]
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue5752>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com