I have a XML document, where I want to make a look-up on a specific ID text ( see below - the infoID). How is the best way to find an element text in a big xml document. Lets say I want to find the infoID "ID-2"?
Should I just run through the entire XML document from the beginning and make a
test, if the text is equal the ID I want to find or is there a better way?
// Run through every element
String infoID = e.getText();
if ( infoID.equals("ID-2") )
break;
<infoBlock>
<infoID>ID-1</infoID>
<infoSubject>My subject 1</infoSubject>
<infoText>My long text 1...</infoText>
</infoBlock>
<infoBlock>
<infoID>ID-2</infoID>
<infoSubject>My subject 2</infoSubject>
<infoText>My long text 2...</infoText>
</infoBlock>
[ January 17, 2006: Message edited by: Jeppe Fjord ]