\documenttype{article} % "\documenttype" signals a GELLMU document % It wants to be set in SGML and then spun to LaTeX to get to DVI. % That way you can also spin it robustly to whatever else other than DVI. \surtitle{W. F. Hammond: The GELLMU Archive} \baseloc{http://www.albany.edu/\tld;hammond/gellmu/boot/} % Now does everyone understand why I do not use "\verb{\tld}" to % make a verbatim '~'. There are two reasons, one of which is more % serious than the other. (Guess which!) % 1. The character '~', though widely used in URL's, is out of spec. % 2. In rendering to LaTeX, there is no reasonable way to have '~' % in a "footnote" since "verb" cannot be in a footnote. \title{Authoring \abbr{SGML} \abbr{DTD}'s with \abbr{GELLMU}} \author{William F. Hammond} \email{hammond@math.albany.edu} \date{September 28, 1998} \latexcommand{ \% Save a tree! \bsl;setlength\{\bsl;topmargin\}\{-36bp\} \bsl;setlength\{\bsl;oddsidemargin\}\{-18bp\} \bsl;setlength\{\bsl;evensidemargin\}\{-18bp\} \bsl;setlength\{\bsl;textwidth\}\{504bp\} \bsl;setlength\{\bsl;textheight\}\{696bp\} \% And I hope that \latex;3 provides "\bsl;texcommand\{\}" \% for any \bsl;emph\{legal\} use of inline raw \bsl;tex; \pdash; even \% inside a "\bsl;newcommand" declaration. } \begin{document} It is certainly not a new idea that \abbr{SGML} markup can be used to manage many things including, in particular, \abbr{SGML} \abbr{DTD}'s. (For the moment, I am at a loss to find a publicly visible example.) The \emph{extensible} nature of \abbr{GELLMU} (\emph{Generalized Extensible \latex\hyp;Like MarkUp}) is rooted in the fact that \abbr{GELLMU} may be used to author \abbr{SGML} documents. It follows, inasmuch as \abbr{GELLMU} may be used to prepare an \abbr{SGML} document, that it may be used to prepare an \abbr{SGML} document that is used to generate an \abbr{SGML} \abbr{DTD}. The following included verbatim segment is the text of a simple \abbr{GELLMU} document \qquostr{prexdt.glm} that flows in one step, i.e., \abbr{GELLMU} stage 1, to \qquostr{prexdt.sgml}. It is followed by a copy of the \abbr{DTD} for a simple \abbr{SGML} document type that I have named \quophrase{dtd}. \qquostr{prexdt.sgml} is a document under the \quophrase{dtd} document type. With a small collection of stage 3 codelets for \quostr{sgmlspl}, one may then generate \qquostr{prexdt.dtd}, which is the third included verbatim segment below. Of course, if this is to make any sense, it must follow that \qquostr{boot.dtd} can itself be authored with the document type that it defines, and that is, indeed, the case. \hrule \subhdrc{\quostr{prexdt.glm:}} \begin{verbatim} \bsl;documenttype[boot.dtd]\lbr;dtd\rbr; \bsl;doctype\lbr;test\rbr; \bsl;dtdref\lbr;prexdt.dtd\rbr; \bsl;cmt\lbr;A Test DTD\rbr; \bsl;cmt\lbr;Does the recommended usage match this\qum; \rbr; \bsl;begin\lbr;document\rbr; \bsl;elt\lbr;test\rbr;\lbr;oo\rbr;\lbr;(preamble,body)\rbr; \bsl;elt\lbr;preamble\rbr;\lbr;rr\rbr;\lbr;(a)\rbr; \bsl;elt\lbr;body\rbr;\lbr;rr\rbr;\lbr;((p|t)*)\rbr;\lbr; BETTER\rbr; \bsl;enp\lbr;ts\rbr;\lbr;a|p\rbr; \bsl;elt\lbr;(\bsl;\pct;ts)\rbr;\lbr;rr\rbr;\lbr;(#PCDATA)*\rbr; \bsl;elt\lbr;t\rbr;\lbr;rr\rbr;\lbr;((r)+)\rbr; \bsl;elt\lbr;r\rbr;\lbr;oo\rbr;\lbr;((c)+)\rbr; \bsl;elt\lbr;s\rbr;\lbr;oo\rbr;\lbr;(i,(c)*)\rbr; \bsl;elt\lbr;c\rbr;\lbr;oo\rbr;\lbr;(#PCDATA)*\rbr; \bsl;elt\lbr;i\rbr;\lbr;oo\rbr;\lbr;(#PCDATA)+\rbr; \bsl;end\lbr;document\rbr; \end{verbatim} \hrule \latexcommand{\bsl;pagebreak} \subhdrc{\quostr{boot.dtd:}} \begin{verbatim} \ltc;!\hyp\hyp; Use \ltc;!DOCTYPE dtd SYSTEM "boot.dtd"\gtc; \hyp\hyp;\gtc; \ltc;!\hyp\hyp; Use \ltc;!DOCTYPE dtd SYSTEM "boot.dtd"\gtc; \hyp\hyp;\gtc; \ltc;!ELEMENT doctype - - (#PCDATA) \hyp\hyp; the name of the document type, i.e., the name of the root element (which needs to be defined) \hyp\hyp;\gtc; \ltc;!ELEMENT dtdref - - (#PCDATA) \hyp\hyp; the (unquoted) system resource name of the DTD to be used with documents of the type "doctype"; this name is only used to generate a comment. Example: for this DTD: doctype = dtd dtdref = boot.dtd \hyp\hyp;\gtc; \ltc;!ENTITY \pct; dtd "elt|enp|ent|empt|cmt"\gtc; \ltc;!ENTITY \pct; tags "rr|ro|or|oo"\gtc; \ltc;!ENTITY \pct; charr "spc|cma|per|ltc|gtc|qum|sol|col|scl|quo|lsq|rsq"\gtc; \ltc;!ENTITY \pct; charn "lbr|rbr|exc|atc|hsh|dol|pct|crt|amp|ast|lpr|rpr|und"\gtc; \ltc;!ENTITY \pct; chare "lsb|rsb|hyp|eqc|plu|vbr|bsl|tld"\gtc; \ltc;!ENTITY \pct; chara "\pct;charr|\pct;charn|\pct;chare"\gtc; \ltc;!ENTITY \pct; charh "rdash"\gtc; \ltc;!ENTITY \pct; chars "\pct;chara|\pct;charh|brk"\gtc; \ltc;!ENTITY \pct; eos "eos|eoq|eoe"\gtc; \ltc;!ELEMENT (\pct;eos) - O EMPTY \hyp\hyp; ends of sentence made by GELLMU \hyp\hyp;\gtc; \ltc;!ELEMENT (\pct;chars) - O EMPTY \hyp\hyp; 33 printable, non-alphanumeric \hyp\hyp;\gtc; \ltc;!ELEMENT (\pct;tags) - O EMPTY \hyp\hyp; the tag requirement combinations \hyp\hyp;\gtc; \ltc;!ENTITY \pct; string "#PCDATA|\pct;chars"\gtc; \ltc;!ELEMENT ag0 - - (\pct;string|\pct;eos)* \hyp\hyp; command argument \hyp\hyp;\gtc; \ltc;!ELEMENT dtd O O (preamble, body)\gtc; \ltc;!ELEMENT preamble - - (doctype,dtdref,(cmt)*) \hyp\hyp; zero or more comments \hyp\hyp;\gtc; \ltc;!ELEMENT body - - (\pct;dtd)*\gtc; \ltc;!ELEMENT elt - O (ag0,ag0,ag0,(ag0)*) \hyp\hyp; element: name, tags, defn, comments\qum; \hyp\hyp;\gtc; \ltc;!ELEMENT enp - O (ag0,ag0,(ag0)*) \hyp\hyp; parameter entity: name, defn, comments\qum; \hyp\hyp;\gtc; \ltc;!ELEMENT ent - O (ag0,ag0,(ag0)*) \hyp\hyp; general entity: name, defn, comments\qum; \hyp\hyp;\gtc; \ltc;!ELEMENT empt - O (ag0,(ag0)*) \hyp\hyp; empty element: name, comments\qum; \hyp\hyp;\gtc; \ltc;!ELEMENT cmt - - ((\pct;string|\pct;eos|verb)*) \hyp\hyp; comment \hyp\hyp;\gtc; \ltc;!ELEMENT verb - - ((\pct;string|\pct;eos)*) \hyp\hyp; inline verbatim, OK in cmt \hyp\hyp;\gtc; \end{verbatim} \hrule \latexcommand{\bsl;pagebreak} \subhdrc{\quostr{prexdt.dtd:}} \begin{verbatim} \ltc;!\hyp\hyp; Use \ltc;!DOCTYPE test SYSTEM "prexdt.dtd"\gtc; \hyp\hyp;\gtc; \ltc;!ELEMENT test - - (#PCDATA) \hyp\hyp; name of root tag\gtc; \ltc;!\hyp\hyp; A Test DTD \hyp\hyp;\gtc; \ltc;!\hyp\hyp; Does the recommended usage match this\qum; \ltc;!DOCTYPE test SYSTEM "prexdt.dtd"\gtc; \hyp\hyp;\gtc; \ltc;!ELEMENT test O O (preamble,body)\gtc; \ltc;!ELEMENT preamble - - (a)\gtc; \ltc;!ELEMENT body - - ((p|t)*) \hyp\hyp; BETTER \hyp\hyp;\gtc; \ltc;!ENTITY \pct; ts "a|p"\gtc; \ltc;!ELEMENT (\pct;ts) - - (#PCDATA)*\gtc; \ltc;!ELEMENT t - - ((r)+)\gtc; \ltc;!ELEMENT r O O ((c)+)\gtc; \ltc;!ELEMENT s O O (i,(c)*)\gtc; \ltc;!ELEMENT c O O (#PCDATA)*\gtc; \ltc;!ELEMENT i O O (#PCDATA)+\gtc; \end{verbatim} \hrule \subhdrc{About the \abbr{GELLMU} \quostr{verbatim} command} Since \abbr{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 \quophrase{verbatim environment} is prepared. Even the \abbr{HTML} \qquostr{pre} command --- for pre\hyp;formatted text --- requires the preparer to escape the characters \verb{\lsq\ltc\rsq}, \verb{\lsq\gtc\rsq}, and \verb{\lsq\amp\rsq} where they occur in the pre\hyp;formatted material. There are two reasonable ways to handle verbatim material in a \abbr{GELLMU} system: \begin{enumerate} \item Prepare the material, as for \abbr{HTML}, for direct inclusion in the \abbr{SGML} image of a \abbr{GELLMU} document. \item Filter the material to use symbolic character names for any character that is not strictly alpha\hyp;numeric before inserting the material inside a \abbr{GELLMU} verbatim command. \end{enumerate} \hrule \subhdrc{About \abbr{GELLMU}} \abbr{GELLMU} is an acronym for \quophrase{Generalized Extensible \latex;\hyp;like MarkUp}. As of October, 1998 all \abbr{GELLMU} materials are didactic, and there has been no \quophrase{release} of related code. The \abbr{GELLMU} materials, under frequent revision, are available for examination. This document on the web is\brk; \begin{anch}[href="dboot.html"]{ \quostr{http://www.albany.edu/\%7Ehammond/gellmu/boot/dboot.html}}\end{anch}, and the durable \abbr{GELLMU} web entrance is\brk; \anch[ href="http://math.albany.edu:8000/math/pers/hammond/igl.html"]{ \quostr{http://math.albany.edu:8000/math/pers/hammond/igl.html}}\anch:. \end{document}