java xml parsing between tags

TheaG

New Member
What im trying to do is parse xml through java. and i only want a snippet of text from each tag for example.xml example\[code\]<data>\nSome Text :\n\MY Spectre around me night and day. Some More: Like a wild beastguards my way.</data><data>\nSome Text :\n\Cruelty has a human heart. Some More: And Jealousy a human face</data>\[/code\]so far i have this\[code\]NodeList ageList = firstItemElement.getElementsByTagName("data");Element ageElement =(Element)ageList.item(0);NodeList textAgeList = ageElement.getChildNodes();out.write("Data : " + ((Node)textAgeList.item(0)).getNodeValue().trim()); \[/code\]also im trying to get rid of all the \n
 
Back
Top