4. Defining Abstract Modules


This section is normative.

An abstract module is a definition of an XHTML module using prose text and some informal markup conventions. While such a definition is not generally useful in the machine processing of document types, it is critical in helping people understand what is contained in a module. This section defines the way in which XHTML abstract modules are defined. An XHTML-conforming module is not required to provide an abstract module definition. However, anyone developing an XHTML module is encouraged to provide an abstraction to ease in the use of that module.

4.1. Syntactic Conventions


element name
content set
expr ?
Zero or one instances of expr are permitted.
expr +
One or more instances of expr are required.
expr *
Zero or more instances of expr are permitted.
a , b
Expression a is required, followed by expression b.
a | b
Either expression a or expression b is required.
a - b
Expression a is permitted, omitting elements in expression b.
extending pre-defined elements
defining required attributes
defining the type of attribute values
defining the legal values of attributes
When a module defines the legal values for an attribute, it does so by listing the explicit legal values (enclosed in quotation marks), separated by vertical bars (|), inside of parentheses following the attribute name. If the attribute has a default value, that value is followed by an asterisk (*). If the attribute has a fixed value, the attribute name is followed by an equals sign (=) and the fixed value enclosed in quotation marks.

4.2. Content Types

Abstract module definitions define minimal, atomic content models for each module. These minimal content models reference the elements in the module itself. They may also reference elements in other modules upon which the abstract module depends. Finally, the content model in many cases requires that text be permitted as content to one or more elements. In these cases, the symbol used for text is PCDATA; this is short for "parsed character data", denoting sequences of characters which are to be parsed for markup by an XML processor .(processed character data). A content type can also be defined as EMPTY, meaning the element has no content in its minimal content model.

4.3. Attribute Types


Attribute Type Definition
CDATA Character data
ID A document-unique identifier
IDREF A reference to a document-unique identifier
IDREFS A space-separated list of references to document-unique identifiers
NAME A name with the same character constraints as ID above
NMTOKEN A name composed of only name tokens as defined in XML 1.0 [XML]
NMTOKENS One or more white space separated NMTOKEN values

In addition to these pre-defined data types, XHTML Modularization defines the following data types and their semantics (as appropriate):

Data type Description
Character A single character from [ISO10646].
Charset A character encoding, as per [RFC2045].
Charsets A space-separated list of character encodings, as per [RFC2045].


Color names and sRGB values
Black Swatch Black = "#000000" Green Swatch Green = "#008000"
Silver Swatch Silver = "#C0C0C0" Lime Swatch Lime = "#00FF00"
Gray Swatch Gray = "#808080" Olive Swatch Olive = "#808000"
White Swatch White = "#FFFFFF" Yellow Swatch Yellow = "#FFFF00"
Maroon Swatch Maroon = "#800000" Navy Swatch Navy = "#000080"
Red Swatch Red = "#FF0000" Blue Swatch Blue = "#0000FF"
Purple Swatch Purple = "#800080" Teal Swatch Teal = "#008080"
Fuchsia Swatch Fuchsia = "#FF00FF" Aqua Swatch Aqua = "#00FFFF"


ContentType A media type, as per [RFC2045].
ContentTypes A comma-separated list of media types, as per [RFC2045].
Coords Comma separated list of coordinates to use in defining areas.
Datetime Date and time information.
FPI A character string representing an SGML Formal Public Identifier.
FrameTarget Frame name used as destination for results of certain actions.
LanguageCode A language code, as per [RFC3066] or its successor.
LanguageCodes A comma-separated list of language ranges with optional q parameters, as defined in section 14.4 of [RFC2616] as the field value of the Accept-Language request header. Individual language codes should conform to [RFC3066] or its successors.
Length The value may be either in pixels or a percentage of the available horizontal or vertical space. Thus, the value "50%" means half of the available space.

Authors may use the following recognized link types, listed here with their conventional interpretations. A LinkTypes value refers to a space-separated list of link types. White space characters are not permitted within link types.



Refers to an external style sheet. See the Style Module for details. This is used together with the link type "Alternate" for user-selectable alternate style sheets.
Refers to the next document in a linear sequence of documents. User agents may choose to pre-load the "next" document, to reduce the perceived load time.
Refers to a document providing an index for the current document.
Refers to a copyright statement for the current document.


Note that in a future version of this specification, the Working Group expects to evolve this type from a simple name to a Qualified Name (QName).


The MediaDesc attribute is a comma-separated list of media descriptors. The following is a list of recognized media descriptors:

Intended for non-paged computer screens.
Intended for projectors.
Intended for braille tactile feedback devices.
Intended for speech synthesizers.
Suitable for all devices.



    is mapped to:

    "print and resolution > 90dpi"
  2. Each entry is truncated just before the first character that isn't a US ASCII letter [a-zA-Z] (ISO 10646 hex 41-5a, 61-7a), digit [0-9] (hex 30-39), or hyphen-minus (hex 2d). In the example, this gives:
  3. A case-insensitive match is then made with the set of media types defined above. User agents may ignore entries that don't match. In the example we are left with screen and print.


MultiLength The value may be a Length or a relative length. A relative length has the form "i*", where "i" is an integer. When allotting space among elements competing for that space, user agents allot pixel and percentage lengths first, then divide up remaining available space among relative lengths. Each relative length receives a portion of the available space that is proportional to the integer preceding the "*". The value "*" is equivalent to "1*". Thus, if 60 pixels of space are available after the user agent allots pixel and percentage space, and the competing relative lengths are 1*, 2*, and 3*, the 1* will be allotted 10 pixels, the 2* will be allotted 20 pixels, and the 3* will be allotted 30 pixels.
MultiLengths A comma separated list of items of type MultiLength.
Number One or more digits
QName An [XMLNS]-qualified name. See QName for a formal definition.
QNames A space-separated list of QNames, as defined above.

Script data can be the content of the "script" element and the value of intrinsic event attributes. User agents must not evaluate script data as HTML markup but instead must pass it on as data to a script engine.



Shape The shape of a region.
Text Arbitrary textual data, likely meant to be human-readable.
URI A Uniform Resource Identifier Reference, as defined by the type anyURI in XMLSCHEMA.
URIs A space-separated list of URIs as defined above.

4.4. An Example Abstract Module Definition

This section is informative

This section defines a sample abstract module as an example of how to take advantage of the syntax rules defined above. Since this example is trying to use all of the various syntactic elements defined, it is pretty complicated. Typical module definitions would be much simpler than this. Finally, note that this module references the attribute collection Common. This is a collection defined in the XHTML Modularization specification that includes all of the basic attributes that most elements need.

4.4.1. XHTML Skiing Module


Elements Attributes Minimal Content Model
resort Common, href (CDATA) description, Aspen+
lodge Common description, (Aspen - lift)+
lift Common, href description?
chalet Common, href description?
room Common, href description?
lobby Common, href description?
fireplace Common, href description?
description Common PCDATA*

This module also defines the content set Aspen with the minimal content model lodge | lift | chalet | room | lobby | fireplace.