public delegate IDestination ResultDocumentHandler(string href, Uri baseUri)
ResultDocumentHandler can be nominated to handle output
produced by the
xsl:result-document instruction in an XSLT stylesheet.
The function is called by the XSLT processor
xsl:result-document with an
href attribute is evaluated.
This callback affects any
executed by the stylesheet, provided that it has an
ResultDocumentHandler is nominated (in the
ResultDocumentHandler property of the
Xslt30Transformer), the output
xsl:result-document is serialized, and is written to the file
or other resource identified by the URI in the
href attribute, resolved
(if it is relative) against the URI supplied in the
ResultDocumentHandler is nominated, however, it
will be called whenever an
instruction with an
href attribute is evaluated, and the generated result tree
will be passed to the
IDestination that it returns.
The XSLT processor will ensure that the stylesheet cannot create
two distinct result documents which are sent to the same URI. It is the responsibility
ResultDocumentHandler to ensure that two distinct result documents are
not sent to the same
IDestination. Failure to observe this rule can result
in output streams being incorrectly closed.
Note that more than one result document can be open at the same time,
and that the order of opening, writing, and closing result documents chosen
by the processor does not necessarily bear any direct resemblance to the way
that the XSLT source code is written. SaxonCS processes
instructions asynchronously, in multiple threads, unless this is suppressed using
the configuration property
Note also that in the event of a dynamic error occurring in the transformation, it is unpredictable which result documents have been successfully written before the failure occurs.
href- An absolute or relative URI. This will be the effective value of the
hrefattribute of the
xsl:result-documentin the stylesheet.
baseUri- The base URI that should be used for resolving the value of
hrefif it is relative. This will always be the value of the
BaseOutputUriproperty of the
IDestinationobject representing the destination to which the result document is sent.