DTD2Schema (original) (raw)

A Conversion Tool from DTD to XML Schema


Download

<dtd2xsd.pl>

Note: the documentation below doesn't reflec the changes by MH; see her announcement of 11 Jan 2001 to xml-dev.

Usage:

perl dtd2xsd.pl [-alias] [-prefix p] [-ns n] [file] -alias enables special aliases (default off) -prefix t specify namespace prefix -ns http://www.w3.org/namespace/ specify namespace URI -simpletype pattern base treat parameter entities whose name match this pattern as simple datatypes derived from this base type -attrgroup pattern treat parameter entities whose name match this pattern as attribute groups -modelgroup pattern treat parameter entities whose name match this pattern as model groups

If no file is specified, STDIN will be used.

Samples:

How does it work?

1. Encoding elements

DTD XML Schema

2. Encoding attributes

DTD XML Schema
<!ATTLIST ROOT a (x|y z) #REQUIRED;>

3. Simple Types, Attribute Groups, and Model Groups

Use dtd2xsd.pl -simpleType ContentType stringto turn

<!-- media type, as per [RFC2045] -->

into

@@along with references to %ContentType;

Use dtd2xsd.pl -simpleType Number nonNegativeIntegerto turn

into

@@more on model groups, attribute groups. Meanwhile, see the makefile for examples.

The program is Copyright � W3C� and provided under the W3C Software License

History:

April 20 2000


Yuichi Koike ($Date: 2017/11/22 16:53:40 $)