XML Processing

Diez B. Roggisch deets at nospam.web.de
Thu Aug 2 21:18:21 CEST 2007


Roman schrieb:
> Is there a package that converts a string that contains special
> characters in xml to to literal value.  For instance, converts string
> http://myhome/&param to http://myhome/&param.

import xml.sax.saxutils

print xml.sax.saxutils.escape("I'm a happy & friendly guy, and 1 < 3 - 
never forget that!")

Diez



More information about the Python-list mailing list