[PRE[ page-icon="HTML" import="HTML訳語集,メッセージ訳語集,その他の訳語集" ]PRE] [1] [[HTML]] の[[媒体型]]です。 [[#comment]] * パラメーター →[[.//引数]] * text/html 媒体型と文書型宣言の補完 [15] [[素のSGML]] では[[文書型宣言]]は必須であるにも拘らず、 HTML 文書の文書型宣言は歴史的に省略されてきました。 [WEAK[HTML UA は普通 SGML 解析器ではないので、文書型宣言は存在意義がなかったのです。]] この点において SGML との整合性のために、 初期の HTML 仕様では MIME の媒体型指定が文書型宣言を暗示しているとこじつけています。 - [16] [[HTML3.0]] draft では、 [SAMP(HTML)[]] で文書を始めることを推奨しつつも、 [CODE(MIME)[text/html; [[version]]=3.0]] であればこの文書型宣言を暗示するとされています (The Structure of HTML 3.0 Documents 参照)。 [[#comment]] * XHTML と text/html [9] [[XHTML1.0]] は、附属書 C の互換性の手引きに従った [[XHTML]] 文書は [CODE[text/html]] としても''良い''としています。 ''XHTML Media Types'' ([[W3C]] [[Note]]) は、 XHTML 1.0 は互換性の手引きに従っていれば [CODE[text/html]] にしてもよく、従っていない場合やそれ以外の [[XHTML]] では [[application/xhtml+xml]] などを使うべきとしています。 [10] 実際には、 1.0 以外の [[XHTML1]] や互換性の手引きに従っていないものにも [CODE[text/html]] が使われています。これは、 [CODE[application/xhtml+xml]] を [[IE]] が未だに対応していないことなどによるものです。 私見では、 1.0 以外の XHTML 1 であっても、 互換性の手引きに従っていて、実際 [[NET]] などを除いて [[HTML4]] と互換であると著者が判断したのであれば [CODE[text/html]] と札付けしても問題ないと思います。 (ほとんど違いのない XHTML 1.0 Strict ではよくて、 XHTML 1.1 では駄目というのは不条理でしょう。 [[usemap]] 属性などの一部の非互換なものを使っていない限りは。) [19] ''Sending XHTML as text/html Considered Harmful'' [[Ian Hickson]] の XHTML を [CODE(MIME)[text/html]] で送るなという話。 [[Web Forms 2.0]] で XHTML 版を [CODE(MIME)[text/html]] で送るなとくどく書かれているのはこういう訳か。 ([[名無しさん]]) [20] [CITE[Re: Sniffing XHTML sent as text/html from Steven Pemberton on 2000-09-13 (www-html@w3.org from September 2000)]] [[W3C]] [[HTML WG]] は、 [CODE(MIME)@en[[[text/html]]]] で送られた [[XHTML]] [[文書]]は [[HTML]] として解釈するべきであるとの見解。 ([[名無しさん]] [sage]) [21] [CITE[HTML Working Group Voyager Issue Tracking System - XHTML-1.0/6232]] 互換性指針のいくつかの問題について、 [[W3C]] [[HTML WG]]は直す意思が無いらしい。 ([[名無しさん]] [sage]) [22] [CITE[h3h.net » Blog Archive » Sending XHTML as text/html Considered Harmful to Feelings]] ([[名無しさん]]) [23] [CITE[Bug 1500 - XHTML-sent-as-text/html is parsed as XML]] ([[名無しさん]]) [24] [[Google Desktop]] は [CODE(MIME)@en[[[text/html]]]] で、 [[文書型宣言]]は [[XHTML 1.0]] の [[DTD]] を[[参照]]しておりますが、かなりひどい [[tag soup]] です。[[空要素タグ]]が[[開始タグ]]と同じだとかいうレベルではなく、 [[属性値]]が[[引用符]]で囲まれていないとか、 非[[妥当]]な[[属性]]が使われているとか。 ([[名無しさん]] [WEAK[2007-02-26 12:40:20 +00:00]]) [25] [CITE@en[TAG telcon -- 19 Mar 2007]] ([CODE[2007-03-20 02:29:14 +09:00]] 版) ([[名無しさん]] [WEAK[2007-03-20 01:52:07 +00:00]]) [26] [[XHTML Basic 1.1]]: [CITE[xhtml-basic/Overview.mhtml - diff - 1.21.2.61]] ([CODE[2007-03-26 16:53:21 +09:00]] 版) > Changed media type as per meeting on 21 March 2007. 元に戻りました。 ([[名無しさん]] [WEAK[2007-03-26 07:55:54 +00:00]]) [27] [[XHTML Basic 1.1]]: [CITE[xhtml-basic/Overview.mhtml - diff - 1.21.2.61]] ([CODE[2007-03-26 16:53:21 +09:00]] 版) > Changed media type as per meeting on 21 March 2007. 元に戻りました。 ([[名無しさん]] [WEAK[2007-03-26 07:56:13 +00:00]]) [28] >>27 いまのところ [[XHTML 1.1]] はそのままのようです。。。 ([[名無しさん]] [WEAK[2007-03-26 08:08:34 +00:00]]) [29] [CITE@en[FW: Agenda: HTML media type]] ([[Grosso, Paul]] 著, [CODE[2007-02-16 23:52:17 +09:00]] 版) ([[名無しさん]]) [30] [CITE@en[Re: '''['''XHTML1.1''']''' Error in Conformance Definition document?]] ([[Shane McCarron]] 著, [CODE[2007-04-02 22:16:44 +09:00]] 版) > To short circuit it, this was my editorial error. ([[名無しさん]] [WEAK[2007-04-03 12:55:59 +00:00]]) [31] [CITE[Geoffers’ » Why XHTML As text/html Is Evil]] ([CODE[2007-04-08 12:36:21 +09:00]] 版) ([[名無しさん]] [WEAK[2007-04-08 03:37:17 +00:00]]) [32] [CITE@ja[「XHTML文書」を text/html として認識させるべからず @ ぽかぽかWeb研究室]] ([CODE[2007-04-28 12:35:35 +09:00]] 版) ([[名無しさん]]) [33] [CITE@en[Re: XHTML 1.1 (Feb 2007 WD) as text/html?]] ([[Mark Birbeck]] 著, [TIME[2007-10-02 19:43:45 +09:00]] 版) やれやれ。 ([[名無しさん]]) [[#comment]] * 仕様から ** RFC 1866 (HTML 2.0) 4. HTML as an Internet Media Type > An HTML user agent allows users to interact with resources which have HTML representations. At a minimum, it must allow users to examine and navigate the content of HTML level 1 documents. HTML user agents should be able to preserve all formatting distinctions represented in an HTML document, and be able to simultaneously present resources referred to by IMG elements (they may ignore some formatting distinctions or IMG resources at the request of the user). Level 2 HTML user agents should support form entry and submission. HTML __&&user agent&&__は利用者が HTML 表現を持つ資源と相互作用することを可能とします。 少なくても、__&&user agent&&__は利用者が HTML __&&level&&__ 1 文書の内容を検査し案内することを可能としなければなりません。 HTML __&&user agent&&__は HTML 文書中に表現されている全ての整形上の差異を保持し、 同時に [CODE(HTML)[IMG]] 要素が参照している資源を表現することが出来るべきです (UA は利用者の要求で整形上の差異や [CODE(HTML)[IMG]] 資源を無視しても構いません)。__&&level&&__ 2 HTML __&&user agent&&__は__&&form&&__ 項目及び__&&submission&&__に対応するべきです。 *** 4.1. text/html media type > This specification defines the Internet Media Type [IMEDIA] (formerly referred to as the Content Type [MIME]) called `text/html'. The following is to be registered with [IANA]. この仕様書は [CODE[text/html]] という__&&Internet Media Type&&__ (かつては__&&content type&&__と呼ばれていたもの。) を定義します。次を IANA に登録します。 :Media Type name:text :Media subtype name:html :Required parameters:none :Optional parameters:level, charset :Encoding considerations:any encoding is allowed :Security considerations:see 10, "Security Considerations" > The optional parameters are defined as follows: 省略可能__&¶meter&&__は次の通り定義します。 > Level > The level parameter specifies the feature set used in the document. The level is an integer number, implying that any features of same or lower level may be present in the document. Level 1 is all features defined in this specification except those that require the
element. Level 2 includes form processing. Level 2 is the default. [CODE(HTML)[level]] __&¶meter&&__はこの文書で使われている機能の集合を指定します。 [CODE(HTML)[level]] は1つの整数で、 文書中にはその数値以下の__&&level&&__の機能が出現し得ます。 __&&level&&__ 1 はこの仕様書で定義された機能のうち [CODE(HTML)[]] __&&element&&__を必要とする物を除く全ての機能です。 __&&level&&__ 2 は__&&form&&__処理を含みます。 __&&level&&__ 2 が既定値です。 > Charset > The charset parameter (as defined in section 7.1.1 of RFC 1521[MIME]) may be given to specify the character encoding scheme used to represent the HTML document as a sequence of octets. The default value is outside the scope of this specification; but for example, the default is `US-ASCII' in the context of MIME mail, and `ISO-8859-1' in the context of HTTP [HTTP]. [CODE(MIME)[charset]] __&¶meter&&__は ([[RFC1521]] の7.1.1節で定義された通り)、オクテットの連続として HTML 文書を表現するのに使う文字符号化方式を指定します。 既定値はこの仕様書の適用範囲外です。しかし例えば、 MIME __&&mail&&__の文脈では既定値は [CODE(charset)[US-ASCII]] ですし、 HTTP の文脈では [CODE(charset)[ISO-8859-1]] です。 *** 4.2. HTML Document Representation [INS[HTML 文書表現]] > A message entity with a content type of `text/html' represents an HTML document, consisting of a single text entity. The `charset' parameter (whether implicit or explicit) identifies a character encoding scheme. The text entity consists of the characters determined by this character encoding scheme and the octets of the body of the message entity. __&&content type&&__が [CODE[text/html]] の__&&message&&____&&entity&&__は一つの__&&text entity&&__で構成される HTML 文書を表します。 [CODE(MIME)[charset]] __&¶meter&&__は (暗示であれ明示であれ) 文字符号化方式を識別します。 この文字符号化方式で決定される文字と__&&message&&____&&entity&&__の__&&body&&__のオクテットで__&&text entity&&__は構成されます。 **** 4.2.1. Undeclared Markup Error Handling [INS[未宣言__&&markup&&____&&error&&__の取扱い]] > To facilitate experimentation and interoperability between implementations of various versions of HTML, the installed base of HTML user agents supports a superset of the HTML 2.0 language by reducing it to HTML 2.0: markup in the form of a start-tag or end-tag, whose generic identifier is not declared is mapped to nothing during tokenization. Undeclared attributes are treated similarly. The entire attribute specification of an unknown attribute (i.e., the unknown attribute and its value, if any) should be ignored. On the other hand, references to undeclared entities should be treated as data characters. > For example: [PRE[

foo

...

=>

,"foo",

,

,"..." xxx

yyy => "xxx ",

," yyy Let α & β be finite sets. => "Let α & β be finite sets." ]PRE] > Support for notifying the user of such errors is encouraged. > Information providers are warned that this convention is not binding: unspecified behavior may result, as such markup does not conform to this specification. **** 4.2.2. Conventional Representation of Newlines [INS[慣習的な改行の表現]] > SGML specifies that a text entity is a sequence of records, each beginning with a record start character and ending with a record end character (code positions 10 and 13 respectively) (section 7.6.1, "Record Boundaries" in [SGML]). SGML は__&&text entity&&__を__&&record&&__の連続と規定しており、各__&&record&&__は__&&record&&__開始文字で始まり__&&record&&__終了文字で終わります。 両文字はそれぞれ符号位置 [CODE[10]] と [CODE[13]] です。 (SGML の7.6.1節「記録の境界」[INS[訳注: JIS X 4151-1992 では6.6.1]] 参照。) > [MIME] specifies that a body of type `text/*' is a sequence of lines, each terminated by CRLF, that is, octets 13, 10. MIME は__&&type&&__ [CODE[text/*]] の__&&body&&__を行の連続と規定しており、それぞれは CRLF, つまりオクテット [CODE[13]] 及び [CODE[10]] で終端されます。 > In practice, HTML documents are frequently represented and transmitted using an end of line convention that depends on the conventions of the source of the document; frequently, that representation consists of CR only, LF only, or a CR LF sequence. Hence the decoding of the octets will often result in a text entity with some missing record start and record end characters. 実際には、 HTML 文書は文書の出典の環境に依存した行末記法を使ってよく表現されます。 それは CR だけであったり LF だけであったり CR LF であったりします。 従ってオクテットの復号の時に__&&text entity&&__の__&&record&&__開始や__&&record&&__終了の文字が欠けていることがよくあります。 > Since there is no ambiguity, HTML user agents are encouraged to infer the missing record start and end characters. 曖昧さはありませんから、 HTML __&&user agent&&__は欠けた__&&record&&__開始・終了両文字を推測することを推奨します。 > An HTML user agent should treat end of line in any of its variations as a word space in all contexts except preformatted text. Within preformatted text, an HTML user agent should treat any of the three common representations of end-of-line as starting a new line. HTML __&&user agent&&__は整形済み__&&text&&__を除く全ての場面において、 全ての種類の行末を語間隔として取扱うのが良いです。 整形済み__&&text&&__中では、 HTML __&&user agent&&__は3つの行末のよく使われる表現を新しい行の開始として取扱うのが良いです。 ** HTML 4 [17] HTML 4 は、 で [CODE(MIME)[text/html]] を定義しています。 それによれば、引数は [CODE(MIME)[charset]] (省略可能、指定することを推奨) だけ、 [[内容転送符号化]]には任意のものを使用できます。 [18] 重要なことに、一般に [[HTTP]] では [CODE(MIME)[charset]] 引数の既定値は [CODE(charset)[[[ISO-8859-1]]]] ですが、 実際にはちゃんとなってないことが多いから [[HTML利用者エージェント]]は既定値を仮定してはならないとされています。 [[#comment]] * メモ - [8] '''HTML Dialects: Internet Media and SGML Document Types''' - [11] ''W3C WD: HTML Dialects: Internet Media Types and SGML Document Types'' - [12] , , , , - [13] [14] ''XHTML 1.0: The Extensible HyperText Markup Language (Second Edition) : 5.1. Internet Media Type'' は、 > XHTML Documents which follow the guidelines set forth in Appendix C, "HTML Compatibility Guidelines" may be labeled with the Internet Media Type "text/html" [RFC2854], as they are compatible with most HTML browsers. > 附属書 C 『[[HTML互換性指針]]』に示した指針に従った [[XHTML]] [[文書]]は、ほとんどの HTML [[ブラウザ]]と互換ですから、__&&Internet Media Type&&__ [CODE[text/html]] で札付けしても構いません ([[may]])。 [[#comment]] * memo