Stack API for XML (StAX) is an event-based interface for XML parsing, very similar to Simple API for XML (SAX). However, instead of passing parse events for a whole document to a single ContentHandler, sub-trees can easily be delegated to other handlers. StAX also provides an event-based interface for the process of mapping XML ids to java objects.
See:
StAXContentHandler
> Javadoc: apidocs/net/sf/stax/StAXContentHandler.html
> Java source code: xref/net/sf/stax/StAXContentHandler.html
IdMapper
> Javadoc: apidocs/net/sf/stax/IdMapper.html
> Java source code: xref/net/sf/stax/IdMapper.html
See also:
Simple API for XML (SAX)
> http://www.saxproject.org
StAX version 1.0 is now available from the central maven repository at ibiblio.org.
To include StAX as a dependency in your project, use
<dependency> <groupId>net.sf.stax</groupId> <artifactId>stax</artifactId> <version>1.0</version> </dependency>For more information on building java projects with maven, please see
Downloads are available from the SourceForge project page.
Binary distribution, zip format.
> stax-1.0.zip
Binary distribution, unix tarball format.
> stax-1.0.tar.gz
Source distribution, zip format.
> stax-1.0-src.zip
Source distribution, unix tarball format.
> stax-1.0-src.tar.gz
Although this project has precedence by a couple of years, there is another XML parsing API with the name StAX:
JSR 173: Streaming API for XML
> http://jcp.org/en/jsr/detail?id=173
Streaming API for XML (StAX)
> http://dev2dev.bea.com/technologies/stax/index.jsp
The Streaming API for XML gives parsing control to the programmer by exposing a simple
iterator based API and an underlying stream of events. Methods such as next()
and hasNext()
allow an application developer to ask for the next event (pull
the event) rather than handling the event in a callback. This gives a developer more procedural
control over the processing of the XML document. The Streaming API also allows the programmer to
stop processing the document, skip ahead to sections of the document, and get subsections of the
document.
The package name for the JSR specification and reference implementation is javax.xml.stream.*
,
so thankfully the "Original" StAX (Stack API for XML) and the newer StAX (Streaming API for XML)
can co-exist happily.