This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes XML and Related Technologies and the fly likes How to Read certain data from a xml file I made?  xPath? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to Read certain data from a xml file I made?  xPath? " Watch "How to Read certain data from a xml file I made?  xPath? " New topic
Author

How to Read certain data from a xml file I made? xPath?

Chrix Wu
Ranch Hand

Joined: Nov 15, 2009
Posts: 121
lets say i have following data in a config file,

i was wondering how do i read the "class" attribute from the file?

my colleague suggested me to use xPath, but how? read as an inputstream or what? or is there any existing api i can use?

do you guys have other suggestions? thanks in advance.



** SCJP 5.0 84% **
** SCWCD 1.5 76% **
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
There are many different ways to read XML-based data using Java API and other technologies. Study the Simple API for XML (SAX) to learn how.

Good luck!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to Read certain data from a xml file I made? xPath?