All About XHTML 1.1 Modules

The XHTML 1.1 DTD is a driver DTD that includes DTD modules. A DTD module is a section of a DTD that has two parts—an abstract part, which specifies what the DTD does in human-readable language, and the module itself, which is a DTD fragment that contains element types, a set of attribute list declarations, and a set of content model declarations.

You can find the XHTML 1.1 driver DTD at http://www.w3.org/TR/xhtml11/xhtml11_dtd.html#a_xhtml11_driver, and the actual implementation of the XHTML 1.1 modules (there's one for forms, one for text, one for images, and so on) at http://www.w3.org/TR/xhtmlmodularization/dtd_module_defs.html#a_xhtml11_modules. You'll find the XHTML 1.1 modules listed in Table 17.1.

Table 17.1. The XHTML 1.1 Modules
ModuleContents
xhtml-applet.moduleJava Applet Element Module
xhtml-base.moduleBase Element Module
xhtml-bdo.moduleBIDI Override Module
xhtml-csismap.moduleClient-side Image Map Module
xhtml-edit.moduleEdit Module (<del> and <ins>)
xhtml-events.moduleEvents Module
xhtml-form.moduleForms Module
xhtml-framework.moduleModular Framework Module
xhtml-hypertext.moduleHypertext Module
xhtml-image.moduleImage Module
xhtml-link.moduleLink Element Module
xhtml-list.moduleLists Module
xhtml-meta.moduleDocument Metainformation Module
xhtml-param.moduleParam Element Module
xhtml-postfw-redecl.modulePost-Framework Redeclaration Module
xhtml-prefw-redecl.modulePre-Framework Redeclaration Module
xhtml-pres.modulePresentation Module
xhtml-ruby.moduleRuby Module
xhtml-script.moduleScripting Module
xhtml-ssismap.moduleServer-side Image Map Module
xhtml-struct.moduleDocument Structure Module
xhtml-style.moduleStylesheets Module
xhtml-table.moduleTables Module
xhtml-text.moduleBasic Text Module

Each module has two parts, and I'll take a look at them here in overview.

XHTML 1.1 Abstract Modules

Each XHTML 1.1 module has an description called an abstract module that specifies what elements and attributes are in the module, and gives a minimal content model for each element. You can find these abstract versions of the XHTML 1.1 modules at http://www.w3.org/TR/xhtml-modularization/xhtml_modules.html#s_xhtmlmodules. An abstract module is really just a table listing the elements, attributes, and minimal content models in the module. For example, the Basic Text abstract module appears in Table 17.2.

Table 17.2. The Basic Text Abstract Module
ElementAttributesMinimal Content Model
abbrCommon(PCDATA | Inline)*
acronymCommon(PCDATA | Inline)*
addressCommon(PCDATA | Inline)*
blockquoteCommon, cite(PCDATA | Heading | Block)*
brCoreEMPTY
citeCommon(PCDATA | Inline)*
codeCommon(PCDATA | Inline)*
dfnCommon(PCDATA | Inline)*
divCommon(Heading |Block | List)*
emCommon(PCDATA | Inline)*
h1Common(PCDATA | Inline)*
h2Common(PCDATA | Inline)*
h3Common(PCDATA | Inline)*
h4Common(PCDATA | Inline)*
h5Common(PCDATA | Inline)*
h6Common(PCDATA | Inline)*
kbdCommon(PCDATA | Inline)*
pCommon(PCDATA | Inline)*
preCommon(PCDATA | Inline)*
qCommon, cite(PCDATA | Inline)*
sampCommon(PCDATA | Inline)*
spanCommon(PCDATA | Inline)*
strongCommon(PCDATA | Inline)*
varCommon(PCDATA | Inline)*

The Basic Text abstract module in Table 17.2 lists two attribute groups—Common and Core. Here's what they contain:

  • The Common attribute groups contains the class, id, title, dir, xml:lang, style, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, and onkeyup attributes.

  • The Core attribute group contains the class, id, and title attributes.

The content models in Table 17.2 also use the Heading, Block, and Inline content models; here's what elements they contain:

  • The Heading content model contains <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>.

  • The Block content model contains <address>, <blockquote>, <div>, <p>, and <pre>.

  • The Inline content model contains <abbr>, <acronym>, <br>, <cite>, <code>, <dfn>, <em>, <kbd>, <q>, <samp>, <span>, <strong>, and <var>.

An abstract module like the Basic Text module is only so that you can find out what's in a module—it isn't actually used by any software, nor does it appear in any actual module implementation. What actually makes these modules work is their implementations.

XHTML 1.1 Module Implementations

As far as an XML processor is concerned, a module is really just a DTD fragment that is included in a driver DTD. This DTD fragment can contain element declarations, attribute declarations, and content model declarations. You can find the XHTML 1.1 module implementations at http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html. For example, here's the XHTML 1.1 images module, xhtml11-image-1.mod:

<!--
…………………………………………………………….
-->
<!-- XHTML 1.1 Images Module
……………………………………… -->
<!-- file: xhtml11-image-1.mod

     This is XHTML XHTML 1.1, a modular variant of XHTML 1.0.
     Copyright 1998-2000 W3C (MIT, INRIA, Keio), All Rights Reserved.
     Rovision: $Id: dtd_module_defs.html,v 1.2 2000/01/05 20:58:33
shane Exp $ SMI

     This DTD module is identified by the PUBLIC and SYSTEM
identifiers:
     PUBLIC "-//W3C//ELEMENTS XHTML 1.1 Images 1.0//EN"
     SYSTEM "xhtml11-image-1.mod"

     Revisions:
     (none)
     ……………………………………………………………
-->

<!-- Images

        img

     This module provides markup to support basic image embedding.
-->

<!-- To avoid problems with text-only UAs as well as to make
     image content understandable and navigable to users of
     non-visual UAs, you need to provide a description with
     the 'alt' attribute, and avoid server-side image maps.

-->

<!ENTITY % Img.element  "INCLUDE" >
<![%Img.element;[
<!ENTITY % Img.content  "EMPTY" >
<!ELEMENT img  %Img.content; >
<!-- end of Img.element -->]]&gt;

<!ENTITY % Img.attlist  "INCLUDE" >
<![%Img.attlist;[
<!ATTLIST img
      %Common.attrib;
      src          %URI.datatype;           #REQUIRED
      alt          %Text.datatype;          #REQUIRED
      longdesc     %URI.datatype;           #IMPLIED
      height       %Length.datatype;        #IMPLIED
      width        %Length.datatype;        #IMPLIED
>
<!-- end of Img.attlist -->]]&gt;

<!-- end of xhtml11-image-1.mod -->

DOCUMENT NOTICE for xhtml11-image-1.mod

Copyright [cw] 1994-2000 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.

http://www.w3.org/Consortium/Legal/

Public documents on the W3C site are provided by the copyright holders under the following license. The software or Document Type Definitions (DTDs) associated with W3C specifications are governed by the Software Notice. By using and/or copying this document, or the W3C document from which this statement is linked, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions:

Permission to use, copy, and distribute the contents of this document, or the W3C document from which this statement is linked, in any medium for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the document, or portions thereof, that you use:

A link or URL to the original W3C document.

The pre-existing copyright notice of the original author, or if it doesn't exist, a notice of the form: "Copyright [cw] 2000 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/" (Hypertext is preferred, but a textual representation is permitted.)

If it exists, the STATUS of the W3C document.

When space permits, inclusion of the full text of this NOTICE should be provided. We request that authorship attribution be provided in any software, documents, or other items or products that you create pursuant to the implementation of the contents of this document, or any portion thereof.

No right to create modifications or derivatives of W3C documents is granted pursuant to this license. However, if additional requirements (documented in the Copyright FAQ) are satisfied, the right to create modifications or derivatives is sometimes granted by the W3C to individuals complying with those requirements.

THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.

COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to this document or its contents without specific, written prior permission. Title to copyright in this document will at all times remain with copyright holders.


Here's how that module is included in the XHTML 1.1 driver DTD:

<!-- Image Module ……………………………………….. -->
<!ENTITY % xhtml-image.module "INCLUDE" >
<![%xhtml-image.module;[
<!ENTITY % xhtml-image.mod
PUBLIC "-//W3C//ELEMENTS XHTML 1.1 Images 1.0//EN" "xhtml11-image-1.mod" >
%xhtml-image.mod;]]&gt;

Note the parameter entity xhtml-image.module here. This entity is set to "INCLUDE" by default, as you see here, but you can set it to "IGNORE" if you want to exclude the image module in a customized version of XHTML 1.1. That W3C calls the XHTML 1.1 DTD fully parameterized, and that's what it means—you can include or exclude modules just by changing parameter entities.

You'll find various suffixes used in the XHTML 1.1 driver DTD; for example, the name of the actual image module file is xhtml-image.mod. Here are the suffixes, such as .mod, that you'll find in the XHTML 1.1 driver DTD, along with what they mean. Using these suffixes, you can decipher what the various parameter entities in the DTD do:

SuffixDescription
.attribIndicates a group of tokens that indicate attribute specifications. Used in ATTLIST declarations.
.classGroups elements of the same class together.
.contentSpecifies the content model of a particular element. You specify what elements go inside what other elements with the content model. For example, here's how that looks for the <head> element: <!ENTITY % Head.content "( %Head-opts.mix;, title, %Head-opts.mix; )" >.
.mixSpecifies a collection of elements from different classes.
.modIs used for DTD modules, such as the term xhtml-image.mod that we've already seen.
.moduleIs used for parameter entities that are used to control inclusion or exclusion of DTD modules. You can set them to INCLUDE (the default) to include a module, or IGNORE to exclude the module.

Extending XHTML 1.1

As mentioned, extending XHTML 1.1 works much like extending XHTML 1.0, except that integrating the new element into the element hierarchy is a little different. For example, instead of modifying the declaration of the <html> element directly, you modify the Html.content parameter entity, which looks like this in XHTML 1.1:

<!ENTITY % Html.content "( head, body )" >

This means that I can modify the DTD that I developed earlier, extend.dtd, to work with XHTML 1.1 by modifying this content model, adding <doc:foot> and including the entire XHTML 1.1 DTD this way:

<!ELEMENT doc:foot (#PCDATA) >
<!ATTLIST doc:foot
    footattribute    CDATA   #IMPLIED
>
<!ENTITY % Html.content "( head, body, doc:foot )" >

<!ENTITY % xhtml11.dtd PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> %xhtml11.dtd;

Now I can use this new DTD as we've used the XHTML 1.0 version of extend.dtd:

<!DOCTYPE html PUBLIC "-//Extender//DTD XHTML-Extensions
1.0//EN" "http://www.starpowder.com/steve/extend.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:doc="http://www.starpowder.com/steve/extend.dtd">
    <head>
        <title>
            Extending XHTML
        </title>

        <link rel="stylesheet" href="extend.css" />
    </head>

    <body>
        <p>
            Here is some text.
        </p>
    </body>

    <doc:foot>
            This is the page's foot.
    </doc:foot>
</html>

And that's it for our look at XHTML. These two chapters have provided an introduction to the subject, and we've hit the major differences between HTML and XHTML. You're now ready to create XHTML documents of substantial complexity. However, there are more details in XHTML than we can cover in two chapters—for example, what attributes are required in each of the more than 100 XHTML elements. For more information, see the W3C XHTML sites using the various URIs that I've listed—everything you need is there.

In the next chapter, I'm going to take a look at two more popular XML applications: Resource Description Framework (RDF) and Channel Definition Format (CDF).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset