[reportlab-users] xml parser error (bogus < or &) in paragraph beginning

rukin m.roukine at gmail.com
Sun Jun 17 17:14:29 EDT 2007


hi,

in reportlab 2.1 how can i put a "&" in a paragragraph ?

the following statements crash when there is a "&" in the rawtext variable:

...
dicussText = '<para leftIndent="20" bgcolor="#D0D0D0"> ' +
rawtext.decode("utf-8","replace") + '</para>'
p2 = Paragraph(dicussText, style)
...

Traceback (most recent call last):
File "repprod2_pdf.py", line 117, in ?
p2 = Paragraph(dicussText, style)
File "/usr/lib/python2.4/site-packages/reportlab/platypus/paragraph.py", line
523, in __init__
self._setup(text, style, bulletText, frags, cleanBlockQuotedText)
File "/usr/lib/python2.4/site-packages/reportlab/platypus/paragraph.py", line
547, in _setup
raise "xml parser error (%s) in paragraph beginning\n'%s'"\
xml parser error (bogus < or &) in paragraph beginning
'<para leftIndent="20" bgcolor='




More information about the reportlab-users mailing list