Dtd2Xsd

This tool converts a DTD (either an XML or SGML DTD) into an XSD schema.

Download the zip file including the standalone executable and the full source code: Dtd2Xsd.zip

See online demo at demo.aspx.
See also online source.

Command Line Usage

The command line executable version has the following options:

 dtd2xsd <options> [InputUri] [OutputFile]
-root "name"Specifies the name of the root element in the DTD.
-e "file"Specifies a file to redirect error output to.
-proxy "server"Specifies the proxy server to use to fetch DTD's through the fire wall.
-sgmlSpecifies that the DTD is an SGML DTD.
-tns "nsuri" Specifies the target namespace
-s prefix ns url

Specifies a schema to add to the list of imported schemas:

  • prefix - is the namespace prefix to associate with the namespace
  • ns - is the namespace URI of the schema to import
  • url - is the schema location.
-nogroups Turns off the default preservation of attribute and content model groups.
InputUriThe input file name or URL. Default is stdin.
OutputFile The optional output file name. Default is stdout.

Notes

Support

Please email bugs, feedback and/or feature requests to Chris Lovett.

Change History

Version Description
1.1 Fix bug in IsStartNameChar check.
1.0 Initial Version