I could be way off base here, but does this have anything to do with not calling synchronizeChildren() in NodeContainer on many of the public methods? I've only given the code a precursory glance, so I'm just grasping at straws right now.
- Sean T. -----Original Message----- From: Wolfhart Bauer [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2000 10:42 PM To: [EMAIL PROTECTED] Subject: [BUG] Behavior of NodeList implementation in 1.0.2 Hello, I have discovered a bug in the class org.apache.xerces.dom.DeepNodeListImpl. The attached code demonstrates it, just try switching the order of the two println lines. It seems that you have to call the getLength() method at least once before accessing any of the items directly. I don't feel that this behavior is intentional. public class XMLTest { public static void main (String[] args) throws Exception { org.apache.xerces.parsers.DOMParser parser = new org.apache.xerces.parsers.DOMParser(); parser.parse("file:///d:/testing/xercestest/test.xml"); org.w3c.dom.Node d = parser.getDocument(); org.w3c.dom.NodeList nl = d.getChildNodes(); System.out.println("Node 0 is an element? "+(nl.item(0).getNodeType()==org.w3c.dom.Node.ELEMENT_NODE)); System.out.println("Length of nodelist: "+nl.getLength()); } } Executed on the file test.xml: <?xml version="1.0"?> <!DOCTYPE TEST SYSTEM "test.dtd"> <TEST/> with the DTD test.dtd: <!ELEMENT TEST EMPTY> By the way, thanks to all developers for the good work with this parser. Wolfhart Bauer