Andy Clark wrote:
> 
> Michael Mason wrote:
> > So it's better to iterate over the children by hand than to use a
> > NodeList? I've been noticing that (for example) removing all the items
> > in a NodeList seems to take longer than I'd hoped.
> 
> Yep, NodeLists are really bad for performance. Definitely use the
> getFirstChild/getNextSibling paradigm.

Beware, this assertion is true for Xerces but it may be false for other
implementations though.
In xerces children are stored in a linked list, so getNextSibling is
clearly the winner. On the other hand, with an implementation where
children would be stored in an array, using the NodeList interface would
be better.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

Reply via email to