• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Xml in java

 
shalini gnana
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to read datas from xml which will serve as an input for my applet..How can i do it?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The standard API for handling XML in Java is called JAXP, and you can find some introductory articles in the XML FAQ.

The details on how to access the XML data differ a bit depending on where the XML file originates - the client or the server.

Once you have the XML, there are various ways to process them - mainly SAX, DOM and XPath. Which is best depends on how the XML looks like, and what you intend to do with it.
 
shalini gnana
Ranch Hand
Posts: 189
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply...I have to start from the scratch..So, can you say some good tutorial so that i can learn from the begining...
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/xml/tutorial_intro.html
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd rather use Dom4J - it's a much nicer API: http://www.dom4j.org/

Unless you really have to read *huge* documents - then you will probably *have* to use SAX...
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also use the JDOM API ...
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that the original post mentions input to an applet, therefore he should stick with the standard java library. JDOM or DOM4J would require that the client have those libraries installed, a useless complexity.

Bill
 
chintan ramavat
Ranch Hand
Posts: 134
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shalini,

I am also looking for the same solution but thing is in my case Server is the one from which my flow will be handling XML and using in EJB, so if you have found something easily adoptable please give your inputs.

thanks

chintan
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic