XHTML

What is XHTML?

XHTML is an XML application that is good for World Wide Web documents, particularly in

Is it really necessary?

Probably most of the things you can do with XHTML can be done with your own custom XML documents and style sheets. "Forms" may be an exception, though work is underway on XForms.

Anyway, it's probably good to have a "standard" XML app that everyone knows!

Versions of XHTML

Version Public ID Official Specification
(req'd reading)
XHTML 1.0 Strict -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/
XHTML 1.0 Transitional -//W3C//DTD XHTML 1.0 Transitional//EN
XHTML 1.0 Frameset -//W3C//DTD XHTML 1.0 Frameset//EN
XHTML 1.1 -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/
XHTML 2.0 ??? http://www.w3.org/TR/xhtml2/

XHTML vs. HTML

XHTML is an XML app, while HTML is a SGML app.

              SGML                        XML
               |                           |
      +--------+-----+            +--------+------+------+
      |        |     |            |        |      |      |
    DocBook   TEI   HTML ...    XHTML   MathML   SVG   SMIL ...

Because SGML admits optional start and end tags, SGML documents require a DTD. You can't really mix SGML documents with different DTDs. HTML can't be extended or mixed with other markup (say, for graphics, math, etc.).

XML was created to (1) get rid of zillions of special features of SGML that were either never used, made a DTD required, or would confuse a processing agent, and (2) allow easy mixing and extensions (namespaces and modules).

Overview of XHTML

Getting Started

Here is a simple well-formed XHTML document, that conforms to the XHTML 1.0 Strict DTD:

<html>
<head>
  <title>Classic</title>
</head>
<body>
  <p>Hello, World</p>
</body>
</html>

If you want a valid document, you must include a doctype declaration. The XHTML definition includes a notion of strictly conforming documents which goes a little beyond validation.

A Slightly Larger Document

<?xml version="1.0" charset="utf-8"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/XHTML1/DTD/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Hello</title>
  </head>
  <body>
    <h1>Hi</h1>
    <p>This is my <a href="fido.html"> dog</a>.
    <img src="fido.jpg" alt="fido" /></p>
  </body>
</html>

The Elements of XHTML

This diagram shows all the elements of XHTML 1.0 Strict, and shows which elements may be children of which.

xhtmlelements.gif

You can also see a page with a short description of each element.

Areas of Study

Besides reading the official specs, you'll want to get good at authoring XHTML documents.

Compatibility with HTML

Many tools know how to render HTML, but do a poor job with XML. So there are a number of things you should do while writing XHTML to maximize the chance your documents will look good on these systems. These things are described in Appendix C of the official definition of XHTML 1.0.

Some of the more interesting issues you have to put up with in moving to XHTML are:

Getting an XHTML document to render properly on both XML-aware and HTML-only user agents requires you do a few unfortunate things, like leaving out processing instructions or doubling up on information you should only have to specify once. Details in the w3.org specs.

The XHTML1.0 Strict DTD

<!-- ========================================================================
=
=  XHTML 1.0 Strict DTD
=
=  Namespace = http://www.w3.org/1999/xhtml
=
=  For further information, see: http://www.w3.org/TR/xhtml1
=
=  Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
=  All Rights Reserved.
=
=  This DTD module is identified by the PUBLIC and SYSTEM identifiers:
=
=     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
=     SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
=
========================================================================= -->

<!--================ Character mnemonic entities =========================-->

<!ENTITY % HTMLlat1
  PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
  "xhtml-lat1.ent">
%HTMLlat1;

<!ENTITY % HTMLsymbol
  PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
  "xhtml-symbol.ent">
%HTMLsymbol;

<!ENTITY % HTMLspecial
  PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
  "xhtml-special.ent">
%HTMLspecial;

<!--================== Imported Names ====================================-->

<!ENTITY % ContentType "CDATA">         <!-- media type per RFC2045 -->
<!ENTITY % ContentTypes "CDATA">        <!-- comma-separated media types -->
<!ENTITY % Charset "CDATA">             <!-- char encoding per RFC2045 -->
<!ENTITY % Charsets "CDATA">            <!-- space separated char encs -->
<!ENTITY % LanguageCode "NMTOKEN">      <!-- language code per RFC3066 -->
<!ENTITY % Character "CDATA">           <!-- single XML character -->
<!ENTITY % Number "CDATA">              <!-- one or more digits -->
<!ENTITY % LinkTypes "CDATA">           <!-- space-separated link types -->
<!ENTITY % MediaDesc "CDATA">           <!-- single or comma-separated -->
                                        <!-- list of media descriptors -->
                                        <!-- (screen, tty, tv, handheld, -->
                                        <!-- projection, print, braille, -->
                                        <!-- aural, emboss, all) -->
<!ENTITY % URI "CDATA">                 <!-- URI, see RFC2396 -->
<!ENTITY % UriList "CDATA">             <!-- space separated URIs -->
<!ENTITY % Datetime "CDATA">            <!-- date and time in ISO format -->
<!ENTITY % Script "CDATA">              <!-- script expression -->
<!ENTITY % StyleSheet "CDATA">          <!-- style sheet data -->
<!ENTITY % Text "CDATA">                <!-- "human readable" -->
<!ENTITY % Length "CDATA">              <!-- n for pixels n% for percent -->
<!ENTITY % MultiLength "CDATA">         <!-- pixel, percent, or relative -->
<!ENTITY % Pixels "CDATA">              <!-- integer length in pixels -->

<!ENTITY % Shape "(rect|circle|poly|default)">
<!ENTITY % Coords "CDATA">              <!-- comma separated lengths -->

<!--=================== Generic Attributes ===============================-->

<!-- core attributes common to most elements
       id       document-wide unique id
       class    space separated list of classes
       style    associated style info
       title    advisory title/amplification -->

<!ENTITY % coreattrs
 "id     ID            #IMPLIED
  class  CDATA         #IMPLIED
  style  %StyleSheet;  #IMPLIED
  title  %Text;        #IMPLIED">

<!-- internationalization attributes
       lang        language code (backwards compatible)
       xml:lang    language code (as per XML 1.0 spec)
       dir         direction for weak/neutral text -->

<!ENTITY % i18n
 "lang      %LanguageCode;  #IMPLIED
  xml:lang  %LanguageCode;  #IMPLIED
  dir       (ltr|rtl)       #IMPLIED">

<!-- attributes for common UI events
       onclick     a pointer button was clicked
       ondblclick  a pointer button was double clicked
       onmousedown a pointer button was pressed down
       onmouseup   a pointer button was released
       onmousemove a pointer was moved onto the element
       onmouseout  a pointer was moved away from the element
       onkeypress  a key was pressed and released
       onkeydown   a key was pressed down
       onkeyup     a key was released -->

<!ENTITY % events
 "onclick      %Script;  #IMPLIED
  ondblclick   %Script;  #IMPLIED
  onmousedown  %Script;  #IMPLIED
  onmouseup    %Script;  #IMPLIED
  onmouseover  %Script;  #IMPLIED
  onmousemove  %Script;  #IMPLIED
  onmouseout   %Script;  #IMPLIED
  onkeypress   %Script;  #IMPLIED
  onkeydown    %Script;  #IMPLIED
  onkeyup      %Script;  #IMPLIED">

<!-- attributes for elements that can get the focus
       accesskey   accessibility key character
       tabindex    position in tabbing order
       onfocus     the element got the focus
       onblur      the element lost the focus -->

<!ENTITY % focus
 "accesskey   %Character;    #IMPLIED
  tabindex    %Number;       #IMPLIED
  onfocus     %Script;       #IMPLIED
  onblur      %Script;       #IMPLIED">

<!ENTITY % attrs "%coreattrs; %i18n; %events;">

<!--=================== Text (Inline) Elements ===========================-->

<!ENTITY % special.pre "br | span | bdo | map">
<!ENTITY % special "%special.pre; | object | img">
<!ENTITY % fontstyle "tt | i | b | big | small">
<!ENTITY % phrase "em | strong | dfn | code | q | samp | kbd | var
                  | cite | abbr | acronym | sub | sup ">
<!ENTITY % inline.forms "input | select | textarea | label | button">
<!ENTITY % misc.inline "ins | del | script">

<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">

<!ENTITY % Inline "(#PCDATA | %inline; | %misc.inline;)*">

<!--================== Block level elements ==============================-->

<!ENTITY % heading "h1 | h2 | h3 | h4 | h5 | h6">
<!ENTITY % lists "ul | ol | dl">
<!ENTITY % blocktext "pre | hr | blockquote | address">
<!ENTITY % misc "noscript | %misc.inline;">

<!ENTITY % block
  "p | %heading; | div | %lists; | %blocktext; | fieldset | table">

<!ENTITY % Block "(%block; | form | %misc;)*">

<!--================== "Flow" elements ===================================-->

<!-- %Flow; mixes block and inline and is used for list items etc. -->

<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">

<!--================ Document Structure ==================================-->

<!ELEMENT html (head, body)>
<!ATTLIST html
  %i18n;
  id     ID     #IMPLIED
  xmlns  %URI;  #FIXED 'http://www.w3.org/1999/xhtml'>

<!--================ Document Head =======================================-->

<!ENTITY % head.misc "(script | style | meta | link | object)*">

<!-- content model is %head.misc; combined with a single
     title and an optional base element in any order -->

<!ELEMENT head (%head.misc;,
     ((title, %head.misc;, (base, %head.misc;)?) |
      (base, %head.misc;, (title, %head.misc;))))>
<!ATTLIST head
  %i18n;
  id       ID     #IMPLIED
  profile  %URI;  #IMPLIED>

<!ELEMENT title (#PCDATA)>              <!-- document title -->
<!ATTLIST title
  %i18n;
  id  ID  #IMPLIED>

<!ELEMENT base EMPTY>                   <!-- document base URI -->
<!ATTLIST base
  href  %URI;  #REQUIRED
  id    ID     #IMPLIED>

<!ELEMENT meta EMPTY>                   <!-- generic metainformation -->
<!ATTLIST meta
  %i18n;
  id          ID     #IMPLIED
  http-equiv  CDATA  #IMPLIED
  name        CDATA  #IMPLIED
  content     CDATA  #REQUIRED
  scheme      CDATA  #IMPLIED>

<!-- Relationship values can be used in principle:

   a) for document specific toolbars/menus when used
      with the link element in document head e.g.
        start, contents, previous, next, index, end, help
   b) to link to a separate style sheet (rel="stylesheet")
   c) to make a link to a script (rel="script")
   d) by stylesheets to control how collections of
      html nodes are rendered into printed documents
   e) to make a link to a printable version of this document
      e.g. a PostScript or PDF version (rel="alternate" media="print") -->

<!ELEMENT link EMPTY>
<!ATTLIST link
  %attrs;
  charset   %Charset;       #IMPLIED
  href      %URI;           #IMPLIED
  hreflang  %LanguageCode;  #IMPLIED
  type      %ContentType;   #IMPLIED
  rel       %LinkTypes;     #IMPLIED
  rev       %LinkTypes;     #IMPLIED
  media     %MediaDesc;     #IMPLIED>

<!ELEMENT style (#PCDATA)>              <!-- Stylesheet statements -->
<!ATTLIST style
  %i18n;
  id         ID             #IMPLIED
  type       %ContentType;  #REQUIRED
  media      %MediaDesc;    #IMPLIED
  title      %Text;         #IMPLIED
  xml:space  (preserve)     #FIXED 'preserve'>

<!ELEMENT script (#PCDATA)>             <!-- Script statements -->
<!ATTLIST script
  id          ID             #IMPLIED
  charset     %Charset;      #IMPLIED
  type        %ContentType;  #REQUIRED
  src         %URI;          #IMPLIED
  defer       (defer)        #IMPLIED
  xml:space   (preserve)     #FIXED 'preserve'>

<!-- alternate content container for non script-based rendering -->

<!ELEMENT noscript %Block;>
<!ATTLIST noscript %attrs;>

<!--=================== Document Body ====================================-->

<!ELEMENT body %Block;>
<!ATTLIST body
  %attrs;
  onload    %Script;  #IMPLIED
  onunload  %Script;  #IMPLIED>

<!--=================== Divisions ========================================-->

<!ELEMENT div %Flow;>
<!ATTLIST div %attrs;>

<!--=================== Paragraphs =======================================-->

<!ELEMENT p %Inline;>
<!ATTLIST p %attrs;>

<!--=================== Headings =========================================-->

<!ELEMENT h1 %Inline;>
<!ATTLIST h1 %attrs;>

<!ELEMENT h2 %Inline;>
<!ATTLIST h2 %attrs;>

<!ELEMENT h3 %Inline;>
<!ATTLIST h3 %attrs;>

<!ELEMENT h4 %Inline;>
<!ATTLIST h4 %attrs;>

<!ELEMENT h5 %Inline;>
<!ATTLIST h5 %attrs;>

<!ELEMENT h6 %Inline;>
<!ATTLIST h6 %attrs;>

<!--=================== Lists ============================================-->

<!ELEMENT ul (li)+>                     <!-- Unordered list -->
<!ATTLIST ul %attrs;>

<!ELEMENT ol (li)+>                     <!-- Ordered (numbered) list -->
<!ATTLIST ol %attrs;>

<!ELEMENT li %Flow;>                    <!-- list item for ul and ol -->
<!ATTLIST li %attrs;>

<!ELEMENT dl (dt|dd)+>                  <!-- definition list -->
<!ATTLIST dl %attrs;>

<!ELEMENT dt %Inline;>                  <!-- definition term -->
<!ATTLIST dt %attrs;>

<!ELEMENT dd %Flow;>                    <!-- definition or the term -->
<!ATTLIST dd %attrs;>

<!--=================== Address ==========================================-->

<!ELEMENT address %Inline;>             <!-- information on author -->
<!ATTLIST address %attrs;>

<!--=================== Horizontal Rule ==================================-->

<!ELEMENT hr EMPTY>
<!ATTLIST hr %attrs;>

<!--=================== Preformatted Text ================================-->

<!-- pre content is %Inline; excluding "img|object|big|small|sub|sup" -->

<!ENTITY % pre.content
   "(#PCDATA | a | %fontstyle; | %phrase; | %special.pre; | %misc.inline;
      | %inline.forms;)*">

<!ELEMENT pre %pre.content;>
<!ATTLIST pre
  %attrs;
  xml:space (preserve) #FIXED 'preserve'>

<!--=================== Block-like Quotes ================================-->

<!ELEMENT blockquote %Block;>
<!ATTLIST blockquote
  %attrs;
  cite        %URI;          #IMPLIED>

<!--=================== Inserted/Deleted Text ============================-->

<!-- ins/del are allowed in block and inline content, but its
  inappropriate to include block content within an ins element
  occurring in inline content. -->

<!ELEMENT ins %Flow;>
<!ATTLIST ins
  %attrs;
  cite      %URI;       #IMPLIED
  datetime  %Datetime;  #IMPLIED>

<!ELEMENT del %Flow;>
<!ATTLIST del
  %attrs;
  cite      %URI;       #IMPLIED
  datetime  %Datetime;  #IMPLIED>

<!--================== The Anchor Element ================================-->

<!-- a is like %Inline; except that anchors shouldn't be nested -->

<!ENTITY % a.content
   "(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms;
     | %misc.inline;)*">

<!ELEMENT a %a.content;>
<!ATTLIST a
  %attrs;
  %focus;
  charset   %Charset;       #IMPLIED
  type      %ContentType;   #IMPLIED
  name      NMTOKEN         #IMPLIED
  href      %URI;           #IMPLIED
  hreflang  %LanguageCode;  #IMPLIED
  rel       %LinkTypes;     #IMPLIED
  rev       %LinkTypes;     #IMPLIED
  shape     %Shape;         "rect"
  coords    %Coords;        #IMPLIED>

<!--===================== Inline Elements ================================-->

<!ELEMENT span %Inline;>
<!ATTLIST span %attrs;>

<!ELEMENT bdo %Inline;>                 <!-- I18N BiDi over-ride -->
<!ATTLIST bdo
  %coreattrs;
  %events;
  lang      %LanguageCode;  #IMPLIED
  xml:lang  %LanguageCode;  #IMPLIED
  dir       (ltr|rtl)       #REQUIRED>

<!ELEMENT br EMPTY>                     <!-- forced line break -->
<!ATTLIST br %coreattrs;>

<!ELEMENT em %Inline;>                  <!-- emphasis -->
<!ATTLIST em %attrs;>

<!ELEMENT strong %Inline;>              <!-- strong emphasis -->
<!ATTLIST strong %attrs;>

<!ELEMENT dfn %Inline;>                 <!-- definitional -->
<!ATTLIST dfn %attrs;>

<!ELEMENT code %Inline;>                <!-- program code -->
<!ATTLIST code %attrs;>

<!ELEMENT samp %Inline;>                <!-- sample -->
<!ATTLIST samp %attrs;>

<!ELEMENT kbd %Inline;>                 <!-- something user would type -->
<!ATTLIST kbd %attrs;>

<!ELEMENT var %Inline;>                 <!-- variable -->
<!ATTLIST var %attrs;>

<!ELEMENT cite %Inline;>                <!-- citation -->
<!ATTLIST cite %attrs;>

<!ELEMENT abbr %Inline;>                <!-- abbreviation -->
<!ATTLIST abbr %attrs;>

<!ELEMENT acronym %Inline;>             <!-- acronym -->
<!ATTLIST acronym %attrs;>

<!ELEMENT q %Inline;>                   <!-- inlined quote -->
<!ATTLIST q
  %attrs;
  cite %URI; #IMPLIED>

<!ELEMENT sub %Inline;>                 <!-- subscript -->
<!ATTLIST sub %attrs;>

<!ELEMENT sup %Inline;>                 <!-- superscript -->
<!ATTLIST sup %attrs;>

<!ELEMENT tt %Inline;>                  <!-- fixed pitch font -->
<!ATTLIST tt %attrs;>

<!ELEMENT i %Inline;>                   <!-- italic font -->
<!ATTLIST i %attrs;>

<!ELEMENT b %Inline;>                   <!-- bold font -->
<!ATTLIST b %attrs;>

<!ELEMENT big %Inline;>                 <!-- bigger font -->
<!ATTLIST big %attrs;>

<!ELEMENT small %Inline;>               <!-- smaller font -->
<!ATTLIST small %attrs;>

<!--==================== Object ==========================================-->

<!-- object is used to embed objects as part of XHTML pages.
  param elements should precede other content. Parameters
  can also be expressed as attribute/value pairs on the
  object element itself when brevity is desired. -->

<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>
<!ATTLIST object
  %attrs;
  declare     (declare)      #IMPLIED
  classid     %URI;          #IMPLIED
  codebase    %URI;          #IMPLIED
  data        %URI;          #IMPLIED
  type        %ContentType;  #IMPLIED
  codetype    %ContentType;  #IMPLIED
  archive     %UriList;      #IMPLIED
  standby     %Text;         #IMPLIED
  height      %Length;       #IMPLIED
  width       %Length;       #IMPLIED
  usemap      %URI;          #IMPLIED
  name        NMTOKEN        #IMPLIED
  tabindex    %Number;       #IMPLIED>

<!-- param is used to supply a named property value.
  In XML it would seem natural to follow RDF and support an
  abbreviated syntax where the param elements are replaced
  by attribute value pairs on the object start tag. -->

<!ELEMENT param EMPTY>
<!ATTLIST param
  id         ID                 #IMPLIED
  name       CDATA              #IMPLIED
  value      CDATA              #IMPLIED
  valuetype  (data|ref|object)  "data"
  type       %ContentType;      #IMPLIED>

<!--=================== Images ===========================================-->

<!ELEMENT img EMPTY>
<!ATTLIST img
  %attrs;
  src         %URI;          #REQUIRED
  alt         %Text;         #REQUIRED
  longdesc    %URI;          #IMPLIED
  height      %Length;       #IMPLIED
  width       %Length;       #IMPLIED
  usemap      %URI;          #IMPLIED
  ismap       (ismap)        #IMPLIED>

<!-- usemap points to a map element which may be in this document
  or an external document, although the latter is not widely supported -->

<!--================== Client-side image maps ============================-->

<!-- These can be placed in the same document or grouped in a
     separate document although this isn't yet widely supported -->

<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
<!ATTLIST map
  %i18n;
  %events;
  id          ID             #REQUIRED
  class       CDATA          #IMPLIED
  style       %StyleSheet;   #IMPLIED
  title       %Text;         #IMPLIED
  name        NMTOKEN        #IMPLIED>

<!ELEMENT area EMPTY>
<!ATTLIST area
  %attrs;
  %focus;
  shape       %Shape;        "rect"
  coords      %Coords;       #IMPLIED
  href        %URI;          #IMPLIED
  nohref      (nohref)       #IMPLIED
  alt         %Text;         #REQUIRED>

<!--================ Forms ===============================================-->

<!-- form uses %Block; excluding form -->
<!ENTITY % form.content "(%block; | %misc;)*">

<!ELEMENT form %form.content;>
<!ATTLIST form
  %attrs;
  action      %URI;          #REQUIRED
  method      (get|post)     "get"
  enctype     %ContentType;  "application/x-www-form-urlencoded"
  onsubmit    %Script;       #IMPLIED
  onreset     %Script;       #IMPLIED
  accept      %ContentTypes; #IMPLIED
  accept-charset %Charsets;  #IMPLIED>

<!-- Each label must not contain more than ONE field.
     Label elements shouldn't be nested. -->

<!ELEMENT label %Inline;>
<!ATTLIST label
  %attrs;
  for         IDREF          #IMPLIED
  accesskey   %Character;    #IMPLIED
  onfocus     %Script;       #IMPLIED
  onblur      %Script;       #IMPLIED>

<!ENTITY % InputType
  "(text | password | checkbox | radio | submit | reset |
    file | hidden | image | button)">

<!-- The name attribute is required for all but submit & reset -->

<!ELEMENT input EMPTY>
<!ATTLIST input
  %attrs;
  %focus;
  type        %InputType;    "text"
  name        CDATA          #IMPLIED
  value       CDATA          #IMPLIED
  checked     (checked)      #IMPLIED
  disabled    (disabled)     #IMPLIED
  readonly    (readonly)     #IMPLIED
  size        CDATA          #IMPLIED
  maxlength   %Number;       #IMPLIED
  src         %URI;          #IMPLIED
  alt         CDATA          #IMPLIED
  usemap      %URI;          #IMPLIED
  onselect    %Script;       #IMPLIED
  onchange    %Script;       #IMPLIED
  accept      %ContentTypes; #IMPLIED>

<!ELEMENT select (optgroup|option)+>    <!-- option selector -->
<!ATTLIST select
  %attrs;
  name        CDATA          #IMPLIED
  size        %Number;       #IMPLIED
  multiple    (multiple)     #IMPLIED
  disabled    (disabled)     #IMPLIED
  tabindex    %Number;       #IMPLIED
  onfocus     %Script;       #IMPLIED
  onblur      %Script;       #IMPLIED
  onchange    %Script;       #IMPLIED>

<!ELEMENT optgroup (option)+>           <!-- option group -->
<!ATTLIST optgroup
  %attrs;
  disabled    (disabled)     #IMPLIED
  label       %Text;         #REQUIRED>

<!ELEMENT option (#PCDATA)>             <!-- selectable choice -->
<!ATTLIST option
  %attrs;
  selected    (selected)     #IMPLIED
  disabled    (disabled)     #IMPLIED
  label       %Text;         #IMPLIED
  value       CDATA          #IMPLIED>

<!ELEMENT textarea (#PCDATA)>           <!-- multi-line text field -->
<!ATTLIST textarea
  %attrs;
  %focus;
  name        CDATA          #IMPLIED
  rows        %Number;       #REQUIRED
  cols        %Number;       #REQUIRED
  disabled    (disabled)     #IMPLIED
  readonly    (readonly)     #IMPLIED
  onselect    %Script;       #IMPLIED
  onchange    %Script;       #IMPLIED>

<!-- The fieldset element is used to group form fields.
  Only one legend element should occur in the content
  and if present should only be preceded by whitespace. -->

<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
<!ATTLIST fieldset %attrs;>

<!ELEMENT legend %Inline;>              <!-- fieldset label -->
<!ATTLIST legend
  %attrs;
  accesskey   %Character;    #IMPLIED>

<!-- button uses %Flow; but excludes a, form and form controls -->

<!ENTITY % button.content
   "(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
    table | %special; | %fontstyle; | %phrase; | %misc;)*">

<!ELEMENT button %button.content;>  <!-- push button -->
<!ATTLIST button
  %attrs;
  %focus;
  name      CDATA                  #IMPLIED
  value     CDATA                  #IMPLIED
  type      (button|submit|reset)  "submit"
  disabled  (disabled)             #IMPLIED>

<!--======================= Tables =======================================-->

<!-- The border attribute sets the thickness of the frame around the
     table. The default units are screen pixels. -->

<!-- The frame attribute specifies which parts of the frame around
     the table should be rendered. -->

<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">

<!-- The rules attribute defines which rules to draw between cells:
     If rules is absent then assume "none" if border is absent or
     border="0" otherwise "all" -->

<!ENTITY % TRules "(none | groups | rows | cols | all)">

<!-- horizontal alignment attributes for cell contents
       char        alignment char, e.g. char=':'
       charoff     offset for alignment char -->

<!ENTITY % cellhalign
  "align    (left|center|right|justify|char)  #IMPLIED
   char     %Character;                       #IMPLIED
   charoff  %Length;                          #IMPLIED">

<!-- vertical alignment attributes for cell contents -->

<!ENTITY % cellvalign
  "valign (top|middle|bottom|baseline) #IMPLIED">

<!ELEMENT table
     (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
<!ELEMENT caption  %Inline;>
<!ELEMENT thead    (tr)+>
<!ELEMENT tfoot    (tr)+>
<!ELEMENT tbody    (tr)+>
<!ELEMENT colgroup (col)*>
<!ELEMENT col      EMPTY>
<!ELEMENT tr       (th|td)+>
<!ELEMENT th       %Flow;>
<!ELEMENT td       %Flow;>

<!ATTLIST table
  %attrs;
  summary      %Text;    #IMPLIED
  width        %Length;  #IMPLIED
  border       %Pixels;  #IMPLIED
  frame        %TFrame;  #IMPLIED
  rules        %TRules;  #IMPLIED
  cellspacing  %Length;  #IMPLIED
  cellpadding  %Length;  #IMPLIED>

<!ATTLIST caption %attrs;>

<!-- colgroup groups a set of col elements. It allows you to group
several semantically related columns together. -->

<!ATTLIST colgroup
  %attrs;
  span        %Number;       "1"
  width       %MultiLength;  #IMPLIED
  %cellhalign;
  %cellvalign;>

<!-- col elements define the alignment properties for cells in
     one or more columns.  The width attribute specifies the width of
     the columns, e.g.
       width=64        width in screen pixels
       width=0.5*      relative width of 0.5
     The span attribute causes the attributes of one
     col element to apply to more than one column. -->

<!ATTLIST col
  %attrs;
  span        %Number;       "1"
  width       %MultiLength;  #IMPLIED
  %cellhalign;
  %cellvalign;>

<!-- Use thead to duplicate headers when breaking table
     across page boundaries, or for static headers when
     tbody sections are rendered in scrolling panel.

     Use tfoot to duplicate footers when breaking table
     across page boundaries, or for static footers when
     tbody sections are rendered in scrolling panel.

     Use multiple tbody sections when rules are needed
     between groups of table rows. -->

<!ATTLIST thead
  %attrs;
  %cellhalign;
  %cellvalign;>

<!ATTLIST tfoot
  %attrs;
  %cellhalign;
  %cellvalign;>

<!ATTLIST tbody
  %attrs;
  %cellhalign;
  %cellvalign;>

<!ATTLIST tr
  %attrs;
  %cellhalign;
  %cellvalign;>

<!-- Scope is simpler than headers attribute for common tables -->

<!ENTITY % Scope "(row|col|rowgroup|colgroup)">

<!-- th is for headers, td for data and for cells acting as both -->

<!ATTLIST th
  %attrs;
  abbr        %Text;    #IMPLIED
  axis        CDATA     #IMPLIED
  headers     IDREFS    #IMPLIED
  scope       %Scope;   #IMPLIED
  rowspan     %Number;  "1"
  colspan     %Number;  "1"
  %cellhalign;
  %cellvalign;>

<!ATTLIST td
  %attrs;
  abbr        %Text;    #IMPLIED
  axis        CDATA     #IMPLIED
  headers     IDREFS    #IMPLIED
  scope       %Scope;   #IMPLIED
  rowspan     %Number;  "1"
  colspan     %Number;  "1"
  %cellhalign;
  %cellvalign;>

External Entities Referenced in the XHTML 1.0 DTD

Well, I simplified things a little. The XHTML DTD references three external entities, but these contain a bunch of entity declarations, and those are what are here:

<!ENTITY quot "&#34;">
<!ENTITY amp  "&#38;#38;">
<!ENTITY lt   "&#38;#60;">
<!ENTITY gt   "&#62;">
<!ENTITY apos "&#39;">

<!ENTITY nbsp   "&#160;"> <!ENTITY iexcl  "&#161;"> <!ENTITY cent   "&#162;">
<!ENTITY pound  "&#163;"> <!ENTITY curren "&#164;"> <!ENTITY yen    "&#165;">
<!ENTITY brvbar "&#166;"> <!ENTITY sect   "&#167;"> <!ENTITY uml    "&#168;">
<!ENTITY copy   "&#169;"> <!ENTITY ordf   "&#170;"> <!ENTITY laquo  "&#171;">
<!ENTITY not    "&#172;"> <!ENTITY shy    "&#173;"> <!ENTITY reg    "&#174;">
<!ENTITY macr   "&#175;"> <!ENTITY deg    "&#176;"> <!ENTITY plusmn "&#177;">
<!ENTITY sup2   "&#178;"> <!ENTITY sup3   "&#179;"> <!ENTITY acute  "&#180;">
<!ENTITY micro  "&#181;"> <!ENTITY para   "&#182;"> <!ENTITY middot "&#183;">
<!ENTITY cedil  "&#184;"> <!ENTITY sup1   "&#185;"> <!ENTITY ordm   "&#186;">
<!ENTITY raquo  "&#187;"> <!ENTITY frac14 "&#188;"> <!ENTITY frac12 "&#189;">
<!ENTITY frac34 "&#190;"> <!ENTITY iquest "&#191;"> <!ENTITY Agrave "&#192;">
<!ENTITY Aacute "&#193;"> <!ENTITY Acirc  "&#194;"> <!ENTITY Atilde "&#195;">
<!ENTITY Auml   "&#196;"> <!ENTITY Aring  "&#197;"> <!ENTITY AElig  "&#198;">
<!ENTITY Ccedil "&#199;"> <!ENTITY Egrave "&#200;"> <!ENTITY Eacute "&#201;">
<!ENTITY Ecirc  "&#202;"> <!ENTITY Euml   "&#203;"> <!ENTITY Igrave "&#204;">
<!ENTITY Iacute "&#205;"> <!ENTITY Icirc  "&#206;"> <!ENTITY Iuml   "&#207;">
<!ENTITY ETH    "&#208;"> <!ENTITY Ntilde "&#209;"> <!ENTITY Ograve "&#210;">
<!ENTITY Oacute "&#211;"> <!ENTITY Ocirc  "&#212;"> <!ENTITY Otilde "&#213;">
<!ENTITY Ouml   "&#214;"> <!ENTITY times  "&#215;"> <!ENTITY Oslash "&#216;">
<!ENTITY Ugrave "&#217;"> <!ENTITY Uacute "&#218;"> <!ENTITY Ucirc  "&#219;">
<!ENTITY Uuml   "&#220;"> <!ENTITY Yacute "&#221;"> <!ENTITY THORN  "&#222;">
<!ENTITY szlig  "&#223;"> <!ENTITY agrave "&#224;"> <!ENTITY aacute "&#225;">
<!ENTITY acirc  "&#226;"> <!ENTITY atilde "&#227;"> <!ENTITY auml   "&#228;">
<!ENTITY aring  "&#229;"> <!ENTITY aelig  "&#230;"> <!ENTITY ccedil "&#231;">
<!ENTITY egrave "&#232;"> <!ENTITY eacute "&#233;"> <!ENTITY ecirc  "&#234;">
<!ENTITY euml   "&#235;"> <!ENTITY igrave "&#236;"> <!ENTITY iacute "&#237;">
<!ENTITY icirc  "&#238;"> <!ENTITY iuml   "&#239;"> <!ENTITY eth    "&#240;">
<!ENTITY ntilde "&#241;"> <!ENTITY ograve "&#242;"> <!ENTITY oacute "&#243;">
<!ENTITY ocirc  "&#244;"> <!ENTITY otilde "&#245;"> <!ENTITY ouml   "&#246;">
<!ENTITY divide "&#247;"> <!ENTITY oslash "&#248;"> <!ENTITY ugrave "&#249;">
<!ENTITY uacute "&#250;"> <!ENTITY ucirc  "&#251;"> <!ENTITY uuml   "&#252;">
<!ENTITY yacute "&#253;"> <!ENTITY thorn  "&#254;"> <!ENTITY yuml   "&#255;">

<!ENTITY OElig    "&#338;">  <!ENTITY oelig   "&#339;">  <!ENTITY Scaron "&#352;">
<!ENTITY scaron   "&#353;">  <!ENTITY Yuml    "&#376;">  <!ENTITY circ   "&#710;">
<!ENTITY tilde    "&#732;">  <!ENTITY ensp    "&#8194;"> <!ENTITY emsp   "&#8195;">
<!ENTITY thinsp   "&#8201;"> <!ENTITY zwnj    "&#8204;"> <!ENTITY zwj    "&#8205;">
<!ENTITY lrm      "&#8206;"> <!ENTITY rlm     "&#8207;"> <!ENTITY ndash  "&#8211;">
<!ENTITY mdash    "&#8212;"> <!ENTITY lsquo   "&#8216;"> <!ENTITY rsquo  "&#8217;">
<!ENTITY sbquo    "&#8218;"> <!ENTITY ldquo   "&#8220;"> <!ENTITY rdquo  "&#8221;">
<!ENTITY bdquo    "&#8222;"> <!ENTITY dagger  "&#8224;"> <!ENTITY Dagger "&#8225;">
<!ENTITY permil   "&#8240;"> <!ENTITY lsaquo  "&#8249;"> <!ENTITY rsaquo "&#8250;">
<!ENTITY euro     "&#8364;"> <!ENTITY fnof    "&#402;">  <!ENTITY Alpha  "&#913;">
<!ENTITY Beta     "&#914;">  <!ENTITY Gamma   "&#915;">  <!ENTITY Delta  "&#916;">
<!ENTITY Epsilon  "&#917;">  <!ENTITY Zeta    "&#918;">  <!ENTITY Eta    "&#919;">
<!ENTITY Theta    "&#920;">  <!ENTITY Iota    "&#921;">  <!ENTITY Kappa  "&#922;">
<!ENTITY Lambda   "&#923;">  <!ENTITY Mu      "&#924;">  <!ENTITY Nu     "&#925;">
<!ENTITY Xi       "&#926;">  <!ENTITY Omicron "&#927;">  <!ENTITY Pi     "&#928;">
<!ENTITY Rho      "&#929;">  <!ENTITY Sigma   "&#931;">  <!ENTITY Tau    "&#932;">
<!ENTITY Upsilon  "&#933;">  <!ENTITY Phi     "&#934;">  <!ENTITY Chi    "&#935;">
<!ENTITY Psi      "&#936;">  <!ENTITY Omega   "&#937;">  <!ENTITY alpha  "&#945;">
<!ENTITY beta     "&#946;">  <!ENTITY gamma   "&#947;">  <!ENTITY delta  "&#948;">
<!ENTITY epsilon  "&#949;">  <!ENTITY zeta    "&#950;">  <!ENTITY eta    "&#951;">
<!ENTITY theta    "&#952;">  <!ENTITY iota    "&#953;">  <!ENTITY kappa  "&#954;">
<!ENTITY lambda   "&#955;">  <!ENTITY mu      "&#956;">  <!ENTITY nu     "&#957;">
<!ENTITY xi       "&#958;">  <!ENTITY omicron "&#959;">  <!ENTITY pi     "&#960;">
<!ENTITY rho      "&#961;">  <!ENTITY sigmaf  "&#962;">  <!ENTITY sigma  "&#963;">
<!ENTITY tau      "&#964;">  <!ENTITY upsilon "&#965;">  <!ENTITY phi    "&#966;">
<!ENTITY chi      "&#967;">  <!ENTITY psi     "&#968;">  <!ENTITY omega  "&#969;">
<!ENTITY thetasym "&#977;">  <!ENTITY upsih   "&#978;">  <!ENTITY piv    "&#982;">


<!ENTITY bull    "&#8226;">
<!ENTITY hellip  "&#8230;"> <!ENTITY prime  "&#8242;"> <!ENTITY Prime   "&#8243;">
<!ENTITY oline   "&#8254;"> <!ENTITY frasl  "&#8260;"> <!ENTITY weierp  "&#8472;">
<!ENTITY image   "&#8465;"> <!ENTITY real   "&#8476;"> <!ENTITY trade   "&#8482;">
<!ENTITY alefsym "&#8501;"> <!ENTITY larr   "&#8592;"> <!ENTITY uarr    "&#8593;">
<!ENTITY rarr    "&#8594;"> <!ENTITY darr   "&#8595;"> <!ENTITY harr    "&#8596;">
<!ENTITY crarr   "&#8629;"> <!ENTITY lArr   "&#8656;"> <!ENTITY uArr    "&#8657;">
<!ENTITY rArr    "&#8658;"> <!ENTITY dArr   "&#8659;"> <!ENTITY hArr    "&#8660;">
<!ENTITY forall  "&#8704;"> <!ENTITY part   "&#8706;"> <!ENTITY exist   "&#8707;">
<!ENTITY empty   "&#8709;"> <!ENTITY nabla  "&#8711;"> <!ENTITY isin    "&#8712;">
<!ENTITY notin   "&#8713;"> <!ENTITY ni     "&#8715;"> <!ENTITY prod    "&#8719;">
<!ENTITY sum     "&#8721;"> <!ENTITY minus  "&#8722;"> <!ENTITY lowast  "&#8727;">
<!ENTITY radic   "&#8730;"> <!ENTITY prop   "&#8733;"> <!ENTITY infin   "&#8734;">
<!ENTITY ang     "&#8736;"> <!ENTITY and    "&#8743;"> <!ENTITY or      "&#8744;">
<!ENTITY cap     "&#8745;"> <!ENTITY cup    "&#8746;"> <!ENTITY int     "&#8747;">
<!ENTITY there4  "&#8756;"> <!ENTITY sim    "&#8764;"> <!ENTITY cong    "&#8773;">
<!ENTITY asymp   "&#8776;"> <!ENTITY ne     "&#8800;"> <!ENTITY equiv   "&#8801;">
<!ENTITY le      "&#8804;"> <!ENTITY ge     "&#8805;"> <!ENTITY sub     "&#8834;">
<!ENTITY sup     "&#8835;"> <!ENTITY nsub   "&#8836;"> <!ENTITY sube    "&#8838;">
<!ENTITY supe    "&#8839;"> <!ENTITY oplus  "&#8853;"> <!ENTITY otimes  "&#8855;">
<!ENTITY perp    "&#8869;"> <!ENTITY sdot   "&#8901;"> <!ENTITY lceil   "&#8968;">
<!ENTITY rceil   "&#8969;"> <!ENTITY lfloor "&#8970;"> <!ENTITY rfloor  "&#8971;">
<!ENTITY lang    "&#9001;"> <!ENTITY rang   "&#9002;"> <!ENTITY loz     "&#9674;">
<!ENTITY spades  "&#9824;"> <!ENTITY clubs  "&#9827;"> <!ENTITY hearts  "&#9829;">
<!ENTITY diams   "&#9830;">

XHTML and Design

Some skills you need