summaryrefslogtreecommitdiffstats
path: root/Lib/xml
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-11-26 07:35:31 (GMT)
committerGeorg Brandl <georg@python.org>2010-11-26 07:35:31 (GMT)
commit5ded791e835b7aea76b8a23e5e4113ef91556e77 (patch)
tree848d6eaf138b4daf1a199f6dda7e8e14a1162f4a /Lib/xml
parent78f11edf3f934461191d4cec81fb4f13811c2be2 (diff)
downloadcpython-5ded791e835b7aea76b8a23e5e4113ef91556e77.zip
cpython-5ded791e835b7aea76b8a23e5e4113ef91556e77.tar.gz
cpython-5ded791e835b7aea76b8a23e5e4113ef91556e77.tar.bz2
Merged revisions 85546-85547 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85546 | georg.brandl | 2010-10-15 19:58:45 +0200 (Fr, 15 Okt 2010) | 1 line #5762: fix handling of empty namespace in minidom, which would result in AttributeError on toxml(). ........ r85547 | georg.brandl | 2010-10-15 20:00:35 +0200 (Fr, 15 Okt 2010) | 1 line #6098: Refrain from claiming DOM level 3 conformance in minidom. ........
Diffstat (limited to 'Lib/xml')
-rw-r--r--Lib/xml/dom/minidom.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py
index 12b7afc..693d171 100644
--- a/Lib/xml/dom/minidom.py
+++ b/Lib/xml/dom/minidom.py
@@ -291,9 +291,10 @@ def _in_document(node):
def _write_data(writer, data):
"Writes datachars to writer."
- data = data.replace("&", "&amp;").replace("<", "&lt;")
- data = data.replace("\"", "&quot;").replace(">", "&gt;")
- writer.write(data)
+ if data:
+ data = data.replace("&", "&amp;").replace("<", "&lt;"). \
+ replace("\"", "&quot;").replace(">", "&gt;")
+ writer.write(data)
def _get_elements_by_tagName_helper(parent, name, rc):
for node in parent.childNodes:
@@ -1340,11 +1341,9 @@ class Notation(Identified, Childless, Node):
class DOMImplementation(DOMImplementationLS):
_features = [("core", "1.0"),
("core", "2.0"),
- ("core", "3.0"),
("core", None),
("xml", "1.0"),
("xml", "2.0"),
- ("xml", "3.0"),
("xml", None),
("ls-load", "3.0"),
("ls-load", None),