Overview
Aalto
is a toolkit for XML processing. It supports the following features:
- Namespace aware StAX (Streaming API for XML) compliant (JSR-173) processor
- Support for both XML parsing and XML creation
- SAX (Simple API for XML) parsing
- High performance processor with excellant error handling support
In particular, the main differentiator of Aalto in comparison with other StAX compliant parsers are:
- Speed of Parsing: Aalto is the fastest java based XML parser available as of date for StAX and SAX based parsing. See jvm-serializers site and this comparative report for further details.
Hence if parsing speed is critical for your project, then Aalto parser can be a good choice. - Non-blocking Asynchronous Parsing: It allows the capability to feed more XML data chunks and incrementally generate more XML events without forcing the current thread to block on I/O read operation
For more details see
Aalto’s Home Page
Diagrammatic representation of StAX API
provides an overview of key abstractions.
The list of jars required to run the sample programs below is listed
here
Sample Programs
The following is a list of sample programs to showcase the various features of Aalto:
StAX (Streaming API for XML) Parsing
- Basic StAX Parsing
- Coalesce CDATA
- Get Version and Encoding Information
- Get DocType Information
- Parse Empty Element
- Get Entity Reference
- Peek To Next Element
- Read Attribute Of XML Element
- Read Namespace Of XML Start Element
- Handling Exceptions Related to Mal-Formed XML
Asynchronous StAX Parsing
- Introduction to Asynchronous StAX Parsing
- Basic Asynchronous StAX Parsing
- Using Aalto Wrapper Class For Asynchronous StAX Parsing
- Async Parsing of Comments, Processing Instructions, CData and Entity References
- Handling Errors During Async Parsing
StAX XML Generation
SAX (Simple API for XML) Parsing
Aalto Configuration
Libraries used to run the sample programs
- aalto-xml-0.9.6.jar
- stax-api-1.0.1.jar
- stax2-api-3.1.1.jar