- From: Mike Champion <mcc@arbortext.com>
- Date: Sun, 26 Oct 1997 21:47:48 -0500
- To: jehamby@be.com, www-dom@w3.org
At 04:22 PM 10/26/97 -0500, Jake Hamby wrote: >After reading the DOM draft spec (971009), I'm a bit confused on the >semantics for the Node's getPreviousSibling and getNextSibling methods. > >Originally, I expected from the meaning of the word "sibling" that this >would only return the previous or next node in the parent's NodeList. For >example, the root node would return null for both methods, and nodes on >the same level of the tree, but with different parent nodes, would not be >considered siblings. > That is my understanding of what it does. >However, in the spec, the methods are defined as using a "breadth-first >traversal" of the tree. I think this might be rephrased "ALLOWS a breadth-first traversal of the tree", or something. The intent, I'm quite sure, was to convey that iterating over getNextSibling calls moves across the breadth of the tree rather than the depth. It should return NULL when it gets to the last sibling node, not go down a level. Thanks for pointing this out. Mike Champion
Received on Sunday, 26 October 1997 21:47:23 UTC