Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Chrix Wu
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!