Name
cx:trang-files — Convert between schema formats.
Synopsis
This step converts between DTD, RELAX NG, and XML Schema grammar formats with Trang.
Output port | Primary | Sequence | Content types |
---|---|---|---|
result | ✔ | ✔ | xml |
Option name | Type | Values | Default value | Required |
---|---|---|---|---|
result-schema | xs:anyURI | ✔ | ||
source-schema | xs:anyURI | ✔ | ||
namespaces | map(xs:string, xs:string)? | () | ||
result-format | xs:string? | ('rng', 'rnc', 'dtd', 'xsd') | () | |
result-parameters | map(xs:QName, item()*)? | () | ||
source-format | xs:string? | ('rng', 'rnc', 'dtd') | () | |
source-parameters | map(xs:QName, item()*)? | () |
<p:import href="https://xmlcalabash.com/ext/library/trang.xpl"/>
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
| <p:output port="result" sequence="true" content-types="xml"/>
| <p:option name="source-schema" as="xs:anyURI" required="true"/>
| <p:option name="result-schema" as="xs:anyURI" required="true"/>
5 | <p:option name="source-format" as="xs:string?" values="('rng', 'rnc', 'dtd')"/>
| <p:option name="result-format"
| as="xs:string?"
| values="('rng', 'rnc', 'dtd', 'xsd')"/>
| <p:option name="namespaces" as="map(xs:string, xs:string)?"/>
10 | <p:option name="source-parameters" as="map(xs:QName, item()*)?"/>
| <p:option name="result-parameters" as="map(xs:QName, item()*)?"/>
|</p:declare-step>
Errors
Code | Description |
---|---|
cxerr:XC0031 | It is a dynamic error (cxerr:XC0031 ) if the input
format is not supported. |
cxerr:XC0032 | It is a dynamic error (cxerr:XC0032 ) if the result
format is not supported. |
cxerr:XC0033 | It is a dynamic error (cxerr:XC0033 ) if the format
cannot be determined from the schema URI. |
Description
Trang translates between DTD, RELAX NG, and XML Schema grammar formats on
the file system. This is roughly the same as running trang
on
the command line.
If a source-format
option is not provided, the step will attempt to
determine the format by looking at the source-schema
.
It is a dynamic error (cxerr:XC0033
) if the format
cannot be determined from the schema URI.
It is a dynamic error (cxerr:XC0031
) if the input
format is not supported.
If a result-format
option is not provided, the step will attempt to
determine the format by looking at the result-schema
.
It is a dynamic error (cxerr:XC0032
) if the result
format is not supported.
See cx:trang
for more details about the namespaces
,
source-parameters
, and result-parameters
options.
The converted schema documents are stored on the file system. The result schema
URI is provided on the result port in a c:result
element.