スキップメニュー:コンテンツへナビゲーションへ

乱雑モックアップ   らんざつ[乱雑] (名・形動)[文]ナリ 入り乱れていること。乱れていて秩序がないこと。また、そのさま。

xhtmlのxml宣言

2009年 9月 16日 |

html/css |

このエントリをはてなブックマークに追加このエントリをdel.icio.usに追加このエントリをLivedoor Clipに追加このエントリーのブックマーク数
<?xml version="1.0" encoding="UTF-8" ?>

cssに慣れてきてからというもの、xml宣言をしてIE6で互換モードになろうが
コーディングしていてレイアウト上で致命的に困る事なんて全くなかったので飾りとして付けてた
けれど外してみることにした。

「text/htmlでのxml宣言の必要性」あたりで検索してみると色々な考察や解釈が得られる
エキサイト翻訳で読んでみるとtext/htmlの場合はxml宣言がいらないように思えた。

2009年1月16日
http://www.w3.org/TR/xhtml-media-types/#text-html

XHTML documents served as ‘text/html’ will not be processed as XML [XML10], e.g., well-formedness errors may not be detected by user agents. Also be aware that HTML rules will be applied for DOM and style sheets (see guidelines 11 and 13).

Authors should also be careful about character encoding issues. See guideline 1 and guideline 9 for details.

2002年8月1日
http://www.w3.org/TR/2002/NOTE-xhtml-media-types-20020801/#text-html

A typical misunderstanding is that since an XHTML document is an XML document, the character encoding of an XHTML document should be treated as UTF-8 or UTF-16 in the absence of an explicit character encoding information. This is NOT the case when an XHTML document is served as ‘text/html’.

あと関係ないけど
http://www.w3.org/TR/xhtml-media-types/#C_11

A.11. Document Object Model and XHTML
Rationale: This will ensure maximum portability of scripts, since the DOM methods will return element and attribute names in uppercase when served as text/html and in lowercase when served as application/xhtml+xml.

text/htmlだと大文字で返して(return element and attribute names in uppercase)、application/xhtml+xmlだと小文字で返すみたい
前回のエントリーでtagNameが大文字になるのはそうゆう事だったのか。


コメントはまだありません »

コメントはまだありません。

この投稿へのコメントの RSS フィード。 TrackBack URL

コメントする

You can add images to your comment by clicking here.




Back to Top↑

あわせて読みたい

Back to Top↑

RSS 乱雑モックアップのフィード

Copyright © 乱雑モックアップ. All Rights Reserved.