summaryrefslogtreecommitdiffstats
path: root/Lib/xml/dom
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-03-23 04:39:24 (GMT)
committerFred Drake <fdrake@acm.org>2001-03-23 04:39:24 (GMT)
commit6526bf863eff2ef78465ba90d19a280d6657bddf (patch)
tree1bac9057f590eda147ff6a0a4bbf46466cd3afbf /Lib/xml/dom
parent5e0dfaccd10317e5baa0295e77add07712de2dd7 (diff)
downloadcpython-6526bf863eff2ef78465ba90d19a280d6657bddf.zip
cpython-6526bf863eff2ef78465ba90d19a280d6657bddf.tar.gz
cpython-6526bf863eff2ef78465ba90d19a280d6657bddf.tar.bz2
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.
Diffstat (limited to 'Lib/xml/dom')
-rw-r--r--Lib/xml/dom/pulldom.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/xml/dom/pulldom.py b/Lib/xml/dom/pulldom.py
index d7280ee..d71f6df 100644
--- a/Lib/xml/dom/pulldom.py
+++ b/Lib/xml/dom/pulldom.py
@@ -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]