p:wrap — The standard p:wrap step.
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. |