W3C home > Mailing lists > Public > www-dom@w3.org > January to March 1999

Re: Level 2 iterators

From: John Cowan <cowan@locke.ccil.org>
Date: Fri, 05 Mar 1999 11:55:48 -0500
Message-ID: <36E00C94.4E432BD5@locke.ccil.org>
To: DOM List <www-dom@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:46 GMT