Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XMLStreamReader vs xpath

francy77Jul 23 2014 — edited Jul 24 2014

Hi all,

i need to retrieve element from an xml file; So for now I use XMLStreamReader in the following way:

while(reader.hasNext()){

                reader.next();

                if(reader.getEventType() == XMLStreamReader.START_ELEMENT){

I compare every node with the value I'm looking for and if i find what i need i'll store it in a variable;

I'm asking if is there a way to use xpath expression and not go through every xml node?

thanks a lot

Francesco

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 21 2014
Added on Jul 23 2014
3 comments
1,511 views