Possible Duplicate:
Java:XML Parser
I have a XML file, in which i want to get the text only within the specified tags(lets say, only the text between "<HERE> ... </HERE>. Each file have multiple "<HERE>" blocks. How can i get that?
I was using this for normal text files:
Scanner scanner = new Scanner(file);
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
..
}
I want to be able to get only the multiple blocks of text inside the tag.
I would type a long response about XML parsing in Java, but one of the best quick reads on it which I cannot beat is this Dzone article:
http://refcardz.dzone.com/refcardz/using-xml-java
Explains all you need to know in just a few pages. Definitely worth a read.