DTDPase is a nice PERL script by Norman Walsh that reads SGML or XML DTD and constructs an XML database of its content. This database can be examined to construct other views of the DTD. HTML and DocBook scripts are provided. Only Caveat: Does not gobble multiple attribute definitions for an element.


Go to the directory, run

  /local/filters/dtdparse/dtdparse --title "Test DTD" --output test.xml test.dtd

Peek in test.xml and you'll see the XML version of the DTD.
To get the HTML version, run:

  /local/filters/dtdparse/dtdformat --html test.xml

Point your favorite web browser at test/index.html and you'll see the
default HTML documentation for the DTD. 

To get the docbook version, delete the test directory, then run 

  /local/filters/dtdparse/dtdformat.pl --refentry test.xml

Look in test/* (i.e. in the directory that will have the name of your DTD)
and you'll find DocBook RefEntry pages of documentation for the DTD.

You can provide your own library (defining a few perl functions)
to provide additional information for the documentation (such as
reasonable descriptions).

Daniel K. Schneider
Last modified: Wed Jul 17 17:58:46 MEST 2002