Re: Walking the DOM (was: XML APIs)

Stephen R. Savitzky wrote:

> But in
> fact even with pseudo-timestamps on the document, you need an O(log N) test
> to determine whether an iterator is inside the part of the document that
> changed; presumably you wouldn't want to invalidate _all_ iterators, only
> the ones currently inside the affected subtree.

Actually I *was* thinking of invalidating all iterators, on the assumption
that the number of iterators is typically small, even if we can't
(due to garbage-collection considerations) determine its actual value.

For Level 1 purposes, a NodeList doesn't actually get invalidated
from the user's viewpoint; it just has to rescan the tree from the origin.

> Determining the desired behavior when a subtree that contains an iterator is
> _moved_ is even more difficult.  One can make a good case either way.

I think it's simplest to treat moves as remove + insert.

-- 
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, 6 November 1998 13:22:11 UTC