Free DTD to XSD conversion utility?

84,765

Solution 1

The W3C offers one. There are also online converters.

Solution 2

If you happen to have Visual Studio, open the DTD file an you should have a button to "Create Schema" out of it.
I haven't checked if it was available on Express edition, though.

Solution 3

Try xmlpad from https://download.cnet.com/XmlPad/3000-7241_4-10252051.html to convert DTD to XSD. Really nice tool.

Solution 4

http://www.thaiopensource.com/relaxng/trang.html

Trang converts between different schema languages for XML. It supports the following languages:

  • RELAX NG (XML syntax)
  • RELAX NG compact syntax
  • XML 1.0 DTDs
  • W3C XML Schema

http://www.thaiopensource.com/relaxng/trang-manual.html

Share:
84,765
Jeremy Stein
Author by

Jeremy Stein

Updated on August 22, 2020

Comments

  • Jeremy Stein
    Jeremy Stein over 3 years

    I have a DTD that I need to convert to an XSD (XML schema) file. Is there a free utility or simple way to accomplish this?

  • Buffalo
    Buffalo about 12 years
    You need to open a DTD file before you can access the requested functionality (convert DTD to XSD in this case; it can also generate a sample XML). Works great, thanks!
  • Edwin Yip
    Edwin Yip over 11 years
    can't parse the w3c strict.dtd file.
  • Maarten Docter
    Maarten Docter over 10 years
    The 'online converters' XML Utilities link is currently out-of-date. The tool moved to: http://www.xmlutilities.net. But now you'll have to request for access. I found a link to this tool http://www.lumrix.net/dtd2xs.php in an O'REILLY article and it worked well for me (you do need the Java Runtime Environment installed, but most of us still have that :-) ).
  • René
    René over 10 years
    Nice, worked perfectly in VS2012. The option is found in the main menu under XML -> Create schema
  • paragbaxi
    paragbaxi over 10 years
    Site down. Cannot reach.
  • Dr. Max Völkel
    Dr. Max Völkel over 9 years
    lumrix.net tool also gone
  • UweB
    UweB about 8 years
    Seems supported by the 2015 community edition as well. :) Thanks!
  • IS4
    IS4 almost 8 years
    Good things disappear quickly from the internet.
  • MeTTeO
    MeTTeO over 7 years
    There is another version of the W3C tool here mathling.com/xmlschema . Found it here: edutechwiki.unige.ch/en/XML_Schema#DTD_to_XSD_Conversion_too‌​ls
  • Peter Howe
    Peter Howe over 7 years
    The lumrix.net link is also broken/out-of-date. A Google search on just "dtd2xs.php" turns up quite a few hits, but most are the same link, or sites that I was a little nervous about downloading from...
  • Andriy Kryvtsun
    Andriy Kryvtsun over 7 years
    Does JDK have command line tool from DTD to XSD conversion?
  • seanf
    seanf about 7 years
    The lumrix dtd2xs tool (Java) can be found here: github.com/reposit/dtd2xs This worked for me: java -cp . dtd2xsd report.dtd > report.xsd
  • Stephen C
    Stephen C about 7 years
    Visual Studio Community 2015 >>> open .dtd file >>> XML tab >>> Create Schema
  • Kiquenet
    Kiquenet over 6 years
    W3C tool requires Perl installation
  • a3nm
    a3nm over 5 years
    The website is down.
  • TonyG
    TonyG over 4 years
    The thaiopensource link currently redirects to relaxng.org/jclark/trang-manual.html
  • Wang
    Wang almost 3 years
    the w3c one is actually broken, I guess it is too old. it generates invalid xsd.
  • Sean Duggan
    Sean Duggan about 2 years
    Currently, that URL comes up with my firewall flagging it as malware.