Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Perl CGl Programming: No experience required.
(Publisher: Sybex, Inc.)
Author(s): Erik Strom
ISBN: 0782121578
Publication Date: 11/01/97

Bookmark It

Search this book:
 
Previous Table of Contents Next


Describing a Document

SGML is by its name a generalized markup language, which means that it is used to define other markup languages. HTML, of course, is one of them. But you could use the SGML specification to define any descriptive language you like. The point is that no matter what language you come up with, the framework of SGML will ensure that it works in a device-independent way. Other people won’t have any trouble reading your SGML-derived document with their SGML software.

Markup languages are usually divided into two types:

  Procedural languages, which provide very rigid formatting instructions
  Descriptive languages, which approach the formatting in a more general way

There are so many procedural markup languages in use that it would be ridiculous to attempt to list them here. Every typesetting system has its own proprietary set of instructions. What distinguishes all of these procedural languages, however, is their specificity. In other words, the language requires you to order precisely what you want.

For example, the change command is a feature of many typesetting systems. A typical cc order might look like this:

   $cc,12p3,helv,10,9.5

which sets the type column width to 12 picas, 3 points, the font to Helvetica, using 10-point characters on a 9.5-point set width. This is pretty specific.


NOTE:  Good examples of procedural markup languages are the commands used in the nroff and troff packages available on most UNIX systems. TeX, the typesetting language that lured Donald Knuth away from his epic The Art of Computer Programming series, is another.

The descriptive markup languages describe the formatting rather than ordering it. In using a descriptive language, you place commands in the document that give a general framework for how it should look. But the descriptive languages, SGML especially, actually discourage the use of a particular font, type size, or column measure.

We can look to HTML for a good example. You can specify typefaces and sizes in an HTML document, but only in a very general way. The reason for this apparent restriction is simple when you think about the whole world of Web browsers out there: Who knows whether browser A or B will have the faintest idea what 10-point Helvetica characters are?


NOTE:  One of Netscape’s extensions to HTML is the <FONT> tag, which you’d think would allow you to encode actual fonts in a Web page. However, it doesn’t. The <FONT> instruction gives you some control over the size of characters, but that’s about it.

SGML was an obvious choice for creating a language for the World Wide Web, especially in the Web’s early days when most browsers were text-based. Something very general was needed to get the Web to work on a wide variety of computers. HTML was the result.

Defining Document Types

SGML is a metalanguage that can be used to define other descriptive markup languages to format documents and control how they are displayed or printed. The formal definition of an SGML-derived language is done in a document—a program, actually—called a document type definition or DTD.

You will encounter this acronym a lot if you spend any time studying HTML. There are now three formal HTML DTDs in more-or-less widespread use on the World Wide Web:

  The IETF (Internet Engineering Task Force) Level 2 DTD
  The Level 3 DTD project of the World Wide Web Consortium
  Netscape’s Mozilla

The IETF Level 2 DTD is considered “standard HTML”; it is doubtful that there is a browser in existence that doesn’t support it. Level 2 is descended directly from the Level 1 DTD developed in 1990 by Tim Berners-Lee at CERN, the birthplace of the World Wide Web. This DTD is the formal specification for HTML 2.0.

The Level 3 DTD is intended to be the next HTML version: 3.2. It provides many useful extensions to the 2.0 standard, such as improved table formatting, inline figures within text, and mathematical notation commands. However, this DTD is the work of a committee, albeit an august one, consisting as it does of the members of the IETF HTML group and the World Wide Web Consortium (W3C). As a result, the specification is subject to change from time to time. Browser developers have to keep abreast of the changes if they wish to support Level 3.


TIP:  The IETF HTML working group maintains a Web site at www.ics.uci.edu/pub/ ietf/html/index.html. Visitors can find out about the latest proposals and specifications for HTML 3.2. The group encourages comments from the public, too. You can join their list server by sending an empty e-mail message with “subscribe” in the subject line to www-talk-request@mail.w3.org.

Netscape’s Mozilla DTD provides extensions to both the Level 2 and 3 HTML DTDs. The extensions were intended to enhance Netscape’s Navigator browser, of course, but some of them, frames especially, proved to be so useful that other browser manufacturers began supporting them, too, making Mozilla a kind of de facto Internet standard. Microsoft decided early on to include the Mozilla features in its Internet Explorer browser. Thus, the two browsers that probably are in the most widespread use on the Web—Navigator and IE—both adhere to the Mozilla DTD.


TIP:  Specific and detailed information on the Mozilla extensions to HTML is available on Netscape’s Web site at home.netscape.com/assist/net_sites/ html_extensions.html.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.