Previous Table of Contents Next


Following this processing instruction group are two additional delimiters: [ End Layout ] and [ After-Revert Section ].

The [ End Layout ] processing instruction group contains those instructions to be processed upon reaching the close tag of your element in the hierarchy (Title within Chapter). Note that they will be applied before output formatting returns to those instructions in effect prior to this element.


Tip:  
These formatting instructions can modify previous instructions. In this case, the instructions that they modify will include any that are in effect from the [ Start Tag Layout ] for this element.

The instructions that you have specified to process upon reaching the end of your close Title element (<\Title>) include:

  A new line
  A horizontal line

The [ After-Revert Section ] contains directives for specifying those formatting instructions to be processed after you have returned to the instructions in effect prior to encountering this element. In this case, you have specified the following instructions:

  Font size: Revert back to what it was previously (prior to element)
  Font appearance: Revert back to previous
  Two new lines

You might be wondering about the difference between the [ End Layout ] and [After-Revert Section] processing sections. If you are, a simple illustration may be in order. Notice that you have included instructions for two new lines in the [ After-Revert Section ]. These new lines, because they are included here, will have a height of the font that you are reverting to (in this case, it’s 12 point). If you had included these new lines in the [ End Layout ] section, they would have had a height of the font in effect in that section—19 point, in this example.

The output format for the Title element occurring within the chapter section element (<CSect>) is illustrated in figure 24.4. Note that because you specify a specific font, font size, and font appearance for this element context, you also want to revert all of these characteristics upon exiting from the element context.


Fig. 24.4  Output specification formatting: Title element as a child of Chapter Section (CSect).

In this example, you looked at portions of an output specification used in WordPerfect SGML Edition. Defining output specifications in other programs will differ in various ways. You will examine output specifications of various types later in this chapter.


Note:  
As an example of the differences in the formatting instruction approach between various programs, note the mechanism for indicating the end of a specific data element. In the example from WordPerfect above, the end tag is shown as <\Title>. If this formatting was performed using a DynaText stylesheet, the end tag would be indicated as </Title>.

Issues Involved with Output Specifications

Because output specifications specify the output formatting of a document, they have tended to be somewhat proprietary. That is, each SGML software package has its own way of defining output formatting. Stylesheets are a simple form of specifying output formats.

Nonetheless, certain aspects of output formatting are often common across the stylesheet syntaxes. Among these common aspects are the following:

  SGML syntax
  Group styles
  Entity usage
  Inheritance

SGML Syntax

In various degrees, most SGML software packages use some form of SGML syntax to define stylesheets. In the previous example, element formatting was indicated within SGML tags for the element concerned.

The stylesheet syntax for the DynaText SGML viewer, produced by Electronic Book Technologies, defines style properties as SGML elements. The property value is defined as the element’s contents. (A sample portion of a DynaText stylesheet is shown in figure 24.5.)


Fig. 24.5  Sample DynaText stylesheet formatting.

Group Styles

The use of groups within stylesheets is often supported. Group styles can simplify the stylesheet development process tremendously. Through group membership, an element can “inherit” the group formatting instructions.

Through the use of group styles, you can minimize the amount of formatting that you must define for a DTD, with only exceptions to the group format requiring specific definition.

Entity and Attribute Usage

Many SGML software packages support the use of entities and attributes within a stylesheet or output specification. Such support is desirable, for it can provide an added degree of formatting flexibility.

When supported, entity usage can provide the same type of flexibility that it does within DTDs and SGML document instances. That is to say, entities can be used to provide the definition of such things as standard fonts and font sizes, boilerplate text, and other reusable values or data. When defined at the beginning of a stylesheet through entities, standard stylesheet characteristics (such as font types) can easily be revised.

Support for attribute recognition within the stylesheet can add a degree of intelligence to the output format processing. Depending on the value of an element attribute, different format processing can be enabled.

As an example, let’s look at a portion of an SGML document instance for a product advisory (see fig. 24.6). Notice that the element <subject> has an attribute named safety and that, in this case, the attribute is set to “y”.


Fig. 24.6  Product advisory SGML document instance.

In this product advisory document model, you use a “y” safety attribute value on the subject element to indicate safety related advisories.


Previous Table of Contents Next