[XML-SIG] Building a DOM tree

Andrew M. Kuchling akuchlin@cnri.reston.va.us
Thu, 25 Mar 1999 09:31:16 -0500 (EST)

Carsten Oberscheid writes:
>At 16:22 23.03.99 -0500, Andrew M. Kuchling wrote:
>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, ... }

	Hmm... hmmm... no, I can't think of any reason that wouldn't
work.  Nodes can only have a single parent, and you can't mix nodes
from two different document trees (unless you're Fred Drake), so key
collisions aren't possible.  That would mean there's a single
dictionary with lots of keys, testing Python's dictionary code a bit
more, but dictionaries are supposed to handle that sort of thing, so
it shouldn't cause any problems.  Shouldn't cause any problems for
threading, either.  Hmmm...

A.M. Kuchling			http://starship.python.net/crew/amk/
We of Faerie are of the wild magic. We are not creatures of spells and
grimoires. We *are* spells, and we are written of in grimoires.
    -- From SANDMAN #52: "Cluracan's Tale"