Although SGML and XML are usually regarded as families of text-based markup languages, they may also be viewed as frameworks for the efficient processing of data that is textual in nature.
The following slides demonstrate processing under SGML in the context of a simple document.
An SGML Document. This is the starting point. This document uses SGML markup under the following ``SGML document type definition''. The markup here is equivalent to somewhat more verbose markup underXML.
SGML DTD. Overall an ``article'' has two parts: a preamble and a body.
The preamble contains at most one surtitle, exactly one title, at most one author, and at most one date, in that order. Each of these elements contains only ordinary text.
The body contains any number of par elements, presumably paragraphs. Each par may contain ordinary text, end-of-sentence markers (the empty SGML element eos), bold elements, and emph elements. The contents of bold and emph are restricted to ordinary text and eos elements.
The use of the characters `-' and `O' in the element declarations signifies whether or not explicit opentags and closetags are required. Thus, preamble requires neither, body requires both, and par requires an opentag but the use of the </par> (close)tag is optional. Note that XML requires the use of both inasmuch as the use of a DTD is formally optional with XML. It one of the functions of an SGML parser to supply all opentag and closetag markers in parsed output regardless of whether they are originally present.
Converter to plain text. This is a collection of functions in the language Perl for processing an ``article'', as defined in the DTD, into a plain text document. Roughly there is one function for each element start and one function for each element end.
The function collection is fed to David Megginson's Perl program "sgmlspl" which is a friendly interface to his Perl library "SGMLS.pm".
Plain Text Version. This is the text document that is produced when the original SGML is run through "sgmlspl" with the preceding collection of functions.
Converter to HTML. This is a collection of functions in the language Perl for processing an ``article'', as defined in the DTD, into an HTML document.
Raw HTML Version. This is the HTML code generated by running the original SGML through "sgmlspl" with the preceding collection of functions.
Rendered HTML. The last HTML document as viewed by whatever browser.
Converter to LaTeX. This is a collection of functions in the language Perl for processing an ``article'', as defined in the DTD, into markup for typesetting with the language LaTeX.
Raw LaTeX Version. This is the LaTeX markup generated by running the original SGML through "sgmlspl" with the preceding collection of functions.
Typeset LaTeX. A graphic image of the previous LaTeX document.
Converter to XML. This is a collection of functions in the language Perl for processing an ``article'', as defined in the DTD, into XML markup. In this case specific handling of individual elements is not necessary. Nonetheless, this particular bit of code is adequate only for this DTD.
XML Version. This is the XML markup generated by running the original SGML through "sgmlspl" with the preceding collection of functions.
GELLMU markup. GELLMU is being designed as a more succinct, LaTeX-like language for the careful creation (by hand) of SGML documents.
SGML made from GELLMU. This is SGML markup produced from the foregoing GELLMU markup. It is roughly the same as the original SGML markup. It is marked for a much more complex SGML DTD.
Some additional information about SGML and XML, including pointers to web resources, is locally available.