% LaTeX \documentclass[leqno]{article} \usepackage{url} \usepackage{graphicx} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{bm} \usepackage{gellmu} \usepackage[margin=100bp,nohead]{geometry} \setlength{\parskip}{6bp} \setlength{\parindent}{0bp} \thispagestyle{empty} \date{October 22, 1999 \\{} Last re-processing \today{} } \title{The Idea of a Markup Interface for XML} %nul \setlength{\topmargin}{-30bp} \setlength{\textheight}{696bp} %cs0 %cs0 %cw0 \newlength{\centerskip} \setlength{\centerskip}{\topsep} \newcommand{\hsf}{\hspace*{\fill}} \newcommand{\tdbc}[1]{\hsf\textbf{#1}\hsf} \newenvironment{menulist}{ \begin{list}{}{ \setlength{\topsep}{0bp} \setlength{\labelwidth}{0.03\linewidth} \setlength{\leftmargin}{0.06\linewidth} \setlength{\itemindent}{0bp} \setlength{\itemsep}{-6bp} \setlength{\parsep}{6bp}} }{\end{list}} \newenvironment{Menulist}{ \begin{list}{}{ \setlength{\topsep}{0bp} \setlength{\labelwidth}{0.03\linewidth} \setlength{\leftmargin}{0.06\linewidth} \setlength{\itemindent}{0bp} \setlength{\itemsep}{3bp} \setlength{\parsep}{6bp}} }{\end{list}} \newenvironment{toclist}{\normalsize \begin{list}{}{ }}{\end{list}} \newenvironment{Toclist}{\large \begin{list}{}{ }}{\end{list}} \newenvironment{citations}{ \begin{list}{}{ \setlength{\topsep}{0bp} \setlength{\labelwidth}{0bp} \setlength{\leftmargin}{0.04\linewidth} \setlength{\labelsep}{0bp} \setlength{\itemindent}{-0.2\leftmargin} \setlength{\itemsep}{3bp} \setlength{\parsep}{0bp}} }{\end{list}} \author{William F. Hammond} \begin{document} \begin{center}\LARGE\bfseries{} The Idea of a Markup Interface for XML \end{center} \begin{center}\Large\bfseries{} \textsl{William F. Hammond} \end{center} \begin{center} \large\bfseries{} October 22, 1999 \\{} Last re-processing \today{} \end{center} \medskip \section*{1\ \ \label{SU-1}The Value of a \LaTeX{}-Like Markup User Interface for XML} \par{A markup user interface (\textsc{MUI}) for an \textsc{XML} language (formally ``\textsc{XML} application'') is a markup language that admits a well-defined translation to the \textsc{XML} language. \ } \par{Recent discussions in \url{news:comp.text.tex} show that at least two of us are thinking about \textsc{MUI}s for \LaTeX{}-like \textsc{XML} languages. \ Jonathan Fine has been working on a \emph{roff}-like \textsc{MUI} that he calls ``Active TeX'', and I have been working on a \LaTeX{}-like \textsc{MUI} that I call \textsc{GELLMU}. \ } \par{As I use the acronym \textsc{MUI}, I do intend it to be reminiscent of the acronym \textsc{GUI} for ``graphical user interface''. \ Both \textsc{GUI}s and \textsc{MUI}s have the intention of making life easier, or perhaps at least more familiar, for some authors. \ An \textsc{MUI}, unlike typical \textsc{GUI}s, has the possibility of giving the author full and rigorous control over content. \ } \par{Furthermore, an \textsc{MUI} in the style of a pre-existing non-\textsc{XML} markup offers a convenient avenue for prototyping a new \textsc{XML} language to model the markup practice in the pre-existing markup. \ } \par{Beyond that, it offers a route for conversion of legacy archives in the pre-existing markup to \textsc{XML} languages with minimal human intervention. \ } \par{Please allow me to say a bit more about what I have in mind for \textsc{GELLMU}. \ } \section*{2\ \ \label{SU-2}The Basic GELLMU Processing Design} \par{The things that I have on hand, aside from \LaTeX{} are: \begin{enumerate} \item \textsc{GNU} Emacs, version 20. \ (I believe that version 19 is OK.) \item James Clark's \texttt{nsgmls}, a part of his \texttt{SP}. \ \end{enumerate} } \par{My processing set-up is the following: \begin{description} \item[{Syntactic translation from \LaTeX{}-like markup to SGML}] { My Elisp processor, which can be run interactively in \textsc{GNU} Emacs or in batch mode, performs syntactic translation to convert \LaTeX{}-like markup to an \textsc{SGML} language (formally, application). \ The syntactic translator is largely ignorant of command names. \ Whatever command names are used become the names of \textsc{SGML} elements. \ There is a standard way to convert multiple argument/option sequences. \ \par{This processing stage traps syntax errors. \ (It will fail to detect an even number of missing \texttt{`\$'} characters; but this error will show in the next stage.) } } \item[{Validating parse of the SGML language}] { At the validation stage the difference between \textsc{SGML} and \textsc{XML} is significant if one wants to have ``math mode'' be a global toggle since that may be modeled robustly only using \textsc{SGML} exclusions. \ \par{A validating parse is made using \texttt{nsgmls}. \ Of course, the language definition, i.e., \textsc{SGML} application definition, is crucial. \ It is contained in an \textsc{SGML} declaration and in an \textsc{SGML} document type definition (\textsc{DTD}). \ } \par{The language definition that I am using is the heart of my personal production system. \ But I regard it only as didactic in the larger scheme of things. \ Others will certainly want things that I do not want. \ } \par{As far as it goes, it models \LaTeX{} rather closely in some ways and rather loosely in other ways. \ Where it departs from close modeling, the reason is usually related to having a document structure that is not print-centric. \ } \par{The validating parse traps errors in language use. \ } } \item[{Down-translation to XML}] { This is done with the program called \texttt{sx} in the family of \texttt{SP} processors. \ \par{While it is possible to recover an equivalent \textsc{SGML} document from the down-translated \textsc{XML}, it is not possible under the \textsc{XML} umbrella to have as precise a language definition as under the wider \textsc{SGML} umbrella. \ That said, either form may be run through a processor that serves to enforce a tighter language definition. \ } } \item[{SGML processing}] { This can go anywhere that is sane for the language definition. \ One can use any programming language, but it helps to have a basic \textsc{SGML} library on hand. \ I am using David Megginson's \texttt{SGMLS.pm}, a Perl 5 library, and its interface \texttt{sgmlspl}. \ \par{In my personal production system I routinely format \textsc{GELLMU} ``articles'' for both \LaTeX{} and \textsc{HTML}. \ Invalid \textsc{HTML} and error messages from \LaTeX{} represent bugs in my processors, which I always repair as soon as possible. \ There may be box size complaints from \TeX{}; they represent authoring content errors. \ These two formatters work either on the \textsc{SGML} or the \textsc{XML} version of an article. \ } \par{At present my personal production language definition is not fully up-to-speed for journal articles nor for translation to XHTML-with-MathML, but it is serving me well for my classes. \ It gives me a sane way to have course handouts and web offerings in a bullet-proof way from a single source. \ At this time I simply cannot assume that more than about a third of my students have easy access to \textsc{PDF} readers. \ So I feel constrained to give them simple \textsc{HTML} with very limited pseudo-TeX for math. \ } \par{Other formattings for \textsc{GELLMU} article that should be possible include translations to (1) DocBook, (2) TEI, and (3) Texinfo, though suboptimally so long as math is not available. \ These are not small jobs, and I may never undertake any of them. \ (Any project that undertakes to format an \textsc{XML} language in Texinfo should give serious consideration first to modeling Texinfo as an \textsc{XML}. \ It would also be desirable to minimize Info/\TeX{} bifurcation in XTexinfo and to provide math for XTexinfo.) } \par{If a time arrives when I can assume that three-fourths of my students have out-of-the-box browsers for XHTML-with-MathML, then I should be able to format the original \textsc{GELLMU} source directly for that --- if by that time I am not able to squeeze it out of carefully-set LaTeX-4. \ (I exaggerate somewhat. \ In principle, I need to provide some math symbol declarations in the sources, and math symbol declaration handling is not yet present in my set-up.) } } \end{description} } \section*{3\ \ \label{SU-3}About this document} \par{This document was prepared as a \textsc{GELLMU} ``article''. \ A copy of the \textsc{HTML} version of this document is available on the web at \begin{center} \url{http://www.albany.edu/~hammond/gellmu/mui/} \end{center} along with a full list of anchored versions as follows: \begin{menulist} \item \textsc{GELLMU} source: \url{mui.glm}. \ \item \textsc{SGML}, ``article'' document type: \url{mui.sgml}. \ \item \textsc{XML}, ``article'' document type: \url{mui.xml}. \ \item formatting in \LaTeX{}: \url{mui.ltx}. \ \item \textsc{DVI} made from \LaTeX{}: \url{mui.dvi}. \ \item \textsc{PDF} made from \LaTeX{}: \url{mui.pdf}. \ \item formatting in \textsc{HTML}: \url{mui.html}. \ \end{menulist} } \end{document}