[XML-SIG] Removing a set of DOM nodes

uche.ogbuji@fourthought.com uche.ogbuji@fourthought.com
Sun, 09 Jan 2000 17:28:02 -0700


I think he's using PyDOM, because near the end of his message he spoke about 
the "DOM Walker".  4DOM instead has a generic Visitor pattern implementation 
(although a simple document-order visitor comes with it).

> if you use PyDOM (i.e. the DOM implementation of the XML SIG)
> then it will be sufficient to just remove the parent of the
> subtree. PyDOM uses proxies to avoid any cyclic references
> such that the usual Python garbage collection can clean
> up without problem.
> 
> If you use 4DOM, the FourThought people should tell you
> about the necessary procedure to perform manual garbage
> collection.
> I assume, you must call a "destroy" method after the
> subtree has been removed from the tree. This will
> take care of any recursion down the tree.

Yes.  You just call ReleaseNode() on the node when you're done with it and it 
will release the node and all descendants.

-- 
Uche Ogbuji
FourThought LLC, IT Consultants
uche.ogbuji@fourthought.com	(970)481-0805
Software engineering, project management, Intranets and Extranets
http://FourThought.com		http://OpenTechnology.org