Hello guys....help! I am trying to go through an xml data structure to modify the values of certain nodes. I want to loop through the doc looking for a specified node and set its value, but all what I get is an infinite loop printing out #text instead of the node name because the node is a text node?!....what determine the types of nodes? Here's my code... Please somebody help me!!! public String getDocument(String xml) { com.ibm.xml.parser.TXDocument doc=null; String document=null; try{ NonValidatingTXDOMParser parser = new NonValidatingTXDOMParser(); parser.parse(new InputSource(xml)); doc = (com.ibm.xml.parser.TXDocument)parser.getDocument();
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
1
posted
0
I think you are just seeing the first child of the first node over and over again because node is not changed in the for loop. That node is probably the new line and any spaces between the end of your first tag and the next real tag. I think the best approach for iterating through nodes is to use NodeList - that way you can print out the number of nodes in the list as a check. Bill