How Do I Query for First Child Nodes Value of a Certain Tag?
I am using the XML Parser for Java version 2. I want to obtain the value of first child node value of a tag. I could not find any method that can do that efficiently. The nearest match is method getElementsByTag(“Name”), which traverses the entire tree under. Answer: Your best bet, if you do not need the entire tree, is to use the SAX interface to return the desired data. Since it is event driven it does not have to parse the whole document.