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

Xml in java

shalini gnana
Ranch Hand

Joined: Sep 18, 2007
Posts: 189
I have to read datas from xml which will serve as an input for my applet..How can i do it?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42263
    
  64
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.


Ping & DNS - my free Android networking tools app
shalini gnana
Ranch Hand

Joined: Sep 18, 2007
Posts: 189
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

Joined: Sep 11, 2006
Posts: 959

http://java.sun.com/xml/tutorial_intro.html


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Vassili Vladimir
Ranch Hand

Joined: Mar 08, 2007
Posts: 1585
You can also use the JDOM API ...


Vassili ...
SCJP 5.0, SCWCD 1.4, SCJA 1.0
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
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

Joined: Sep 15, 2006
Posts: 134
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
 
subject: Xml in java