xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnaud Le Hors <leh...@us.ibm.com>
Subject Re: Bug
Date Thu, 09 Nov 2000 16:51:13 GMT
This is a very common mistake. NodeList objects are LIVE. This means
everytime you remove a node all the indexes the contained nodes and the
length of the list get updated. The safest way to remove all the
children of a node is to simply do something like:

while ((Node child = node.getLastChild()) != null)
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

View raw message