En Mon, 09 Mar 2009 15:30:31 -0200, Petr Muller <a...@afri.cz> escribió:
Thanks for response and sorry for I wasn't clear first time. I have a heap of data (logs), from which I build a XML document using xml.dom.minidom. In this data, some xml invalid characters may occur - form feed (\x0c) character is one example. I don't know what else is illegal in xml, so I've searched if there's some method how to prepare strings for insertion to a xml doc before I start research on a xml spec and write such function on my own.
You don't have to; Python already comes with xml support. Using ElementTree to build the document is usually easier and faster:
http://effbot.org/zone/element-index.htm -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list