Class DocumentBuilder
Class DomDestination
Class DynamicContext
Class DynamicError
Class EmptyEnumerator
Class ExtensionFunctionCall
Class NullDestination
Class Processor
Class QName
Class SchemaManager
Class SchemaValidator
Class Serializer
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 XdmEmptySequence
Class XdmItem
Class XdmItemType
Class XdmNode
Class XdmNodeKind
Class XdmSequenceType
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 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 |
|
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. |
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 |
SetInputStream(System.IO.Stream input, System.Uri baseUri) Supply the principal input document for the transformation in the form of a stream. |
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 |
---|
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.
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 {get; set; }
public 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 Stream 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.
public Controller Implementation {get; }
Escape hatch to the underlying Java implementation
Method Detail |
---|
public void SetInputStream(System.IO.Stream input, System.Uri baseUri)
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
xsl:strip-space
and xsl:preserve-space
declarations in the stylesheet.
input
-
baseUri
-
document()
function if the document contains links to other documents in the form of relative URIs.
public void SetParameter(QName name, XdmValue value)
Set the value of a stylesheet parameter.
Parameters:name
-
value
-
public void Run(XmlDestination destination)
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.