Authoring SGML DTD's with GELLMU1
 By William F. Hammond
 hammond@math.albany.edu
 September 28, 1998
It is certainly not a new idea that SGML markup can be used to manage many things including, in particular, SGML DTD's.  (For the moment, I am at a loss to find a publicly visible example.)

The extensible nature of GELLMU (Generalized Extensible LATEX-Like MarkUp) is rooted in the fact that GELLMU may be used to author SGML documents.

It follows, inasmuch as GELLMU may be used to prepare an SGML document, that it may be used to prepare an SGML document that is used to generate an SGML DTD.

The following included verbatim segment is the text of a simple GELLMU document "prexdt.glm" that flows in one step, i.e., GELLMU stage 1, to "prexdt.sgml".  It is followed by a copy of the DTD for a simple SGML document type that I have named "dtd".  "prexdt.sgml" is a document under the "dtd" document type.  With a small collection of stage 3 codelets for sgmlspl, one may then generate "prexdt.dtd", which is the third included verbatim segment below.

Of course, if this is to make any sense, it must follow that "boot.dtd" can itself be authored with the document type that it defines, and that is, indeed, the case.

_________________________________________________________________________________________________________________________
 prexdt.glm:
  \documenttype[boot.dtd]{dtd}  \doctype{test}  \dtdref{prexdt.dtd}  \cmt{A Test DTD}  \cmt{Does the recommended usage match this?      }  \begin{document}  \elt{test}{oo}{(preamble,body)}  \elt{preamble}{rr}{(a)}  \elt{body}{rr}{((p|t)*)}{    BETTER}  \enp{ts}{a|p}  \elt{(\%ts)}{rr}{(#PCDATA)*}  \elt{t}{rr}{((r)+)}  \elt{r}{oo}{((c)+)}  \elt{s}{oo}{(i,(c)*)}  \elt{c}{oo}{(#PCDATA)*}  \elt{i}{oo}{(#PCDATA)+}  \end{document} 

_____________________________________________________________________________
 boot.dtd:
                                                       

_____________________________________________________________________________
 prexdt.dtd:
                             

_____________________________________________________________________________
Since GELLMU documents are amenable for processing to many ultimate target formats, including possible future formats, it is essential to make verbatim sections safe.  This means that verbatim sections cannot be prepared in the way that a LATEX "verbatim environment" is prepared.  Even the HTML "pre" command -- for pre-formatted text -- requires the preparer to escape the characters <', >', and `&' where they occur in the pre-formatted material.