- From: X. Shen <xshen@dfki.uni-kl.de>
- Date: Mon, 31 Jul 2000 06:26:57 -0400 (EDT)
- To: html-tidy@w3.org
Hi, as a green beginner, I just encountered a problem concerning the method removeChild() specified in the class Node. Your kind help and instruction are highly appreciated. In order to remove the processing instruction nodes in the DOM generated by Tidy.parseDOM(), which are often malformatted, the following lines are written: ... ... Node n; ... ... NodeList list = n.getChildNodes(); int i = 0; while (i < list.getLength()){ Node node = list.item(i); if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE){ n.removeChild(node); continue; } i ++; } ... ... There comes sometimes a run-time exception: "org.w3c.tidy.DOMExceptionImpl: refChild not found.", yet the node to be removed does exist. How could that happen? Thanks a lot for your time! Xianghua Shen
Received on Tuesday, 1 August 2000 23:21:06 UTC