Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in account the performance for files bigger than 10Mb?
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With