Back/Next /Contents

Feature Usage Declaration

The FEATURES specification of the SGML declaration defines the SGML features used by the markup of the document. There are three classes of features: MARKUP MINIMIZATION, LINK and OTHER.

For each feature named, the literal "YES" or "NO" must be specified. In some cases, the literal "YES" is followed by a number; the meaning of this number depends on the feature support being described.

The following sections detail these classes.

Markup Minimization Features

The markup minimization features ease the entry of SGML markup by allowing omission of some SGML tags or other markup. They also support the use of keyboarding conventions which may then be converted into SGML markup. One interesting property of the markup minimization features is that a DTD may always be written as if the use of a feature is permitted in the document instance, whether it is allowed by the SGML declaration or not. This means that a DTD may always be written to exploit the markup minimization features, whether specific documents choose to use the features or not.

The use of these minimization features can make entry of SGML much easier and can also make the SGML data much easier to read and understand. It can be misused; with some DTDs and markup features, omission of markup, while valid can change the document structure in unintended ways but if you are creating or modifying SGML data "by hand", these features are very helpful.

Some systems that generate SGML do not omit any markup. This will always be valid when using conforming SGML systems. Some systems will not accept SGML with minimization. While this is irritating (and hard to understand given the availability of SGML parsers which support minimization) this can be accomodated with one of several available SGML converters or using an SGML editor which can output unminimized SGML (sometimes called "normalized").

These features are:

This feature allows the DTD to specify character strings which cause an end tag to be implied in addition to their role as data in the document.

Datatag has the interesting characteristic that data is treated as data and as markup. One danger of this is that if a DTD defines data tag groups, DATATAG is enabled and the document is normalized (all end tags are included) errors can occur when the data tag patterns are recognized, implying end tags. If the document is normalized, DATATAG should not be enabled.

This feature allows the DTD to specify that certain start and/or end tags may be omitted. Enabling or disabling this feature does not change the way most parsers parse a document. Elements will be opened or closed based on the content models and other rules of SGML.
This feature allows a generic identifier to be broken into two parts: a stem and a suffix. The idea is that there can be multiple levels or "ranks" of the same element type. The author may specify the stem without the suffix in a start tag and the tag inherits the rank (which is used as the suffix) from the immediately preceding use of the stem. If RANK is not enabled, then both the stem and suffix must always be specified.
This feature allows the author to shorten tag and attribute specifications. This shortening may take the form of omitting the element generic identifier (empty tag), omitting the tag's closing delimiter (unclosed tag), using an alternate form of end tag called the "null end tag", omitting literal delimiters in attribute specifications and omitting the attribute name in attribute specifications where the value is selected from a name token list (omitted attribute name).

Link Features

These features are designed to allow processing attributes or other information in attribute form to be supplied or "linked" to elements in documents. There are three LINK features in SGML: SIMPLE, IMPLICIT and EXPLICIT. The following discussion is not sufficient to introduce them fully but should at least serve to make you aware that they exist. LINK features are not well supported in the industry; some products do support them but most do not.

This link feature supports simple link process definitions (these contain only attribute lists applicable to the document element). A number following SIMPLE indicates the maximum number of these definitions which may be active at the same time.
This link feature supports "implicit link" linktype declarations in which the processing application must imply the result of the link processing.
This link feature supports "explicit link" linktype declarations in which the result of processing is another SGML document of a given document type. Explicit link processes may be chained, if supported, and the number following "YES" specified here indicates the maximum number of links in this chain.

Other Features

These features didn't fit easily or group into any categories and so were called simply OTHER. They are:

This feature supports the use of multiple DTDs in the same document instance concurrently. One commonly used example of this feature involves the markup of a document element's logical content with one DTD's markup definitions and a document's presentation with another DTD's definition. This feature is not commonly supported. When "yes" is specified, it is followed by a number indicating the maximum number of concurrent document types (in addition to the base document type) that the document may use.
This feature supports the referencing of entities which are complete SGML documents in their own right from within an SGML document. When used, the SGML declaration also indicates the number of sub-document entities which may be open at the same time (nested).
This feature supports the use of formal public identifiers in the PUBLIC identifiers. These identifiers may be used in the declaration of entities. Using this feature forces the parser to insure that all public identifiers used in a document conform to the rules of formal public identifiers. Otherwise, these identifiers have much less rigorous rules to follow.

The following example shows a declaration with several of the more commonly supported features enabled:


DATATAG, OMITTAG, RANK, SHORTTAG, SUBDOC, and FORMAL are all enabled in this case. The maximum number of nested subdocument entity references is 10. All other features are disabled.

Back/Next /Contents

Wayne L. Wohler, Dept G82/025Z, Publishing Solutions Development, IBM Corporation, PO Box 1900, Boulder, Colorado 80301-9191
Phone: 1-303-924-5943