Previous Up Next


p:xslt — Performs XSLT processing.


<p:declare-step type="p:xslt">
     <p:input port="source" sequence="true" primary="true"/>
     <p:input port="stylesheet"/>
     <p:input port="parameters" kind="parameter"/>
     <p:output port="result" primary="true"/>
     <p:output port="secondary" sequence="true"/>
     <p:option name="initial-mode"/>                               <!-- QName -->
     <p:option name="template-name"/>                              <!-- QName -->
     <p:option name="output-base-uri"/>                            <!-- anyURI -->
     <p:option name="version"/>                                    <!-- string -->


The p:xslt step applies an [XSLT 1.0] or [XSLT 2.0] stylesheet to a document.

If the step specifies a version, then that version of XSLT is used to process the transformation. If the step does not specify a version, the implementation may use any version it has available and may use any means to determine what version to use, including, but not limited to, examining the version of the stylesheet.

The XSLT stylesheet provided on the stylesheet port is applied to the document on the source port. Any parameters passed on the parameters port are used to define top-level stylesheet parameters. The primary result document of the transformation appears on the result port. All other result documents appear on the secondary port. If XSLT 1.0 is used, an empty sequence of documents always appears on the secondary port.

If a sequence of documents is provided on the source port, the first document is used as the primary input document. The whole sequence is also the default collection. If no documents are provided on the source port, the primary input document is undefined and the default collection is empty.

A dynamic error occurs if the XSLT processor signals a fatal error. This includes the case where the transformation terminates due to a xsl:message instruction with a terminate attribute value of “yes”. How XSLT message termination errors are reported to the XProc processor is implementation-dependent.

The invocation of the transformation is controlled by the initial-mode and template-name options that set the initial mode and/or named template in the XSLT transformation where processing begins.

The output-base-uri option sets the context's output base URI per the XSLT 2.0 specification, otherwise the base URI of the result document is the base URI of the first document in the source port's sequence. If the value of the output-base-uri option is not absolute, it will be resolved using the base URI of its p:option element. An XSLT 1.0 step should use the value of the output-base-uri as the base URI of its output, if the option is specified.

If XSLT 2.0 is used, the outputs of this step may include PSVI annotations.


Error Description
err:C0038 Occurs if the specified version of XSLT is not available.
err:C0039 Occurs if a sequence of documents (including an empty sequence) is provided to an XSLT 1.0 step.
err:C0056 Occurs if the specified initial mode or named template cannot be applied to the specified stylesheet.


FIXME: tbd.