Previous | Table of Contents | Next |
The structure of a documentits typeis defined by a document type definition, or DTD. The DTD is a blueprint of the document; it can be simple or complex. It specifies what elements are allowed, whether they are required or optional, and the order in which they can occur.
The DTD lays out the rules for a document through the use of elements, attributes, and entities (see Chapter 3, SGML Terminology). To get an idea of how SGML handles structure, consider figure 2.6, which shows a simple DTD.
Fig. 2.6 This document type definition defines the document structure of the product advisory bulletin.
The DTD defines the product advisory document. Even though its structure is simple, it still has rules. Within the DTD, elements are the building blocks of the document structure. The DTD defines the rules for what an element can containspecific characters, values, or collections of other elements.
In the DTD, the element advisory contains child elements, or subelements, that make up the bulletin. Table 2.1 describes the subelements that represent the major components of the document.
Element Name | Description |
---|---|
advnbr | Advisory number |
type | Advisory type |
dateiss | Date issued |
daterev | Date revised |
subject | Advisory subject |
subsec | Subsection |
See What Are the Components of SGML Documents? p. 47 See Entities, p. 58
Note:
The element subsec contains additional elements, some of which are referenced via entities.
The DTD also defines the tag set that corresponds to the structural notation of the document. Combined with the text of the document, these tags fit the text into the structure thats defined in the DTD. If this sounds confusing, take a look at a tagged document. Figure 2.7 shows the SGML tagged textor markupof the product advisory bulletin.
Fig. 2.7 This is a view of the product advisory bulletin as an SGML document instance.
You now have completed an initial tour of the SGML view of documents. You have examined the key concepts of structure, content, and format. You saw how SGML uses these components to create modular and transportable documents.
For more information, see the following:
Previous | Table of Contents | Next |