trang takes as input a schema written in any of the following formats:
RELAX NG (XML syntax)
RELAX NG (compact syntax)
XML 1.0 DTD
and produces as output a schema written in any of the following formats:
RELAX NG (XML syntax)
RELAX NG (compact syntax)
XML 1.0 DTD
W3C XML Schema
Trang can also infer a schema from one or more example XML documents.
Trang uses an internal representation based on RELAX NG. For each supported input format, there is an
input module that converts a schema in that input format into this internal representation. For each
supported output format, there is an output module that converts the internal representation into a
schema in that output format. Thus, any supported input format can be translated to any supported output
format.
Trang requires two command-line arguments: the first is the URI or filename of the schema to be
translated; the second is the output filename.
Trang infers the input and output modules to be used from the extension of input and output filenames as
follows:
.rng RELAX NG (XML syntax)
.rnc RELAX NG (compact syntax)
.dtd XML 1.0 DTD
.xsd W3C XML Schema
.xml XML documents (used as examples from which to infer a schema)
This inference can be overridden using the -I and -O options.
When the input is XML documents used as examples to infer a schema, more than one input file may be
specified as arguments. All the input files are specified before the output file.