[XML-SIG] Building a DOM tree

Carsten Oberscheid co@daisybytes.su.uunet.de
Thu, 25 Mar 1999 11:58:26 +0100

At 16:22 23.03.99 -0500, Andrew M. Kuchling wrote:
>	Fewer cycles can be created if every node has a reference to
>the Document node, but that doesn't avoid the problem completely;
>you'd still have to explicitly destroy Document nodes.  If anyone can
>suggest a solution that avoids cycles and avoids having to remember to 
>destroy things, please post!

<proposal appearance="UGLY">
Assuming that each Node object can be a member only of one single DOM tree,
wouldn't it be possible to replace the _parent_relation member of the
document element by one global _parent_relation dictionary on module level? 

   xml.dom.core._parent_relation == { id(childNode): parentNode, ... }

This would make the reference to the document node obsolete.
get_parentNode() returns xml.dom.core._parent_relation[id(self)],
insertChild() and removeChild() must take care of the global dictionary as
they do with the document element's dictionary now.

Beauty aside, could this work or did I miss something?


---------------------------------------------- daisy bytes! ---------
 Carsten Oberscheid                                
 co@daisybytes.su.uunet.de              digital document processing
 http://www.peb.de/daisybytes.su           electronic publishing