Package net.sf.saxon.s9api
Class XsltExecutable
- java.lang.Object
-
- net.sf.saxon.s9api.XsltExecutable
-
public class XsltExecutable extends java.lang.ObjectAn XsltExecutable represents the compiled form of a stylesheet. To execute the stylesheet, it must first be loaded to form anXsltTransformer.An XsltExecutable is immutable, and therefore thread-safe. It is simplest to load a new XsltTransformer each time the stylesheet is to be run. However, the XsltTransformer is serially reusable within a single thread.
An XsltExecutable is created by using one of the
compilemethods on theXsltCompilerclass.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classXsltExecutable.ParameterDetailsInner class containing information about a global parameter to a compiled stylesheet
-
Field Summary
Fields Modifier and Type Field Description (package private) Processorprocessor(package private) PreparedStylesheetpss
-
Constructor Summary
Constructors Modifier Constructor Description protectedXsltExecutable(Processor processor, PreparedStylesheet pss)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexplain(Destination destination)Produce a diagnostic representation of the compiled stylesheet, in XML form.java.util.HashMap<QName,XsltExecutable.ParameterDetails>getGlobalParameters()Get the names of the xsl:param elements defined in this stylesheet, with details of each parameter including its required type, and whether it is required or optionalPreparedStylesheetgetUnderlyingCompiledStylesheet()Get the underlying implementation object representing the compiled stylesheet.WhitespaceStrippingPolicygetWhitespaceStrippingPolicy()Get the whitespace stripping policy defined by this stylesheet, that is, the policy defined by the xsl:strip-space and xsl:preserve-space elements in the stylesheetXsltTransformerload()Load the stylesheet to prepare it for execution.
-
-
-
Field Detail
-
processor
Processor processor
-
pss
PreparedStylesheet pss
-
-
Constructor Detail
-
XsltExecutable
protected XsltExecutable(Processor processor, PreparedStylesheet pss)
-
-
Method Detail
-
load
public XsltTransformer load()
Load the stylesheet to prepare it for execution.- Returns:
- An XsltTransformer. The returned XsltTransformer can be used to set up the dynamic context for stylesheet evaluation, and to run the stylesheet.
-
explain
public void explain(Destination destination) throws SaxonApiException
Produce a diagnostic representation of the compiled stylesheet, in XML form.The detailed form of this representation is not stable (or even documented).
- Parameters:
destination- the destination for the XML document containing the diagnostic representation of the compiled stylesheet- Throws:
SaxonApiException- Since:
- 9.1
-
getWhitespaceStrippingPolicy
public WhitespaceStrippingPolicy getWhitespaceStrippingPolicy()
Get the whitespace stripping policy defined by this stylesheet, that is, the policy defined by the xsl:strip-space and xsl:preserve-space elements in the stylesheet- Returns:
- a newly constructed WhitespaceStrippingPolicy based on the declarations in this
stylesheet. This policy can be used as input to a
DocumentBuilder.
-
getGlobalParameters
public java.util.HashMap<QName,XsltExecutable.ParameterDetails> getGlobalParameters()
Get the names of the xsl:param elements defined in this stylesheet, with details of each parameter including its required type, and whether it is required or optional- Returns:
- a HashMap whose keys are the names of global parameters in the stylesheet,
and whose values are
XsltExecutable.ParameterDetailsobjects giving information about the corresponding parameter. - Since:
- 9.3
-
getUnderlyingCompiledStylesheet
public PreparedStylesheet getUnderlyingCompiledStylesheet()
Get the underlying implementation object representing the compiled stylesheet. This provides an escape hatch into lower-level APIs. The object returned by this method may change from release to release.- Returns:
- the underlying implementation of the compiled stylesheet
-
-