Re: Level 2 iterators

Miles Sabin wrote:

> [...] work directly with Node's parent,
> child and sibling operations [...] really rather
> a shame ... a standard iterator interface with broad
> applicability would have been a real gain.

Actually, there is no guarantee that walking the tree yourself
with parent, child, and sibling attributes doesn't lead you into
a cul-de-sac either, when arbitrary tree mutations are going on.
I chose to use these attributes in DOMParser (a SAX parser that
walks a DOM tree and fires events based on it), in order not to
use an unbounded stack when walking a DOM of arbitrary depth,
but there is no guarantee that DOMParser can even terminate if
the tree is being cleverly mutated in just the wrong ways.

IMHO what DOM needs is an interoperable *locking* mechanism.

-- 
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, 5 March 1999 11:56:10 UTC