W3C home > Mailing lists > Public > www-dom@w3.org > April to June 1998

RE: Alternative to the Live NodeIterator

From: Andrew n marshall <amarshal@usc.edu>
Date: Fri, 1 May 1998 01:15:45 -0700
To: "Mike Champion" <mcc@arbortext.com>, <www-dom@w3.org>
Message-ID: <000901bd74d9$56ff5060$c4e37d80@philica>
> -----Original Message-----
> From: Mike Champion [mailto:mcc@arbortext.com]
> Subject: Re: Alternative to the Live NodeIterator
 . . .
>>  It seems to require that a globale list of all NodeIterators be maintained
>> somewhere, each with a abstract description of the search criteria.  Every
>> time a node is added (or worse, an entire tree), it has to compared every
>> search criteria and additional processing may be require to determine
>> ordering.
> I certainly hope not!  It has always been my assumption that each
> NodeIterator knows where it points to in the tree (e.g., "after the Node at
> address 0xbeef0666"), and when a call comes to re-position the iterator or
> return its next or previous node, it would use the tree itself to
> re-position it properly.

The reference cannot be directly to the node; what if the referenced node is

So the reference must begin from some parent.  Then I have to ask how does
this work if the reference node is deleted?  What if several nodes are
deleted, destroying both indexes and identity references?

I think either a backend event interface or a marker node within the tree are
required.  Both concepts require references to the node iterators.

> If the iterator has search criteria ("filters" is
> the current DOM terminology), then the filter would be applied before
> deciding which Node to return.

The implications of what you are suggesting have a huge overhead.  For
example, on every next() a NodeIterator acquired from
Document.getElementsByTagName() would have to search through all nodes after
the previously returned node just to make sure no new nodes that match the
filter are available.  It completely eliminates the possibility of a simple
data structure to contain all references.

With regards to Don Park's recent email, if 'live' iterators are a necessity,
I support his proposal for a 'release()' method for NodeIterators.

Andrew n marshall
  student - artist - programmer
      "Everyone a mentor, Everyone a pupil"
Received on Friday, 1 May 1998 04:07:53 UTC

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