aspose file tools*
The moose likes XML and Related Technologies and the fly likes parsing data in xml document 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 "parsing data in xml document" Watch "parsing data in xml document" New topic
Author

parsing data in xml document

Prasath Thirumoorthy
Ranch Hand

Joined: Jul 23, 2004
Posts: 65
Hi Friends,
I hope u all fine.

In how many ways we can parse the data from the xml document ?

do let me know the answer for this...

Thanks & Regards,
Prasath


Thanks,
Prasath

SCJP1.4, SCWCD
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
You should start by reading this Sun tutorial on working with XML in Java.
Bill
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi Prasath,

get a good book (Safari online book shelf is not bad). To give you an idea:
You have 4 possibilities to work with XML:

1) Treat it as a text string (including regular expressions) -- not recommended
2) Use a SAX parser. J2SE1.4 has one built in. The parser will fire one event for everything it encounters in the XML and you need to provide a class that handles the events
3) Use a PULL parser (like kXML). Works a little like SAX, the main difference is that you ask for the next piece instead of getting it thrown at you.Works very well also on J2ME (Phone, PDA)
4) Use a DOM parser. J2SE 1.4 has one build in. The parser builds the XML Document as a (in memory) tree and you can move around, query and update it

Good luck with your studies.
:-) stw
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: parsing data in xml document