Update of /cvsroot/pythonreports/PythonReports/PythonReports
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17727
Modified Files:
datatypes.py
Log Message:
fix XML entity escaping
Index: datatypes.py
===================================================================
RCS file: /cvsroot/pythonreports/PythonReports/PythonReports/datatypes.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** datatypes.py 8 Dec 2007 07:11:21 -0000 1.7
--- datatypes.py 7 Jan 2011 10:33:32 -0000 1.8
***************
*** 1,4 ****
--- 1,5 ----
"""Data types and element primitives, common for templates and printouts"""
"""History:
+ 20-dec-2010 [luch] fix XML entity escaping
08-dec-2007 [als] _DataBlock.make_element: escape cdata
23-jun-2007 [als] fix Validator.writexml: since we encode the attributes,
***************
*** 1134,1138 ****
# encoded data is ASCII. non-encoded must be unicode.
_data = unicode(_data)
! _elem.text = saxutils.escape(_data)
return _elem
--- 1135,1139 ----
# encoded data is ASCII. non-encoded must be unicode.
_data = unicode(_data)
! _elem.text = _data
return _elem
***************
*** 1199,1203 ****
# (the text, if any, must be already encoded by .make_element)
_text = u"%s<%s>%s%s</%s>%s" % (indent, self.starttag(element),
! _text, _indent2, self.tag, newl)
writer.write(_text.encode(encoding, "xmlcharrefreplace"))
--- 1200,1204 ----
# (the text, if any, must be already encoded by .make_element)
_text = u"%s<%s>%s%s</%s>%s" % (indent, self.starttag(element),
! saxutils.escape(_text), _indent2, self.tag, newl)
writer.write(_text.encode(encoding, "xmlcharrefreplace"))
|