Saturday, September 13, 2008

Streaming API for XML

Many people are working with web services. Thus, web services is an evolving field that always has new terchnologies and/or APIs to support and ease the way to developing and using web services.

I am introducing here a java API that is supposed to be one of those evolving APIs that help enhance the work with web services and also enhance the work of web services themselves. Actually, I have known about it from a colleague of mine and found it interesting and worth learning about. That is StAX which stands for "Streaming API for XML". StAX is a streaming Java-based, event-driven, pull-parsing API for reading and writing XML documents. StAX enables you to create bidrectional XML parsers that are fast, relatively easy to program, and have a light memory footprint.

StAX is the latest API in the JAXP (Java API for XML Processing) family, and provides an alternative to SAX, DOM, TrAX, and DOM for developers looking to do high-performance stream filtering, processing, and modification, particularly with low memory and limited extensibility requirements. 

To summarize, StAX provides a standard, bidirectional pull parser interface for streaming XML processing, offering a simpler programming model than SAX and more efficient memory management than DOM. StAX enables developers to parse and modify XML streams as events, and to extend XML information models to allow application-specific additions.

Of course I will not be better in explaining the API and listing more details about it than the JEE tutorial from which I have already quoted most of what I mentioned above. You can know more about the API and how to use it in part III, Chapter 18 of the tutorial. I wish you all really find it useful.