Name
p:wrap — The standard p:wrap step.
Synopsis
The p:wrap step wraps matching nodes in the
source document with a new parent element.
| Input port | Primary | Sequence | Content types |
|---|---|---|---|
| source | ✔ | xml html |
| Output port | Primary | Sequence | Content types |
|---|---|---|---|
| result | ✔ | application/xml |
| Option name | Type | Default value | Required |
|---|---|---|---|
| match | XSLTSelectionPattern | ✔ | |
| wrapper | xs:QName | ✔ | |
| attributes | map(xs:QName, xs:anyAtomicType)? | () | |
| group-adjacent | XPathExpression | () |
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" type="p:wrap">
| <p:input port="source" content-types="xml html"/>
| <p:output port="result" content-types="application/xml"/>
| <p:option name="wrapper" required="true" as="xs:QName"/>
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:option xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
| name="group-adjacent"
| as="xs:string?"
| e:type="XPathExpression"/>
| <p:option name="attributes" as="map(xs:QName, xs:anyAtomicType)?"/>
15 |</p:declare-step>Errors
| Code | Description |
|---|---|
err:XC0023 | It
is a dynamic error (err:XC0023) if the pattern matches
anything other than document, element, text, processing instruction, and comment
nodes. |
Description
The p:wrap 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:wrap step.