When proposing changes to Nodelist, make sure you've considered its "live
view" semantics, where changes to the model are immediately visible in the
list. That behavior seriously complicates implementing this interface, and
it's required for a correct DOM implementation. The Xerces DOM has
experimented with several approaches, and they're all ugly in one way or
another.

See http://www.w3.org/DOM/faq.html#nodelist


Generally, if Nodelist is causing trouble, the best answer is to avoid it
entirely and use explicit tree traversal instead -- first-child followed by
next-sibling. Or, as the FAQ points out, to build your own list-of-nodes
data structure.

(I still think Nodelist was a mistake. It was a deliberate attempt to
provide something that clueless web-script authors who didn't understand
tree structures could use... but I really don't think an array-like live
view was an improvement.)

______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish
(http://www.ovff.org/pegasus/songs/threes-rev-11.html)

Reply via email to