By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,282 Members | 1,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,282 IT Pros & Developers. It's quick & easy.

XML Processing

P: n/a
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
Share this Question
Share on Google+
2 Replies

P: n/a
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

P: n/a
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.