File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xml handling" Watch "xml handling" New topic
Author

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.

Thanks
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 />www.linkedin.com/in/pcherkas
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: xml handling