[Patches] [Patch #102492] minidom/pulldom: remove nodes already in the tree

noreply@sourceforge.net noreply@sourceforge.net
Fri, 1 Dec 2000 15:58:00 -0800


Patch #102492 has been updated. 

Project: python
Category: XML
Status: Open
Submitted by: akuchling
Assigned to : loewis
Summary: minidom/pulldom:  remove nodes already in the tree

Follow-Ups:

Date: 2000-Nov-23 18:32
By: akuchling

Comment:
This patch attempts to fix bug #116677:                         "minidom:Node.appendChild() has        wrong semantics".
It changes the appendChild,  insertBefore, etc. methods 
to remove the node being added if it's already in the tree.
The patch also fixes some spots where the previousSibling/nextSibling pointers aren't being properly updated.

Some changes to pulldom.py were required, and I'm unsure
about them.  Mostly they consist of using the published minidom interface instead of directly setting .parentNode.  Judging by my debug printouts, pulldom ends up doing redundant work after this patch -- every node is added to the tree *twice*.  However the resulting tree does
seem to be correct.

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

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102492&group_id=5470