Saxon.Api

 

 

Saxon.Api

Class XsltExecutable


public class XsltExecutable

An XsltExecutable represents the compiled form of a stylesheet. To execute the stylesheet, it must first be loaded to form an XsltTransformer or Xslt30Transformer.

An XsltExecutable is immutable, and therefore thread-safe. It is simplest to load a new XsltTransformer or Xslt30Transformer each time the stylesheet is to be run. The XsltTransformer or Xslt30Transformer is not thread-safe, though it is serially reusable within a single thread.

An XsltExecutable is created by using one of the Compile methods on the XsltCompiler class.

Property Summary

 Processor Processor

Get the Processor that was used to create this XsltExecutable

 

Method Summary

 void Explain (IDestination destination)

Output an XML representation of the compiled code of the stylesheet, for purposes of diagnostics and instrumentation.

 Dictionary<QNameParameterDetails> 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.

 WhitespacePolicy 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.

 XsltTransformer Load ()

Load the stylesheet to prepare it for execution.

 Xslt30Transformer Load30 ()

Load the stylesheet to prepare it for execution. This version of the load() method creates an Xslt30Transformer which offers interfaces for stylesheet invocation corresponding to those described in the XSLT 3.0 specification. It can be used with XSLT 2.0 or XSLT 3.0 stylesheets, and in both cases it offers new XSLT 3.0 functionality such as the ability to supply parameters to the initial template, or the ability to invoke stylesheet-defined functions, or the ability to return an arbitrary sequence as a result without wrapping it in a document node.

 

Property Detail

Processor

public Processor Processor {get; }

Get the Processor that was used to create this XsltExecutable

Method Detail

Explain

public void Explain(IDestination destination)

Output an XML representation of the compiled code of the stylesheet, for purposes of diagnostics and instrumentation.

Parameters:

destination - The destination for the diagnostic output

GetGlobalParameters

public Dictionary<QNameParameterDetails> 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 Dictionary whose keys are the names of global parameters in the stylesheet, and whose values are ParameterDetails objects giving information about the corresponding parameter.

getWhitespaceStrippingPolicy

public WhitespacePolicy 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 WhitespacePolicy based on the declarations in this stylesheet. This policy can be used as input to a DocumentBuilder.

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.

Load30

public Xslt30Transformer Load30()

Load the stylesheet to prepare it for execution. This version of the load() method creates an Xslt30Transformer which offers interfaces for stylesheet invocation corresponding to those described in the XSLT 3.0 specification. It can be used with XSLT 2.0 or XSLT 3.0 stylesheets, and in both cases it offers new XSLT 3.0 functionality such as the ability to supply parameters to the initial template, or the ability to invoke stylesheet-defined functions, or the ability to return an arbitrary sequence as a result without wrapping it in a document node.

Returns:

An Xslt30Transformer. The returned Xslt30Transformer can be used to set up the dynamic context for stylesheet evaluation, and to run the stylesheet.