<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>XsltTransformer</title> <meta name="keywords" content="Saxon.Api.XsltTransformer class"> <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> </head> <body> <div style="width:20%; float:left; background-color:#c1cede; overflow:auto; height:100%"> <h2>Saxon.Api</h2> <div style="position:relative; height:4pt"> <p>Class <a href="DocumentBuilder.html">DocumentBuilder</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="DomDestination.html">DomDestination</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="DynamicContext.html">DynamicContext</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="DynamicError.html">DynamicError</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="EmptyEnumerator.html">EmptyEnumerator</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="ExtensionFunctionCall.html">ExtensionFunctionCall</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="ExtensionFunctionDefinition.html">ExtensionFunctionDefinition</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="NullDestination.html">NullDestination</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="Processor.html">Processor</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="QName.html">QName</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="SchemaManager.html">SchemaManager</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="SchemaValidator.html">SchemaValidator</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="Serializer.html">Serializer</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="StaticContext.html">StaticContext</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="StaticError.html">StaticError</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="TextWriterDestination.html">TextWriterDestination</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XPathCompiler.html">XPathCompiler</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XPathExecutable.html">XPathExecutable</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XPathSelector.html">XPathSelector</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XQueryCompiler.html">XQueryCompiler</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XQueryEvaluator.html">XQueryEvaluator</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XQueryExecutable.html">XQueryExecutable</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmAnyFunctionType.html">XdmAnyFunctionType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmAnyItemType.html">XdmAnyItemType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmAnyNodeType.html">XdmAnyNodeType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmAtomicType.html">XdmAtomicType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmAtomicValue.html">XdmAtomicValue</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmDestination.html">XdmDestination</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmEmptySequence.html">XdmEmptySequence</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmFunctionItem.html">XdmFunctionItem</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmItem.html">XdmItem</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmItemType.html">XdmItemType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmNode.html">XdmNode</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmNodeKind.html">XdmNodeKind</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmSequenceType.html">XdmSequenceType</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XdmValue.html">XdmValue</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XmlDestination.html">XmlDestination</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XsltCompiler.html">XsltCompiler</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XsltExecutable.html">XsltExecutable</a></p> </div> <div style="position:relative; height:4pt"> <p>Class <a href="XsltTransformer.html">XsltTransformer</a></p> </div> <div style="position:relative; height:4pt"> <p>Enum <a href="RecoveryPolicy.html">RecoveryPolicy</a></p> </div> <div style="position:relative; height:4pt"> <p>Enum <a href="SchemaValidationMode.html">SchemaValidationMode</a></p> </div> <div style="position:relative; height:4pt"> <p>Enum <a href="TreeModel.html">TreeModel</a></p> </div> <div style="position:relative; height:4pt"> <p>Enum <a href="WhitespacePolicy.html">WhitespacePolicy</a></p> </div> <div style="position:relative; height:4pt"> <p>Enum <a href="XdmAxis.html">XdmAxis</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="IMessageListener.html">IMessageListener</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="IQueryResolver.html">IQueryResolver</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="IResultDocumentHandler.html">IResultDocumentHandler</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="IXdmEnumerator.html">IXdmEnumerator</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="IXmlLocation.html">IXmlLocation</a></p> </div> <div style="position:relative; height:4pt"> <p>Interface <a href="SchemaResolver.html">SchemaResolver</a></p> </div> </div> <div style="width:5%; float:left; background-color:#e4eef0; overflow:auto; height:100%"> </div> <div style="float:left; width:75%; overflow:auto; height:100%;"> <h2><font size="-1">Saxon.Api</font><br>Class XsltTransformer </h2> <hr> <dl> <dt><pre>public class XsltTransformer</pre></dt> <dt> implements <a href="http://msdn.microsoft.com/en-us/library/system.object(VS.80).aspx">object</a></dt> </dl> <dl> <dd> <p> An <code>XsltTransformer</code> represents a compiled and loaded stylesheet ready for execution. The <code>XsltTransformer</code> holds details of the dynamic evaluation context for the stylesheet. </p> <p>An <code>XsltTransformer</code> 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. </p> <p>An <code>XsltTransformer</code> is always constructed by running the <code>Load</code> method of an <code>XsltExecutable</code>. </p> </dd> </dl> <hr><a name="property_summary"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary=""> <tr border="#ccccff" class="TableHeadingColor"> <th align="left" colspan="2"><font size="+2"><b>Property Summary</b></font></th> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="XdmNode.html">XdmNode</a></code></td> <td><code><b><a href="#InitialContextNode">InitialContextNode</a></b></code><p> The initial context item for the stylesheet. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="QName.html">QName</a></code></td> <td><code><b><a href="#InitialMode">InitialMode</a></b></code><p> The initial mode for the stylesheet. This is either a QName, for a named mode, or null, for the unnamed (default) mode. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="QName.html">QName</a></code></td> <td><code><b><a href="#InitialTemplate">InitialTemplate</a></b></code><p> The initial template for the stylesheet. This is either a QName, for a named template, or null, if no initial template has been set. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> Uri</code></td> <td><code><b><a href="#BaseOutputUri">BaseOutputUri</a></b></code><p> The base output URI, which acts as the base URI for resolving the <code>href</code> attribute of <code>xsl:result-document</code>. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="RecoveryPolicy.html">RecoveryPolicy</a></code></td> <td><code><b><a href="#RecoveryPolicy">RecoveryPolicy</a></b></code></td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="SchemaValidationMode.html">SchemaValidationMode</a></code></td> <td><code><b><a href="#SchemaValidationMode">SchemaValidationMode</a></b></code><p> The <code>SchemaValidationMode</code> to be used in this transformation, especially for documents loaded using the <code>doc()</code>, <code>document()</code>, or <code>collection()</code> functions. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> XmlResolver</code></td> <td><code><b><a href="#InputXmlResolver">InputXmlResolver</a></b></code><p> The <code>XmlResolver</code> to be used at run-time to resolve and dereference URIs supplied to the <code>doc()</code> and <code>document()</code> functions. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="IResultDocumentHandler.html">IResultDocumentHandler</a></code></td> <td><code><b><a href="#ResultDocumentHandler">ResultDocumentHandler</a></b></code><p> The <code>IResultDocumentHandler</code> to be used at run-time to process the output produced by any <code>xsl:result-document</code> instruction with an <code>href</code> attribute. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> <a href="IMessageListener.html">IMessageListener</a></code></td> <td><code><b><a href="#MessageListener">MessageListener</a></b></code> Listener for messages output using <xsl:message>. <p>The caller may supply a message listener before calling <code>Run</code>; 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 <code>XdmNode</code> representing a document node. </p> <p>If no message listener is supplied by the caller, message information will be written to the standard error stream. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> Stream</code></td> <td><code><b><a href="#TraceFunctionDestination">TraceFunctionDestination</a></b></code> Destination for output of messages using <trace()>. <p>If no message listener is supplied by the caller, message information will be written to the standard error stream. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> Controller</code></td> <td><code><b><a href="#Implementation">Implementation</a></b></code><p> Escape hatch to the underlying Java implementation </p> </td> </tr> </table> <a name="method_summary"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary=""> <tr border="#ccccff" class="TableHeadingColor"> <th align="left" colspan="2"><font size="+2"><b>Method Summary</b></font></th> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> void</code></td> <td><code><b><a href="#SetInputStream(System.IO.Stream,System.Uri)">SetInputStream</a></b>(<a href="http://msdn.microsoft.com/en-us/library/system.io.stream(VS.80).aspx">System.IO.Stream</a> input, System.Uri baseUri)</code><p> Supply the principal input document for the transformation in the form of a stream. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> void</code></td> <td><code><b><a href="#SetParameter(Saxon.Api.QName,Saxon.Api.XdmValue)">SetParameter</a></b>(<a href="QName.html">QName</a> name, <a href="XdmValue.html">XdmValue</a> value)</code><p> Set the value of a stylesheet parameter. </p> </td> </tr> <tr bgcolor="white" class="TableRowColor"> <td align="right" valign="top" width="1%"><code> void</code></td> <td><code><b><a href="#Run(Saxon.Api.XmlDestination)">Run</a></b>(<a href="XmlDestination.html">XmlDestination</a> destination)</code><p> Run the transformation, sending the result to a specified destination. </p> </td> </tr> </table> <a name="property_detail"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary=""> <tr border="#ccccff" class="TableHeadingColor"> <th align="left" colspan="2"><font size="+2"><b>Property Detail</b></font></th> </tr> </table><a name="InitialContextNode"></a><h3>InitialContextNode</h3><pre>public <a href="XdmNode.html">XdmNode</a> <b>InitialContextNode</b> {get; set; }</pre><dl> <dd> <p> The initial context item for the stylesheet. </p> <p>This may be either a node or an atomic value. Most commonly it will be a document node, which might be constructed using the <code>Build</code> method of the <code>DocumentBuilder</code> object. </p> <p>Note that this can be inefficient if the stylesheet uses <code>xsl:strip-space</code> to strip whitespace, or <code>input-type-annotations="strip"</code> to remove type annotations, since this will result in the transformation operating on a virtual document implemented as a view or wrapper of the supplied document. </p> </dd> </dl> <hr><a name="InitialMode"></a><h3>InitialMode</h3><pre>public <a href="QName.html">QName</a> <b>InitialMode</b> {get; set; }</pre><dl> <dd> <p> The initial mode for the stylesheet. This is either a QName, for a named mode, or null, for the unnamed (default) mode. </p> </dd> </dl> <hr><a name="InitialTemplate"></a><h3>InitialTemplate</h3><pre>public <a href="QName.html">QName</a> <b>InitialTemplate</b> {get; set; }</pre><dl> <dd> <p> The initial template for the stylesheet. This is either a QName, for a named template, or null, if no initial template has been set. </p> </dd> </dl> <hr><a name="BaseOutputUri"></a><h3>BaseOutputUri</h3><pre>public Uri <b>BaseOutputUri</b> {get; set; }</pre><dl> <dd> <p> The base output URI, which acts as the base URI for resolving the <code>href</code> attribute of <code>xsl:result-document</code>. </p> </dd> </dl> <hr><a name="RecoveryPolicy"></a><h3>RecoveryPolicy</h3><pre>public <a href="RecoveryPolicy.html">RecoveryPolicy</a> <b>RecoveryPolicy</b> {get; set; }</pre><dl> <dd></dd> </dl> <hr><a name="SchemaValidationMode"></a><h3>SchemaValidationMode</h3><pre>public <a href="SchemaValidationMode.html">SchemaValidationMode</a> <b>SchemaValidationMode</b> {get; set; }</pre><dl> <dd> <p> The <code>SchemaValidationMode</code> to be used in this transformation, especially for documents loaded using the <code>doc()</code>, <code>document()</code>, or <code>collection()</code> functions. </p> </dd> </dl> <hr><a name="InputXmlResolver"></a><h3>InputXmlResolver</h3><pre>public XmlResolver <b>InputXmlResolver</b> {get; set; }</pre><dl> <dd> <p> The <code>XmlResolver</code> to be used at run-time to resolve and dereference URIs supplied to the <code>doc()</code> and <code>document()</code> functions. </p> </dd> </dl> <hr><a name="ResultDocumentHandler"></a><h3>ResultDocumentHandler</h3><pre>public <a href="IResultDocumentHandler.html">IResultDocumentHandler</a> <b>ResultDocumentHandler</b> {get; set; }</pre><dl> <dd> <p> The <code>IResultDocumentHandler</code> to be used at run-time to process the output produced by any <code>xsl:result-document</code> instruction with an <code>href</code> attribute. </p> <p> In the absence of a user-supplied result document handler, the <code>href</code> attribute of the <code>xsl:result-document</code> instruction must be a valid relative URI, which is resolved against the value of the <code>BaseOutputUri</code> property, and the resulting absolute URI must identify a writable resource (typically a file in filestore, using the <code>file:</code> URI scheme). </p> </dd> </dl> <hr><a name="MessageListener"></a><h3>MessageListener</h3><pre>public <a href="IMessageListener.html">IMessageListener</a> <b>MessageListener</b> {get; set; }</pre><dl> <dd> Listener for messages output using <xsl:message>. <p>The caller may supply a message listener before calling <code>Run</code>; 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 <code>XdmNode</code> representing a document node. </p> <p>If no message listener is supplied by the caller, message information will be written to the standard error stream. </p> <p>Each message is presented as an XML document node. Calling <code>ToString()</code> on the message object will usually generate an acceptable representation of the message. </p> <p>When the <xsl:message> instruction specifies <code>terminate="yes"</code>, the message is first notified using this interface, and then an exception is thrown which terminates the transformation. </p> </dd> </dl> <hr><a name="TraceFunctionDestination"></a><h3>TraceFunctionDestination</h3><pre>public Stream <b>TraceFunctionDestination</b> {get; set; }</pre><dl> <dd> Destination for output of messages using <trace()>. <p>If no message listener is supplied by the caller, message information will be written to the standard error stream. </p> <p>The supplied destination is ignored if a <code>TraceListener</code> is in use. </p> </dd> </dl> <hr><a name="Implementation"></a><h3>Implementation</h3><pre>public Controller <b>Implementation</b> {get; }</pre><dl> <dd> <p> Escape hatch to the underlying Java implementation </p> </dd> </dl> <hr><a name="method_detail"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary=""> <tr border="#ccccff" class="TableHeadingColor"> <th align="left" colspan="2"><font size="+2"><b>Method Detail</b></font></th> </tr> </table><a name="SetInputStream(System.IO.Stream,System.Uri)"></a><h3>SetInputStream</h3><pre>public void <b>SetInputStream</b>(<a href="http://msdn.microsoft.com/en-us/library/system.io.stream(VS.80).aspx">System.IO.Stream</a> input, System.Uri baseUri)</pre><dl> <dd> <p> Supply the principal input document for the transformation in the form of a stream. </p> <p>If this method is used, the <code>InitialContextNode</code> is ignored. </p> <p>The supplied stream will be consumed by the <code>Run()</code> method. Closing the input stream after use is the client's responsibility. </p> <p>A base URI must be supplied in all cases. It is used to resolve relative URI references appearing within the input document. </p> <p>Schema validation is applied to the input document according to the value of the <code>SchemaValidationMode</code> property. </p> <p>Whitespace stripping is applied according to the value of the <code>xsl:strip-space</code> and <code>xsl:preserve-space</code> declarations in the stylesheet. </p> <b>Parameters:</b><dl> <dt><code>input</code> - </dt> <dd> The stream containing the source code of the principal input document to the transformation. The document node at the root of this document will be the initial context node for the transformation. </dd> </dl> <dl> <dt><code>baseUri</code> - </dt> <dd> The base URI of the principal input document. This is used for example by the <code>document()</code> function if the document contains links to other documents in the form of relative URIs. </dd> </dl> </dd> </dl> <hr><a name="SetParameter(Saxon.Api.QName,Saxon.Api.XdmValue)"></a><h3>SetParameter</h3><pre>public void <b>SetParameter</b>(<a href="QName.html">QName</a> name, <a href="XdmValue.html">XdmValue</a> value)</pre><dl> <dd> <p> Set the value of a stylesheet parameter. </p><b>Parameters:</b><dl> <dt><code>name</code> - </dt> <dd>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). </dd> </dl> <dl> <dt><code>value</code> - </dt> <dd>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). </dd> </dl> </dd> </dl> <hr><a name="Run(Saxon.Api.XmlDestination)"></a><h3>Run</h3><pre>public void <b>Run</b>(<a href="XmlDestination.html">XmlDestination</a> destination)</pre><dl> <dd> <p> Run the transformation, sending the result to a specified destination. </p><b>Parameters:</b><dl> <dt><code>destination</code> - </dt> <dd> The destination for the results of the stylesheet. The class <code>XmlDestination</code> is an abstraction that allows a number of different kinds of destination to be specified. </dd> </dl> </dd> </dl> <hr> </div> </body> </html>