Name
p:rename — The standard p:rename step.
Synopsis
The p:rename step renames elements, attributes, or
processing-instruction targets in a document.
| Input port | Primary | Sequence | Content types |
|---|---|---|---|
| source | ✔ | xml html |
| Output port | Primary | Sequence | Content types |
|---|---|---|---|
| result | ✔ | xml html |
| Option name | Type | Default value | Required |
|---|---|---|---|
| new-name | xs:QName | ✔ | |
| match | XSLTSelectionPattern | '/*' |
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" type="p:rename">
| <p:input port="source" content-types="xml html"/>
| <p:output port="result" content-types="xml html"/>
| <p:option xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
5 | name="match"
| as="xs:string"
| select="'/*'"
| e:type="XSLTSelectionPattern"/>
| <p:option name="new-name" required="true" as="xs:QName"/>
10 |</p:declare-step>Errors
| Code | Description |
|---|---|
err:XC0013 | It
is a dynamic error (err:XC0013) if the pattern matches
a processing instruction and the new name has a non-null namespace. |
err:XC0023 | It is a dynamic
error (err:XC0023) if the pattern matches anything other than element,
attribute, or processing instruction nodes, or if it matches more
than one attribute on a single element. |
Description
The p:rename 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:rename step.