[ python-Bugs-1157901 ] xml.dom.minidom.Node.removeChild() doesn't remove

SourceForge.net noreply at sourceforge.net
Sun Mar 6 22:24:13 CET 2005


Bugs item #1157901, was opened at 2005-03-06 22:17
Message generated for change (Comment added) made by mkempka
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1157901&group_id=5470

Category: XML
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Kempka (mkempka)
Assigned to: Nobody/Anonymous (nobody)
Summary: xml.dom.minidom.Node.removeChild() doesn't remove

Initial Comment:
There seems to be a constellation where
xml.dom.minidom.Node.removeChild() doesn't remove
childs properly.

I found this bug in 2.3.4 and it is still in:

Python 2.3.5 (#2, Feb  9 2005, 00:38:15)
[GCC 3.3.5 (Debian 1:3.3.5-8)] on linux2


I attached 3 files, the dombug.py demonstrates the
problem: 

First, I iterate over all children of a specific
element, check their tag name and remove them using
removeChild() and then child.unlink().
After the elements are removed I iterate again, do the
same check for a tag and find there are still elements
in there. That is, there are still elements in there
when I parse the file errorintroducer.xml. When I parse
the file errorfree.xml the elements are all removed. 

The difference between the xml files is the carriage
return after each closing tag. 

Since to my knowledge both xml files are well-formed I
would expect in both cases that all elements are removed.

----------------------------------------------------------------------

>Comment By: Matthias Kempka (mkempka)
Date: 2005-03-06 22:24

Message:
Logged In: YES 
user_id=736381

so.. this form posts the error report with uploading
files...interesting...

Anyway, the output I get when running the program with
errorintroducer.xml is:

> python dombug.py
found element 1
 .. removed
found element 3
 .. removed
found element 5
 .. removed
-----------everything removed from timerList[0]---------------
found Element    2
found Element    4
found Element    6


imho it should be, as it is with errorfree.xml:

found element 1
 .. removed
found element 2
 .. removed
found element 3
 .. removed
found element 4
 .. removed
found element 5
 .. removed
found element 6
 .. removed
-----------everything removed from timerList[0]---------------


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1157901&group_id=5470


More information about the Python-bugs-list mailing list