XHTML 1.1 DTD


Document Structure & Optional Elements in head
html body head title link meta style

Elements

Document Structure

html (XHTML document element)

content
( %head.qname;, %body.qname; )
attributes
xmlns (URI = "http://www.w3.org/1999/xhtml")
version (CDATA)
I18n
minimal content model
head, body
ex.
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
description
XHTML文書のルート要素。html要素はhead要素とbody要素を一回ずつ、この順番で子要素として持つ事が必須です。xmlns属性では名前空間を宣言します。これは利用しているタグセットがXHTMLのものであることを示すために必要です。

head (document head)

content
( %HeadOpts.mix;, %title.qname;, %HeadOpts.mix; )
attributes
profile (URI)
I18n
minimal content model
title
ex.
<head>
    <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
    <link rev="made" href="mailto:b3@nurs.or.jp" />
    <link rel="next" type="text/html" href="./wu-tang.html" />
    <link rel="prev" type="text/html" href="./davo.html" />
    <link rel="stylesheet" type="text/css" href="main.css" />
    <title>roi君の秘密</title>
</head>
description
html要素の第一階層の子。head要素は、title要素を一つだけ子要素として持つことが必須とされています。head要素には文書のヘッダーとしての役割があり、%HeadOpts.mix;で定義されている、meta要素やlink要素等を含めることで、文書の作者やナビゲーション等の情報を記述することが出来ます。

body (document body)

content
( %Block.mix; )+
attributes
Common (class, I18N, id, title, Events, style)
minimal content model
(Heading | Block | List)*
ex.
<body id="team-one">
description
html要素の第一階層の子。%Block.mix;で定義されている要素を第一階層のノードにすることができます。裸のテキストやインラインレベルの要素を直接の子要素にすることはできません。

title (document title)

content
( #PCDATA )
attributes
I18n
minimal content model
PCDATA
ex.
<title>roi君の秘密</title>
description
head要素の第一階層の子。head要素はtitle要素を子として一つのみ必ず持たなければなりません。title要素はHTML文書で最も重要な要素の一つであり、その内容には留意すべきです。文書の内容をよく表す適切な名前をつけることが望ましいとされています。

ex.

最小限の要素で構成された、正しいXHTML文書の例です。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>roi君の秘密</title>
    </head>
    <body>
        <p>roi君は本当はアレなんだよ。</p>
    </body>
</html>

Link Element

content
EMPTY
attributes
Common (class, I18N, id, title, Events, style)
charset (Charset)
href (URI)
hreflang (LanguageCode)
media (MediaDesc)
rel (LinkTypes)
rev (LinkTypes)
type (ContentType)
minimal content model
EMPTY
ex.
<link rev="made" href="mailto:b3@nurs.or.jp" />
<link rel="next" type="text/html" href="./wu-tang.html" />
<link rel="prev" type="text/html" href="./davo.html" />
<link rel="stylesheet" type="text/css" href="main.css" />
description
head要素の第一階層の子。head要素は任意の個数のlink要素を子に持つ事ができます。link要素は外部の資源へのドキュメントレベルリンクを定義するために使用されます。例えばstart, contents, previous, next, index, end, helpといったナビゲーションのためのリンクやCSSへのリンク等です。

Metainformation

meta (generic metainformation)

content
EMPTY
attributes
I18n
content (CDATA) #REQUIRED
http-equiv (NMTOKEN)
name (NMTOKEN)
scheme (CDATA)
minimal content model
EMPTY
ex.
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="robots" content="ALL" />
<meta name="keywords" content="team-one, mako, まこ, みそ" />
<meta name="description" content="まこが繰り広げる味噌ストーリー第一話" />
<meta name="Author" content="team-one味噌製作委員会" />
description
head要素の第一階層の子。head要素は任意の個数のmeta要素を子に持つ事ができます。meta要素は、文書の作者といったメタ情報を記述するための要素です。name属性にプロパティの名称を、content属性にそのプロパティの値を指定します。xml:lang属性(I18n)では値に使われている言語を指定します。また、http-equiv属性を使ってプロパティを定義することで、UAからリソースの要求があった際にサーバーから返されるHTTPヘッダに文書のMIMEタイプや文字コード等のメタ情報を付加することができます。

Style Sheets

style (style sheet information)

content
( #PCDATA )
attributes
I18n
type (ContentType) #REQUIRED
media (MediaDesc)
title (Text)
xml:space="preserve"
minimal content model
PCDATA
ex.
<style type="text/css" media="screen,print">
p.roiroi {
    color : pink;
}
</style>
description
head要素の第一階層の子。head要素は任意の個数のstyle要素を子に持つ事ができます。style要素はその文書にCSSをじかに埋め込む為に使われます。type属性は必須です。従来のHTMLと違い、内容が解析対象となる文字データ(Processed Character DATA)のため、これまで推奨されていたstyle要素内容をコメントで囲う手法では、UAがXHTMLを正しく解釈した場合、コメント(<!-- -->)が解釈されてしまい内容部分は無視されます。ですから、XHTMLではstyle要素を使うより、link要素を使って外部CSSを読み込む方法の方がより確実です。

Text

Inline Structural

br (forced line break)

content
EMPTY
attributes
Core (class, id, title)
minimal content model
EMPTY
ex.
瀬をはやみ<br />
岩にせかるる<br />
滝川の<br />
われても末に<br />
逢はむとぞ思ふ
description
強制改行。

span (generic inline container)

content
( #PCDATA | %Inline.mix; )*
attributes
Common
minimal content model
(PCDATA | Inline)*

Inline Phrasal

This module declares the elements and their attributes used to support inline-level phrasal markup.

abbr, acronym, cite, code, dfn, em, kbd, samp, strong, var

content
( #PCDATA | %Inline.mix; )*
attributes
Common
minimal content model
(PCDATA | Inline)*

q

content
( #PCDATA | %Inline.mix; )*
attributes
Common
cite %URI.datatype;
minimal content model
(PCDATA | Inline)*

Block Structural

This module declares the elements and their attributes used to support block-level structural markup.

div

content
( #PCDATA | %Flow.mix; )*
attributes
Common
minimal content model
(PCDATA | Flow)*

p

content
( #PCDATA | %Inline.mix; )*
attributes
Common
minimal content model
(PCDATA | Inline)*

Block Phrasal

This module declares the elements and their attributes used to support block-level phrasal markup.

address

content
( #PCDATA | %Inline.mix; )*
attributes
Common
minimal content model
(PCDATA | Inline)*

blockquote

content
( %Block.mix; )+
attributes
Common
cite %URI.datatype;
minimal content model
(PCDATA | Heading | Block | List)*

pre

content
( #PCDATA | %InlStruct.class; %InlPhras.class; | %tt.qname; | %i.qname; | %b.qname; %I18n.class; %Anchor.class; | %script.qname; | %map.qname; %Inline.extra; )*
attributes
Common
xml:space ( preserve )
minimal content model
(PCDATA | Inline)*

h1, h2, h3, h4, h5, h6

content
( #PCDATA | %Inline.mix; )*
attributes
Common
minimal content model
(PCDATA | Inline)*

Hypertext (required)

This module declares the anchor ('a') element type, which defines the source of a hypertext link. The destination (or link 'target') is identified via its 'id' attribute rather than the 'name' attribute as was used in HTML.

a (anchor)

content
( #PCDATA | %InlNoAnchor.mix; )*
attributes
Common
href %URI.datatype;
charset %Charset.datatype;
type %ContentType.datatype;
hreflang %LanguageCode.datatype;
rel %LinkTypes.datatype;
rev %LinkTypes.datatype;
accesskey %Character.datatype;
tabindex %Number.datatype;
minimal content model
(PCDATA | Inline - a)*

Lists (required)

This module declares the list-oriented element types and their attributes.

dl (definition list)

content
( %dt.qname; | %dd.qname; )+
attributes
Common

dt (definition term)

content
( #PCDATA | %Inline.mix; )*
attributes
Common

dd (definition description)

content
( #PCDATA | %Flow.mix; )*
attributes
Common

ol (ordered list - numbered styles)

content
( %li.qname; )+
attributes
Common

ul (bullet styles)

content
( %li.qname; )+
attributes
Common

li (list item)

content
( #PCDATA | %Flow.mix; )*
attributes
Common

Editing Elements

BIDI Override Element

Ruby

Presentation

Base Element

Scripting

Images

Image Maps

Server-side Image Maps

Param Element

Embedded Object

Tables

Forms

Legacy Markup(ignore)

Document Model

Optional Elements in head

HeadOpts.mix
script, style, meta, link, object

All Content Elements

Inline.mix
%Inline.class; %Misc.class;

includes all inline elements, including %Misc.class;

Block.mix
%Heading.class; %List.class; %Block.class; %Misc.class;

includes all block elements plus %Misc.class;

Flow.mix
%Heading.class; %List.class; %Block.class; %Inline.class; %Misc.class;

includes all text content, block and inline

Misc.class
%Edit.class; %Script.class; %Misc.extra;

These elements are neither block nor inline, and can essentially be used anywhere in the document body.

Edit.class
ins, del

ins and del are used to denote editing changes

Script.class
script, noscript

script and noscript are used to contain scripts and alternative content

Misc.extra
--
Inline.class
%InlStruct.class; %InlPhras.class; %InlPres.class; %I18n.class; %Anchor.class; %InlSpecial.class; %InlForm.class; %Ruby.class; %Inline.extra;

includes all inline elements, used as a component in mixes

InlStruct.class
br, span
InlPhras.class
em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym, q
InlPres.class
tt, i, b, big, small, sub, sup
I18n.class
bdo
Anchor.class
a
InlSpecial.class
img, map, object
InlForm.class
input, select, textarea, label, button
Ruby.class
ruby
Inline.extra
--
InlNoRuby.class
%InlStruct.class; %InlPhras.class; %InlPres.class; %I18n.class; %Anchor.class; %InlSpecial.class; %InlForm.class; %Inline.extra;

except ruby, used as a component in mixes

NoRuby.content
( #PCDATA | %InlNoRuby.class; %Misc.class; )*

includes all inlines except ruby

InlNoAnchor.class
%InlStruct.class; %InlPhras.class; %InlPres.class; %I18n.class; %InlSpecial.class; %InlForm.class; %Ruby.class; %Inline.extra;

includes all non-anchor inlines, used as a component in mixes

InlNoAnchor.mix
%InlNoAnchor.class; %Misc.class;

includes all non-anchor inlines

Block.class
%BlkStruct.class; %BlkPhras.class; %BlkPres.class; %BlkSpecial.class; %Block.extra;

includes all block elements, used as an component in mixes

BlkStruct.class
p, div
BlkPhras.class
pre, blockquote, address
BlkPres.class
hr
BlkSpecial.class
%Table.class; %Form.class; %Fieldset.class;
Table.class
table
Form.class
form
Fieldset.class
fieldset
Block.extra
--
Heading.class
h1, h2, h3, h4, h5, h6
List.class
ul, ol, dl