xmlrpclib and decoding entity references

John Ridley ojokimu at yahoo.co.uk
Tue May 3 20:09:27 EDT 2005


Chris Curvey wrote on Tue, 03 May 2005 08:10:50 -0700:

> Can anyone give me a lead on how to convert the entity references
> into something that will make it through to my method call?

The xmllib module has a function for doing this:

>>> import xmllib
>>> xmllib.XMLParser().translate_references(your_xml_sample)

xmllib is now obsolete, but you could copy and paste the relevant parts
to your project as they only amount to a fifty-line function and few
regular expressions.

HTH

John Ridley

Send instant messages to your online friends http://uk.messenger.yahoo.com 



More information about the Python-list mailing list