[PythonReports-devel] [ pythonreports-Bugs-1846113 ] XML entity references are not encoded
Brought to you by:
a1s
From: SourceForge.net <no...@so...> - 2007-12-07 11:27:46
|
Bugs item #1846113, was opened at 2007-12-07 22:27 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=896376&aid=1846113&group_id=181233 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Report building Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Bruce Schultz (halfcat) Assigned to: Nobody/Anonymous (nobody) Summary: XML entity references are not encoded Initial Comment: 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 ? run() File "PythonReports/pdf.py", line 432, in run write(_printout, _pdf) File "PythonReports/pdf.py", line 420, in write PdfWriter(report).write(filepath) File "PythonReports/pdf.py", line 68, in __init__ self.report = prp.load(report) File "/home/bruce/projects/pythonreports/PythonReports-0.3.1/PythonReports/printout.py", line 131, in load _et.parse(source) File "/home/bruce/projects/pythonreports/PythonReports-0.3.1/PythonReports/datatypes.py", 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=896376&aid=1846113&group_id=181233 |