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

Alternative to the Live NodeIterator

From: Andrew n marshall <amarshal@usc.edu>
Date: Mon, 27 Apr 1998 10:21:25 -0700
To: <www-dom@w3.org>
Message-ID: <000601bd7200$e81fda50$0ee37d80@philica>

It seems like the concept of a 'live' NodeIterator is a very heavy demand to
place upon DOM implementors.  In fact, I don't think a single DOM
implementation deals with this yet.  I'm assuming the reason for this type of
demand is to make up for the fact that authors cannot override the DOM Nodes.

What is the need for this prerequisite, especially since the DOM assumes all
DOM methods occur in the same thread?  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.

The only reason I can think of for this, is to allow authors to keep track of
which nodes they have or have not processed with a before/after
currentPosition analogy.  I think this could be replaced by a form of property
set associated with each node, similar to the Client Properties of Sun's Swing
classes for Java.  In this system, a hashtable is connected to every node
(Jcomponent in this case), and anyone is allowed to put/get Object based
key/value pairs.  This allows a lot flexibility by allowing any type of data,
and therefore any amount of data as well.

In the rare possibly a user would want to repeatively process a set of Nodes,
the user would acquire a new NodeIterator with each new cycle.  Then the user
would query each node for his key. If the key was not found, they the node has
never been processed.  This would allow user action upon finding the new node.
The draw backs would be the repeated search times in creating the new

This system could easily be implemented by single back-end Hashtable, where
the node and user key pairs act as teh keys in the back-end Hashtable.

Andrew n marshall
  student - artist - programmer
      "Everyone a mentor, Everyone a pupil"
Received on Monday, 27 April 1998 13:13:36 UTC

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