-# Copyright
+# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+#
+# This file is part of Hooke.
+#
+# Hooke is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# Hooke is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+# Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Hooke. If not, see
+# <http://www.gnu.org/licenses/>.
"""Dynamically patch :mod:`xml.dom.minidom`'s attribute value escaping.
http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
"""
+import logging
import xml.dom.minidom
"Writes datachars to writer."
if isAttrib:
data = data.replace("\r", "
").replace("\n", "
")
- data = data.replace("\t", "	")
+ data = data.replace("\t", "	").replace('"', """)
writer.write(data)
xml.dom.minidom._write_data = _write_data
instancemethod = type(xml.dom.minidom.Element.writexml)
xml.dom.minidom.Element.writexml = instancemethod(
writexml, None, xml.dom.minidom.Element)
+
+logging.warn(
+ 'Monkey patched xml.dom.minidom.Element and ._write_data for issue5752')