








We have seen a number of ways to lay out a DTD. The flat structure of a DTD and the paucity of tools for assisting in the layout lead one inexorably towards the idea of using SGML itself to represent a DTD. If this approach is taken, one can use DSSSL or any other SGML formatting language to add style to one's DTD. One can have sections and subsections, with titles and overall comments and tables of comments. One can have Ambrosia, but at the risk of standing alone. None the less, the author has found that this is the most convenient way of managing a DTD. One generates the actual DTD automatically from the marked-up form, perhaps using perl or Balise.
There are a few tools for producing HTML from an SGML DTD. The author has a simple tool for producing PostScript using troff. There are not many tools in this category, sadly.
Tools such as make, RCS and CVS are all very useful. These are freely available for Unix and also for MS-DOS; commercial versions are available for Microsoft Windows and the Macintosh.
The make utility is very useful if you work in an environment where SGML DTDs must be processed or compiled before they can be used. Make reads a configuration file (Makefile) that describes the interdependencies between all the files in a directory, and can run programs as needed to make things up to date. For example, you could tell make that the rules file depends on the DTD file, and that the DTD file in turn depends on an included DTD fragment. If you edited the fragment, make would see that the DTD was older than the fragment, and hence out of date; this in turn would tell it that the rules file was out of date, so it would be recompiled automatically.
RCS is useful for keeping a history of all the changes made to a file. You can compare any two revisions, and can retrieve any earlier revision. RCS will also maintain a revision number in the file for you if you want, so that someone who has a copy of one of your files can tell you what version they have.
CVS is like RCS, except that several people can share a single master copy of the DTD (or whatever else you wish) and can work on it together.
If you have ever saved a file from an editor and then moments later wished you hadn't, and wished you could `go back' to last Wednesday's version of the file, you need something like RCS or CVS.
If you use vi or emacs to edit your DTDs, you should investigate the ctags facility. The author wrote a short program to generate a ctags-like database from a DTD in an hour or so using awk or perl on Unix. The consequence is then that you can position your cursor on any element name, press a key, and be taken straight to the place where that element is defined.
Very often, an hour or two thinking about tools can save a lot of time later.
Contact Robin Cover with corrections and updates, or to submit contributions to the ISUG online document database.
