escaping illegal characters in XML

Sandy Norton sandskyfly at
Sat Jan 11 14:16:33 CET 2003


What's the most robust way to escape illegal characters when outputing
XML using the python standard library (or PyXML)?


I've written a websucker that extracts links and urls from various
news sites using "from xml.sax.saxutils import escape" to do my
escaping and then writing out the xml file using xml.dom.minidom.
Unfortunately, I still get illegal characters embedded in the results.

Is there any foolproof method?

Thanks in advance for any hints and pointers.


More information about the Python-list mailing list