Name
p:replace — The standard p:replace step.
Synopsis
The p:replace step replaces matching nodes in
its primary input with the top-level node(s) of the
replacement port's document.
| Input port | Primary | Sequence | Content types |
|---|---|---|---|
| source | ✔ | xml html | |
| replacement | text xml html |
| Output port | Primary | Sequence | Content types |
|---|---|---|---|
| result | ✔ | text xml html |
| Option name | Type | Required |
|---|---|---|
| match | XSLTSelectionPattern | ✔ |
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" type="p:replace">
| <p:input port="source" primary="true" content-types="xml html"/>
| <p:input port="replacement" content-types="text xml html"/>
| <p:output port="result" content-types="text xml html"/>
5 | <p:option xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
| name="match"
| required="true"
| as="xs:string"
| e:type="XSLTSelectionPattern"/>
10 |</p:declare-step>Errors
| Code | Description |
|---|---|
err:XC0023 | It
is a dynamic error (err:XC0023) if that pattern matches
an attribute or a namespace nodes. |
Description
The p:replace step is a
standard XProc 3.0 step.
It is also described on XProcRef.org.
Additional examples
The XProc test suite contains examples of the p:replace step.