XML Pull Parsing
News and changes:
- 2004-11-02: Ian Kaplan has website with
examples of working with XmlPull API including detailed overview of processing XML and building in-memory
- 2004-07-02: site overhaul with emphasis on general issues of XML Pull Parsing and resource for
discussing new ideas and concepts related to pull parsing, handy utility classes and samples, and last but not
least, addition of JSR 173 StAX (Streaming API for XML) links
- 2004-01-12: XmlPull API Issue tracker (Bugzilla)
- 2004-01-12: Updated unit tests (see list of changes for
- 2003-08-28: XML design patterns and Pull Parsers sessions at the LTU XML Symposium in Irvine (California): session 101 The Xml Design Process and debut of new
versions of XML tools integrated with XPP3 in the "XML in Motion" area in session 208 XML Tools: The Next Generation.
- 2003-07-23: The Simple Messaging Framework uses
XmlPull API to do document/literal data-binding that is works together with AXIS. For example check tutorial
section on implementing
the MessageReader and MessageWriter Interfaces and sample code in
- 2003-07-08: DOM2 builder addon has now improved interface
to support building tree from any XML pull event substream
- 2003-05-18: updated wrapper addon class XmlSerializerWrapper with new methods: fragment() to simplify
writing small XML fragments and event() to make easier to copy XML input (XmlPullParser) to output
- 2003-05-17:new addons: Wrapper Addon extends XmlPull API and
adds new convenience methods to pull parser and serializer and Util Addon that provide set of static utility methods
- 2003-04-23: new addons: DOM2XmlPullBuilder to allow
creating DOM2 trees using XmlPull parser and XmlPullParserPool to provide easy to use parser
- 2003-04-23: added new optional feature RELAXED (to allow requesting that parser be as lenient as
possible when parsing invalid XML) and optional property LOCATION to inform parser about location of input so error
and diagnostic messages are more helpful
- 2003-04-02: the Beta 1 release of the JiBX XML data binding framework
that uses XmlPull API is now available and described in developerWorks article that includes
a section on how a pull parser is much better for data binding than a push parser
- 2003-02-25: minor 126.96.36.199 release to pack the latest additions to tests and documentation, please see
list of changes
- 2003-02-25: new tutorial describing how to use
XmlSerializer to generate XML output
- 2003-02-17: introducing addons that provide reusable functionality
built on top XmlPull API such as SAX2 driver and XML RPC
- 2002-10-16: kXML2, XPP3/MXP1 and XNI2XmlPull pass the latest compatibility
- 2002-10-16: updated 1.1.2 version of XmlPull API (and compatibility tests) is available for download.
This version has following changes: improved handling for XMLDecl, improved J2ME compatibility, and improved
usability of XmlSerializer, for details please see list of
- 2002-08-04: XML.com published response
article to Elliotte Rusty Harold's recent review of
XmlPull API on XML.com
What Is It?
XmlPull project is dedicated to be a site for
- for general Pull parsing promotion/education (including StAX) and in particular to contain easy-to-reuse
samples and code fragments
- a resource for discussing new ideas and concepts related to pull parsing
- a java namespace (org.xmlpull.*) and project location of a free implementation of the event object API and
Factories, based on the StAX XMLStreamReade and old Common API for XML Pull Parsing
- as java namespace and project location of StAX and XmlPull based utilities and samples such as:
- providing an XML stream from a DOM tree
- a DOM builder
- SAX adapter
- JUnit tests
- as a maintenance resource for the existing XmlPull interface
Short Overview of APIs
Read a short paper about Pull Parsing APIs with sample code demonstrating each
Timeline (or Where did it come from?)
before 2000: XML pull parsers such as kXML1, XPP1, BEA, NekoPull, and other in Java (as well in other
languages notably .NET and PullDom in Python) were created and used but Java code was not portable between different
started around 2000: grassroots effort by Stefan Haustein and Aleksander Slominski to create a Common API
for XML Pull Parsing (XmlPull) that aimed to define a simple and elegant pull parsing API that will
provide a standardized way to do pull XML parsing from J2ME to J2EE and was very successful
2002-2003: JSR 173 expert group was created to standardize XML pull parsing in Java world and included XPP,
kXML, and BEA pill parser authors
2004: StAX RI is available and few other StAX implementations emerged
Mailing lists where both user and developers can ask general XML Pull Parsing
questions and post ideas for future
StAX builders mailing list.
Download StAX RI source code and browse read-only CVS mirror of perforce.
List of StAX and XmlPull APIs implementations.
About XmlPull API
It is a minimalist API: very easy to implement standalone or on top of existing parser. The API allows both fast
high level iteration (using next() method) and low level tokenizing (using nextToken() token) and is designed for
easy building on top of it SAX, XML pull parsers that uses iterators with event objects, or even DOM implementations.
To to support J2ME and real small implementation parsing of DOCDECL is optional (but DOCDECL can be reported if
The aim is to provide a similar but orthogonal pull parsing basis to widely successful push parsing SAX API. The XmlPull API is in public domain in hope that it will be embraced by
Java developers (conformance tests are under LGPL license to minimize risk of incompatible implementations).
How To Learn About It?
Here you will find documentation describing concepts behind XMLPULL and gentle introduction with samples.
How To Use It?
XMLPULL API is available freely. You can download XmlPull API as tarball or zip file.
We are also providing access to the latest API version via anonymous CVS.
However to use XMLPULL you will need download an implementation of XmlPull
How To Contact Us?
There are available both user and developer mailing lists to allow discussion of
XmlPull API, requesting new enhancements and report bugs.
We hope that you find XmlPull API useful in your applications (and let us know your comments),
Initial authors: Stefan Haustein and Aleksander Slominski