Name
ex:expand-templates — Expand value templates in a document.
Synopsis
This step expands value templates in an input document. This is analagous
to what p:inline does for inline content.
| Input port | Primary | Sequence | Content types |
|---|---|---|---|
| source | ✔ | text xml html |
| Output port | Primary | Sequence | Content types |
|---|---|---|---|
| result | ✔ | text xml html |
| Option name | Type | Default value |
|---|---|---|
| variables | map(xs:QName,item()*)? | () |
This is an extension step; to use it, your pipeline must include its declaration.
For example, by including the extension library with an import at the top of your
pipeline:
<p:import href="https://exproc.org/library/expand-templates.xpl"/>Declaration
1 |<p:declare-step xmlns:ex="http://exproc.org/ns/steps"
| xmlns:p="http://www.w3.org/ns/xproc"
| type="ex:expand-templates">
| <p:input port="source" content-types="text xml html"/>
5 | <p:output port="result" content-types="text xml html"/>
| <p:option name="variables" as="map(xs:QName,item()*)?"/>
|</p:declare-step>Errors
| Code | Description |
|---|---|
exerr:XC0050 | It is a dynamic error (exerr:XC0050)
if the XPath expression in a value template cannot be evaluated. |
Description
This step expands value templates in the source document. The source
document is the context item for expression evalation; the in-scope variables
are the ones passed in variables.
Document properties
All document properties are preserved.