Package net.sf.saxon
Class PreparedStylesheet
java.lang.Object
net.sf.saxon.expr.instruct.Executable
net.sf.saxon.PreparedStylesheet
This PreparedStylesheet class represents a Stylesheet that has been
prepared for execution (or "compiled").
Note that the PreparedStylesheet object does not contain a reference to the source stylesheet tree (rooted at an XSLStyleSheet object). This allows the source tree to be garbage-collected when it is no longer required.
The PreparedStylesheet in XSLT 3.0 represents the set of all packages making up an executable stylesheet.
-
Field Summary
Fields inherited from class net.sf.saxon.expr.instruct.Executable
schemaAware
-
Constructor Summary
ConstructorsConstructorDescriptionPreparedStylesheet
(Compilation compilation) Constructor - deliberately protected -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check that all required parameters have been supplied.void
explain
(ExpressionPresenter presenter) Produce an XML representation of the compiled and optimized stylesheet, as a human-readable entityvoid
explainNamedTemplates
(ExpressionPresenter presenter) Explain the expression tree for named templates in a stylesheetgetCachedStylesheet
(String href, String baseURI) Get a "next in chain" stylesheet.Get the parameters that were set at compile time.getComponent
(SymbolicName name) Get the properties for xsl:output, including character maps.Get the default initial template nameGet the RuleManager which handles template rulesboolean
isEligibleInitialMode
(Component.M component) Ask whether a mode is eligible for invoking from outside the stylesheetMake a Controller from this stylesheet object.void
putCachedStylesheet
(String href, String baseURI, PreparedStylesheet pss) Save a "next in chain" stylesheet in compiled form, so that it can be reused repeatedly.void
putNamedTemplate
(StructuredQName templateName, NamedTemplate template) Register the named template with a given namevoid
setComponentIndex
(Map<SymbolicName, Component> index) Register the index of componentsvoid
Set the RuleManager that handles template rulesMethods inherited from class net.sf.saxon.expr.instruct.Executable
addPackage, addQueryLibraryModule, addQueryLocationHintProcessed, checkInitialContextItem, createsSecondaryResult, explainGlobalVariables, fixupQueryModules, getCharacterMapIndex, getConfiguration, getFunctionLibrary, getGlobalContextRequirement, getGlobalParameter, getGlobalParameters, getHostLanguage, getOutputProperties, getOutputProperties, getPackages, getPrimarySerializationProperties, getQueryLibraryModules, getQueryLibraryModules, getQueryModuleWithSystemId, isQueryLocationHintProcessed, isSchemaAware, registerGlobalParameter, setCharacterMapIndex, setConfiguration, setCreatesSecondaryResult, setDefaultOutputProperties, setFunctionLibrary, setGlobalContextRequirement, setHostLanguage, setOutputProperties, setSchemaAware, setTopLevelPackage
-
Constructor Details
-
PreparedStylesheet
Constructor - deliberately protected- Parameters:
compilation
- Compilation options
-
-
Method Details
-
newController
Make a Controller from this stylesheet object.- Returns:
- the new Controller
- See Also:
-
getCompileTimeParams
Get the parameters that were set at compile time. These will generally be static parameters, but it is also permitted to set non-static parameters at compile time.- Returns:
- the parameters that were set prior to XSLT compilation
-
checkSuppliedParameters
Check that all required parameters have been supplied. Also checks that the supplied parameters dynamically do not conflict with parameters supplied statically. Used in XSLT only.- Overrides:
checkSuppliedParameters
in classExecutable
- Parameters:
params
- the set of parameters that have been supplied dynamically to the transformer (null represents an empty set).- Throws:
XPathException
- if there is a required parameter for which no value has been supplied
-
getTopLevelPackage
- Overrides:
getTopLevelPackage
in classExecutable
-
setRuleManager
Set the RuleManager that handles template rules- Parameters:
rm
- the RuleManager containing details of all the template rules
-
getRuleManager
Get the RuleManager which handles template rules- Returns:
- the RuleManager registered with setRuleManager
-
putNamedTemplate
Register the named template with a given name- Parameters:
templateName
- the name of a named XSLT templatetemplate
- the template
-
getDefaultInitialTemplateName
Get the default initial template name- Returns:
- the default initial template name
-
setComponentIndex
Register the index of components- Parameters:
index
- the component index
-
getComponent
-
isEligibleInitialMode
Ask whether a mode is eligible for invoking from outside the stylesheet- Parameters:
component
- the component- Returns:
- true if the component can be referenced from the calling application
-
explainNamedTemplates
Explain the expression tree for named templates in a stylesheet- Parameters:
presenter
- destination for the explanatory output- Throws:
XPathException
- if writing to the output fails
-
getDeclaredSerializationProperties
Get the properties for xsl:output, including character maps. The object returned will be a clone of the internal values, and thus it can be mutated without affecting the value held in thisPreparedStylesheet
.This method gets the output properties for the unnamed output format in the stylesheet.
- Returns:
- A SerializationProperties object reflecting the output properties defined for the default (unnamed) output format in the stylesheet.
- See Also:
-
getCachedStylesheet
Get a "next in chain" stylesheet. This method is intended for internal use.- Parameters:
href
- the relative URI of the next-in-chain stylesheetbaseURI
- the baseURI against which this relativeURI is to be resolved- Returns:
- the cached stylesheet if present in the cache, or null if not
-
putCachedStylesheet
Save a "next in chain" stylesheet in compiled form, so that it can be reused repeatedly. This method is intended for internal use.- Parameters:
href
- the relative URI of the stylesheetbaseURI
- the base URI against which the relative URI is resolvedpss
- the prepared stylesheet object to be cached
-
explain
Produce an XML representation of the compiled and optimized stylesheet, as a human-readable entity- Parameters:
presenter
- defines the destination and format of the output- Throws:
XPathException
- if output fails
-