views:

410

answers:

2

In Java for XML marshalling/unmarshalling one can use JAXB, JIBX, CASTOR, ADB etc. But out of these which is most generic & commonly used? Or is there any other utility available?

+1  A: 

I personally use XMLBeans. I like it more than JAXB (and I am biased in favour of things from Sun since they should be more "standard"). I cannot speak to the commonly used part of it though.

TofuBeer
+4  A: 

The standard is the JAXB (JSR 222), and the famous project with this name is the reference implementation. Unlike JAXB 1.0, JAXB 2.0 RI is quite good, and I've used it a lot. Other libraries implements the JAXB standard (I think tha Castor and JiBX, but I have no experience with them).

I've also use XStream, which was very easy and simple - it has a proprietary API though.

I don't know of any benchmark other than https://bindmark.dev.java.net/old-index.html - notice it is a 4 year old one. perhaps you can take it's ideas or any usable code it may have and run some tests yourself.

David Rabinowitz
In some very special cases JAXB's behaviour is rather unpredictable, but on the whole it is very good and useful
Bozho
What are these special cases?
David Rabinowitz
The worst I've had with JAXB was how it actually crashed on some malformed XML (it still throws an exception, but not a nice XmlSchemaViolation, more like a SecurityAccessViolation somewhere, names made up cause I can't remember the originals)
wds
EclipseLink JAXB (MOXY) also implements the JAXB standard, http://www.eclipse.org/eclipselink/moxy.php
Blaise Doughan