Overview
Woodstox
is a very powerful toolkit for XML processing.Its main features are as follows:
- Namespace aware StAX (Streaming API for XML) compliant (JSR-173) processor
- Support for DTD, RelaxNG and W3C Validations
- Support for both XML parsing and XML creation
- SAX (Simple API for XML) parsing and validation
- High performance processor with excellant error handling support
Woodstox StAX based implementation is ‘Pull Parser’ which loads the chunks of XML for processing instead of loading the entire document. Hence it is very efficient for processing of high volume XML.
Diagrammatic representation of StAX API
provides an overview of key abstractions.
Before trying out the sample programs, see
Understanding Steps in Loading of Woodstox classes
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 Woodstox:
StAX (Streaming API for XML) Parsing
- Basic StAX Parsing
- Replace Entity Reference
- Peek to Next Element
- Read Attribute Of XML Element
- Read Namespace Of XML Start Element
- Verify Empty Element Content
- Coalesce CDATA
StAX XML Generation
XML Validation
- Validate against DTD
- Validate against XML Schema
- Validate against RelaxNG Schema
- Validate XML generated by Woodstox
Exception Handling
- Handling Exceptions Related to Mal-Formed XML
- Exploring Validation Errors Using ValidationProblem
- Handling Warnings
Woodstox Configuration
SAX (Simple API for XML)
Libraries used to run the sample programs
- msv-core-2010.2.jar
- org.osgi.core-4.2.0.jar
- stax2-api-3.1.1.jar
- woodstox-core-asl-4.2.0.jar
- woodstox-core-lgpl-4.2.0.jar
- woodstox-msv-rng-datatype-20020414.jar
- xsdlib-2010.1.jar