File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

parsing data in xml document

 
Prasath Thirumoorthy
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13049
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should start by reading this Sun tutorial on working with XML in Java.
Bill
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic