Re: Question on NodeList and client-server

Don Hamson wrote:

> Without copying the children to a private object
> instance, or locking children nodes;

In fact, neither of these things are possible with the DOM Level 1.

> how do I know that the length is valid
> when I attempt to iterate over the list?

You do not.  The only safe approach is to use nextSibling (and
even then you risk getting caught in a deleted subtree) or
to keep increasing the index until you get a null value.

The Level 1 DOM simply doesn't handle the case that someone other
than the XML/HTML parser is tampering with the node tree at the
same time that you are traversing it: multithreading is not
supported, except for the limited case of the parser (which can
only extend, never delete).

-- 
John Cowan	http://www.ccil.org/~cowan		cowan@ccil.org
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)

Received on Friday, 16 October 1998 10:27:11 UTC