File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes xml handling 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 handling" Watch "xml handling" New topic

xml handling

manish ahuja
Ranch Hand

Joined: Oct 23, 2003
Posts: 312
Hi there,

Traditionally I have been using JAXP or JDOM for handling xml payloads in java where we use the DOM or SAX api for handling xml.
Alternatively there are java2xml and viceversa api libraries available like JAXB, Castor and XMLBeans.
I was wondering when to go for raw xml handling using libraries like JAXP , JDOM and when to resort to java-xml bridging toolkits like castor.

Do post your thoughts on the same.

Pavel Cherkashin
Ranch Hand

Joined: Mar 04, 2005
Posts: 47
As far as raw nodes <-> fields bridge is considered, the Dom4j is very usable. It implements xpath and to access every node or attribute of the document is easy.

This tool works with raw xml and raw beans and abstract the developer from handling "nodeStarted" and "nodeEnded" etc.

Pavel Cherkashin - <br />SCJP, SCWCD, SCDJWS, SCBCD, SCEA, ...<br />
Pavel Cherkashin
Ranch Hand

Joined: Mar 04, 2005
Posts: 47
Of course if there is a reason to use more abstract binding, then it depends from special needs. Sometimes it is needed to specify the structure of the xml data. Sometimes it is needed to handle the inheritance of data beans. The large byte arrays and multi part data content - is a special topic. The validation of values is also form time to time being the topic to discuss when selecting the tool.

You're the driver.
I agree. Here's the link:
subject: xml handling
It's not a secret anymore!