JDOM2 Feature StAX Support

rolfl edited this page Apr 8, 2012 · 2 revisions

The StAX library has been available since 2003, and in 2006 it was formally introduced in to the Java6 release. The library is independently available for Java5 though.

JDOM2 introduces input and output handlers for the StAX API, allowing JDOM documents to be built from StAX XMLStreamReader and XMLEventReader instances, and allowing JDOM to be directly output to StAX XMLStreamWriter and XMLEventWriter instances.

In the 'spirit' of StAX, JDOM allows for the streams to be processed in 'fragments', in such a way that you can parse JDOM fragments from the StAX readers whatever their source, and JDOM can be written in fragments to StAX writers.