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

Re: Yet Another NodeList Question

From: Mike Champion <mike.champion@aliaron.com>
Date: Fri, 19 Mar 1999 15:59:46 -0500
Message-ID: <002801be724b$6ddbfd40$54ac45d1@mcc.aliaron>
To: <www-dom@w3.org>, "Harold Poskanzer" <hmp@infoseek.com>

-----Original Message-----
From: Harold Poskanzer <hmp@infoseek.com>
To: www-dom@w3.org <www-dom@w3.org>
Date: Friday, March 19, 1999 3:37 PM
Subject: Yet Another NodeList Question

>Since a NodeList is a "live view" into the tree, what does nextSibling do
>items in a NodeList?  It would seem like it should return the next sibling
>the tree, not the next sibling in the NodeList.  However, that makes
>through items in an "abstract" NodeList (like that generated from
>getElementsByTagName) a little difficult.

getNextSibling() called on a Node returned from an iterator, a NodeList,
etc. should return its sibling in the tree.  getNext (or whatever we call
it) on an iterator will return the next node in the set being iterated over.
There is no "next" operation on a NodeList; you get the next by incrementing
the index passed to the item() method.

I prefer to think of all NodeLists (and iterators) as abstract references
into the tree rather than physical lists into which nodes are copied from
the tree.

Does that help?

Mike Champion
Received on Friday, 19 March 1999 16:00:18 UTC

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