This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread 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


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!
 
 
subject: How to Read certain data from a xml file I made? xPath?