This interface represents a set of
transformation instructions for transforming a
Source document into a Result
document. The javax.xml.transform package is
nominally independent of type of transformation, but in practice, an
object of this type always represents the compiled form of an
XSLT
stylesheet. Obtain a Templates object from a
transformerFactory object, or with a
javax.xml.transform.sax.TemplatesHandler. Once you
have a Templates object, you can use the
newTRansformer( ) method to create a
transformer object for applying the templates to a
Source to produce a Result
document.
getOutputProperties(
) returns a
java.util.Properties
object that defines name/value pairs
specifying details about how a textual version of the
Result document should be produced. These
properties are specified in an XSLT stylesheet with the
<xsl:output> element. The constants defined
by the OutputKeys are legal output property names.
The returned Properties object contains explicitly
properties directly, and contains default values in a parent
Properties object. This means that if you query a
property value with getProperty( ),
you'll get an explicitly specified value of a
default value. On the other hand, if you query a property with the
get( ) method (inherited by
Properties from its superclass)
you'll get a property value if it was explictly
specified in the stylesheet, or null if it was not
specified. The returned Properties object is a
clone of the internal value, so you can modify it (before passing it
to the setOutputProperties(
) method of a
TRansformer object, for example) without affecting
the Templates object.
Templates implementations are required to be
threadsafe. A Templates object can be used to
create any number of transformer objects.
public interface Templates {
// Public Instance Methods
java.util.Properties getOutputProperties( );
Transformer newTransformer( ) throws TransformerConfigurationException;
}