473,378 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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:

=========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??

Mar 14 '06 #1
0 1869

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Wolfgang Lipp | last post by:
<annotation> the first eleven contributions in this thread started as an off-list email discussion; i have posted them here with the consent of their authors. -- _w.lipp </annotation> From:...
9
by: Gunnar G | last post by:
Is there anything like vector in STL, that performes deep copy of the elements it contains? I hope this will appear in future releases of STL :)
1
by: R0bert Nev1lle | last post by:
Here's my next IE challenge (or frustration). It deals with the overflow attribute. Overflow property was a challenge on my page since the page emulates position fixed for IE. The present...
1
by: Ryan Liu | last post by:
Hi, I know I need create a DataRow from a DataTable for the schema reason. Why must I create a XmlElement in a XmlDocument? I already have a string, I was trying to use...
2
by: anupamjain | last post by:
I have gone through many threads on this topic, but am still clueless about the solution of my problem. I am using : childNodesBuffer = currentchildelem.cloneNode(true).getChildNodes(); ...
43
by: michael.f.ellis | last post by:
The following script puzzles me. It creates two nested lists that compare identically. After identical element assignments, the lists are different. In one case, a single element is replaced. In...
6
by: Jakob Bieling | last post by:
Hi, I want to move an element from a std::list to the end of the same list. To get this done, I thought I'd just do something like: std::list <intlst; lst.push_back (0); lst.push_back (1);...
14
by: webEater | last post by:
I have a problem, it's not browser specific, and I don't get a solution. I have an (X)HTML document, I show you a part of it: .... <!--<div class="pad">--> <div id="eventImages"><img src=""...
1
by: Maksim Kasimov | last post by:
Hi, i'm faced with such a problem when i use xml.dom.minidom: to append all child nodes from "doc" in "_requ" to "doc" in "_resp", i do the following: _requ =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.