Message79203
It seems impossible to clone an Element created without a document:
>>> Element('foo').cloneNode(False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/xml/dom/minidom.py", line 211, in cloneNode
return _clone_node(self, deep, self.ownerDocument or self)
File "/usr/lib/python2.5/xml/dom/minidom.py", line 1814, in _clone_node
if node.ownerDocument.isSameNode(newOwnerDocument):
AttributeError: 'NoneType' object has no attribute 'isSameNode'
The documentation claims that cloneNode was fixed for releases
"subsequent" to 2.0, but this doesn't appear to be true.
http://docs.python.org/library/xml.dom.minidom.html#xml.dom.minidom.Node.cloneNode
A similar issue occurs when attempting to import a node into a document
(something I tried as a work-around for this failure):
>>> d.importNode(e, False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/xml/dom/minidom.py", line 1737, in importNode
return _clone_node(node, deep, self)
File "/usr/lib/python2.5/xml/dom/minidom.py", line 1814, in _clone_node
if node.ownerDocument.isSameNode(newOwnerDocument):
AttributeError: 'NoneType' object has no attribute 'isSameNode' |
|
Date |
User |
Action |
Args |
2009-01-05 22:00:10 | exarkun | set | recipients:
+ exarkun |
2009-01-05 22:00:10 | exarkun | set | messageid: <1231192810.66.0.263343969898.issue4851@psf.upfronthosting.co.za> |
2009-01-05 22:00:10 | exarkun | link | issue4851 messages |
2009-01-05 22:00:08 | exarkun | create | |
|