When creating an attribute node using createAttribute() or

createAttributeNS(), use the parallel setAttributeNode() or
setAttributeNodeNS() to add the node to the document -- do not assume
that setAttributeNode() will operate properly for both.
This commit is contained in:
Fred Drake 2001-03-23 04:39:24 +00:00
parent 5e0dfaccd1
commit 6526bf863e
1 changed files with 2 additions and 1 deletions

View File

@ -83,10 +83,11 @@ class PullDOM(xml.sax.ContentHandler):
else:
qname = a_localname
attr = self.document.createAttributeNS(a_uri, qname)
node.setAttributeNodeNS(attr)
else:
attr = self.document.createAttribute(a_localname)
node.setAttributeNode(attr)
attr.value = value
node.setAttributeNode(attr)
self.lastEvent[1] = [(START_ELEMENT, node), None]
self.lastEvent = self.lastEvent[1]