A Brief History of DSSSL
Standard Generalized Markup Language (SGML) is a platform-independent
(neutral), application-independent, ISO-standardized metalanguage for
structuring data. More important, SGML is the mother of HTML and XML. HTML and
XML are derivations or special applications of SGML. However, before the advent
of HTML and XML, SGML was the most prominent metalanguage describing the
structure of data.
SGML was published as an international standard
(ISO 8879) in 1986. SGML allows for the creation of structured documents that
describe data. The markup of data in SGML is highly descriptive and defined
using a Document Type Definition (DTD). It is com-pletely data independent,
which means that data coded in SGML is not dependent on any specific display
mechanism, platform, or software. Does this sound familiar? These are some of
the same features that XML has. Of course, because XML is a child (descendent)
of SGML, this should make perfect sense.
Although SGML does a good job describing and
structuring data, it does nothing for the formatting of data. In 1996, ISO
approved the final draft of the Document Style Semantics and Specification
Language (DSSSL) for SGML documents. DSSSL’s spe-cific purpose is to provide
processing instructions for SGML documents. The two main types of instructions
that DSSSL provides have to do with transformations (transforming a SGML document
from one structure to another) and formatting or styles (applying style sheets
to SGML documents). We are going to be covering the DSSSL style language here.
As is true for any style language, DSSSL defines
syntax for how different elements in a SGML document will be mapped to
formatting objects for display. For example, a SGML document might contain an
element, X. A DSSSL
style sheet could be applied to the SGML document that maps the contents of the
element X to a
specific font size, font weight, color, and so on. Listing 11.1 gives a very
simple example of an SGML document.
LISTING 11.1 Very Simple SGML Document
<!DOCTYPE
Note [
<!ELEMENT Note - - (From, To, Subject, Body)
> <!ELEMENT From - - (#PCDATA) >
<!ELEMENT To - - (#PCDATA)> <!ELEMENT Subject - - (#PCDATA)>
<!ELEMENT Body - - (#PCDATA)> ]>
<Note>
<From>Bob</From>
<To>Jenny</To>
<Subject>Hello
Friend!</Subject>
<Body>Just thought I would drop you a line.</Body>
</Note>
You can see that, indeed, Listing 11.1 is an example of what a simple
message structure might look like in SGML. There is a document element, Note, which has four children: From, To, Subject, and Body. There is a Document Type Declaration containing an inter-nal DTD. It
is interesting to note that in SGML, a DTD is always required. In the DTD
element declarations, there are two dashes (-) after each element name. The dashes sig-nify whether opening and
closing tags are required. A dash indicates a required tag, whereas the letter o stands for optional (because XML always requires a
closing tag, this feature of the element definition was dropped from the XML
DTD).
Although Listing 11.1 is complete and does accurately depict a “note”
according to the DTD, there is nothing that explains how the note should be
displayed. In SGML, DSSSL is the standard for defining the formatting. If a
DSSSL style sheet were created for this SGML document, it would appear
something like what’s shown in Listing 11.2.
LISTING 11.2 DSSSL Style Sheet
<!DOCTYPE style-sheet public “-//James Clark//DTD DSSSL Style
Sheet//EN” > (element Note (make simple-page-sequence))
(element To (make paragraph
font-family: arial font-size: 15pt font-weight: bold )) (element From
(make paragraph font-family: arial font-size: 15pt font-weight: bold ))
(element Subject (make paragraph font-family: arial font-size: 13pt
font-weight: bold )) (element body
(make paragraph font-family: arial font-size: 12pt ))
The first thing you’ll notice in Listing 11.2 is that there is a
Document Type Declaration. In DSSSL, style sheets are very complicated;
therefore, it is normal practice to reference a larger, public style sheet from
a style sheet you are creating. The public style sheet defines the layout
schemes. In this case, the publicly defined style sheet for rendering HTML is
being referenced. You can see that the remainder of the style sheet defines the
font, size, and weight of each of the elements in the SGML document. The
settings in the DSSSL style sheet override the settings in the referenced style
sheet if both define styles for the same elements.
The markup used in SGML and DSSSL should look fairly familiar to you. It
is not that different from the markup we see today in XML, XML DTDs, and CSS.
In fact, SGML and DSSSL work well and are still used today. A Web-enabled
version of DSSSL, called DSSSL-Online, has been produced. However, SGML and
DSSSL are very complicated technologies. Newer innovations in data
metalanguages have introduced an easier-to-follow syntax, tighter definitions,
and superior implementations.
Next, we are going to review a more recent formatting option, Cascading
Style Sheets.
Related Topics
Privacy Policy, Terms and Conditions, DMCA Policy and Compliant
Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.