Author Tomalak
Recipients Tomalak, sechi_francesco
Date 2009-05-06.13:42:31
SpamBayes Score 0.000167058
Marked as misclassified No
Message-id <1241617353.08.0.16356945794.issue5752@psf.upfronthosting.co.za>
In-reply-to
Content
@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", "&#13;").replace("\n", "&#10;")
    data = data.replace("&", "&amp;").replace("<", "&lt;")
    data = data.replace("\"", "&quot;").replace(">", "&gt;")
    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)
    #[...]
History
Date User Action Args
2009-05-06 13:42:33Tomalaksetrecipients: + Tomalak, sechi_francesco
2009-05-06 13:42:33Tomalaksetmessageid: <1241617353.08.0.16356945794.issue5752@psf.upfronthosting.co.za>
2009-05-06 13:42:32Tomalaklinkissue5752 messages
2009-05-06 13:42:31Tomalakcreate