From: Martin v. Löwis Date: Sat, 31 Mar 2001 16:30:40 +0000 (+0000) Subject: Initialize Attr.value with empty string in createAttribute*, as per DOM X-Git-Tag: v2.1c1~202 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb67ea1d6e2dfb2680bba29144ef33fd2cc9a21a;p=thirdparty%2FPython%2Fcpython.git Initialize Attr.value with empty string in createAttribute*, as per DOM spec. Closes bug #412036. Also reindent toprettyxml. --- diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 72ec5e05f7ce..81315e729d8d 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -87,11 +87,11 @@ class Node(_Node): return writer.getvalue() def toprettyxml(self, indent="\t", newl="\n"): - # indent = the indentation string to prepend, per level - # newl = the newline string to append - writer = _get_StringIO() - self.writexml(writer, "", indent, newl) - return writer.getvalue() + # indent = the indentation string to prepend, per level + # newl = the newline string to append + writer = _get_StringIO() + self.writexml(writer, "", indent, newl) + return writer.getvalue() def hasChildNodes(self): if self.childNodes: @@ -794,6 +794,7 @@ class Document(Node): def createAttribute(self, qName): a = Attr(qName) a.ownerDocument = self + a.value = "" return a def createElementNS(self, namespaceURI, qualifiedName): @@ -806,6 +807,7 @@ class Document(Node): prefix, localName = _nssplit(qualifiedName) a = Attr(qualifiedName, namespaceURI, localName, prefix) a.ownerDocument = self + a.value = "" return a def getElementsByTagNameNS(self, namespaceURI, localName):