mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Initialize Attr.value with empty string in createAttribute*, as per DOM
spec. Closes bug #412036. Also reindent toprettyxml.
This commit is contained in:
parent
68ad64af87
commit
cb67ea1d6e
1 changed files with 7 additions and 5 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue