Evaluation of other XML Binding Technologies

From Filtered Push Wiki
Jump to: navigation, search
  • Stax lies somewhere in between DOM, which is tree-based, and SAX, which is event based. StAX's entry point is a cursor which represents a point in the document. As the application moves the cursor, StAX pulls information from the parser as it is needed. StAX included both reader and writer APIs. StAX was created to address limitations in SAX and DOM and is an API part of the JAXP family. A huge benefit of StAX over SAX is that it does not require the entire document to be read. StAX has the abillity to "peek" at the next event, giving the programmer the ability to skip certain portions of the document.
  • JDOM, another alternative to SAX and DOM is based on the DOM model, but designed for use in Java. This API is lightweight and fast, it is a Java based "document object model" for XML files. While JDOM serves the same purpose as DOM, it is easier to use. JDOM documents can be built from XML files, DOM trees, SAX events, or any other source.
  • dom4j is an open source library for working with XML, XPath and XSLT. It uses the Java Collections Framework and has full support for DOM, SAX and JAXP. It features its own tree based model inspired by XPath. It has two modes, event based and tree based and also has full support for DOM. Another notable difference is that DOM4J works through interfaces rather than concrete classes.
  • XStream is a simple library that can be used to serialize objects to XML using reflection. This works both ways, it can convert the XML it generates back into objects as well. XStream relies on the object names to create the element names and produces very readable XML as a result. XStream stands out for its ease of use and low footprint.
  • JaxMe 2 is an open source implementation of JAXB, that can also store the Java Beans it generates from the schema in a database such as eXist (though it may also store it in a relational database such as MySQL) Castor is another Open Source data binding framework for Java. Much like Jaxb it uses the schema to map XML to classes. Additionally it supports mapping existing classes to XML.
  • XOM, a new open source XML object model, is designed to be easy to learn and easy to use. XOM is very memory efficient. If you read an entire document into memory, XOM uses as little memory as possible. More importantly, XOM allows you to filter documents as they're built so you don't have to build the parts of the tree you aren't interested in.