Name

p:xslt — The standard p:xslt step.

Synopsis

The p:xslt step invokes an XSLT stylesheet.

Input portPrimarySequenceContent types
source✔ ✔ any 
stylesheet  xml 
Output portPrimarySequenceContent types
result✔ ✔ any 
secondary ✔ any 
Option nameTypeDefault value
global-context-itemitem()?()
initial-modexs:QName?()
output-base-urixs:anyURI?()
parametersmap(xs:QName,item()*)?()
populate-default-collectionxs:boolean?true()
static-parametersmap(xs:QName,item()*)?()
template-namexs:QName?()
versionxs:string?()
Declaration
 1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" type="p:xslt">
   |   <p:input port="source"
   |            content-types="any"
   |            sequence="true"
 5 |            primary="true"/>
   |   <p:input port="stylesheet" content-types="xml"/>
   |   <p:output port="result"
   |             primary="true"
   |             sequence="true"
10 |             content-types="any"/>
   |   <p:output port="secondary" sequence="true" content-types="any"/>
   |   <p:option name="parameters" as="map(xs:QName,item()*)?"/>
   |   <p:option name="static-parameters" as="map(xs:QName,item()*)?"/>
   |   <p:option name="global-context-item" as="item()?"/>
15 |   <p:option name="populate-default-collection" as="xs:boolean?" select="true()"/>
   |   <p:option name="initial-mode" as="xs:QName?"/>
   |   <p:option name="template-name" as="xs:QName?"/>
   |   <p:option name="output-base-uri" as="xs:anyURI?"/>
   |   <p:option name="version" as="xs:string?"/>
20 |</p:declare-step>
Errors
CodeDescription
err:XC0007It is a dynamic error (err:XC0007) if any key in parameters is associated to a value which is not an instance of the XQuery 1.0 and XPath 2.0 Data Model, e.g. with a map, an array, or a function.
err:XC0008It is a dynamic error (err:XC0008) if the stylesheet does not support a given mode.
err:XC0038It is a dynamic error (err:XC0038) if the specified xslt version is not available.
err:XC0039It is a dynamic error (err:XC0039) if the source port does not contain exactly one XML document or one HTML document if XSLT 1.0 is used.
err:XC0056It is a dynamic error (err:XC0056) if the stylesheet does not provide a given template.
err:XC0093 It is a dynamic error (err:XC0093) if a static error occurs during the static analysis of the XSLT stylesheet.
err:XC0094It is a dynamic error (err:XC0094) if any document supplied on the source port is not an XML document, an HTML documents, or a Text document if XSLT 2.0 is used.
err:XC0095It is a dynamic error (err:XC0095) if an error occurred during the transformation.
err:XC0096It is a dynamic error (err:XC0096) if the transformation is terminated by XSLT message termination.
err:XC0105It is a dynamic error (err:XC0105) if an XSLT 1.0 stylesheet is invoked and option parameters contains a value that is not an atomic value or a node.
err:XC0121It is a dynamic error (err:XC0121) if a document appearing on the secondary port has a base URI that is not both absolute and valid according to RFC 3986.
Implementation defined features
Implementation dependent features

Description

The p:xslt step is a standard XProc 3.0 step. It is also described on XProcRef.org.

Line numbering

If dynamic errors occur during processing and there are no line numbers in the reported errors, make sure that the line numbering feature is enabled globally in the configuration or when the validated document is loaded. (Line numbers will be reported for static errors regardless of the line numbering setting.)

Extension attributes

cx:cache-stylesheet

If the cx:cache-stylesheet attribute is true, and the stylesheet has a base URI, then that stylesheet will be cached. The first time a cached stylesheet is encountered, it is compiled and saved. Subsequent uses of that cached stylesheet will reuse the previously compiled version.

See Caching compiled resources for more details.

cx:empty-global-context

If cx:empty-global-context is true, the global context item will be empty, even if there is only one source document.