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
<data>\nSome Text :\n\MY Spectre around me night and day. Some More: Like a wild beast guards my way.</data> <data>\nSome Text :\n\Cruelty has a human heart. Some More: And Jealousy a human face </data> so far i have this
NodeList ageList = firstItemElement.getElementsByTagName("data"); Element ageElement =(Element)ageList.item(0); NodeList textAgeList = ageElement.getChildNodes(); out.write("Data : " + ((Node)textAgeList.item(0)).getNodeValue().trim()); im trying to just get the "Some More:....." part i dont want the whole tag also im trying to get rid of all the \n