DTD to XML Schema (Trang)

The Stylus Studio custom document wizard allows you to register user-defined wizards that convert external files into formats that can be opened by Stylus Studio. The XSD from DTD (Trang) is an example of a custom document wizard.

The XSD from DTD (Trang) document wizard takes a DTD file as its source and converts it to an XML Schema document (XSD) using the Trang schema converter from Thai Open Source Software Center (www.thaiopensource.com).

Fields

There are two types of fields in the XSD from DTD (Trang) document wizard:

  • Input fields (displayed in the wizard as [input]) control how the source file will be interpreted and converted into XML Schema.
  • Output fields (displayed in the wizard as [output]) control formatting and other characteristics of the generated XSD file.

Input file (required)

The name and location of the DTD file you want to convert to XSD. You can type the file name or use the Browse button to browse a file system for the source DTD file.

[input] xmlns=<uri>

The default namespace; used for unqualified element names.

[input] xmlns:<prefix=uri>

The namespace for the element and autoboot names using prefix.

[input] colon-replacement=<chars>

The character that is used to replace colons in element names. Used when constructing the names of definitions used to represent the element and attribute list declarations in the DTD. Trang generates a definition for each element declaration and attlist declaration in the DTD. The definition name is based on the element name. In RELAX NG, the definition names cannot contain colons; colons are allowed in element names in DTDs. Trang first tries to use the element names without prefixes. If this results in a conflict, Trang replaces the colon with the chars specified. If no chars is specified, a period is used.

[input] 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 character is replaced by the name of the element, after colon replacement, and the result is used as the name of the definition.

[input] inline-attlist / no-inline-attlist

inline-attlist specifies not to generate definitions for attribute list declarations. Instead, attributes in attribute list declarations are moved into the definitions generated for element list declarations.

no-inline-attlist generates a distinct definition (with combine="interleave") for each attribute list declaration in the DTD; each element declaration definition references the definition for the corresponding attribute list declaration.

[input] attlist-define=<name-pattern>

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 character is replaced by the element name, after colon replacement, and the result is used as the name of the definition.

[input] 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.

[input] 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.

[input] 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 uses a for prefix unless that conflicts with a prefix used in the DTD.

[input] generate-start / no-generate-start

Specifies whether or not 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.

[output] encoding=<name>

Uses name as the encoding for output files.

[output] indent=<n>

Indents each indent level in the output file by n spaces.

[output] disable-abstract-elements

Disables the use of abstract elements and substitution groups in the generated XML schema.

[output] any-process-contents=strict|lax|skip

Specifies the value for the processContents attribute of any elements. The default is strict, which corresponds to DTD semantics.

[output] any-attribute-process-contents=strict|lax|skip

Specifies the value for the processContents attribute of anyAttribute elements. The default is skip, which corresponds to RELAX NG semantics.

 
Free Stylus Studio XML Training:
W3C Member