• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Xml in java

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://java.sun.com/xml/tutorial_intro.html
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can also use the JDOM API ...
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic