aspose file tools*
The moose likes XML and Related Technologies and the fly likes reading from XML 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 "reading from XML" Watch "reading from XML" New topic
Author

reading from XML

suresh sai
Ranch Hand

Joined: Jul 16, 2007
Posts: 62
Hi.,
Could you please tell me,How can I read values from an XML?.Supppose,I have my own xml file (student.xml) that contains the tag as follows,
<student>
<name>kathy</name>
<subject>java</subject>
</student>
And I need to read name,subject values from the servlet or jsp.
thanks in advance
Tarun Yadav
Ranch Hand

Joined: Sep 20, 2007
Posts: 134
There are quite a few ways to parse XML in your app and each has it's pros and cons. Take a look here:http://www.cafeconleche.org/books/xmljava/. It's the complete book online, I'm sure you'll find something that suits your requirements.
[ September 24, 2007: Message edited by: Tarun Yadav ]
Arvind Mahendra
Ranch Hand

Joined: Jul 14, 2007
Posts: 1162
well one way is to make them like init parameters or something. There si also a class that allows you to read XMl values and a method something like parseWebXML(). look up the method and class. I wish I could help more But Im busy so I can help you out later
[ September 24, 2007: Message edited by: Chunnard Singh ]

I want to be like marc
suresh sai
Ranch Hand

Joined: Jul 16, 2007
Posts: 62
thanks tarun and chunnard.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reading from XML