since: 31st/Aug./2001; last modified: 16st/Sep./2001
XHTML 1.1 は豊富な意味的な構造を、マークアップで実現できます。より単純化した文書型は、 XHTML Basic で提供されています。具体的には、 XHTML 1.0 Transitinoal や Frameset 文書型の機能はサポートされておらず、ここで含まれていたプレゼンテーション用の部分は、スタイルシートなどで実現することになります。 HTML 4 で非推奨 (deprecated) とされた部分は、全く含まれていません。このような特徴をもつ XHTML 1.1 は、将来の文書型の雛型として想定され、設計されています。
<?xml version="1.0" encoding="Shift_JIS"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" > <head> <title>XHTML 1.1 の例</title> </head> <body> <p>この文書は XHTML 1.1 の最小構成です。</p> </body> </html>
XHTML 1.1 は、複数のモジュールを取り込むことで定義されています。このモジュールは、一般にファイル単位で存在し、その内容は DTD の書式で記述されています。それと平行して、機械処理を前提としない、人が読んで分かりやすい定義として、概念モジュール定義 (Abstract Module Definition) が提供されています。
尚、モジュールの定義は、 XHTML 1.1 仕様書ではなく、 "[XHTMLMOD]" で提供されています。
XHTML 1.1 では、多くの要素タイプで共通に利用できる属性を、説明の便宜上、集合として扱われています。最初に、代表的な属性の集合の表を載せておきます。
集合名 | 集合に含まれる属性 |
---|---|
Core |
class (NMTOKENS), id (ID), title (CDATA) |
I18N |
xml:lang (NMTOKEN) |
Events |
onclick (Script), ondblclick (Script), onmousedown (Script), onmouseup (Script), onmouseover (Script), onmousemove (Script), onmouseout (Script), onkeypress (Script), onkeydown (Script), onkeyup (Script) |
Style |
style (CDATA) |
Common |
Core + Events + I18N + Style |
中核モジュールは、構造モジュール、テキストモジュール、ハイパーテキストモジュール、リストモジュールからなります。
以下に、これらのモジュールの概念モジュール定義を紹介します。モジュール名をアンカーとするリンクは、本稿の当該モジュールの説明へのものです。尚、モジュール名の "*" は、 [XHTMLMOD] で必須モジュールと定義されたものです。このような共通部分を定義することで、 XHTML ファミリー文書型の一貫性を提供しています。
body, head, html, title
要素 | 属性 | 最小内容モデル |
---|---|---|
body |
Common | (Heading | Block | List)* |
head |
I18N, profile (URI) | title |
html |
I18N, version (CDATA), xmlns (URI = "http://www.w3.org/1999/xhtml") | head, body |
title |
I18N | PCDATA |
abbr, acronym, address, blockquote,
br, cite, code, dfn, div, em,
h1, h2, h3, h4, h5, h6,
kbd, p, pre, q, samp, span, strong, var
要素 | 属性 | 最小内容モデル |
---|---|---|
abbr |
Common | (PCDATA | Inline)* |
acronym |
Common | (PCDATA | Inline)* |
address |
Common | (PCDATA | Inline)* |
blockquote |
Common, cite (URI) | (PCDATA | Headings | Block | List)* |
br |
Core | EMPTY |
cite |
Common | (PCDATA | Inline)* |
code |
Common | (PCDATA | Inline)* |
dfn |
Common | (PCDATA | Inline)* |
div |
Common | (PCDATA | Flow)* |
em |
Common | (PCDATA | Inline)* |
h1 |
Common | (PCDATA | Inline)* |
h2 |
Common | (PCDATA | Inline)* |
h3 |
Common | (PCDATA | Inline)* |
h4 |
Common | (PCDATA | Inline)* |
h5 |
Common | (PCDATA | Inline)* |
h6 |
Common | (PCDATA | Inline)* |
kbd |
Common | (PCDATA | Inline)* |
p |
Common | (PCDATA | Inline)* |
pre |
Common, xml:space="preserve" | (PCDATA | Inline)* |
q |
Common, cite (URI) | (PCDATA | Inline)* |
samp |
Common | (PCDATA | Inline)* |
span |
Common | (PCDATA | Inline)* |
strong |
Common | (PCDATA | Inline)* |
var |
Common | (PCDATA | Inline)* |
このモジュールの最小内容モデルは幾つかの内容セットを定義する:
a
要素 | 属性 | 最小内容モデル |
---|---|---|
a |
Common, accesskey (Character), charset (Charset), href (URI), hreflang (LanguageCode), rel (LinkTypes), rev (LinkTypes), tabindex (Number), type (ContentType) | (PCDATA | Inline - a)* |
このモジュールは、テキスト・モジュールの内容セット Inline
に a
要素を追加する。
dl, dt, dd, ol, ul, li
要素 | 属性 | 最小内容モデル |
---|---|---|
dl |
Common | (dt | dd)+ |
dt |
Common | (PCDATA | Inline)* |
dd |
Common | (PCDATA | Flow)* |
ol |
Common | li+ |
ul |
Common | li+ |
li |
Common | (PCDATA | Flow)* |
このモジュールは、内容セット List も定義し、その最小内容モデルは (dl | ol | ul)+ である。そして、このモジュールは、このセットを、テキスト・モジュールの Flow
内容セットに追加する。
b, big, hr, i, small, sub, sup, tt
要素 | 属性 | 最小内容モデル |
---|---|---|
b |
Common | (PCDATA | Inline)* |
big |
Common | (PCDATA | Inline)* |
hr |
Common | EMPTY |
i |
Common | (PCDATA | Inline)* |
small |
Common | (PCDATA | Inline)* |
sub |
Common | (PCDATA | Inline)* |
sup |
Common | (PCDATA | Inline)* |
tt |
Common | (PCDATA | Inline)* |
このモジュールが使われるときは、 hr
要素が、テキスト・モジュールの内容セット BLOCK
に追加される。
加えて、 b, big, i, small, sub, sup, tt
要素が、テキスト・モジュールの内容セット Inline
に加えられる。
del, ins
要素 | 属性 | 最小内容モデル |
---|---|---|
del |
Common, cite (URI), datetime (Datetime) | (PCDATA | Flow)* |
ins |
Common, cite (URI), datetime (Datetime) | (PCDATA | Flow)* |
このモジュールが使われるときは、 del
要素と ins
要素が、テキスト・モジュールの内容セット Inline
に追加される。
bdo
要素 | 属性 | 最小内容モデル |
---|---|---|
bdo | Core, dir* ("ltr" | "rtl") | (PCDATA | Inline)* |
このモジュールが使われるときは、 bdo
要素が、テキスト・モジュールの内容セット Inline
に追加される。
このモジュールを選択すると、属性 dir* ("ltr" | "rtl")
を、属性集合 I18N
に加える。
button, fieldset, form, input,
label, legend, select, optgroup,
option, textarea
要素 | 属性 | 最小内容モデル |
---|---|---|
form |
Common, accept (ContentTypes), accept-charset (Charsets), action* (URI), method ("get"* | "post"), enctype (ContentType) | (Heading | List | Block - Form | fieldset)+ |
input | Common, accept (ContentTypes), accesskey (Character), alt (Text), checked ("checked"), disabled ("disabled"), maxlength (Number), name (CDATA), readonly ("readonly"), size (Number), src (URI), tabindex (Number), type ("text"* | "password" | "checkbox" | "button" | "radio" | "submit" | "reset" | "file" | "hidden" | "image"), value (CDATA) | EMPTY |
select | Common, disabled ("disabled"), multiple ("multiple"), name (CDATA), size (Number), tabindex (Number) | (optgroup | option)+ |
option | Common, disabled ("disabled"), label (Text), selected ("selected"), value (CDATA) | PCDATA |
textarea | Common, accesskey (Character), cols* (Number), disabled ("disabled"), name (CDATA), readonly ("readonly"), rows* (Number), tabindex (Number) | PCDATA |
button | Common, accesskey (Character), disabled ("disabled"), name (CDATA), tabindex (Number), type ("button" | "submit"* | "reset"), value (CDATA) | (PCDATA | Headings | List | Block - Form | Inline - Formctrl )* |
fieldset |
Common | (PCDATA | legend | Flow)* |
label | Common, accesskey (Character), for (IDREF) | (PCDATA | Inline - label)* |
legend |
Common, accesskey (Character) | (PCDATA | Inline)+ |
optgroup | Common, disabled ("disabled"), label* (Text) | option+ |
このモジュールは二つの内容セットを定義する:
このモジュールが使われるときは、テキスト・モジュールで定義されている、内容セット Block
に内容セット Form
を加え、内容セット Inline
に内容セット Formctrl
を加える。
caption, col, colgroup, table, tbody,
td, tfoot, th, thead, tr
要素 | 属性 | 最小内容モデル |
---|---|---|
caption |
Common | (PCDATA | Inline)* |
table |
Common, border (Pixels), cellpadding (Length), cellspacing (Length), datapagesize (CDATA), frame ("void" | "above" | below" | "hsides" | "lhs" | "rhs" | "vsides" | "box" | "border"), rules ("none" | "groups" | "rows" | "cols" | "all"), summary (Text), width (Length) | caption?, ( col* | colgroup* ), (( thead?, tfoot?, tbody+ ) | ( tr+ )) |
td |
Common, abbr (Text), align ("left" | "center" | "right" | "justify" | "char"), axis (CDATA), char (Character), charoff (Length), colspan (Number), headers (IDREFS), rowspan (Number), scope ("row", "col", "rowgroup", "colgroup"), valign ("top" | "middle" | "bottom" | "baseline") | (PCDATA | Flow)* |
th |
Common, abbr (Text), align ("left" | "center" | "right" | "justify" | "char"), axis (CDATA), char (Character), charoff (Length), colspan (Number), headers (IDREFS), rowspan (Number), scope ("row", "col", "rowgroup", "colgroup"), valign ("top" | "middle" | "bottom" | "baseline") | (PCDATA | Flow)* |
tr |
Common, align ("left" | "center" | "right" | "justify", "char"), char (Character), charoff (Length), valign ("top" | "middle" | "bottom" | "baseline") | (td | th)+ |
col |
Common, align ("left" | "center" | "right" | "justify", "char"), char (Character), charoff (Length), span (Number), valign ("top" | "middle" | "bottom" | "baseline"), width (MultiLength) | EMPTY |
colgroup |
Common, align ("left" | "center" | "right" | "justify", "char"), char (Character), charoff (Length), span (Number), valign ("top" | "middle" | "bottom" | "baseline"), width (MultiLength) | col* |
tbody |
Common, align ("left" | "center" | "right" | "justify", "char"), char (Character), charoff (Length), valign ("top" | "middle" | "bottom" | "baseline") | tr+ |
thead |
Common, align ("left" | "center" | "right" | "justify", "char"), char (Character), charoff (Length), valign ("top" | "middle" | "bottom" | "baseline") | tr+ |
tfoot |
Common, align ("left" | "center" | "right" | "justify", "char"), char (Character), charoff (Length), valign ("top" | "middle" | "bottom" | "baseline") | tr+ |
このモジュールが使われるときは、テキスト・モジュールの内容セット Block
に、 table
要素を追加する。
img
要素 | 属性 | 最小内容モデル |
---|---|---|
img |
Common, alt* (Text), height (Length), longdesc (URI), src* (URI), width (Length) | EMPTY |
このモジュールが使われるときは、テキスト・モジュールの内容セット Inline
に、 img
要素を追加する。
area, map
要素 | 属性 | 最小内容モデル |
---|---|---|
a& | coords (CDATA), shape ("rect" | "circle" | "poly" | "default") | n/a |
area | Common, accesskey (Character), alt* (Text), coords (CDATA), href (URI), nohref ("nohref"), shape ("rect"* | "circle" | "poly" | "default"), tabindex (Number) | EMPTY |
img& | usemap (IDREF) | n/a |
input& | usemap (IDREF) | n/a |
map | I18N, Events, class (NMTOKEN), id* (ID), title (CDATA) | ((Heading | Block) | area)+ |
object& | usemap (IDREF) | 注意:オブジェクト・モジュールが含まれている場合に限る |
このモジュールが使われるときは、テキスト・モジュールの内容セット Inline
に map
要素が追加される。
img
の ismap
属性
要素 | 属性 | 最小内容モデル | 注意 |
---|---|---|---|
img& | ismap ("ismap") | n/a | |
input& | ismap ("ismap") | n/a | フォームモジュール、もしくは基本フォームモジュールが選択されているとき |
object, param
要素 | 属性 | 最小内容モデル |
---|---|---|
object |
Common, archive (URIs), classid (URI), codebase (URI), codetype (ContentType), data (URI), declare ("declare"), height (Length), name (CDATA), standby (Text), tabindex (Number), type (ContentType), width (Length) | (PCDATA | Flow | param)* |
param |
id (ID), name* (CDATA), type (ContentType), value (CDATA), valuetype ("data"* | "ref" | "object") | EMPTY |
このモジュールが使われるときは、テキスト・モジュールの内容セット Inline
に、 object
要素を追加する。
要素 | 属性 | 注意 |
---|---|---|
a& | onblur (Script), onfocus (Script) | |
area& | onblur (Script), onfocus (Script) | Client-side Image Map Module も使われているとき |
frameset& | onload (Script), onunload (Script) | Frames Module も使われているとき |
form& | onreset (Script), onsubmit (Script) | Basic Forms か Forms Module が使われているとき |
body& | onload (Script), onunload (Script) | |
label& | onblur (Script), onfocus (Script) | Forms Module が使われているとき |
input& | onblur (Script), onchange (Script), onfocus (Script), onselect (Script) | Basic Forms or Forms Module が使われているとき |
select& | onblur (Script), onchange (Script), onfocus (Script) | Basic Forms か Forms Module が使われているとき |
textarea& | onblur (Script), onchange (Script), onfocus (Script), onselect (Script) | Basic Forms か Forms Module が使われているとき |
button& | onblur (Script), onfocus (Script) | Forms Module が使われているとき |
meta
要素 | 属性 | 最小内容モデル |
---|---|---|
meta |
I18N, content* (CDATA), http-equiv (NMTOKEN), name (NMTOKEN), scheme (CDATA) | EMPTY |
このモジュールが選択されたときは、構造モジュールで定義される head
要素タイプの内容モデルに、 meta
要素タイプが追加される。
noscript, script
要素 | 属性 | 最小内容モデル |
---|---|---|
noscript |
Common | (Heading | List | Block)+ |
script |
charset (Charset), defer ("defer"), src (URI), type* (ContentType), xml:space="preserve" | PCDATA |
このモジュールが使われるときは、テキスト・モジュールの内容セット Block
と Inline
に、 script
要素と noscript
要素が追加される。
加えて、構造モジュールで定義される head
要素の内容モデルに script
要素が追加される。
style
要素要素 | 属性 | 最小内容モデル |
---|---|---|
style |
I18N, media (MediaDesc), title (Text), type* (ContentType), xml:space="preserve" | PCDATA |
このモジュールが使われるときは、構造モジュールの head
要素の内容モデルに、 style
要素を追加する。
style
属性
スタイル属性モジュールは、 style
属性を定義する。
このモジュールが選択されると、スタイル属性集合を有効にする。
link
要素 | 属性 | 最小内容モデル |
---|---|---|
link |
Common, charset (Charset), href (URI), hreflang (LanguageCode), media (MediaDesc), rel (LinkTypes), rev (LinkTypes), type (ContentType) | EMPTY |
このモジュールが使われるときは、構造モジュールで定義される head
要素の内容モデルに、 link
要素を追加する。
base
要素 | 属性 | 最小内容モデル |
---|---|---|
base |
href* (URI) | EMPTY |
このモジュールが使われると、 base
要素を、構造モジュールの head
要素の内容モデルに追加する。
XHTML では、 [RUBY] で定義されている、ルビ注釈モジュール (Ruby Annotation Module) も利用している:
ruby, rbc, rtc, rb, rt, rp
要素 | 属性 | 最小内容モデル |
---|---|---|
ruby | Common | (rb, (rt | (rp, rt, rp))) |
rbc | Common | rb+ |
rtc | Common | rt+ |
rb | Common | (PCDATA | Inline - ruby)* |
rt | Common, rbspan (CDATA) | (PCDATA | Inline - ruby)* |
rp | Common | PCDATA* |
Ruby Annnotation モジュールは、 [XHTMLMOD] ではなく、 [RUBY] で定義されています。
文書型の DTD は、 XHTML 1.1 の [Appendix C] から提供されています。本稿では、基本的には概念モジュール定義に則って説明しますが、一部 DTD にまで立ち入って説明します。