Name

Package: javax.xml.transform

Synopsis

This package defines an API for performing transformations. Although these are common XSLT transformations, the API is flexible enough to support other transformation technologies. Like the javax.xml.parsers package, the classes and interfaces in this package hide vendor-specific implementation code. JAXP 1.1 ships with Xalan as its reference implementation for transformations; different processors can be plugged in.

ErrorListener

This interface allows applications to implement custom error handling. If an error listener is not registered, errors are written to System.err. More details on this interface can be found in Chapter 9.

public interface ErrorListener {
    void error(TransformerException exception)
        throws TransformerException;
    void fatalError(TransformerException exception)
        throws TransformerException;
    void warning(TransformerException exception)
        throws TransformerException;
}

OutputKeys

These are constant definitions for legal output property settings on the Transformer interface. They map directly to the legal attributes for the <xsl:output> element. Programmatically specified output properties take priority over output properties specified in the XSLT stylesheet.

public class OutputKeys { public static final String CDATA_SECTION_ELEMENTS = "cdata-section-elements"; public static final String DOCTYPE_PUBLIC = "doctype-public"; public static final String DOCTYPE_SYSTEM = "doctype-system"; public static final String ENCODING = "encoding"; ...

Get Java and XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.