4. Defining Abstract Modules


This section is normative.


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

4.2. Content Types


4.3. Attribute Types


Attribute Type Definition
CDATA Character data
ID A document-unique identifier
IDREF A reference to a document-unique identifier
NAME A name with the same character constraints as ID above
NMTOKENS One or more white space separated NMTOKEN values
PCDATA Processed character data


Data type Description
Character A single character from [ISO10646].
Charset A character encoding, as per [RFC2045].

The attribute value type "Color" refers to color definitions as specified in [SRGB]. A color value may either be a hexadecimal number (prefixed by a hash mark) or one of the following sixteen color names. The color names are case-insensitive.

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"

Thus, the color values "#800080" and "Purple" both refer to the color purple.

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].




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.

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 media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities.
Intended for television-type devices (low resolution, color, limited scrollability).
Intended for projectors.
Intended for handheld devices (small screen, monochrome, bitmapped graphics, limited bandwidth).
Intended for paged, opaque material and for documents viewed on screen in print preview mode.
Intended for braille tactile feedback devices.
Intended for speech synthesizers.
Suitable for all devices.

Future versions of XHTML may introduce new values and may allow parameterized values. To facilitate the introduction of these extensions, conforming user agents must be able to parse the media attribute value as follows:

  1. The value is a comma-separated list of entries. For example,
    media="screen, 3d-glasses, print and resolution > 90dpi"

    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.

Note. Style sheets may include media-dependent variations within them (e.g., the CSS @media construct). In such cases it may be appropriate to use "media =all".

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
Pixels The value is an integer that represents the number of pixels of the canvas (screen, paper). Thus, the value "50" means fifty pixels. For normative information about the definition of a pixel, please consult [CSS2]

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.

The case-sensitivity of script data depends on the scripting language.

Please note that script data that is element content may not contain character references, but script data that is the value of an attribute may contain them.

Shape The shape of a region.
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

The XHTML Skiing Module defines markup used when describing aspects of a ski lodge. The elements and attributes defined in this module are:

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.