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

Re: Level 2 iterators

From: Ray Whitmer <ray@imall.com>
Date: Fri, 05 Mar 1999 13:42:05 -0700
Message-ID: <36E0419C.245F4915@imall.com>
To: John Cowan <cowan@locke.ccil.org>
CC: DOM List <www-dom@w3.org>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:05 UTC