Name
p:namespace-rename — The standard p:namespace-rename step.
Synopsis
The p:namespace-rename step renames any namespace declaration or
use of a namespace in a document to a new IRI value.
| Input port | Primary | Sequence | Content types |
|---|---|---|---|
| source | ✔ | xml html |
| Output port | Primary | Sequence | Content types |
|---|---|---|---|
| result | ✔ | xml html |
| Option name | Type | Values | Default value |
|---|---|---|---|
| apply-to | xs:string | ('all','elements','attributes') | 'all' |
| from | xs:string? | () | |
| to | xs:string? | () |
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" type="p:namespace-rename">
| <p:input port="source" content-types="xml html"/>
| <p:output port="result" content-types="xml html"/>
| <p:option name="from" as="xs:string?"/>
5 | <p:option name="to" as="xs:string?"/>
| <p:option name="apply-to"
| select="'all'"
| values="('all','elements','attributes')"/>
|</p:declare-step>Errors
| Code | Description |
|---|---|
err:XC0014 | It is a dynamic error (err:XC0014)
if the XML namespace (http://www.w3.org/XML/1998/namespace)
or the
XMLNS namespace (http://www.w3.org/2000/xmlns/) is
the value of either the from option or the
to option. |
err:XC0092 | It is a dynamic error (err:XC0092)
if as a consequence of changing or removing the namespace of an attribute
the attribute's name is not unique on the respective element. |
Description
The p:namespace-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:namespace-rename step.