% LaTeX
% from xml version="1.0"
%nul
%nul
%nul
\documentclass{article}
\setlength{\parindent}{6bp}
\setlength{\topmargin}{0bp}
\setlength{\headheight}{0bp}
\setlength{\headsep}{0bp}
\setlength{\oddsidemargin}{0bp}
\setlength{\evensidemargin}{0bp}
\setlength{\textwidth}{468bp}
\setlength{\textheight}{624bp}
\setlength{\parskip}{6bp}
\thispagestyle{empty}
\newlength{\centerskip}
\setlength{\centerskip}{\topsep}
%nul
%nul
%nul
%nul
%nul
%nul
\title{Authoring SGML DTD's with GELLMU}
\date{September 28, 1998}
% Save a tree!
\setlength{\topmargin}{-36bp}
\setlength{\oddsidemargin}{-18bp}
\setlength{\evensidemargin}{-18bp}
\setlength{\textwidth}{504bp}
\setlength{\textheight}{696bp}
% And I hope that \LaTeX{}3 provides "\texcommand{}"
% for any \emph{legal} use of inline raw \tex; --- even
% inside a "\newcommand" declaration.
\newcommand{\hsf}{\hspace*{\fill}}
\newcommand{\tdbc}[1]{\hsf{\bf #1}\hsf}
\newenvironment{menulist}{
\begin{list}{}{
\setlength{\topsep}{0bp}
\setlength{\labelwidth}{0bp}
\setlength{\leftmargin}{0.04\textwidth}
\setlength{\itemindent}{0bp}
\setlength{\itemsep}{0bp}
\setlength{\parsep}{0bp}}
}{\end{list}}
\newenvironment{Menulist}{
\begin{list}{}{
\setlength{\topsep}{0bp}
\setlength{\labelwidth}{0bp}
\setlength{\leftmargin}{0.04\textwidth}
\setlength{\itemindent}{0bp}
\setlength{\itemsep}{3bp}
\setlength{\parsep}{3bp}}
}{\end{list}}
\newenvironment{citations}{
\begin{list}{}{
\setlength{\topsep}{0bp}
\setlength{\labelwidth}{0bp}
\setlength{\leftmargin}{0.04\textwidth}
\setlength{\labelsep}{0bp}
\setlength{\itemindent}{-0.2\leftmargin}
\setlength{\itemsep}{3bp}
\setlength{\parsep}{0bp}}
}{\end{list}}
\author{William F. Hammond
\\Email: \texttt{hammond@math.albany.edu}
}
\begin{document}
\begin{center}\LARGE\bf
Authoring SGML DTD's with GELLMU
\end{center}
\begin{center}\Large\bf
\textsl{William F. Hammond}
\end{center}
\begin{center}
Email: \verb|hammond@math.albany.edu|
\end{center}
\begin{center}
\large\bf
September 28, 1998
\end{center}

\medskip
\par{It is certainly not a new idea that \textsc{SGML} markup can be used
to manage many things including, in particular, \textsc{SGML}
\textsc{DTD}'s. \   (For the moment, I am at a loss to find a publicly
visible example.)
}
\par{The \emph{extensible} nature of \textsc{GELLMU}
(\emph{Generalized Extensible \LaTeX{}-Like MarkUp})
is rooted in the fact
that \textsc{GELLMU} may be used to author \textsc{SGML} documents. \ 
}
\par{It follows, inasmuch as \textsc{GELLMU} may be used to prepare an
\textsc{SGML} document, that it may be used to prepare an \textsc{SGML}
document that is used to generate an \textsc{SGML} \textsc{DTD}. \ 
}
\par{The following included verbatim segment is the text of a simple
\textsc{GELLMU} document \texttt{"prexdt.glm"} that flows in one step,
i.e., \textsc{GELLMU} stage 1, to \texttt{"prexdt.sgml"}. \   It is followed
by a copy of the \textsc{DTD} for a simple \textsc{SGML} document type that
I have named ``dtd''. \   \texttt{"prexdt.sgml"} is a document
under the ``dtd'' document type. \   With a small collection of
stage 3 codelets for \texttt{sgmlspl}, one may then generate
\texttt{"prexdt.dtd"}, which is the third included verbatim segment
below. \ 
}
\par{Of course, if this is to make any sense, it must follow that
\texttt{"boot.dtd"} can itself be authored with the document type
that it defines, and that is, indeed, the case. \ 

}


\medskip
\hspace*{\fill}\rule[1bp]{0.8\textwidth}{0.3bp}\hspace*{\fill}
\medskip
\begin{center}\normalsize\bf
\texttt{prexdt.glm:}\end{center}
\begin{verbatim}
\documenttype[boot.dtd]{dtd}
\doctype{test}
\dtdref{prexdt.dtd}
\cmt{A Test DTD}
\cmt{Does the recommended usage match this?
  <!DOCTYPE test SYSTEM "prexdt.dtd">
}
\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}
\end{verbatim}

\medskip
\hspace*{\fill}\rule[1bp]{0.8\textwidth}{0.3bp}\hspace*{\fill}
\medskip
\pagebreak
\begin{center}\normalsize\bf
\texttt{boot.dtd:}\end{center}
\begin{verbatim}
<!-- Use <!DOCTYPE dtd SYSTEM "boot.dtd"> -->
<!-- Use
     <!DOCTYPE dtd SYSTEM "boot.dtd">
 -->
<!ELEMENT doctype - - (#PCDATA) -- the name of the document type,
    i.e., the name of the root element (which needs to be defined) -->
<!ELEMENT dtdref - - (#PCDATA) -- 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 -->
<!ENTITY % dtd "elt|enp|ent|empt|cmt">
<!ENTITY % tags "rr|ro|or|oo">
<!ENTITY % charr "spc|cma|per|ltc|gtc|qum|sol|col|scl|quo|lsq|rsq">
<!ENTITY % charn "lbr|rbr|exc|atc|hsh|dol|pct|crt|amp|ast|lpr|rpr|und">
<!ENTITY % chare "lsb|rsb|hyp|eqc|plu|vbr|bsl|tld">
<!ENTITY % chara "%charr|%charn|%chare">
<!ENTITY % charh "rdash">
<!ENTITY % chars "%chara|%charh|brk">
<!ENTITY % eos "eos|eoq|eoe">
<!ELEMENT (%eos) - O EMPTY -- ends of sentence made by GELLMU -->
<!ELEMENT (%chars) - O EMPTY -- 33 printable, non-alphanumeric -->
<!ELEMENT (%tags) - O EMPTY -- the tag requirement combinations -->
<!ENTITY % string "#PCDATA|%chars">
<!ELEMENT ag0 - - (%string|%eos)* -- command argument -->
<!ELEMENT dtd O O (preamble, body)>
<!ELEMENT preamble - - (doctype,dtdref,(cmt)*) -- zero or more comments -->
<!ELEMENT body - - (%dtd)*>
<!ELEMENT elt - O (ag0,ag0,ag0,(ag0)*) -- element:
             name, tags, defn, comments? -->
<!ELEMENT enp - O (ag0,ag0,(ag0)*) -- parameter entity:
             name, defn, comments? -->
<!ELEMENT ent - O (ag0,ag0,(ag0)*) -- general entity:
             name, defn, comments? -->
<!ELEMENT empt - O (ag0,(ag0)*) -- empty element:
             name, comments? -->
<!ELEMENT cmt - - ((%string|%eos|verb)*) -- comment -->
<!ELEMENT verb - - ((%string|%eos)*) -- inline verbatim, OK in cmt -->

\end{verbatim}

\medskip
\hspace*{\fill}\rule[1bp]{0.8\textwidth}{0.3bp}\hspace*{\fill}
\medskip
\pagebreak
\begin{center}\normalsize\bf
\texttt{prexdt.dtd:}\end{center}
\begin{verbatim}
<!-- Use <!DOCTYPE test SYSTEM "prexdt.dtd"> -->
<!ELEMENT test - - (#PCDATA) -- name of root tag>
<!-- A Test DTD -->
<!-- Does the recommended usage match this?
  <!DOCTYPE test SYSTEM "prexdt.dtd"> -->
<!ELEMENT test O O (preamble,body)>
<!ELEMENT preamble - - (a)>
<!ELEMENT body - - ((p|t)*) --     BETTER -->
<!ENTITY % ts "a|p">
<!ELEMENT (%ts) - - (#PCDATA)*>
<!ELEMENT t - - ((r)+)>
<!ELEMENT r O O ((c)+)>
<!ELEMENT s O O (i,(c)*)>
<!ELEMENT c O O (#PCDATA)*>
<!ELEMENT i O O (#PCDATA)+>

\end{verbatim}

\medskip
\hspace*{\fill}\rule[1bp]{0.8\textwidth}{0.3bp}\hspace*{\fill}
\medskip
\begin{center}\normalsize\bf
About the \textsc{GELLMU} \texttt{verbatim} command\end{center}
\par{Since \textsc{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 \textsc{HTML}
\texttt{"pre"} command --- for pre-formatted text --- requires the
preparer to escape the characters \verb+`<'+,
\verb+`>'+, and \verb+`&'+ where they occur in
the pre-formatted material. \ 
}
\par{There are two reasonable ways to handle verbatim material in a
\textsc{GELLMU} system:
\begin{enumerate}
\item   Prepare the material, as for \textsc{HTML}, for direct inclusion
       in the \textsc{SGML} image of a \textsc{GELLMU} document. \ 
\item   Filter the material to use symbolic character names for any
       character that is not strictly alpha-numeric before inserting
       the material inside a \textsc{GELLMU} verbatim command. \ 
\end{enumerate}

}


\medskip
\hspace*{\fill}\rule[1bp]{0.8\textwidth}{0.3bp}\hspace*{\fill}
\medskip
\begin{center}\normalsize\bf
About \textsc{GELLMU}\end{center}
\par{\textsc{GELLMU} is an acronym for ``Generalized Extensible
\LaTeX{}-like MarkUp''. \   As of October, 1998 all \textsc{GELLMU} materials
are didactic, and there has been no ``release'' of related code. \ 
The \textsc{GELLMU} materials, under frequent revision, are available for
examination. \ 
This document on the web is \\
\texttt{http://www.albany.edu/\%7Ehammond/gellmu/boot/dboot.html}\footnote{dboot.html},
and the durable \textsc{GELLMU} web entrance is \\
\texttt{http://math.albany.edu:8000/math/pers/hammond/igl.html}\footnote{http://math.albany.edu:8000/math/pers/hammond/igl.html}. \ 
}

\bigskip
\setlength{\parindent}{0bp}

Document network location:\\[2bp]
\setlength{\tabcolsep}{3bp}
\begin{tabular}{rl}
 DVI: &\verb|http://www.albany.edu/~hammond/gellmu/boot/dboot.dvi|\\
HTML: &\verb|http://www.albany.edu/~hammond/gellmu/boot/dboot.html|
\end{tabular}

\bigskip
\setlength{\parindent}{0bp}

\hsf\\[0bp]
 [Processed from GELLMU to \LaTeX{} on Sat 12 Aug 2000 at 18:10:44 EDT]
\end{document}

