Hello Mike,
What you describe has existed for quite some time in Xerces-J's DOM implementation. See nodeListItem() and nodeListGetLength() [1].
[1] http://cvs.apache.org/viewcvs.cgi/xml-xerces/java/src/org/apache/xerces/dom/ParentNode.java?view=markup
On Wed, 21 Jul 2004, Mike Morearty wrote:
The gist of the optimization would be:
* item(n) would see if "n" is close to the previously requested item. In almost all cases, "n" will be either equal to, one less than, or one greater than the previously requested item. In that case, it would call getPreviousSibling() or getNextSibling() as needed. * getLength() would cache its result. * If the node-list changes, the DOMNodeListImpl would discard (or adjust) its cached information.
--------------------------- Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]