doc.appendChild(doc.createComment("foo--bar"))
self.assertRaises(ValueError, doc.toxml)
+ def testEmptyXMLNSValue(self):
+ doc = parseString("<element xmlns=''>\n"
+ "<foo/>\n</element>")
+ doc2 = parseString(doc.toxml())
+ self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE)
+
+
def test_main():
run_unittest(MinidomTest)
def _write_data(writer, data):
"Writes datachars to writer."
- data = data.replace("&", "&").replace("<", "<")
- data = data.replace("\"", """).replace(">", ">")
- writer.write(data)
+ if data:
+ data = data.replace("&", "&").replace("<", "<"). \
+ replace("\"", """).replace(">", ">")
+ writer.write(data)
def _get_elements_by_tagName_helper(parent, name, rc):
for node in parent.childNodes:
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),
- Issue #10459: Update CJK character names to Unicode 5.2.
+- Issue #6098: Don't claim DOM level 3 conformance in minidom.
+
+- Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when an empty
+ XML namespace attribute is encountered.
+
- Issue #1710703: Write structures for an empty ZIP archive when a ZipFile is
created in modes 'a' or 'w' and then closed without adding any files. Raise
BadZipfile (rather than IOError) when opening small non-ZIP files.