Java XML - Java API for XML Processing (JAXP)
About
JAXP (Java API for XML Processing) is an umbrella term that bundle the various low-level XML APIs in JavaSE. ie
- the parser standards Parsers Package (javax.xml.parsers):
- SAX (Simple API for XML) and Streaming API for XML (StAX) standard. (Since version 1.4 of JAXP).
- StAX.
- the Extensible Stylesheet Language Transformations (XSLT) to convert the data to other XML documents or to other formats, such as HTML.
JAXP also provides namespace support support (see javax/xml/namespace), allowing you to work with DTDs that might otherwise have naming conflicts.
- A SAX or DOM API parser
- An XSL processor (to control how XML data is displayed).
Features
Feature | StAX | SAX | DOM | TrAX |
---|---|---|---|---|
API Type | Pull, streaming | Push, streaming | In memory tree | XSLT Rule |
Parser | Pull | Push | ||
Programming model (Ease of Use) | Simple | Medium | Simple | Medium |
XPath Capability | No | No | Yes | Yes |
CPU and Memory Efficiency | Good | Good | Varies | Varies |
Forward Only | Yes | Yes | No | No |
Read XML | Yes | Yes | Yes | Yes |
Write XML | Yes | No | Yes | Yes |
Create, Read, Update, Delete | No | No | Yes | No |
JAXP Sample Programs
Several samples are included in the download archive.
java -jar JAXP_146.jar
See JAXP_146.jar
Jar
The API can be found in the following jar jaxp-api.jar
Documentation / Reference
Others
- SOAP Package (javax.xml.soap): Provides the API for creating and building SOAP messages.
- javax.xml.xpath: This package provides an object-model neutral API for the evaluation of XPath expressions and access to the evaluation environment.