This document contains installation instructions and other notes that may help you use this software library more effectively. See also the JAXP FAQ for more information.
Note:
If you are reading this page on-line, 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.
The latest JAXP updates can be found at the JAXP Project on java.net. Including source code.
QName
serialization)These versions of the relevant technologies have been incorporated into the reference implementation.
This release is contained in five JAR files:
javax.xml
packages/components of JAXP. These packages
contain the APIs that give applications a consistent way to obtain
instances of XML processing implementations. The information in this section pertains to the Xerces technology.
This section discusses known schema processing bugs, limitations, and implementation-dependent operations.
These limitations specify known upper bounds on values.
This implementation-dependent operation is not fully clarified by the W3C XML Schema specification ( http://www.w3.org/2001/XMLSchema). As a result, differing implementations exist.
This section covers known issues that arise when migrating from earlier versions of JAXP.
QName Serialization changes:
(from QName
Javadoc)
/**
* Stream Unique Identifier.
*
* Due to a historical defect, QName was released with multiple
* serialVersionUID values even though its serialization was the
* same.
*
* To workaround this issue, serialVersionUID is set with either
* a default value or a compatibility value. To use the
* compatibility value, set the system property:
*
* com.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0
*
* This workaround was inspired by classes in the javax.management
* package, e.g. ObjectName, etc.
* See CR6267224 for original defect report.
*/
If an Exception
is thrown during deserialization, set the system
property:
com.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0
JAXP 1.2 is built into JWSDP and J2EE 1.4. These sections of the Compatibility Guide cover the relevant migration issues:
This section contains implementation notes for DOM Level 3 Core and DOM Level 3 Load and Save.
Not implemented:
Supported parameters:
Not supported:
JAXP 1.1 is built into J2EE 1.3 and J2SE 1.4. For differences in functionality from JAXP 1.1, see the JAXP Compatibility Guide.
The XSLTC transformer generates a transformation engine, or translet, from an XSL stylesheet. This approach separates the interpretation of stylesheet instructions from their runtime application to XML data.
XSLTC works by compiling a stylesheet into Java byte code (translets), which can then be used to perform XSLT transformations. This approach greatly improves the performance of XSLT transformations where a given stylesheet is compiled once and used many times. It also generates an extremely lightweight translet, because only the XSLT instructions that are actually used by the stylesheet are included.
Note:
XSLT is supported by the JAXP transform package. Seejavax.xml.transform
for details on accessing basic XSLT functionality in an implementation-independent manner.
A problem can occur when using a custom class loader with a transformation factory.
Transformation factories in JAXP always prefer the use of the "context class loader" to the use of the "system class loader". Thus, if an application uses a custom class loader, it may need to set the custom class loader as the context class loader for transformation factory to use it. Setting a custom class loader on the current thread can be done as follows:
try { Thread currentThread = Thread.currentThread(); currentThread.setContextClassLoader(customClassLoader); } catch (SecurityException e) { // ... }
If the application is multi-threaded, the custom class loader may need to be set in all threads (every time a new thread is created). A security exception is thrown if an application does not have permission to set the context class loader.
javax.xml.transform.TransformerFactory#setAttribute(java.lang.String
name, java.lang.Object value)
allows the setting of implementation
specific attributes. This implementation supports:
// Public constants for attributes supported by the XSLTC TransformerFactory. public final static String TRANSLET_NAME = "translet-name"; public final static String DESTINATION_DIRECTORY = "destination-directory"; public final static String PACKAGE_NAME = "package-name"; public final static String JAR_NAME = "jar-name"; public final static String GENERATE_TRANSLET = "generate-translet"; public final static String AUTO_TRANSLET = "auto-translet"; public final static String USE_CLASSPATH = "use-classpath"; public final static String DEBUG = "debug"; public final static String ENABLE_INLINING = "enable-inlining"; public final static String INDENT_NUMBER = "indent-number";
When an application is running on a web server, such as the Java Web Services Developer Pack (JWSDP), with security enabled, the following permissions must be set:
permission java.io.FilePermission "/${webserver.home}/common/endorsed/xercesImpl.jar", "read"; permission java.io.FilePermission "/${webserver.home}/common/endorsed/xalan.jar", "read"; permission java.util.PropertyPermission "javax.xml.parser.SAXParserFactory", "read, write"; permission java.util.PropertyPermission "javax.xml.transform.TransformerFactory", "read, write"; permission java.util.PropertyPermission "user.dir", "read"; permission java.util.PropertyPermission "file.separator", "read"; permission java.util.PropertyPermission "line.separator", "read"; permission java.util.PropertyPermission "JavaClass.debug", "read"; permission java.lang.RuntimePermission "createClassLoader"; permission java.lang.RuntimePermission "accessDeclaredMembers";Note:
If read permission is not set for xercesImpl.jar, a FactoryConfigurationError is thrown that says:
Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
Performance of Xerces parser improved significantly.
XSLTC was not included as part of this release, which was destined solely for the J2EE platform.
The parser implementation changed from Xerces 2.0.0_01 to Xerces-J 2.0.1_01 (Xerces 2.0.1 final with controlled bug fixes). The Xalan XSLT processor implementation was updated to xalan-j 2.3.1_01 (Xalan version 2.3.1 with controlled bug fixes).
Finally, this release fully supports the proposed 1.2 JAXP specification, which implements document validation using W3C XML Schema.
The parser implementation changed from Xerces 2.0.0 beta3 to Xerces-J 2.0.0_01 (Xerces 2.0.0 final with controlled bug fixes). The Xalan XSLT processor implementation was updated to xalan-j 2.3.0_01 (Xalan version 2.3.0 with controlled bug fixes).
The Xalan XSLTC processor was also added in this release. (It is used to compile a stylesheet into a transformation engine (translet) that is ready to run.)
This release fully supports the proposed 1.2 JAXP specification, which implements document validation using W3C XML Schema.
The parser implementation changed from Apache Crimson to Xerces 2 version 2.0.0 beta3. The XSLT processor implementation was updated to Xalan classic version 2.2.D14.
The parser supports W3C XML Schema but does not support all aspects of the proposed JAXP 1.2 specification. In particular, the ability to enforce that an instance document conforms to a particular schema has not been implemented. However, the validation portions of the specification can be used along with schema hints in the instance document.