[XML-SIG] pyDOM NamedNodeMap - bug report and problem

Andrew M. Kuchling akuchlin@mems-exchange.org
Fri, 13 Aug 1999 09:41:20 -0400 (EDT)


Dieter Maurer writes:
>For some unknown reason (a bug, I think),
>the real attribute information is in the "children[0]" attribute
>of the returned "item".

The DOM implementation builds an internal tree of objects of class
_node; however, users of the implementation never see a _node
instance, but instead an instance of Element, Text, or whatever, that
acts as a proxy for the _node instance.  The user-visible proxy holds
the parent pointer for the node, thus avoiding creating a cycle of
references and leaking memory.  To create the proxy for a _node n, you
use NODE_CLASS[ n.type ](n, self._document ) .  As a note to users, if
you *ever* get returned a _node instance, that is a bug and should be
reported.

-- 
A.M. Kuchling			http://starship.python.net/crew/amk/
The story so far: In the beginning the Universe was created. This has made a
lot of people very angry and has been widely regarded as a bad move.
    -- Douglas Adams, _The Restaurant at the End of the Universe_