<!DOCTYPE article SYSTEM "gellmu.dtd"><article>
<nul/>
<nul/>
<nul/>
<surtitle>W. F. Hammond: The GELLMU Archive</surtitle>
<baseloc>http:<sol/><sol/>www.albany.edu<sol/><tld/>hammond<sol/>gellmu<sol/>boot<sol/></baseloc>
<nul/>
<nul/>
<nul/>
<nul/>
<nul/>
<nul/>
<title>Authoring <abbr>SGML</abbr> <abbr>DTD</abbr>'s with <abbr>GELLMU</abbr></title>
<author>William F. Hammond</author>
<email>hammond<atc/>math.albany.edu</email>
<date>September 28, 1998</date>
<latexcommand>
<pct/> Save a tree<eoe/>
<bsl/>setlength<lbr/><bsl/>topmargin<rbr/><lbr/><hyp/>36bp<rbr/>
<bsl/>setlength<lbr/><bsl/>oddsidemargin<rbr/><lbr/><hyp/>18bp<rbr/>
<bsl/>setlength<lbr/><bsl/>evensidemargin<rbr/><lbr/><hyp/>18bp<rbr/>
<bsl/>setlength<lbr/><bsl/>textwidth<rbr/><lbr/>504bp<rbr/>
<bsl/>setlength<lbr/><bsl/>textheight<rbr/><lbr/>696bp<rbr/>
<pct/> And I hope that <latex/>3 provides "<bsl/>texcommand<lbr/><rbr/>"
<pct/> for any <bsl/>emph<lbr/>legal<rbr/> use of inline raw <bsl/>tex; <pdash/> even
<pct/> inside a "<bsl/>newcommand" declaration<eos/>
</latexcommand>
<body>
<parb>
It is certainly not a new idea that <abbr>SGML</abbr> markup can be used
to manage many things including, in particular, <abbr>SGML</abbr>
<abbr>DTD</abbr>'s<eos/>  (For the moment, I am at a loss to find a publicly
visible example.)
<parb>
The <emph>extensible</emph> nature of <abbr>GELLMU</abbr>
(<emph>Generalized Extensible <latex><hyp/>Like MarkUp</emph>)
is rooted in the fact
that <abbr>GELLMU</abbr> may be used to author <abbr>SGML</abbr> documents<eos/>
<parb>
It follows, inasmuch as <abbr>GELLMU</abbr> may be used to prepare an
<abbr>SGML</abbr> document, that it may be used to prepare an <abbr>SGML</abbr>
document that is used to generate an <abbr>SGML</abbr> <abbr>DTD</abbr><eos/>
<parb>
The following included verbatim segment is the text of a simple
<abbr>GELLMU</abbr> document <qquostr>prexdt.glm</qquostr> that flows in one step,
i.e., <abbr>GELLMU</abbr> stage 1, to <qquostr>prexdt.sgml</qquostr><eos/>  It is followed
by a copy of the <abbr>DTD</abbr> for a simple <abbr>SGML</abbr> document type that
I have named <quophrase>dtd</quophrase><eos/>  <qquostr>prexdt.sgml</qquostr> is a document
under the <quophrase>dtd</quophrase> document type<eos/>  With a small collection of
stage 3 codelets for <quostr>sgmlspl</quostr>, one may then generate
<qquostr>prexdt.dtd</qquostr>, which is the third included verbatim segment
below<eos/>
<parb>
Of course, if this is to make any sense, it must follow that
<qquostr>boot.dtd</qquostr> can itself be authored with the document type
that it defines, and that is, indeed, the case<eos/>

<hrule>
<subhdrc><quostr>prexdt.glm:</quostr></subhdrc>
<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/>
  <ltc/>!DOCTYPE test SYSTEM "prexdt.dtd"<gtc/>
<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<vbr/>t)<ast/>)<rbr/><lbr/>    BETTER<rbr/>
<bsl/>enp<lbr/>ts<rbr/><lbr/>a<vbr/>p<rbr/>
<bsl/>elt<lbr/>(<bsl/><pct/>ts)<rbr/><lbr/>rr<rbr/><lbr/>(#PCDATA)<ast/><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)<ast/>)<rbr/>
<bsl/>elt<lbr/>c<rbr/><lbr/>oo<rbr/><lbr/>(#PCDATA)<ast/><rbr/>
<bsl/>elt<lbr/>i<rbr/><lbr/>oo<rbr/><lbr/>(#PCDATA)+<rbr/>
<bsl/>end<lbr/>document<rbr/>
</verbatim>

<hrule>
<latexcommand><bsl/>pagebreak</latexcommand>

<subhdrc><quostr>boot.dtd:</quostr></subhdrc>
<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 <hyp/> <hyp/> (#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 <hyp/> <hyp/> (#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<vbr/>enp<vbr/>ent<vbr/>empt<vbr/>cmt"<gtc/>
<ltc/>!ENTITY <pct/> tags "rr<vbr/>ro<vbr/>or<vbr/>oo"<gtc/>
<ltc/>!ENTITY <pct/> charr "spc<vbr/>cma<vbr/>per<vbr/>ltc<vbr/>gtc<vbr/>qum<vbr/>sol<vbr/>col<vbr/>scl<vbr/>quo<vbr/>lsq<vbr/>rsq"<gtc/>
<ltc/>!ENTITY <pct/> charn "lbr<vbr/>rbr<vbr/>exc<vbr/>atc<vbr/>hsh<vbr/>dol<vbr/>pct<vbr/>crt<vbr/>amp<vbr/>ast<vbr/>lpr<vbr/>rpr<vbr/>und"<gtc/>
<ltc/>!ENTITY <pct/> chare "lsb<vbr/>rsb<vbr/>hyp<vbr/>eqc<vbr/>plu<vbr/>vbr<vbr/>bsl<vbr/>tld"<gtc/>
<ltc/>!ENTITY <pct/> chara "<pct/>charr<vbr/><pct/>charn<vbr/><pct/>chare"<gtc/>
<ltc/>!ENTITY <pct/> charh "rdash"<gtc/>
<ltc/>!ENTITY <pct/> chars "<pct/>chara<vbr/><pct/>charh<vbr/>brk"<gtc/>
<ltc/>!ENTITY <pct/> eos "eos<vbr/>eoq<vbr/>eoe"<gtc/>
<ltc/>!ELEMENT (<pct/>eos) <hyp/> O EMPTY <hyp><hyp/> ends of sentence made by GELLMU <hyp><hyp/><gtc/>
<ltc/>!ELEMENT (<pct/>chars) <hyp/> O EMPTY <hyp><hyp/> 33 printable, non<hyp/>alphanumeric <hyp><hyp/><gtc/>
<ltc/>!ELEMENT (<pct/>tags) <hyp/> O EMPTY <hyp><hyp/> the tag requirement combinations <hyp><hyp/><gtc/>
<ltc/>!ENTITY <pct/> string "#PCDATA<vbr/><pct/>chars"<gtc/>
<ltc/>!ELEMENT ag0 <hyp/> <hyp/> (<pct/>string<vbr/><pct/>eos)<ast/> <hyp><hyp/> command argument <hyp><hyp/><gtc/>
<ltc/>!ELEMENT dtd O O (preamble, body)<gtc/>
<ltc/>!ELEMENT preamble <hyp/> <hyp/> (doctype,dtdref,(cmt)<ast/>) <hyp><hyp/> zero or more comments <hyp><hyp/><gtc/>
<ltc/>!ELEMENT body <hyp/> <hyp/> (<pct/>dtd)<ast/><gtc/>
<ltc/>!ELEMENT elt <hyp/> O (ag0,ag0,ag0,(ag0)<ast/>) <hyp><hyp/> element:
             name, tags, defn, comments<qum/> <hyp><hyp/><gtc/>
<ltc/>!ELEMENT enp <hyp/> O (ag0,ag0,(ag0)<ast/>) <hyp><hyp/> parameter entity:
             name, defn, comments<qum/> <hyp><hyp/><gtc/>
<ltc/>!ELEMENT ent <hyp/> O (ag0,ag0,(ag0)<ast/>) <hyp><hyp/> general entity:
             name, defn, comments<qum/> <hyp><hyp/><gtc/>
<ltc/>!ELEMENT empt <hyp/> O (ag0,(ag0)<ast/>) <hyp><hyp/> empty element:
             name, comments<qum/> <hyp><hyp/><gtc/>
<ltc/>!ELEMENT cmt <hyp/> <hyp/> ((<pct/>string<vbr/><pct/>eos<vbr/>verb)<ast/>) <hyp><hyp/> comment <hyp><hyp/><gtc/>
<ltc/>!ELEMENT verb <hyp/> <hyp/> ((<pct/>string<vbr/><pct/>eos)<ast/>) <hyp><hyp/> inline verbatim, OK in cmt <hyp><hyp/><gtc/>

</verbatim>

<hrule>
<latexcommand><bsl/>pagebreak</latexcommand>

<subhdrc><quostr>prexdt.dtd:</quostr></subhdrc>
<verbatim>
<ltc/>!<hyp><hyp/> Use <ltc/>!DOCTYPE test SYSTEM "prexdt.dtd"<gtc/> <hyp><hyp/><gtc/>
<ltc/>!ELEMENT test <hyp/> <hyp/> (#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 <hyp/> <hyp/> (a)<gtc/>
<ltc/>!ELEMENT body <hyp/> <hyp/> ((p<vbr/>t)<ast/>) <hyp><hyp/>     BETTER <hyp><hyp/><gtc/>
<ltc/>!ENTITY <pct/> ts "a<vbr/>p"<gtc/>
<ltc/>!ELEMENT (<pct/>ts) <hyp/> <hyp/> (#PCDATA)<ast/><gtc/>
<ltc/>!ELEMENT t <hyp/> <hyp/> ((r)+)<gtc/>
<ltc/>!ELEMENT r O O ((c)+)<gtc/>
<ltc/>!ELEMENT s O O (i,(c)<ast/>)<gtc/>
<ltc/>!ELEMENT c O O (#PCDATA)<ast/><gtc/>
<ltc/>!ELEMENT i O O (#PCDATA)+<gtc/>

</verbatim>

<hrule>
<subhdrc>About the <abbr>GELLMU</abbr> <quostr>verbatim</quostr> command</subhdrc>
<parb>
Since <abbr>GELLMU</abbr> documents are amenable for processing to many
ultimate target formats, including possible future formats, it is
essential to make verbatim sections safe<eos/>  This means that verbatim
sections cannot be prepared in the way that a <latex>
<quophrase>verbatim environment</quophrase> is prepared<eos/>  Even the <abbr>HTML</abbr>
<qquostr>pre</qquostr> command <pdash/> for pre<hyp/>formatted text <pdash/> requires the
preparer to escape the characters <verb><lsq><ltc><rsq></verb>,
<verb><lsq><gtc><rsq></verb>, and <verb><lsq><amp><rsq></verb> where they occur in
the pre<hyp/>formatted material<eos/>
<parb>
There are two reasonable ways to handle verbatim material in a
<abbr>GELLMU</abbr> system:
<enumerate>
<item>  Prepare the material, as for <abbr>HTML</abbr>, for direct inclusion
       in the <abbr>SGML</abbr> image of a <abbr>GELLMU</abbr> document<eos/>
<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</abbr> verbatim command<eos/>
</enumerate>

<hrule>
<subhdrc>About <abbr>GELLMU</abbr></subhdrc>
<parb>
<abbr>GELLMU</abbr> is an acronym for <quophrase>Generalized Extensible
<latex/><hyp/>like MarkUp</quophrase><eos/>  As of October, 1998 all <abbr>GELLMU</abbr> materials
are didactic, and there has been no <quophrase>release</quophrase> of related code<eos/>
The <abbr>GELLMU</abbr> materials, under frequent revision, are available for
examination<eos/>
This document on the web is<brk/>
<anch><op0>href="dboot.html"</op0><ag0>
<quostr>http:<sol/><sol/>www.albany.edu<sol/><pct/>7Ehammond<sol/>gellmu<sol/>boot<sol/>dboot.html</quostr></ag0></anch>,
and the durable <abbr>GELLMU</abbr> web entrance is<brk/>
<anch><op0>
href="http:<sol/><sol/>math.albany.edu:8000<sol/>math<sol/>pers<sol/>hammond<sol/>igl.html"</op0><ag0>
<quostr>http:<sol/><sol/>math.albany.edu:8000<sol/>math<sol/>pers<sol/>hammond<sol/>igl.html</quostr></ag0></anch><eos/>
</body>
</article>

