[reportlab-users] Paragraph text with &

Juha Ruotsalainen kontza at gmail.com
Sat Feb 3 07:15:00 EST 2007


Hi there,

Juha Tuomala's hint to use "text = text.replace( '&', '&')" didn't
work. I guess it has something to do with Python's XML parser (that's
what Paragraph uses).

See, my paragraph's contents are read from a XML file, where I have a
text "<subject>Jack, Jim &amp; Jill</subject>". After parsing the
input XML via xml.dom.minidom, "&amp;" has been converted to "&".

Now if I use "&amp;".form for Paragraph's constructor, it is being fed
through XML parser, which does the same, i.e. replaces "&amp;" with a
"&", I'm back where I started: Reportlab raises (a deprecated, at
least in Python 2.5, text-based exception), because a line starts with
an ampersand.

Slainte,
--
jussi


More information about the reportlab-users mailing list