Streaming API for XML (StAX)

The Streaming API for XML (StAX) JSR defines a parsing mechanism for XML documents that's based on Java standards. It is different from the other two parsing standards, SAX and DOM, in the sense that this API provides the parsing control to the programmer through the use of iterator-based APIs. Having an iterator-based API enables an application to pull the next event as required and then store its state in a data container, such as an array or vector.

This API arose from the need for a streaming API for the JAXB and JAX-RPC specifications. Both of these specifications process an XML documents as a stream of events, where the current context of the event determines the next step that the XML processor has to take. ...

Get Java™ APIs for XML Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.