TOP |
This input module accepts DTDs as defined by the XML 1.0 Recommendation.
It accepts the following INPUT parameters:
xmlns=uri |
Specifies the default namespace, that is the namespace used for unqualified element names. |
xmlns:prefix=uri |
Specifies the namespace for the element and attribute names using
prefix . |
colon-replacement=chars |
Replaces colons in element names by
chars when constructing the names of
definitions used to represent the element declarations and attribute
list declarations in the DTD. Trang generates a definition for each
element declaration and attlist declaration in the DTD. The name of
the definition is based on the name of the element. In RELAX NG, the
names of definitions cannot contain colons. However, in the DTD, the
element name may contain a colon. By default, Trang will first try to
use the element names without prefixes. If this causes a conflict, it
will instead replace the colon by a legal name character (it try first
to use a period). |
element-define=name-pattern |
Specifies how to construct the name of the definition representing
an element declaration from the name of the element. The
name-pattern must contain exactly one percent
character. This percent character is replaced by the name of element
(after colon replacement) and the
result is used as the name of the definition. |
inline-attlist |
Specifies not to generate definitions for attribute list
declarations and instead move attributes declared in attribute list
declarations into the definitions generated for element declarations.
This is the default behavior when the output module is
xsd . Otherwise, the default behaviour is as described in
the nonline-attlist
parameter. |
nonline-attlist |
Generates a distinct definition (with
combine="interleave" ) for each attribute list declaration
in the DTD; the definition for each element declaration references the
definition for the corresponding attribute list declaration. This is
the default behavior, except when the output module is
xsd , for which the default behavior is as described in
the inline-attlist
parameter. |
attlist-define=name-pattern |
This specifies how to construct the name of the definition
representing an attribute list declaration from the name of the
element. The name-pattern must contain exactly
one percent character. This percent character is replaced by the name
of element (after colon replacement)
and the result is used as the name of the definition. |
any-name=name |
Specifies the name of the definition generated for the content of elements declared in the DTD as having a content model of ANY. |
strict-any |
Preserves the exact semantics of ANY content models by using an explicit choice of references to all declared elements. By default, Trang uses a wildcard that allows any element. |
annotation-prefix=prefix |
Default values are represented using an annotation attribute
prefix:defaultValue where
prefix is bound to
http://relaxng.org/ns/compatibility/annotations/1.0 as
defined by the RELAX NG DTD Compatibility Committee Specification. By default, Trang will use
a for prefix unless that
conflicts with a prefix used in the DTD. |
generate-start |
|
no-generate-start |
Specifies whether Trang should generate a start
element. DTDs do not indicate what elements are allowed as document
elements. Trang assumes that all elements that are defined but never
referenced are allowed as document elements. |
This output module outputs an W3C XML Schema as defined by the XML Schema Recommendation.
It supports the following OUTPUT parameters:
encoding=name |
Use an encoding of name for the output
files. |
indent=n |
Indent by n spaces for each indentation
level. |
disable-abstract-elements |
Disables the use of abstract elements and subsitution groups in the generated XML Schema. This can also be controlled using an annotation attribute. |
any-process-contents=strict |lax |skip |
Specifies the value for the processContents attribute
of any elements. The default is skip
(corresponding to RELAX NG semantics) unless the input format is
dtd , in which case the default is strict
(corresponding to DTD semantics). |
any-attribute-process-contents=strict |lax |skip |
Specifies the value for the processContents attribute
of anyAttribute elements. The default is
skip (corresponding to RELAX NG semantics). |
It has the following limitations:
Annotations can be added to the RELAX NG schema to guide the
translation. These annotations have the namespace URI
http://www.thaiopensource.com/ns/relaxng/xsd
. This document
will use the convention that the prefix tx
refers to this
namespace URI; in other words, it will assume a namespace declaration
of
xmlns:tx="http://www.thaiopensource.com/ns/relaxng/xsd"
The tx:enableAbstractElements
attribute is inherited
in a similar way to the ns
attribute: it can be specified
on a grammar
, div
or include
element to enable or disable the use of abstract elements for all
descendant define
elements. In the absence of any
inherited tx:enableAbstractElements
attribute, the use of
abstract elements is enabled unless the
disable-abstract-elements
option was specified.
It can happen that the same element name occurs in a choice in more
than one define
element; at most one of these
define
elements can be translated to an abstract element.
In this case, Trang will not translate any of them to an abstract
element, unless the use of abstract elements has been disabled by
tx:enableAbstractElements
for all except one of the
define
elements.
In fact, the use of abstract elements is not restricted to the case
where the define
consists of a choice
that
contains only element
patterns; the choice
may also contain ref
patterns referring to definitions
that are to be translated into element declarations, whether abstract
or not. The tx:enableAbstractElements
attribute applies
equally to these definitions.
Attribute | Description | Type |
---|---|---|
outputFile | the target schema to build | String |
Element | Description |
---|---|
inputParam | provides string parameter(s) to the input converter
Any nested text Any textual value of the parameter |
inputSchema | lists the DTDs to convert. At least one source DTD should be provided
Any nested text Any textual value of the parameter |
outputParam | provides string parameter(s) to the output converter
Any nested text Any textual value of the parameter |
Documentation generated by ant.doc Ant macro from ModelAnt by MDA Tools |