5 . 3 SGML
The most important formal standard in electronic publishing is the Standard Generalized Markup Language (SGML). For years, people invented different mechanisms for marking up text with such things as typesetter control commands, printer codes, structural hints, and probably anything else you can imagine. SGML is a standard way of embedding tags within the body of a document to create all sorts of markup.
SGML is also one of the more misunderstood standards. It allows the creation of a set of tags with which you can clearly and unambiguously define the structure of a document. It does not, however, address the issues of document layouthow it looks. Let's examine this notion of document structure, because it is fundamental to understanding SGML.
Take this bookplease! It consists of three major elements: the front matter, the main body, and the back matter. The front matter contains the title page, the preface, and the table of contents. The main body contains the chapters. The back matter contains the appendixes, and index. Chapters consist of sections, and many sections consist of subsections. Most books have this familiar structure. This structure and the many variations can be precisely described by SGML.
Structure and style are different aspects of a document. SGML addresses the structure only. This is one of its great strengths and, some say, its great weakness. SGML does a wonderful job of capturing the content of a document and enabling that content to be manipulated at a later time. However, the information a document carries due to its visual design and layout is essentially lost unless careful, additional steps are taken. Additional style standards and specifications exist and are being implemented to address this issue. (See Section 5 . 3 . 3 DSSSL for a discussion of the major style standard.) One particular document structure can be visually represented in many different styles.
Let's take a look at how the structure of a typical office letter might appear. The names associated with each item in the letter are tags.
SGML is many things to many people. In the preface to The SGML Handbook, Charles F. Goldfarb,(9) the "father" of SGML, states that:
It is a tagging language.
It handles logical structures.
It is a file linking and addressing scheme.
It is a data base language for text.
It is a foundation for multimedia and hypertext.
It is a syntax for text processing style sheets.
It allows coded text to be reused in ways not anticipated by the coder.
It is a document representation language for any architecture.
It is a notation for any kind of structure.
It is a metalanguage for defining document types.
It represents hierarchies.
It is an extensible document description language.
It is a standard for communicating among different hardware platforms and software applications.
SGML is and does all of these things, but the whole is much more than the sum of the parts. Moreover, it is only by understanding the whole that one can make the best use of SGML.
SGML is an important standard, and one worth understanding. Most important a moderate understanding of the basic concepts will lead you to appropriate uses of SGML.
5 . 3 . 1 Speaking of Metalanguages
Now it's time for a little jargon. Metalanguages: what are they and why should you care? First, as the name implies, a metalanguage is a language. Languages are used to describe all sorts of things. A metalanguage describes another language. SGML has the ability to describe languages that describe document structures. A complete SGML file contains not only the markedup text, but also the definition of that markup. This markup definition, or language, is called a document type definition or DTD. Another very powerful aspect of metalanguages in the computing world is the fact that programs can be automatically constructed using metalanguages.
An analogous, realworld example is the universal remotecontrol device that can be taught to control any VCR. You teach it the language of your particular VCR so that it can speak your VCR's language. The act of teaching the universal remote to speak one particular VCR's language is analogous to creating a program from a metalanguage. The result is a specialized language that performs the required functions. It's compact and exactly what you need. Most importantly, metalanguages (and universal remote controls) are flexible. Change your VCR, and you simply reteach the remote. Change the markup language, and regenerate your markup processor.
Back in computer land, let's say that I want to write a new computer language. Let's also say that this new language could be expressed using a metalanguage. It might then be possible to use a metalanguage tool to create interpreters or compilers for my new language. This type of language technology exists and is widely used. The metalanguage is called BNF (Backus-Nauer Form), and the tools to generate new interpreters are called parser generators or compiler-compilers. One common tool in this domain is called YACC (Yet Another Compiler Compiler).
At this point you may rightly ask, "So what? Who cares?" Well, in the SGML domain, some clever people have written a computer tool called the Amsterdam SGML Parser (ASP-SGML).(10) It is analogous to YACC, but it creates an SGML parser for a specific type of document, the one described by the SGML metalanguage. The motivation for all this work is flexibility. The easier it is to modify a parser, the easier it is for end users to tailor the language to their particular needs. In addition, this approach opens up the creation of inexpensive specialized SGML parsers for specific applications.
5 . 3 . 2 Document Type Definition (DTD)
There are two parts to an SGML representation of a document. The first is called a document type definition (DTD). The second is the content of the document itself, with all the markup tags defined in the DTD. A key and elegant feature of SGML is that it is extensible. A DTD can define new tags and tags based on other tags.
The DTD defines elements, and the document content provides specific instances of those elements. Put another way, the DTD is like a mold, and the text is like the metal poured into that mold. An element is a thing, a placeholder, a name. An instance of an element is the object itself. For example, a DTD may define "chap" as the element for a chapter. In this book, World Wide Web is a particular instance of a "chap."
DTDs themselves are becoming standardized. Standard DTDs are the key to meaningful document interchange. SGML without a DTD is like listening to someone speaking a foreign language. When you listen, you can recognize that a language is being spoken and that words, phrases, and sentences are in the speech, but you just can't understand anything. The DTD enables SGML parser to understand the stream of text being processed. Of course, this analogy shouldn't be taken to far. The parser doesn't "understand" anything, and the only "meaning" that can be extracted is a valid document structure.
![]()
This discussion should make one thing clear: putting all this markup in a document is a lot of work. Techniques and commercial products are available for converting documents into SGML markedup documents. SGML conversion is also THE area in which a clear understanding of what SGML is and is not is vital.
"SGML-Like"And We Could Get "Sort of Married" Too..., an article(11) by Bill Zoellick of Avalanche Development Company, now Interleaf, aptly points out the dangers of systems and consultants who ignore the fundamentals of SGML markup. He states that SGML markup without a DTD, as some systems attempt, is not really valid markup. The DTD "is the coin of the realm. If you do not have a DTD, you cannot play the SGML game." The DTD imposes a set of rules and a structure that a document must follow. It will also allow another SGML system to interpret (parse) your document according to valid SGML rules. Marking up a document without following the rules specified by a DTD is problematic and should not be called SGML. SGML parser/verifiers can analyze a document and its markup for conformance to a DTD. Of course, fixing the document may be no simple task; that's all the more reason to do it the right way from the start.
5 . 3 . 3 DSSSL
The Document Style Semantics and Specification Language (DSSSL, pronounced dissel) is the style sheet standard. The formal DSSSL standard is known as ISO/IEC 10179:1995. DSSSL is intended to work with SGML or other document formats "for which a property set can be defined according to the Property Set Definition Requirements of ISO/IEC 10744."(12) DSSSL consists primarily of two mini-languages: a transformation language and a style language.
DSSSL's main function is to associate formatting information with document elements. DSSSL includes a transformation language used to describe the association of formatting information to the logical elements of a hierarchically structured document, such as an SGMLtagged document. It has a general mechanism for mapping the tree structure represented by an SGML DTD into another tree structure representing the visual composition of a document.
Like any other computer language, DSSSL is a language with a specific syntax and a collection of keywords. It will allow a designer to associate visual style descriptions with SGML elements. For example, using DSSSL, you can instruct a formatting processor to print all elements with the tag <SECTION> using Futura oblique bold with a 14-point size. The logical element <SECTION> would be associated, via a DSSSL specification, with the formatting information of the font Futura oblique bold 14 point.
DSSSL's second principal part is the style language. It will allow you to associate visual styles with collections of elements that are not specifically identified as logical elements. For example, the first paragraphs of a chapter may require different typography from all the other paragraphs. You could format such a paragraph with a larger font size and with a large initial cap. The knowledge that such a paragraph is still a paragraph can be maintained, however. At a later time, when you insert a new first paragraph, DSSSL takes care of the formatting.
![]()
DSSSL Conceptual Model(13)
DSSSL's complexity and generality make implementations difficult. In recognition of this complexity, a new effort called DSSSL Online is beginning to reach fruition. DSSSL is being used as the basis of a Web style sheet. The complexity of DSSSL will also make complete implementations difficult and scarce. However, the future standards team of SGML and DSSSL should prove immensely powerful.
![]()
The DSSSL Transformation Process(14)
One method being used to create usable forms of DSSSL is to implement a subset known as DSSSL Online. DSSSL Online is being proposed as the basis of a common style sheet language for the Web.
5 . 3 . 4 HyTime
"If computers are the wave of the future, then hypertext is the surfboard." -Ted Nelson
HyTime, ISO/IEC standard 10744, is the international standard to represent linked and time-based information. It is the hypertext standard and is an extension of SGML.
Hypertext is a maturing technology that allows you to jump from one piece of text to another using an on-line reading system.(15) For a good overview of this field check out Hypertext & Hypermedia by Jakob Nielsen (Academic Press 1990). Formally, HyTime is called Hypermedia/Time-based Structuring Language (HyTime).
The HyTime standard is an application of SGML. It uses the capabilities of SGML to formalize the representation of a linking capability, music, and time.
If this sounds like an odd combination, you're right. The initial HyTime work was motivated by an interest in representing music; therefore, time was very important. Musical events led to a connection with hypermedia, and now both a music description and hypermedia standards are being developed by closely related groups. Eventually, the work was split into HyTime and SMDL (Standard Music Description Language). HyTime is an application of SGML, and SMDL is an application of HyTimeyou got that clear now? (16)
Some of the objectives of HyTime are to support music publishing, business presentations, and computer-assisted instruction with music and sound effects. HyTime has three key concepts Events, Links, and Time. An event is some action, possibly external to the application; that is, a user. A link is a connection between one or more "anchors" in the information. Time is represented as durations of various sorts within a very flexible framework.
One key conceptual contribution of HyTime is its model of time. Time can be represented in two ways, musical and real. Musical time is abstract and analogous to the logical structure of a document. Real time is concrete and analogous to the physical formatted document. These two time representations can be synchronized using HyTime.
HyTime's model of time is intended for nonmusical as well as musical applications. It uses the concept of a unit of music time called a virtual time unit (VTU). A VTU is not inherently equivalent to any real number of seconds or any other concrete measure of time. For example, if an application were videobased, the VTU might be defined as the time for one video frame. For a musical application, the unit might be an eighth note.
Keep in mind that these concepts are nothing revolutionary. However, HyTime formalizes the representation of these concepts using SGML. It should be possible to represent and interchange the information represented in HyTime with systems that interpret HyTime information. Hypermedia is desperate for such an interchange standard. The Web has somewhat hijacked this more rigorous hypertext model, and it remains for the future to see if HyTime will have a significant impact on the Web.
HyTime is a standard for the representaion of hypermedia. Hypermedia includes documents with audio, video, and other types of data, as well as the ability to link from one element to another. HyTime provides a robust formal mechanism to describe these links and is effectivly a superset of the type of documents we see on the Web. The relationship of one link to another can have more meaning than the simply "go to" of a Web document. A link can be the "parent" or "owner" of another link, and these relationships can be exploited by intelligent applications.
In reality, SGML is a necessary foundation to HyTime, but HyTime goes far beyond the capabilities of SGML and introduces new concepts.
HyTime introduces the concept of an architectural form. The HyTime standard itself consists of a collection of six sets of architectural forms. An architectural form is a formal mechanism, using SGML syntax, of defining extensible templates. In SGML, the Document Type Definition is the way to define, formally, the structure of the document. In HyTime, the architectural form is also a formal definition not merely of a document structure but of an extensable template, sort of a meta-DTD. It is a way of introducing object oriented concepts into the semantics of SGML. An architectural form is similar to the definition of a class (in Smalltalk terms), from which subclasses can be created.
These are structures that can be extended into additional structures.
"Readme.1st SGML for Writers and Editors"(17) contains the following consise description of the six HyTime collections of architectural forms:
- 1. Base: Element and attribute architectural forms common to the other five modules and also usable independently (e.g., attributes for controlling the location and type of referenced elements).
- 2. Measurement: Expression of size and position of objects using application-chosen measurement units (e.g., seconds, inches, words, virtual units).
- 3. Location address: Assignment of Ids to non-SGML objects and to elements in other SGML documents (useful for hyperlink anchors).
- 4. Hyperlinks: Relationships among information objects, in the same or multiple documents.
- 5. Scheduling: Description of "finite coordinate spaces" and scheduling events to occur within those spaces.
- 6. Rendition: Presentation of objects in finite coordinate spaces.
For an application system to take advantage of HyTime encoded document, it must use a HyTime engine. Even though HyTime is an application of SGML that uses constructs from SGML, it really requires a different kind of processor. An SGML parser can successfully parse a HyTime document, but the results will essentially be meaningless for any of the HyTime constructs. The HyTime engine will take the results of the SGML parse and interpret the HyTime constructs meaningfully. Visit the HyTime Web page at UMass-Lowell maintained by Lloyd Rutledge at: http://dmsl.cs.uml.edu/standards/hytime.html for a list of companies, products and other information about HyTime.
![]()
DynaText hypermedia (HyTime) browser from Electronic Book Technologies
The value of using HyTime is the same as for using SGML. Standard accepted representations of document content will ultimatly last longer and depend less on quirky, fashionable specifications subject to the whims of the leading vendor of the day.
Skip to chapter[1][2][3][4][5][6][7][8][9]
| © Prentice-Hall, Inc. A Simon & Schuster Company Upper Saddle River, New Jersey 07458 |