I have a record in my database which has an ampersand character '&' in it. Building the report seems to go ok, but when parsing the report for printing, it throws an exception. If I manually change the & to & in the .prp file, it parses ok.
I think the solution is to make sure that the XML is correctly escaped, and I'm attaching a patch which does that.
The exception which got thrown in the parser when generating the pdf:
Traceback (most recent call last):
File "PythonReports/pdf.py", line 435, in ?
File "PythonReports/pdf.py", line 432, in run
File "PythonReports/pdf.py", line 420, in write
File "PythonReports/pdf.py", line 68, in __init__
self.report = prp.load(report)
line 131, in load
line 1233, in parse
_root = ET.ElementTree.parse(self, source, parser)
File "<string>", line 32, in parse
SyntaxError: not well-formed (invalid token): line 3869, column 38
Line 3869 in the .prp was a <data> element which contained the '&' in it.
Log in to post a comment.