|
The Streaming API for XML (StAX) is a groundbreaking new Java API for parsing and writing XML easily and efficiently. Spearheaded by BEA, StAX has passed the final approval ballot of the Java Community Process (see JSR-173).
Processing XML is a standard task in most computing environments. Until now, developers have typically used two approaches: the Simple API for XML processing (SAX) and the Document Object Model (DOM). Although both methods have their advantages, both also have significant disadvantages, such as a lack of iterative processing (SAX) and a potential performance loss resulting from reading the entire XML document into memory (DOM).
StAX solves these problems by providing more control of XML parsing to the programmer, in particular 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, or pull the event, rather than handle the event in a callback. StAX also enables the programmer to stop processing the document at any time, skip ahead to sections of the document, and get subsections of the document.
StAX helps you process XML faster and easier in these typical use cases:
- Data binding, a two-way process that reads and writes XML
(unmarshaling and marshaling) to and from a programming language data
structure
- SOAP message processing (SOAP is an XML message transport format used predominantly by Web services)
- Parsing a specific XML vocabulary
- Processing pipelined XML
Download WebLogic's StAX Implementation.
|