469,592 Members | 1,772 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

XML Processing

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.

Thanks in advance

Aug 2 '07 #1
2 925
On Aug 2, 1:45 pm, Roman <rgelfa...@hotmail.comwrote:
Is there a package that converts a string that contains special
characters in xml to to literal value. For instance, converts stringhttp://myhome/&paramtohttp://myhome/&param.

Thanks in advance
I've seen examples using the HTMLgen module. But here's another script
I just found:

http://mail.python.org/pipermail/pyt...er/016814.html

I would think that you could use regular expressions too.

Mike

Aug 2 '07 #2
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/&amp;param.
import xml.sax.saxutils

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

Diez
Aug 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by gl | last post: by
2 posts views Thread by Luiz Vianna | last post: by
4 posts views Thread by Fao, Sean | last post: by
10 posts views Thread by Enrique Cruiz | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.