L
次のページ
H
前のページ
U
上のページ

« Mac_Stripe-XHTML_Strict-ja | Main | Mac_Stripe-XHTML_Strict-ja の2005年10月29日の更新のお知らせ »

2005年10月29日

文書の適合性(Mac_Stripe-XHTML_Strict-ja 解説)

Mac_Stripe-XHTML_Strict-ja に含まれるテンプレートにおいてオリジナルとは異なる部分のうち、文書の適合性に関する箇所について解説をします。

XML 宣言(推奨事項)

オリジナルコード
(なし)
改良コード
<?xml version="1.0" encoding="<$Charset$>" ?>
根拠
XHTML 1.0: 拡張可能 ハイパーテキスト マークアップ言語 (第二版)」の「3.1.1 厳密適合文書」より

An XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents.

XML 宣言は全ての XML 文書で必須というわけではない。しかしながら XHTML 文書作成者はその全ての文書の中で XML 宣言を使用するように強く推奨される。

対象
  • archive.template
  • category.template
  • entry.template
  • index.template
  • main.template

文書型宣言(必須事項)

オリジナルコード
(なし)
改良コード
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
根拠
XHTML 1.0: 拡張可能 ハイパーテキスト マークアップ言語 (第二版)」の「3.1.1 厳密適合文書」より

The root element of the document must be html.

文書の root 要素は html でなければならない。

および同セクションの次の箇所。

There must be a DOCTYPE declaration in the document prior to the root element.

その root 要素に先立って文書には DOCTYPE 宣言がなければならない。

対象
  • archive.template
  • category.template
  • entry.template
  • index.template
  • main.template

html 要素の xmlns 属性(必須事項)

オリジナルコード
<html>
改良コード
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<$Lang$>" lang="<$Lang$>">
根拠
XHTML 1.0: 拡張可能 ハイパーテキスト マークアップ言語 (第二版)」の「3.1.1 厳密適合文書」より

The root element of the document must contain an xmlns declaration for the XHTML namespace [XMLNS]. The namespace for XHTML is defined to be http://www.w3.org/1999/xhtml.

文書のその root 要素は XHTML 名前空間 [XMLNS] のための xmlns 宣言を含んでいなければならない。XHTML のための名前空間は http://www.w3.org/1999/xhtml と定義される。

対象
  • archive.template
  • category.template
  • entry.template
  • index.template
  • main.template

html 要素の lang 属性(推奨事項)

オリジナルコード
<html>
改良コード
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<$Lang$>" lang="<$Lang$>">
根拠
Web コンテンツ アクセシビリティ ガイドライン」の「4.3 文書の主な自然言語の識別。 [優先度 3]」に次のように書かれている。

For example, in HTML set the "lang" attribute on the HTML element.

例えば、HTML では HTML 要素に "lang" 属性を設定すること。

対象
  • archive.template
  • category.template
  • entry.template
  • index.template
  • main.template

html 要素の xml:lang 属性(推奨事項)

lang 属性を付けるという条件下で必須事項です。

オリジナルコード
<html>
改良コード
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<$Lang$>" lang="<$Lang$>">
根拠
XHTML 1.0: 拡張可能 ハイパーテキスト マークアップ言語 (第二版)」の「C.7. langxml:lang 属性」より

Use both the lang and xml:lang attributes when specifying the language of an element.

要素の言語を指定するときは langxml:lang 属性の両方を使用すること。

対象
  • archive.template
  • category.template
  • entry.template
  • index.template
  • main.template
  • Posted by OKAMURA at 03時18分
  • Edited on: 2005年10月29日 03時44分
  • Categories: 解説