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 | ✔ | xml html |
| Output port | Primary | Sequence | Content types |
|---|---|---|---|
| result | ✔ | 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://xmlcalabash.com/ext/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="xml html"/>
5 | <p:output port="result" content-types="xml html"/>
| <p:option name="variables" as="map(xs:QName,item()*)?"/>
|</p:declare-step>Description
This step expands any attribute- or text-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.