File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "reading from XML" Watch "reading from XML" New topic

reading from XML

suresh sai
Ranch Hand

Joined: Jul 16, 2007
Posts: 62
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,
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: 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:
subject: reading from XML
It's not a secret anymore!