JavaTM API for XML Processing Release Notes

Specification Version: 1.4
Reference Implementation (RI) Version: 1.4 FCS

This document contains installation instructions and other notes that may help you use this software library more effectively. See also the JAXP Compatibility Guide and JAXP FAQ for more information.

If you are reading this page online, this is the most current version of the release notes. If this page was downloaded as part of the release bundle, please see the JAXP Documentation page for the most current version of the release notes.


Packaging Changes

JAXP 1.3 contained five JAR files which were jaxp-api.jar, sax.jar, dom,jar, xercesImpl.jar, and xalan.jar. The packaging reflected the technologies covered, as well as sources used in JAXP 1.3. In JAXP 1.4, these technologies and the newly added StAX package have been tightly integrated into the JAXP RI. As a result, the new packaging has been simplified into two jars as described below:

This jar file contains APIs that give applications a consistent way to obtain instances of XML processing implementations. Included are packages like javax.xml.parsers, javax.xml.transform, and the new packages.
The reference implementation classes for JAXP 1.4.

Feature Changes

An important technical change in JAXP 1.4 is the addition of the* packages from StAX, the Streaming API for XML (JSR 173). With this addition, JAXP 1.4 now supports validation and transformation of documents with the streaming API. Since JAXP 1.4 is integrated in Java SE 6, the StAX support is transparent on any system running the latest Java.


JAXP 1.4 changed its XML Schema validation logic for gMonth to reflect the changes made in the XML Schema 1.0 Specification Errata: E2-12 Error. Specifically, it will now reject gMonths with a lexical representation of "--MM--" as invalid.

Command Line Access to XSLTC

The command-line access to XSLTC, the XSLT processor in the JAXP RI, has been removed from the implementation since JAXP 1.3 (which corresponds to JDK 5.0). However, the functionality was not physically removed from the package. It was hidden by renaming the main() method to _main() in class Therefore, it is possible to enable the command-line feature by writing a simple class with a main() method that calls the _main() method of the Process class. This renaming was necessary due to security risks associated with having entry points as part of the platform's runtime system. The following is an example on how to re-gain access to the CLI:

        public static void main(String[] args) {
            try {
            catch (Exception e) {

JAXP Specification Changes since 1.3

Refer also to JAXP 1.4 Specification Chapter 9. Changes Since JAXP 1.3.

The following sections summarize the significant changes introduced in JAXP 1.4. For additional details, please see the appropriate JavaDoc.

1. Package javax.xml.datatype

1.1. Class DatatypeFactory


  • Added newInstance(String, ClassLoader) method.

1.2. Class Duration

  • Return false if the argument to equals() is null instead of throwing NullPointerException.

1.3. Class XMLGregorianCalendar

  • Return false if the argument to equals() is null instead of throwing NullPointerException.

2. Package javax.xml.parsers

2.1. Class DocumentBuilderFactory

  • Added newInstance(String, ClassLoader) method.

2.2. Class SAXParserFactory

  • Added newInstance(String, ClassLoader) method.

3. Package

      Added the package to support StAX. The package consists of the following interfaces:

  • EventFilter

  • Location

  • StreamFilter

  • XMLEventReader

  • XMLEventWriter

  • XMLReporter

  • XMLResolver

  • XMLStreamConstants

  • XMLStreamReader

  • XMLStreamWriter


  • XMLEventFactory

  • XMLInputFactory

  • XMLOutputFactory


  • XMLStreamException

      And errors:

  • FactoryConfigurationError

4. Package

      Added the package to support StAX. The package consists of the following interfaces:

  • Attribute

  • Characters

  • Comment

  • DTD

  • EndDocument

  • EndElement

  • EntityDeclaration

  • EntityReference

  • Namespace

  • NotationDeclaration

  • ProcessingInstruction

  • StartDocument

  • StartElement

  • XMLEvent

4.1. Package

      Added the package to support StAX. The package consists of the following interfaces:

  • XMLEventAllocator

  • XMLEventConsumer

      And classes:

  • EventReaderDelegate

  • StreamReaderDelegate

5. Package javax.xml.transform

5.1. Class ErrorListener

  • Clarified the semantics of fatalError().

5.2. Class Transformer

  • Clarified the semantics of getOutputProperty() with respect to properties that have not been set explicitly with either setOutputProperty() or xsl:output in the stylesheet.

5.3. Class TransformerFactory

  • Added newInstance(String, ClassLoader) method.

5.4. Package javax.xml.transform.stax

      Added the javax.xml.transform.stax package to support StAX. The package consists of the following interfaces:

  • TemplatesHandler

  • TransformerHandler

      And classes:

  • StAXResult

  • StAXSource

6. Package javax.xml.validation

6.1. Class Schema

  • Clarified that the features set on the SchemaFactory should be passed to the Validator created with newValidator().

  • Clarified that the features set on the SchemaFactory should be passed to the ValidatorHandler created with newValidatorHandler().

6.2. Class SchemaFactory

  • Added newInstance(String, ClassLoader) method.

  • Clarified that the features set on the SchemaFactory should be passed to the Schemas created with newSchema(). Included a note to implementors and developers about the subtleties associated with newSchema() in this context.

  • Clarified that the inputs to newSchema(Source[]) are expected to be XML documents or elements.

  • Updated documentation of setFeature() to clarify that the features set on the SchemaFactory should be passed to the Schemas created with this factory and by extension to the Validator and ValidatorHandlers created from that Schema.

6.3. Class SchemaFactoryLoader

The SchemaFactoryLoader class was created during the JAXP 1.3 development process. Shortly before JAXP 1.3 was finished, the factory mechanisms associated with validation were changed, and this class was removed. Unfortunately, the file was left in a repository and it slipped into the Java 2 Platform Standard Edition 5.0 API Specification.

Since the class can neither be added to JAXP 1.3 nor removed from the Java 5.0 API Specification due to backwards compatibility issues, it is being added to JAXP 1.4. The class is harmless and should not be used. It is being added simply to avoid the confusion that arises when developers notice that it's defined in the platform but not in JAXP.

Do not use this class.

6.4. Class TypeInfoProvider

  • Extended the semantics of getElementTypeInfo(), allowing it to be called from either the startElement event or the endElement event. This allows the API to support W3C XML Schema union types more usefully.

    When W3C XML Schema validation is being performed, in the case where an element has a union type, the TypeInfo returned by a call to getElementTypeInfo() from the startElement event will be the union type. The TypeInfo returned by a call from the endElement event will be the actual member type used to validate the element.

6.5. Class Validator

  • The Validator may now accept Sources other than DOMSource and SAXSource; for example, StAXSource.

  • Clarified that the inputs to validate() are expected to be XML documents or elements.

7. Package javax.xml.xpath

7.1. Class XPath

  • Clarified that it is the XPathVariableResolver in effect at compile time that is used to resolve any variables that appear in the expression.

7.2. Class XPathFactory

  • Added newInstance(String, ClassLoader) method.

Known Issues

1. maxOccur in XML schema

In constructs like xsd:sequence, the validating parser may use space (memory) proportional to the value of a minOccurs/ maxOccurs. This may cause the VM to run out of memory, or simply run for a very long time. To prevent potential attacks that exploit this behavior, secure processing can be enabled on a factory as follows:

factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);

Note that for xsd:element and xsd:any, the validating parser will use a constant amount of space, i.e. independent of the value of minOccurs/maxOccurs.

2. Very large XSLT stylesheet

The XSLT compiler (XSLTC) that is part of JAXP RI 1.4 compiles a stylesheet into JVM bytecodes. Certain large stylesheets may reach VM limits by generating methods that are longer than 64K or offsets that are longer than a short. This is a known limitation that will be addressed in an upcoming release of JAXP.

Terms of Use; Privacy Policy; Copyright ©2013-2015 (revision 20151030.c1dd42a)
Please Confirm