SGML
From TechWriter Wiki
SGML was officially `born' in October 1986 with the publication by ISO (the International Standards Organization) of the SGML specification as Standard ISO8879
Structured Generalized Markup Language provides a way of defining a document's structure such that the document can be 'interpreted' and displayed or printed on a variety of (hardware and software) systems.
SGML defines the logical (or generalized) structure of a document, as opposed to the physical format or layout of the document. This means that different applications can interpret these definitions in ways specific to that application. For example, using a standard WYSIWYG word processor, you format text that should appear as a level one heading in bold, 18-point Helvetica, and with 24 points of space below it. Using SGML, you simply tag the text as being a level one heading. The font, point size and spacing can then be applied by whatever application the document is being displayed or printed from, depending on the capabilities of that application. So if the application does not include the font Helvetica, it can choose one of the fonts that is available to it. Or if the document is being rendered on a smaller page size (or screen size) the application can choose to reduce the point size and the spacing.
It is important to note, however, that SGML is not strictly a markup language. Instead, it is a set of rues for defining actual mark-up languages (known as SGML applications). SGML defines a basic syntax, but the actual elements of the document (for example, headings, body paragraphs, types of emphasis, and so on) and the document format (the way in which these elements can be combined) are defined in the SGML application.
The most well-known example of an SGML application is HTML (described below), although the fact that HTML is an SGML application is less well-known. IBM's Script and Bookmark, and DocBook are other examples.
Example of SGML markup: The following example shows a small extract from a document created in the HTML application BookMaster
... :p.This is a paragraph. :p.This is the next paragraph. :b.This is in bold.:eb. :p.For an example of a table, see :HDREF REFID=atable.. :TDEF ID='atable' COLS='2* * * *' ARRANGE='1 2 2/1 3 4' VALIGN='CENTER' ALIGN='CENTER CENTER LEFT RIGHT' :TABLE REFID='ATABLE'. :ROW. :C 1.First cell takes up column 1 on rows 1 and 2. :C 2.Second cell takes up columns 2 and 3 on row 1. :C 3.Third cell takes up column 2 on row 2. :C 4.Fourth cell takes up column 3 on row 3. :ETABLE. ...
Within the SGML application, a DTD (Document Type Definition) is used to define the various elements that can appear in a document - such as headings, paragraphs, tables, and so on. The DTD also defines what elements can appear where - for example, table cells can only appear within table rows which can only appear within tables, and so on. Typically, each type of document will have its own DTD, although in some cases, more general DTDs can be created to cover several document types.
Example of a DTS: The following example shows an extract from a DTS for use with Information Mapping.
<!-- Declarations for MAP --> <!ELEMENT MAP_TITLE (#PCDATA)> <!ELEMENT RULE EMPTY> <!ELEMENT BLOCK (BLOCKLABEL, BLOCKTEXT)> <!ATTLIST BLOCK TYPE (USE | UNSPECIFIED) "UNSPECIFIED"> <!-- Delcarations for BLOCK --> <!ELEMENT BLOCKLABEL (#PCDATA)> <!ELEMENT BLOCKTEXT (PARA | NOTICE | PROCEDURE | SCREEN | MESSAGE)*> <!-- Declarations for PROCEDURE --> <!ELEMENT PROCEDURE (STEP)*> <!ELEMENT STEP (#PCDATA | PROCEDURE | PARA | NOTICE | MESSAGE)*>
SGML has the advantage that the actual style of the document (what point size to use for headers, what form of emphasis is to be used) is taken out of the hands of the authors. These formatting considerations can be centralized (typically either On a Standards Group or on the Publications Manager), leading to greater standardization.
SGML is also useful when the document is being translated as the translator does not have to worry about matching the formatting of the original document. This holds especially true of machine translation (and many translation companies will machine-translate before `tweaking' by hand, anyway.
