wood burning stoves*
The moose likes XML and Related Technologies and the fly likes newbie:Data retrieval from xml files 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 "newbie:Data retrieval from xml files" Watch "newbie:Data retrieval from xml files" New topic
Author

newbie:Data retrieval from xml files

Holmes Wong
Ranch Hand

Joined: Feb 18, 2002
Posts: 163
Hi, guys:
I am kind of new to xml processing. What I am trying to do is to get data
from xml files. For example:
<department id="1">
<employee id="222">
<name>smith</name>
<age>30</age>
</employee>
<employee ....>
.....
</employee>
.....
</department>
If I want to get a particular employee's name and age, what technology do I need to use to easily do this job? DOM? SAX2?
I need nice advice from you. If you have some good tutorials to jump start, please tell me. Thanks.

about them.
to use
[ October 30, 2003: Message edited by: Holmes Wong ]
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Holmes Wong:

If I want to get a particular employee's name and age, what technology do I need to use to easily do this job? DOM? SAX2?

Its depends on your XML files and your own requirements. Please see this link to know the comparsion between dom and sax http://www.sdc.iup.edu/outreach/fall2000/xml2/domvssax.html
If you search in google "dom vs sax" you will get lot of hits poiting to various article.
If you just want to read & display the xml data on a browser screen the XSL alone is enough. Visit http://www.w3schools.com and read the XML tutorial, thats the best start for beginners.
more question?? you can always ask here......


Spritle Software Blogs
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: newbie:Data retrieval from xml files
 
Similar Threads
Confusion with startElement,endElement and characters method
Hibernate - can't get the collection (List) when create criteria
sorting xml
SAXPARSER - Problem while parsing HTTPS Response XML
Use a SAX Parser to split huge XML file into multiple parts, also need to keep the hierarchy intact