XML technologies / DITA / Using familiar technologies / SGML — Using a sledgehammer to crack a nut

(Excerpt from “DITA – Der neue Standard für Technische Dokumentation” by Johannes Hentrich)

IBM conceived SGML in the mid-1960s as a metalanguage for developing markup languages for electronic documents. A familiar example of a language developed from SGML is the Internet’s ubiquitous HTML (Hypertext Markup Language).

SGML was developed to create electronic documents independently of a particular platform, computer application or file format. This was intended to ensure that documents could be exchanged between different computer systems at any time.

This requires separating document content from layout. SGML concerns itself solely with marking up and structuring content. Content is marked using elements, whose properties can be described further through attributes. Elements and attributes are defined in a DTD (Document Type Definition).

A DTD also contains rules for representing documents of a particular type. A document type is a class of similar documents: installation instructions, for example, form a different class from tutorials.

A metalanguage such as SGML lets you define your own elements and attributes, allowing content to be marked according to its meaning. For example, a newly defined element named <author> could identify a document’s author:

<author>Charles Darwin</author>

This is called semantic markup.

Content can also be marked according to the desired formatting in the output medium. This is called typographic markup. Elements are defined, for example, to display content in italics or bold. Both HTML and DITA use elements such as <b> for bold and <i> for italics. The following example marks content as bold:

<b>Der Inhalt wird in HTML fett ausgegeben.</b>

Typographic markup always aims at a particular output result. Semantic markup initially disregards how the marked content will later appear in an output medium.

Semantic markup offers many advantages for the following reasons:

SGML’s goals and principles are simple in essence: content is separated from layout and marked through freely definable elements and attributes independently of format. Layout is assigned to element content in a later processing stage.

Simple as these principles are, putting them into practice proves difficult.

SGML is a universal tool for defining document types and their elements of almost any complexity. Yet the downside of this freedom was and still is often underestimated: defining the underlying DTDs is very laborious.

In practice, a tool for defining document types is initially of little help, since technical documentation needs a ready-made document structure, that is, a finished document type. Reaching that structure and its DTD can take a very long time.

At the start of DTD development, questions include:

The list can grow considerably if special cases must be considered or one DTD must cover several document types. Eva Maler and Jeanne El Andaloussi’s book Developing SGML DTDs provides good guidance for DTD development, while also showing how complex the process can be.

Creating a DTD hardly pays off when only a few manuals are needed. Analysis and definition can take at least as long as creating the documentation itself. Under these conditions, technical documentation simply becomes too expensive.

Consequently, SGML was and remains used mainly by companies and institutions compelled to provide a standard DTD, both to receive documents in the prescribed form and to exchange documents based on that DTD. SGML DTDs for technical documentation are therefore found especially in major industries such as telecommunications, automotive and aviation. SGML has proved less practical for small-scale solutions.

SGML “light”

To retain SGML’s advantages—structured documents independent of platform and application—authors often settle for a half-hearted SGML solution: SGML is used, but the underlying DTD is very simple.

Such DTDs largely dispense with extensive analysis of existing document types and include only elements usable generally in a document or across document types.

The following example shows the structural view of an SGML document using a simple DTD. Structural elements are essentially limited to paragraphs (paragraph element), marginal notes (marg element), tables (table element) and various list types (list-b element, list-s element). The only more “exotic” element marks a note (note element).

A simple SGML structure

Figure: A simple SGML structure.

A typical feature of a simple DTD is the near-total absence of semantic markup. A paragraph element contains at most typographic markup for bold and italics, plus elements for index entries and cross-references.

Neither the structure nor its elements reveal the document type. Users cannot tell whether information instructs them to act or explains a concept. The missing semantic markup also provides no clue to what is being described.

The sequence of titles, paragraphs, tables and lists resembles HTML, itself an SGML application. This is no coincidence: a primary goal of HTML was a DTD with as few elements as possible capable of marking as much content as possible.

Since elements like HTML’s can capture almost any content, this kind of markup is called “generic markup”. Elements are neutral information containers with little connection to their contents. They are often used not only to capture content but also to format it. HTML’s <table> element is probably the best-known example: it formats tables but also often structures an HTML page’s layout.

Generic markup avoids developing a complex DTD to provide, for example, a suitable structure and semantic markup for a software administration manual. But its disadvantages are undeniable. HTML’s much-criticized limits on content reuse and lack of contextual search also clearly affect documents based on generic DTDs.

Another drawback appears when converting such documents to XML structures like DITA. DITA is much more structured and marks both the information type—task, concept, reference or glossary entry—and the content’s meaning. Converting generic markup to DITA differs little from converting unstructured documents such as Word files. “Migrating to DITA” discusses converting existing unstructured or weakly structured documents to DITA in detail.

A major obstacle to SGML adoption was thus the lack of generally available DTDs suitable as a basis for small and medium-sized companies’ documentation. Simple DTDs allowing generic markup were often chosen out of necessity. Their limits frequently emerged only when circumstances forced conversion to more structured documents.

Only the DocBook DTD, whose development began in 1991, provided the first freely available public DTD also suitable for technical documentation. “Against topics: DocBook” introduces the standard in more detail and compares it with DITA. DocBook is based on the concept and structure of a printed book. Some requirements, such as publishing linear manuals and topic-based online help from one source, are therefore difficult to achieve with DocBook.

Further processing of SGML

Another obstacle to SGML adoption was converting electronic SGML files into a format suitable for printing. DSSSL (Document Style Semantics and Specification Language) provides a formatting language, but like SGML, its complexity makes the required output stylesheets difficult and expensive to create.

One solution was to develop editors that could handle SGML files “somehow”. Besides a possible WYSIWYG display, they were to use familiar production mechanisms, such as PDF creation. Adobe FrameMaker became well known in technical documentation by offering WYSIWYG functionality and PDF production through Acrobat Destiller.

FrameMaker and similar solutions have a drawback: they do not work with native SGML, the actual SGML file. FrameMaker requires an EDD (Element Definition Document) representing the SGML application’s structure and formatting in FrameMaker. Editing therefore changes FrameMaker documents representing SGML rather than the SGML documents themselves.

Creating and editing SGML documentation therefore requires both a DTD for the SGML documents and an EDD for FrameMaker. Complex DTDs require complex EDDs. WYSIWYG and a familiar production mechanism thus come at a price.

The difficulty of processing or even using SGML kept it from a major breakthrough. The immense effort required particularly excluded small and medium-sized documentation departments.

SGML thus remained and remains largely reserved for an exclusive circle willing to pay its costs. A reduced form using generic markup at least let cost-conscious users use a markup language, but without exploiting its inherent possibilities. They discover how little generic markup can do when it must produce well-structured documents such as DITA.

SGML offers every means to master document structures of any complexity, but only at the cost of complexity that is itself barely manageable.

  

 

 

 

back to top