Class DocumentBuilder
Class DomDestination
Class DynamicContext
Class DynamicError
Class EmptyEnumerator
Class ExtensionFunctionCall
Class InvalidityHandlerWrapper
Class NamespaceConstant
Class NullDestination
Class Processor
Class QName
Class SchemaManager
Class SchemaValidator
Class Serializer
Class StandardLogger
Class StaticContext
Class StaticError
Class TextWriterDestination
Class XPathCompiler
Class XPathExecutable
Class XPathSelector
Class XQueryCompiler
Class XQueryEvaluator
Class XQueryExecutable
Class XdmAnyFunctionType
Class XdmAnyItemType
Class XdmAnyNodeType
Class XdmAtomicType
Class XdmAtomicValue
Class XdmDestination
- Class TreeProtector
Class XdmEmptySequence
Class XdmFunctionItem
Class XdmItem
Class XdmItemType
Class XdmNode
Class XdmNodeKind
Class XdmSequenceType
Class XdmValue
Class XmlDestination
Class Xslt30Transformer
Class XsltCompiler
Class XsltExecutable
- Class ParameterDetails
Class XsltPackage
Class XsltTransformer
Enum RecoveryPolicy
Enum SchemaValidationMode
Enum TreeModel
Enum WhitespacePolicy
Enum XdmAxis
Interface IInvalidityHandler
Interface IMessageListener
Interface IQueryResolver
Interface IResultDocumentHandler
Interface IXdmEnumerator
Interface IXmlLocation
Interface SchemaResolver
public class XsltTransformer
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 |
RecoveryPolicy |
RecoveryPolicy |
SchemaValidationMode |
SchemaValidationMode
The |
XmlResolver |
InputXmlResolver
The |
IResultDocumentHandler |
ResultDocumentHandler
The |
IMessageListener |
MessageListener
Listener for messages output using <xsl:message>.
The caller may supply a message listener before calling If no message listener is supplied by the caller, message information will be written to the standard error stream. |
StandardLogger |
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. |
XmlDestination |
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. |
net.sf.saxon.Controller |
Implementation Escape hatch to the underlying Java implementation |
Method Summary | |
---|---|
void |
SetInputStream(System.IO.Stream input, System.Uri baseUri) Supply the principal input document for the transformation in the form of a stream. |
net.sf.saxon.event.Receiver |
GetReceiver(net.sf.saxon.event.PipelineConfiguration pipe) Return a Receiver. Saxon calls this method to obtain a Receiver, to which it then sends a sequence of events representing the content of an XML document. |
void |
SetParameter(QName name, XdmValue value) Set the value of a stylesheet parameter. |
void |
Close() Close the Destination, releasing any resources that need to be released. |
void |
Run(XmlDestination destination) Run the transformation, sending the result to a specified destination. |
Property Detail |
---|
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.
Note that this can be inefficient if the stylesheet uses xsl:strip-space
to strip whitespace, or input-type-annotations="strip"
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.
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.
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.
Saxon.Api.DynamicError
- Setting this property to the name of a template
that does not exist in the stylesheet throws a DynamicError with error
code XTDE0040. Setting it to the name of a template that has template
parameters throws a DynamicError with error code XTDE0060.
public Uri BaseOutputUri {get; set; }
The base output URI, which acts as the base URI for resolving the href
attribute of xsl:result-document
.
public RecoveryPolicy RecoveryPolicy {get; set; }
public SchemaValidationMode SchemaValidationMode {get; set; }
The SchemaValidationMode
to be used in this transformation, especially for documents
loaded using the doc()
, document()
, or collection()
functions.
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.
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).
public IMessageListener MessageListener {get; set; }
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.
public StandardLogger TraceFunctionDestination {get; set; }
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.
Since 9.6. Changed in 9.6 to use a StandardLogger
public XmlDestination Destination {get; set; }
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.
The Destination can be used to chain transformations into a pipeline, by using one
XsltTransformer
as the destination of another
public net.sf.saxon.Controller Implementation {get; }
Escape hatch to the underlying Java implementation
Method Detail |
---|
Return a Receiver. Saxon calls this method to obtain a Receiver, to which it then sends a sequence of events representing the content of an XML document.
Parameters:pipe
-
Set the value of a stylesheet parameter.
Parameters:name
-
value
-
Close the Destination, releasing any resources that need to be released.
This method is called by the system on completion of a query or transformation. Some kinds of Destination may need to close an output stream, others might not need to do anything. The default implementation does nothing.
Run the transformation, sending the result to a specified destination.
Parameters:destination
-
XmlDestination
is an abstraction that allows a number of different kinds of destination
to be specified.
Saxon.Api.DynamicError
- Throws a DynamicError if the transformation
fails.
Supply the principal input document for the transformation in the form of a stream.
If this method is used, the
InitialContextNode
is ignored.The supplied stream will be consumed by the
Run()
method. Closing the input stream after use is the client's responsibility.A base URI must be supplied in all cases. It is used to resolve relative URI references appearing within the input document.
Schema validation is applied to the input document according to the value of the
SchemaValidationMode
property.Whitespace stripping is applied according to the value of the
Parameters:xsl:strip-space
andxsl:preserve-space
declarations in the stylesheet.input
-baseUri
-document()
function if the document contains links to other documents in the form of relative URIs.