467,864 Members | 1,837 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,864 developers. It's quick & easy.

Is xml.dom.minidom.Element.cloneNode(deep=True) really fixed already?

Hi, I am now using minidom for my current development. I use cloneNode
method in Element object, but it just does not work. The test code is
very simple as follows:

from xml.dom.minidom import *
print a.toprettyxml()

print b.toprettyxml()
---------------END CODE-------------------
<see i="sullivan"/>
Traceback (most recent call last):
File "D:\__Apply\test8XML.py", line 10, in -toplevel-
File "C:\Python24\lib\xml\dom\minidom.py", line 211, in cloneNode
return _clone_node(self, deep, self.ownerDocument or self)
File "C:\Python24\lib\xml\dom\minidom.py", line 1814, in _clone_node
if node.ownerDocument.isSameNode(newOwnerDocument):
AttributeError: 'NoneType' object has no attribute 'isSameNode'

--------------result end------------------

Since the prototype of cloneNode is cloneNode(deep), which does not
indicate the type of deep, I also tied other non-None value like
cloneNode(1), cloneNode('a') etc.None of them work.
Referencing the document, I have seen in python 2.0, this function was
very broken. But my Python version is quite up-to-date: version 2.4.1.

Is it a bug still not fixed??

Mar 14 '06 #1
  • viewed: 1400

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Gunnar G | last post: by
1 post views Thread by R0bert Nev1lle | last post: by
1 post views Thread by Ryan Liu | last post: by
2 posts views Thread by anupamjain | last post: by
43 posts views Thread by michael.f.ellis | last post: by
6 posts views Thread by Jakob Bieling | last post: by
14 posts views Thread by webEater | last post: by
1 post views Thread by Maksim Kasimov | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.