Saxon.Api

Class DocumentBuilder

Class DomDestination

Class DynamicError

Class NullDestination

Class Processor

Class QName

Class SchemaManager

Class SchemaValidator

Class SequenceEnumerator

Class Serializer

Class StaticError

Class TextWriterDestination

Class XPathCompiler

Class XPathExecutable

Class XPathSelector

Class XQueryCompiler

Class XQueryEvaluator

Class XQueryExecutable

Class XdmAtomicValue

Class XdmDestination

Class XdmEmptySequence

Class XdmItem

Class XdmNode

Class XdmValue

Class XmlDestination

Class XsltCompiler

Class XsltExecutable

Class XsltTransformer

Enum RecoveryPolicy

Enum SchemaValidationMode

Enum TreeModel

Enum WhitespacePolicy

Enum XdmAxis

Interface IMessageListener

Interface IQueryResolver

Interface IResultDocumentHandler

Interface IXmlLocation

Interface SchemaResolver

 

Saxon.Api
Class XsltTransformer


public class XsltTransformer
implements object

An XsltTransformer represents a compiled and loaded stylesheet ready for execution. The XsltTransformer holds details of the dynamic evaluation context for the stylesheet.

An XsltTransformer should not be used concurrently in multiple threads. It is safe, however, to reuse the object within a single thread to run the same stylesheet several times. Running the stylesheet does not change the context that has been established.

An XsltTransformer is always constructed by running the Load method of an XsltExecutable.


Property Summary
 XdmNode InitialContextNode

The initial context item for the stylesheet.

 QName InitialMode

The initial mode for the stylesheet. This is either a QName, for a named mode, or null, for the unnamed (default) mode.

 QName InitialTemplate

The initial template for the stylesheet. This is either a QName, for a named template, or null, if no initial template has been set.

 Uri BaseOutputUri

The base output URI, which acts as the base URI for resolving the href attribute of xsl:result-document.

  RecoveryPolicy
 XmlResolver InputXmlResolver

The XmlResolver to be used at run-time to resolve and dereference URIs supplied to the doc() and document() functions.

 IResultDocumentHandler ResultDocumentHandler

The IResultDocumentHandler to be used at run-time to process the output produced by any xsl:result-document instruction with an href attribute.

 IMessageListener MessageListener Listener for messages output using <xsl:message>.

The caller may supply a message listener before calling Run; the processor will then invoke the listener once for each message generated during the transformation. Each message will be output as an object of type XdmNode representing a document node.

If no message listener is supplied by the caller, message information will be written to the standard error stream.

 Stream TraceFunctionDestination Destination for output of messages using <trace()>.

If no message listener is supplied by the caller, message information will be written to the standard error stream.

 Controller Implementation

Escape hatch to the underlying Java implementation

 
Method Summary
 void SetParameter(QName name, XdmValue value)

Set the value of a stylesheet parameter.

 void Run(XmlDestination destination)

Run the transformation, sending the result to a specified destination.

 
Property Detail

InitialContextNode

public XdmNode InitialContextNode {get; set; }

The initial context item for the stylesheet.

This may be either a node or an atomic value. Most commonly it will be a document node, which might be constructed using the Build method of the DocumentBuilder object.


InitialMode

public QName InitialMode {get; set; }

The initial mode for the stylesheet. This is either a QName, for a named mode, or null, for the unnamed (default) mode.


InitialTemplate

public QName InitialTemplate {get; set; }

The initial template for the stylesheet. This is either a QName, for a named template, or null, if no initial template has been set.


BaseOutputUri

public Uri BaseOutputUri {get; set; }

The base output URI, which acts as the base URI for resolving the href attribute of xsl:result-document.


RecoveryPolicy

public  RecoveryPolicy {get; set; }

InputXmlResolver

public XmlResolver InputXmlResolver {get; set; }

The XmlResolver to be used at run-time to resolve and dereference URIs supplied to the doc() and document() functions.


ResultDocumentHandler

public IResultDocumentHandler ResultDocumentHandler {get; set; }

The IResultDocumentHandler to be used at run-time to process the output produced by any xsl:result-document instruction with an href attribute.

In the absence of a user-supplied result document handler, the href attribute of the xsl:result-document instruction must be a valid relative URI, which is resolved against the value of the BaseOutputUri property, and the resulting absolute URI must identify a writable resource (typically a file in filestore, using the file: URI scheme).


MessageListener

public IMessageListener MessageListener {get; set; }
Listener for messages output using <xsl:message>.

The caller may supply a message listener before calling Run; the processor will then invoke the listener once for each message generated during the transformation. Each message will be output as an object of type XdmNode representing a document node.

If no message listener is supplied by the caller, message information will be written to the standard error stream.

Each message is presented as an XML document node. Calling ToString() on the message object will usually generate an acceptable representation of the message.

When the <xsl:message> instruction specifies terminate="yes", the message is first notified using this interface, and then an exception is thrown which terminates the transformation.


TraceFunctionDestination

public Stream TraceFunctionDestination {get; set; }
Destination for output of messages using <trace()>.

If no message listener is supplied by the caller, message information will be written to the standard error stream.

The supplied destination is ignored if a TraceListener is in use.


Implementation

public Controller Implementation {get; }

Escape hatch to the underlying Java implementation


Method Detail

SetParameter

public void SetParameter(QName name,
                    XdmValue value)

Set the value of a stylesheet parameter.

Parameters:
name -
The name of the parameter, expressed as a QName. If a parameter of this name has been declared in the stylesheet, the given value will be assigned to the variable. If the variable has not been declared, calling this method has no effect (it is not an error).
value -
The value to be given to the parameter. If the parameter declaration defines a required type for the variable, then this value will be converted in the same way as arguments to function calls (for example, numeric promotion is applied).

Run

public void Run(XmlDestination destination)

Run the transformation, sending the result to a specified destination.

Parameters:
destination -
The destination for the results of the stylesheet. The class XmlDestination is an abstraction that allows a number of different kinds of destination to be specified.