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

noreply@sourceforge.net noreply@sourceforge.net
Wed, 20 Dec 2000 03:03:06 -0800


Patch #102492 has been updated. 

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

Follow-Ups:

Date: 2000-Dec-20 03:03
By: loewis

Comment:
The patch is ok. I *think* pulldom would continue to work if it didn't attempt to set up parentNode attributes during parsing, but did all appendChild calls just in expandNode. However, we can look into that once the patch is installed.
-------------------------------------------------------

Date: 2000-Dec-19 18:02
By: akuchling

Comment:
Updated this patch to current CVS code.  It probably still defaults
the purpose of pulldom, but I don't see how to preserve it without making pulldom contain more of the guts of a DOM implementation.
-------------------------------------------------------

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.

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

Date: 2000-Dec-03 03:42
By: loewis

Comment:
I believe this patch defeats the purpose of pulldom. The intent is that processing SAX events does not create any hierarchy (and in particular no cyclic objects). Only when expandNode is called, a fully-connected hierarchy is created.
-------------------------------------------------------

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

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