You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by John Ky <ha...@syd.speednet.com.au> on 2000/08/22 07:31:16 UTC
Re: User Data (XPCOM Wrapper)
> NodeLists aren't really mutable. They're just a view of the document; if
> you want to know that the NodeList has changed, use an event handler that
> watches the same tree they do. (And I'd argue that, now that DOM Level 2
is
> bringing in the Traversal classes, it would be a Good Idea to avoid
> NodeLists anyway; representing a live view as a pseudo-vector has some
> performance issues I've never liked. But others may disagree.)
>
> DOMImplementation is similarly an immutable (singleton!) object at this
> time, as far as the DOM API is concerned.
>
> If there's something you Really Need here, I'd be interested in seeing a
> use-case.
I needed to be able to enforce object identities on a DOM Wrapper.
Even though NodeLists are immutable, I needed to maintain a relationship
between the (xpcom) wrapping class and the (xerces) implementation class.
I did not want two or more wrapper objects of the same type to point to
the same implementation object.
Maybe there is a better way to do this which avoids the need for UserData,
but I'm not that bright.
BTW, I have an XPCOM wrapper of DOM-2 core for Xerces-C.
Completely untested, but available for anyone that wants it.
-John