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:

=========CODE==============
from xml.dom.minidom import *
a=Element('see')
print a.toprettyxml()

b=a.cloneNode(True)
print b.toprettyxml()
---------------END CODE-------------------
<see i="sullivan"/>


Traceback (most recent call last):
  File "D:\__Apply\test8XML.py", line 10, in -toplevel-
    b=a.cloneNode(True)
  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??

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to