Re: Level 2 iterators

John Cowan wrote:

> > NodeIterator, on the other hand, has no caching issues, because it only
> > visits each node once.
>
> Not necessarily!  As I pointed out, if the action taken at each
> node is to remove it and reinsert it as the last child of its
> parent, NodeIterators will have to maintain a history list if
> they want to be sure of visiting each node only once.

If we did have to maintain a history to prevent nodes from being returned
twice in this case, this is a history issue, not a caching issue.  There
would be no need to dump the history ever.  Indeed you seem to want stale
entries we visited in the list.

But the iterator maintains its position in the live logical set of nodes to
be returned.  If a visited node reappears at some future point in the logical
set of nodes we are iterating, it seems appropriate according to the spec to
visit it again when we reach the new position in the logical set.

Could you point me to a part of the spec which you feel states that any node
would only ever be visited once?

Ray Whitmer

Received on Friday, 5 March 1999 15:42:32 UTC