Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAXB vs Apache XMLBeans

Tags:

java

xml

apache

Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in account the performance for files bigger than 10Mb?

like image 904
Simon Avatar asked Sep 01 '09 11:09

Simon


People also ask

What is the difference between JAXB and Jaxp?

JAXP is Java API for XML Processing, which provides a platform for us to Parse the XML Files with the DOM Or SAX Parsers. Where as JAXB is Java Architecture for XML Binding, it will make it easier to access XML documents from applications written in the Java programming language.

What is JAXB used for?

JAXB simplifies access to an XML document from a Java program by presenting the XML document to the program in a Java format. The first step in this process is to bind the schema for the XML document into a set of Java classes that represents the schema.

What is JAXB advantage?

JAXB Advantages JAXB allows non-sequential processing of XML documents. In DOM we need to navigate a tree structure and JAXB doesn't requires such navigations. We work with java instances instead of event/elements. JAXB uses memory efficiently than DOM.


2 Answers

Both have similar performances, however even if Apache XMLBeans seems to present better performance, I normally choose JAXB because I don't want to increase the size of my applications with 3rd party tools.

With Apache XMLBeans you need a small package around 2mb, it's probably easy to learn and well documented. Have full support of XSD specification and namespaces, and mapping only via XML Schema Definition (XSD). It also seems to use deprecated API’s.

like image 61
Bruno Simões Avatar answered Sep 24 '22 12:09

Bruno Simões


The architect of XmlBeans wrote about why he chose to build XmlBeans, even though JAXB was the established standard. Take a look at his blog, specifically the problems with jaxb The most compelling advantage was type substitution.

like image 37
Roger Weber Avatar answered Sep 21 '22 12:09

Roger Weber