#pattern * The HTML syntax #ja $1 HTML 構文 #pattern * Writing HTML documents #ja $1 HTML 文書を書く #en This section only applies to documents, authoring tools, and markup generators. In particular, it does not apply to conformance checkers; conformance checkers must use the requirements given in the next section ("parsing HTML documents"). #ja この節は文書、著述ツール、マーク付け生成器にのみ適用されます。 特に、適合性検査器には適用されません。 適合性検査器は次の節 (「HTML 文書の構文解析」) で与えられる要件を用いなければ[[MUST:なりません]]。 #en Documents must consist of the following parts, in the given order: #ja 文書は、次に示す部分により、次の順序で構成されなければ[[MUST:なりません]]。 #en Optionally, a single U+FEFF BYTE ORDER MARK (BOM) character. #ja 任意選択で、1つの U+FEFF BYTE ORDER MARK (BOM) 文字。 #en Any number of comments and space characters. #ja 任意の個数の注釈間隔文字。 #en A DOCTYPE. #ja DOCTYPE。 #en The root element, in the form of an html element. #ja 根要素を html 要素の形で。 #en The various types of content mentioned above are described in the next few sections. #ja 前述の各種の内容は、次の数個の節で説明します。 #en In addition, there are some restrictions on how character encoding declarations are to be serialized, as discussed in the section on that topic. #ja 加えて、文字符号化宣言をどう直列化するかについても、 それに関する節で説明した通り、いくつかの制限があります。 #en Space characters before the root html element, and space characters at the start of the html element and before the head element, will be dropped when the document is parsed; space characters after the root html element will be parsed as if they were at the end of the body element. Thus, space characters around the root element do not round-trip. #ja 根 html 要素の前の間隔文字や、 html 要素のはじめで head 要素の前の間隔文字は、 文書が構文解析される時に除去されます。根 html 要素のの間隔文字は、 body 要素の終わりにあったものとして構文解析されます。 従って、根要素の近辺の間隔文字は往復しません。 #en It is suggested that newlines be inserted after the DOCTYPE, after any comments that are before the root element, after the html element's start tag (if it is not omitted), and after any comments that are inside the html element but before the head element. #ja DOCTYPE の後、 根要素の前の注釈がある場合はその後、 html 要素の開始タグの後 (省略しない場合)、 html 要素中で head 要素の前に注釈がある場合にはその後には、 改行を挿入することをおすすめします。 #en Many strings in the HTML syntax (e.g. the names of elements and their attributes) are case-insensitive, but only for characters in the ranges U+0041 .. U+005A (LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z) and U+0061 .. U+007A (LATIN SMALL LETTER A to LATIN SMALL LETTER Z). For convenience, in this section this is just referred to as "case-insensitive". #ja HTML 構文中の多くの文字列 (例えば要素や属性の名前) は大文字と小文字を区別しませんが、 区別しないのは範囲 U+0041 ~ U+005A (LATIN CAPITAL LETTER A ~ LATIN CAPITAL LETTER Z) と 範囲 U+0061 ~ U+007A (LATIN SMALL LETTER A ~ LATIN SMALL LETTER Z) の文字についてのみです。便宜上、この節ではこれを単に「大文字・小文字を区別しない」と呼びます。 #pattern * The DOCTYPE #ja $1 DOCTYPE #en A DOCTYPE is a mostly useless, but required, header. #ja DOCTYPE はほとんど無意味ですが、 [[REQUIRED:必須]]の頭部です。 #en DOCTYPEs are required for legacy reasons. When omitted, browsers tend to use a different rendering mode that is incompatible with some specifications. Including the DOCTYPE in a document ensures that the browser makes a best-effort attempt at following the relevant specifications. #ja DOCTYPE は遺物的な理由で[[REQUIRED:必須]]です。 省略すると、ブラウザはいくつかの仕様書と非互換な異なるレンダリング・モードを使おうとします。 DOCTYPE を文書に含めることによってブラウザに関係する仕様書に従うよう最善の努力を試みさせるようにします。 #en A DOCTYPE must consist of the following characters, in this order: #ja DOCTYPE は、次の文字により次の順序で構成されなければ[[MUST:なりません]]。 #en A U+003C LESS-THAN SIGN (<) character. #ja U+003C LESS-THAN SIGN (<) 文字。 #en A U+0021 EXCLAMATION MARK (!) character. #ja U+0021 EXCLAMATION MARK (!) 文字。 #en A U+0044 LATIN CAPITAL LETTER D or U+0064 LATIN SMALL LETTER D character. #ja U+0044 LATIN CAPITAL LETTER D 文字か U+0064 LATIN SMALL LETTER D 文字。 #en A U+004F LATIN CAPITAL LETTER O or U+006F LATIN SMALL LETTER O character. #ja U+004F LATIN CAPITAL LETTER O 文字か U+006F LATIN SMALL LETTER O 文字。 #en A U+0043 LATIN CAPITAL LETTER C or U+0063 LATIN SMALL LETTER C character. #ja U+0043 LATIN CAPITAL LETTER C 文字か U+0063 LATIN SMALL LETTER C 文字。 #en A U+0054 LATIN CAPITAL LETTER T or U+0074 LATIN SMALL LETTER T character. #ja U+0054 LATIN CAPITAL LETTER T 文字か U+0074 LATIN SMALL LETTER T 文字。 #en A U+0059 LATIN CAPITAL LETTER Y or U+0079 LATIN SMALL LETTER Y character. #ja U+0059 LATIN CAPITAL LETTER Y 文字か U+0079 LATIN SMALL LETTER Y 文字。 #en A U+0050 LATIN CAPITAL LETTER P or U+0070 LATIN SMALL LETTER P character. #ja U+0050 LATIN CAPITAL LETTER P 文字か U+0070 LATIN SMALL LETTER P 文字。 #en A U+0045 LATIN CAPITAL LETTER E or U+0065 LATIN SMALL LETTER E character. #ja U+0045 LATIN CAPITAL LETTER E 文字か U+0065 LATIN SMALL LETTER E 文字。 #en One or more space characters. #ja 1つ以上の間隔文字。 #en A U+0048 LATIN CAPITAL LETTER H or U+0068 LATIN SMALL LETTER H character. #ja U+0048 LATIN CAPITAL LETTER H 文字か U+0068 LATIN SMALL LETTER H 文字。 #en A U+004D LATIN CAPITAL LETTER M or U+006D LATIN SMALL LETTER M character. #ja U+004D LATIN CAPITAL LETTER M 文字か U+006D LATIN SMALL LETTER M 文字。 #en A U+004C LATIN CAPITAL LETTER L or U+006C LATIN SMALL LETTER L character. #ja U+004C LATIN CAPITAL LETTER L 文字か U+006C LATIN SMALL LETTER L 文字。 #en Zero or more space characters. #ja 零個以上の間隔文字。 #en A U+003E GREATER-THAN SIGN (>) character. #ja U+003E GREATER-THAN SIGN (>) 文字。 #en In other words, <!DOCTYPE HTML>, case-insensitively. #ja つまり、大文字または小文字の <!DOCTYPE HTML> です。 #pattern * Elements #ja $1 要素 #en There are five different kinds of elements: void elements, CDATA elements, RCDATA elements, foreign elements, and normal elements. #ja 要素には5種類あります。 空隙要素、 CDATA 要素、 RCDATA 要素、外来要素、通常要素です。 #en Void elements #ja 空隙要素 #en CDATA elements #ja CDATA 要素 #en RCDATA elements #ja RCDATA 要素 #en Foreign elements #ja 外来要素 #en Elements from the MathML namespace #en Normal elements #ja 通常要素 #en All other allowed HTML elements are normal elements. #ja 他の全ての認められているHTML 要素は通常要素です。 #en The root element, in the form of an html element. #ja 根要素を、 html 要素として。 #en Optionally, a DOCTYPE legacy string (defined below). #ja 任意選択で、 DOCTYPE 遺物文字列 (後で定義します)。 #en In other words, <!DOCTYPE HTML>, case-insensitively. #ja すなわち、大文字または小文字の <!DOCTYPE HTML>。 #en For the purposes of XSLT generators that cannot output HTML markup without a DOCTYPE, a DOCTYPE legacy string may be inserted into the DOCTYPE (in the position defined above). This string must consist of: #ja DOCTYPE なしの HTML マーク付けを出力できない XSLT 生成器のため、 DOCTYPE 遺物文字列を DOCTYPE (の前述の位置) に挿入して[[MAY:構いません]]。 この文字列は次のものから構成されなければ[[MUST:なりません]]。 #pattern A * or * character. #ja $1 文字か $2 文字。 #en The literal string "XSLT-compat". #ja 生の文字列「XSLT-compat」。 #en The same character as in item 9 (a matching U+0022 QUOTATION MARK or U+0027 APOSTROPHE character). #ja 項目9と同じ文字 (U+0022 QUOTATION MARK 文字または U+0027 APOSTROPHE 文字の一致する方)。 #en In other words, <!DOCTYPE HTML PUBLIC "XSLT-compat"> or <!DOCTYPE HTML PUBLIC 'XSLT-compat'>, case-insensitively except for the bit in quotes. #ja すなわち、引用符内以外は大文字か小文字の <!DOCTYPE HTML PUBLIC "XSLT-compat"> または <!DOCTYPE HTML PUBLIC 'XSLT-compat'>。 #en The DOCTYPE legacy string should not be used unless the document is generated from XSLT. #ja DOCTYPE 遺物文字列は XSLT で生成された文書を除き使用する[[SHOULD NOT:べきではありません]]。 #en There are five different kinds of elements: void elements, CDATA elements, RCDATA elements, foreign elements, and normal elements. #ja 要素には、 空隙要素、 CDATA 要素、 RCDATA 要素、外来要素、通常要素の5つの異なる種類があります。 #en Tags are used to delimit the start and end of elements in the markup. CDATA, RCDATA, and normal elements have a start tag to indicate where they begin, and an end tag to indicate where they end. The start and end tags of certain normal elements can be omitted, as described later. Those that cannot be omitted must not be omitted. Void elements only have a start tag; end tags must not be specified for void elements. Foreign elements must either have a start tag and an end tag, or a start tag that is marked as self-closing, in which case they must not have an end tag. #ja タグは、 マーク付けにおいて要素の開始と終了を区切るために使います。 CDATA 要素、 RCDATA 要素、通常要素は、 その始まる位置を示す開始タグと、 その終わる位置を示す終了タグを持ちます。 特定の通常要素の開始タグと終了タグは、 後述の通り省略することができます。 省略できないものは省略しては[[MUST NOT:なりません]]。 空隙要素は開始タグのみを持ちます。 空隙要素に終了タグを指定しては[[MUST NOT:なりません]]。 外来要素は開始タグと終了タグを持つか、または開始タグを自己閉塞と印付けするかのいずれかで[[MUST:なければなりらず]]、 後者の場合終了タグを持っては[[MUST NOT:なりません]]。 #en The contents of the element must be placed between just after the start tag (which might be implied, in certain cases) and just before the end tag (which again, might be implied in certain cases). The exact allowed contents of each individual element depends on the content model of that element, as described earlier in this specification. Elements must not contain content that their content model disallows. In addition to the restrictions placed on the contents by those content models, however, the five types of elements have additional syntactic requirements. #ja 要素の内容は開始タグ (これは場合によっては暗示的なものかもしれません。) の直後と終了タグ (これも場合によっては暗示的なものかもしれません。) の直前の間に配置しなければ[[MUST:なりません]]。 各要素それぞれで認められる内容は正確には、この仕様書の先の方で説明した当該要素の内容モデルに依存します。 要素はその内容モデルが禁じた内容を含んではなりません。しかも、 各要素の内容モデルによって内容に課した制約に加えて、5種類の要素には追加の構文的要件があります。 #en Void elements can't have any contents (since there's no end tag, no content can be put between the start tag and the end tag). #ja 空隙要素は内容を持つことができません (終了タグがないので、内容を開始タグと終了タグの間に置くことができません)。 #en CDATA elements can have text, though it has restrictions described below. #ja CDATA 要素はテキストを持つことができますが、 後述の制約があります。 #en RCDATA elements can have text and character references, but the text must not contain an ambiguous ampersand. There are also further restrictions described below. #ja RCDATA 要素はテキスト文字参照を持つことができますが、 テキストは曖昧アンド記号を含んでは[[MUST NOT:なりません]]。 後述の追加制約もあります。 #en Foreign elements whose start tag is marked as self-closing can't have any contents (since, again, as there's no end tag, no content can be put between the start tag and the end tag). Foreign elements whose start tag is not marked as self-closing can have text, character references, CDATA sections, other elements, and comments, but the text must not contain the character U+003C LESS-THAN SIGN (<) or an ambiguous ampersand. #ja 開始タグが自己閉塞と印付けされた外来要素は内容を持つことができません (やはり、終了タグがないため、内容を開始タグと終了タグの間に置くことができないからです)。 開始タグが自己閉塞と印付けされていない外来要素はテキスト文字参照CDATA 区間、 他の要素注釈を持つことができますが、 テキストは文字 U+003C LESS-THAN SIGN (<) や曖昧アンド記号を含んでは[[MUST NOT:なりません]]。 #en Normal elements can have text, character references, other elements, and comments, but the text must not contain the character U+003C LESS-THAN SIGN (<) or an ambiguous ampersand. Some normal elements also have yet more restrictions on what content they are allowed to hold, beyond the restrictions imposed by the content model and those described in this paragraph. Those restrictions are described below. #ja 通常要素はテキスト文字参照、 他の要素注釈を持つことができますが、 テキストは文字 U+003C LESS-THAN SIGN (<) や曖昧アンド記号を含んでは[[MUST NOT:なりません]]。 いくつかの通常要素は、保持することが認められる内容に関して、 内容モデルにより課される制約やこの段落で説明した制約に加え、 更に追加の制約をも有します。 その制約については後述します。 #en Tags contain a tag name, giving the element's name. HTML elements all have names that only use characters in the range U+0030 DIGIT ZERO .. U+0039 DIGIT NINE, U+0061 LATIN SMALL LETTER A .. U+007A LATIN SMALL LETTER Z, U+0041 LATIN CAPITAL LETTER A .. U+005A LATIN CAPITAL LETTER Z, and U+002D HYPHEN-MINUS (-). In the HTML syntax, tag names may be written with any mix of lower- and uppercase letters that, when converted to all-lowercase, matches the element's tag name; tag names are case-insensitive. #ja タグはタグ名を持ち、 これが要素の名前を与えます。 HTML 要素はすべて、範囲 U+0030 DIGIT ZERO ~ U+0039 DIGIT NINE、 U+0061 LATIN SMALL LETTER A ~ U+007A LATIN SMALL LETTER Z、U+0041 LATIN CAPITAL LETTER A ~ U+005A LATIN CAPITAL LETTER Z、 U+002D HYPHEN-MINUS (-) の文字のみを使った名前を持ちます。 HTML 構文では、タグ名はすべて小文字に変換した時に要素のタグ名に一致するような任意の小文字と大文字の組み合わせで書いて[[MAY:構いません]]。 つまり、タグ名は大文字・小文字を区別しません。 #pattern * Start tags #ja $1 開始タグ #en Start tags must have the following format: #ja 開始タグは次の書式でなければ[[MUST:なりません]]。 #en The first character of a start tag must be a U+003C LESS-THAN SIGN (<). #ja 開始タグの最初の文字は U+003C LESS-THAN SIGN (<) でなければ[[MUST:なりません]]。 #en The next few characters of a start tag must be the element's tag name. #ja 開始タグの次の数文字は要素のタグ名でなければ[[MUST:なりません]]。 #en If there are to be any attributes in the next step, there must first be one or more space characters. #ja 次の段階で属性が存在する場合には、まず1文字以上の間隔文字がなければ[[MUST:なりません]]。 #en Then, the start tag may have a number of attributes, the syntax for which is described below. Attributes may be separated from each other by one or more space characters. #ja その後、開始タグは後述の構文に沿った数々の属性を持って[[MAY:構いません]]。 属性は1つ以上の間隔文字で互いに分離して[[MAY:構いません]]。 #en After the attributes, there may be one or more space characters. (Some attributes are required to be followed by a space. See the attributes section below.) #ja 属性の後に、1文字以上の間隔文字があって[[MAY:構いません]]。 (いくつかの属性の後には間隔が[[REQUIRED:必須]]です。後述の属性の節をご覧ください。) #en Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS (/) character. This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing. #ja 要素が空隙要素の1つである場合や、 要素が外来要素である場合、 U+002F SOLIDUS (/) 文字が1つあっても[[MAY:構いません]]。 この文字は空隙要素にあっては何の効果もありませんが、 外来要素にあっては開始タグを自己閉塞と印付けします。 #en Finally, start tags must be closed by a U+003E GREATER-THAN SIGN (>) character. #ja 最後に、開始タグは U+003E GREATER-THAN SIGN (>) もjいで閉じなければ[[MUST:なりません]]。 #pattern * End tags #ja $1 終了タグ #en End tags must have the following format: #ja 終了タグは次の書式でなければ[[MUST:なりません]]。 #en The first character of an end tag must be a U+003C LESS-THAN SIGN (<). #ja 終了タグの最初の文字は U+003C LESS-THAN SIGN (<) でなければ[[MUST:なりません]]。 #en The second character of an end tag must be a U+002F SOLIDUS (/). #ja 終了タグの2番目の文字は U+002F SOLIDUS (/) でなければ[[MUST:なりません]]。 #en The next few characters of an end tag must be the element's tag name. #ja 終了タグの次の数文字は要素のタグ名でなければ[[MUST:なりません]]。 #en After the tag name, there may be one or more space characters. #ja タグ名の後、1文字以上の間隔文字があって[[MAY:構いません]]。 #en Finally, end tags must be closed by a U+003E GREATER-THAN SIGN (>) character. #ja 最後に、終了タグは U+003E GREATER-THAN SIGN (>) 文字により閉じなければ[[MUST:なりません]]。 #pattern * Attributes #ja $1 属性 #en Start tags must have the following format: #ja 開始タグは次の書式でなければ[[MUST:なりません]]。 following format: #en Attributes for an element are expressed inside the element's start tag. #ja 要素の属性は、 当該要素の開始タグの内側で表現されます。 #en Attributes have a name and a value. Attribute names must consist of one or more characters other than the space characters, U+0000 NULL, U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('), U+003E GREATER-THAN SIGN (>), U+002F SOLIDUS (/), and U+003D EQUALS SIGN (=) characters, the control characters, and any characters that are not defined by Unicode. In the HTML syntax, attribute names may be written with any mix of lower- and uppercase letters that are an ASCII case-insensitive match for the attribute's name. #ja 属性は名前と値を持ちます。 属性名は、 間隔文字、U+0000 NULL、U+0022 QUOTATION MARK (")、U+0027 APOSTROPHE (')、U+003E GREATER-THAN SIGN (>)、U+002F SOLIDUS (/)、U+003D EQUALS SIGN (=) のいずれかの文字、 制御文字、 Unicode で定義されていない文字以外の文字1文字以上で構成されなければ[[MUST:なりません]]。 HTML 構文では、属性名は当該属性の名前に ASCII 大文字・小文字不区別で一致する任意の小文字・大文字の組み合わせで書いて[[MAY:構いません]]。 #en Attribute values are a mixture of text and character references, except with the additional restriction that the text cannot contain an ambiguous ampersand. #ja 属性値テキスト文字参照の混合ですが、テキストが曖昧アンド記号を含むことができないとの追加の制限があります。 #en Attributes can be specified in four different ways: #ja 属性は4種類の方法で指定できます。 #en Empty attribute syntax #ja 空属性構文 #en Just the attribute name. #ja 属性名のみです。 #en In the following example, the disabled attribute is given with the empty attribute syntax: #ja 次の例では、disabled 属性が空属性構文により与えられています。 #en If an attribute using the empty attribute syntax is to be followed by another attribute, then there must be a space character separating the two. #ja 空属性構文を用いる属性の後に別の属性が続く場合、 両者を分離する間隔文字がなければ[[MUST:なりません]]。 #en Unquoted attribute value syntax #ja 非引用属性値構文 #en The attribute name, followed by zero or more space characters, followed by a single U+003D EQUALS SIGN character, followed by zero or more space characters, followed by the attribute value, which, in addition to the requirements given above for attribute values, must not contain any literal space characters, any U+0022 QUOTATION MARK (") characters, U+0027 APOSTROPHE (') characters, U+003D EQUALS SIGN (=) characters, or U+003E GREATER-THAN SIGN (>) characters, and must not be the empty string. #ja 属性名の後に零文字以上の間隔文字があり、 その後に1文字の U+003D EQUALS SIGN 文字があり、その後に零文字以上の間隔文字があり、 その後に属性値があるもので、 その属性値については前述の属性値に関する要件に加え、 生の間隔文字、 U+0022 QUOTATION MARK (") 文字、 U+0027 APOSTROPHE (') 文字、 U+003D EQUALS SIGN (=) 文字、 U+003E GREATER-THAN SIGN (>) 文字を含んでは[[MUST NOT:ならず]]、 空文字列であっては[[MUST NOT:なりません]]。 #en In the following example, the value attribute is given with the unquoted attribute value syntax: #ja 次の例では、 value 属性が非引用属性値構文により与えられています。 #en If an attribute using the unquoted attribute syntax is to be followed by another attribute or by one of the optional U+002F SOLIDUS (/) characters allowed in step 6 of the start tag syntax above, then there must be a space character separating the two. #ja 非引用属性値構文を用いた属性に他の属性が続く場合や先述の開始タグ構文の段階6で認められる U+002F SOLIDUS (/) 文字が続く場合、 両者を間隔文字により分離しなければ[[MUST:なりません]]。 #en Single-quoted attribute value syntax #ja 単一引用符属性値構文 #en The attribute name, followed by zero or more space characters, followed by a single U+003D EQUALS SIGN character, followed by zero or more space characters, followed by a single U+0027 APOSTROPHE (') character, followed by the attribute value, which, in addition to the requirements given above for attribute values, must not contain any literal U+0027 APOSTROPHE (') characters, and finally followed by a second single U+0027 APOSTROPHE (') character. #ja 属性名の後、 零文字以上の間隔文字が続き、 その後1文字の U+003D EQUALS SIGN 文字が続き、零文字以上の間隔文字が続き、1文字の U+0027 APOSTROPHE (') 文字が続き、属性値が続き、 この属性値については先述の属性値に関する要件に加えて生の U+0027 APOSTROPHE (') 文字を含んでは[[MUST NOT:ならず]]、その後に2つ目の1文字の U+0027 APOSTROPHE (') 文字が続くもの。 #en In the following example, the type attribute is given with the single-quoted attribute value syntax: #ja 次の例では、 type 属性が単一引用符属性値構文により与えられます。 #en If an attribute using the single-quoted attribute syntax is to be followed by another attribute, then there must be a space character separating the two. #ja 単一引用符属性構文を使った属性に他の属性が続く場合、両者を間隔文字によって分離しなければ[[MUST:なりません]]。 #en Double-quoted attribute value syntax #ja 二重引用符属性値構文 #en The attribute name, followed by zero or more space characters, followed by a single U+003D EQUALS SIGN character, followed by zero or more space characters, followed by a single U+0022 QUOTATION MARK (") character, followed by the attribute value, which, in addition to the requirements given above for attribute values, must not contain any literal U+0022 QUOTATION MARK (") characters, and finally followed by a second single U+0022 QUOTATION MARK (") character. #ja 属性名の後に零文字以上の間隔文字が続き、 その後に1文字の U+003D EQUALS SIGN 文字が続き、その後に零文字以上の間隔文字が続き、その後に1文字の U+0022 QUOTATION MARK (") 文字が続き、その後に属性値が続くところ、 前述の属性値に関する要件に加えて生の U+0022 QUOTATION MARK (") 文字を含んでは[[MUST:ならず]]、 最後に2つ目の1文字の U+0022 QUOTATION MARK (") 文字が続くもの。 #en In the following example, the name attribute is given with the double-quoted attribute value syntax: #ja 次の例では、 name 属性が二重引用符属性値構文で与えられます。 #en If an attribute using the double-quoted attribute syntax is to be followed by another attribute, then there must be a space character separating the two. #ja 二重引用符属性構文を使った属性の後に他の属性が続く場合、両者を間隔文字により分離しなければ[[MUST:なりません]]。 #en There must never be two or more attributes on the same start tag whose names are an ASCII case-insensitive match for each other. #ja 同じ開始タグに名前が ASCII 大文字・小文字不区別で一致する属性が2つ以上あっては[[MUST:なりません]]。 #pattern * Optional tags #ja $1 任意選択タグ #en Certain tags can be omitted. #ja タグの中には省略できるものがあります。 #en An html element's start tag may be omitted if the first thing inside the html element is not a comment. #ja html 要素の開始タグは、 html 要素の内側の最初のものが注釈でない場合、 省略して[[MAY:構いません]]。 #en An html element's end tag may be omitted if the html element is not immediately followed by a comment and the element contains a body element that is either not empty or whose start tag has not been omitted. #ja html 要素の終了タグは、 html 要素の直後が注釈ではなく、 空でないか、または開始タグが省略されていない body 要素を同要素が含む場合、 省略して[[MAY:構いません]]。 #en A head element's start tag may be omitted if the first thing inside the head element is an element. #ja head 要素の開始タグは、 head 要素の内側の最初のものが要素である場合、 省略して[[MAY:構いません]]。 #en A head element's end tag may be omitted if the head element is not immediately followed by a space character or a comment. #ja head 要素の終了タグは、 head 要素の直後に間隔文字注釈がない場合、 省略して[[MAY:構いません]]。 #en A body element's start tag may be omitted if the first thing inside the body element is not a space character or a comment, except if the first thing inside the body element is a script or style element. #ja body 要素の開始タグは、 body 要素の内側の最初のものが間隔文字注釈でない場合、 body 要素の内側の最初のものが script 要素や style 要素の場合を除き、 省略して[[MAY:構いません]]。 #en A body element's end tag may be omitted if the body element is not immediately followed by a comment and the element is either not empty or its start tag has not been omitted. #ja body 要素の終了タグは、 body 要素の直後が注釈ではなく、 要素が空ではないか、または開始タグが省略されていない場合、 省略して[[MAY:構いません]]。 #en A li element's end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element. #ja li 要素の終了タグは、 li 要素の直後が別の li 要素か、 親要素にそれ以上に内容がない場合、 省略して[[MAY:構いません]]。 #en A dt element's end tag may be omitted if the dt element is immediately followed by another dt element or a dd element. #ja dt 要素の終了タグは、 dt 要素の直後が別の dt 要素か dd 要素の場合、省略して[[MAY:構いません]]。 #en A dd element's end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element. #ja dd 要素の終了タグは、 dd 要素の直後が別の dd 要素か dt 要素の場合や、 親要素にそれ以上内容がない場合、省略して[[MAY:構いません]]。 #en A p element's end tag may be omitted if the p element is immediately followed by an address, article, aside, blockquote, datagrid, dialog, dir, div, dl, fieldset, footer, form, h1, h2, h3, h4, h5, h6, header, hr, menu, nav, ol, p, pre, section, table, or ul, element, or if there is no more content in the parent element and the parent element is not an a element. #ja p 要素の終了タグは、 p 要素の直後が addressarticleasideblockquotedatagriddialogdirdivdlfieldsetfooterformh1h2h3h4h5h6headerhrmenunavolppresectiontableul のいずれかの要素の場合や親要素にそれ以上に内容がなく、親要素が a 要素ではない場合、 省略して[[MAY:構いません]]。 #en An rt element's end tag may be omitted if the rt element is immediately followed by an rt or rp element, or if there is no more content in the parent element. #ja rt 要素の終了タグは、 rt 要素の直後が rt 要素や rp 要素でない場合や、 親要素にそれ以上内容がない場合、 省略して[[MAY:構いません]]。 #en An rp element's end tag may be omitted if the rp element is immediately followed by an rt or rp element, or if there is no more content in the parent element. #ja rp 要素の終了タグは、 rp 要素の直後が rt 要素や rp 要素の場合や、 親要素にそれ以上内容がない場合、省略して[[MAY:構いません]]。 #en An optgroup element's end tag may be omitted if the optgroup element is immediately followed by another optgroup element, or if there is no more content in the parent element. #ja optgroup 要素の終了タグは、 optgroup 要素の直後が 別の optgroup 要素の場合や、 親要素にそれ以上内容がない場合、 省略して[[MAY:構いません]]。 #en An option element's end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element. #ja option 要素の終了タグは、 option 要素の直後が別の option 要素の場合や、 直後が optgroup 要素の場合や、 親要素にそれ以上内容がない場合、省略して[[MAY:構いません]]。 #en A colgroup element's start tag may be omitted if the first thing inside the colgroup element is a col element, and if the element is not immediately preceded by another colgroup element whose end tag has been omitted. #ja colgroup 要素の開始タグは、 colgroup 要素の内側の最初のものが col 要素の場合で、 直前が終了タグの省略された別の colgroup 要素でない場合、 省略して[[MAY:構いません]]。 #en A colgroup element's end tag may be omitted if the colgroup element is not immediately followed by a space character or a comment. #ja colgroup 要素の終了タグは、 colgroup 要素の直後が間隔文字注釈でない場合、 省略して[[MAY:構いません]]。 #en A thead element's end tag may be omitted if the thead element is immediately followed by a tbody or tfoot element. #ja thead 要素の終了タグは、 thead 要素の直後が tbody 要素や tfoot 要素の場合、省略して[[MAY:構いません]]。 #en A tbody element's start tag may be omitted if the first thing inside the tbody element is a tr element, and if the element is not immediately preceded by a tbody, thead, or tfoot element whose end tag has been omitted. #ja tbody 要素の開始タグは、 tbody 要素の内側の最初のものが tr 要素の場合で、 要素の直前が終了タグの省略された tbody 要素、thead 要素、 tfoot 要素でない場合、 省略して[[MAY:構いません]]。 #en A tbody element's end tag may be omitted if the tbody element is immediately followed by a tbody or tfoot element, or if there is no more content in the parent element. #ja tbody 要素の終了タグは、 tbody 要素の直後が tbody 要素や tfoot 要素の場合や、親要素にそれ以上内容がない場合、省略して[[MAY:構いません]]。 #en A tfoot element's end tag may be omitted if the tfoot element is immediately followed by a tbody element, or if there is no more content in the parent element. #ja tfoot 要素の終了タグは、 tfoot 要素の直後が tbody 要素の場合や、 親要素にそれ以上内容がない場合、省略して[[MAY:構いません]]。 #en A tr element's end tag may be omitted if the tr element is immediately followed by another tr element, or if there is no more content in the parent element. #ja tr 要素の終了タグは、 tr 要素の直後が別の tr 要素の場合や、 親要素にそれ以上内容がない場合、省略して[[MAY:構いません]]。 #en A td element's end tag may be omitted if the td element is immediately followed by a td or th element, or if there is no more content in the parent element. #ja td 要素の終了タグは、 td 要素の直後が td 要素や th 要素の場合や、 親要素にそれ以上内容がない場合、省略して[[MAY:構いません]]。 #en A th element's end tag may be omitted if the th element is immediately followed by a td or th element, or if there is no more content in the parent element. #ja th 要素の終了タグは、th 要素の直後が td 要素や th 要素の場合や、 親要素にそれ以上内容がない場合、省略して[[MAY:構いません]]。 #en However, a start tag must never be omitted if it has any attributes. #ja しかし開始タグが属性を持つ場合、 開始タグを省略しては[[MUST:なりません]]。 #pattern * Restrictions on content models #ja $1 内容モデルの制限 #en For historical reasons, certain elements have extra restrictions beyond even the restrictions given by their content model. #ja 歴史的理由により、内容モデルによる制限以上の追加の制限を持つ要素がいくつかあります。 #en An optgroup element must not contain optgroup elements, even though these elements are technically allowed to be nested according to the content models described in this specification. (If an optgroup element is put inside another in the markup, it will in fact imply an optgroup end tag before it.) #ja optgroup 要素は、 この仕様書で述べた内容モデルに従えば技術的には入れ子にできますが、 optgroup 要素を含んでは[[MUST NOT:なりません]]。 (optgroup 要素をマーク付け中で別の optgroup 要素中に配置しても、 実際にはその前に optgroup 終了タグが暗示的に存在するものとみなされます。) #en A table element must not contain tr elements, even though these elements are technically allowed inside table elements according to the content models described in this specification. (If a tr element is put inside a table in the markup, it will in fact imply a tbody start tag before it.) #ja table 要素はこの仕様書で述べた内容モデルに従えば技術的には内側で tr 要素が認められていますが、 table 要素は tr 要素を含んでは[[MUST NOT:なりません]]。 (tr 要素がマーク付け中で table 要素の内側に置かれた場合、 実際には前に tbody 開始タグが暗示的に存在するものとみなされます。) #en A single U+000A LINE FEED (LF) character may be placed immediately after the start tag of pre and textarea elements. This does not affect the processing of the element. The otherwise optional U+000A LINE FEED (LF) character must be included if the element's contents start with that character (because otherwise the leading newline in the contents would be treated like the optional newline, and ignored). #ja pre 要素と textarea 要素の開始タグの直後に1文字の U+000A LINE FEED (LF) 文字を置いても[[MAY:構いません]]。 この文字は要素の処理に影響しません。 通常は任意選択のこの U+000A LINE FEED (LF) 文字は、 要素の内容がこの文字から始まる場合には、含めなければ[[MUST:なりません]] (そうしなければ、内容の最初の改行は任意選択の改行として扱われ、無視されるからです)。 #en The following two pre blocks are equivalent: #ja 次の2つの pre ブロックは等価です。 #en <pre>Hello</pre> #ja <pre>こんにちは</pre> #en <pre>
Hello</pre> #ja <pre>
こんにちは</pre> #en * Restrictions on the contents of CDATA and RCDATA elements #ja $1 CDATA 要素や RCDATA 要素の内容の制限 #en The text in CDATA and RCDATA elements must not contain any occurrences of the string "</" (U+003C LESS-THAN SIGN, U+002F SOLIDUS) followed by characters that case-insensitively match the tag name of the element followed by one of U+0009 CHARACTER TABULATION, U+000A LINE FEED (LF), U+000C FORM FEED (FF), U+0020 SPACE, U+003E GREATER-THAN SIGN (>), or U+002F SOLIDUS (/), unless that string is part of an escaping text span. #ja CDATA 要素や RCDATA 要素のテキストは文字列「</」 (U+003C LESS-THAN SIGN、U+002F SOLIDUS) の後に要素のタグ名と大文字・小文字を区別しない場合に一致する文字が続き、 その後に U+0009 CHARACTER TABULATION、U+000A LINE FEED (LF)、U+000C FORM FEED (FF)、U+0020 SPACE、U+003E GREATER-THAN SIGN (>)、U+002F SOLIDUS (/) のいずれかが続くような列を、その文字列が逃避テキスト径間の一部である場合を除き、 含んでは[[MUST NOT:なりません]]。 #en An escaping text span is a span of text that starts with an escaping text span start that is not itself in an escaping text span, and ends at the next escaping text span end. There cannot be any character references inside an escaping text span. #ja 逃避テキスト径間は、 テキストの径間であって、 それ自体は逃避テキスト径間中にない逃避テキスト径間開始によって始まり、 次の逃避テキスト径間によって終わるものです。 逃避テキスト径間の内側には文字参照を入れることができません。 #en An escaping text span start is a part of text that consists of the four character sequence "<!--" (U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS). #ja 逃避テキスト径間開始は、 テキストの一部で、 4文字の列「<!--」(U+003C LESS-THAN SIGN、U+0021 EXCLAMATION MARK、U+002D HYPHEN-MINUS、U+002D HYPHEN-MINUS) です。 #en An escaping text span start may share its U+002D HYPHEN-MINUS characters with its corresponding escaping text span end. #ja 逃避テキスト径間開始は、 その U+002D HYPHEN-MINUS 文字を対応する逃避テキスト径間終了と共有して[[MAY:構いません]]。 #en The text in CDATA and RCDATA elements must not have an escaping text span start that is not followed by an escaping text span end. #ja CDATA 要素と RCDATA 要素のテキストは逃避テキスト径間終了が後に続かない逃避テキスト径間開始を含んでは[[MUST NOT:なりません]]。 #pattern * Text #ja $1 テキスト #en Text is allowed inside elements, attributes, and comments. Text must consist of Unicode characters. Text must not contain U+0000 characters. Text must not contain permanently undefined Unicode characters. Text must not contain control characters other than space characters. Extra constraints are placed on what is and what is not allowed in text based on where the text is to be put, as described in the other sections. #ja テキストは要素、 属性、注釈の内側で認められています。 テキストは Unicode 文字で構成されなければ[[MUST:なりません]]。 テキストは U+0000 文字を含んでは[[MUST NOT:なりません]]。 テキストは恒久的に未定義の Unicode 文字を含んでは[[MUST NOT:なりません]]。 テキストは間隔文字以外の制御文字を含んでは[[MUST NOT:なりません]]。 他の節で述べた通り、テキストが配置される場所によって、テキスト中で何が認められ、 何が認められないかの追加の制約があります。 #pattern * Newlines #ja $1 改行 #en Newlines in HTML may be represented either as U+000D CARRIAGE RETURN (CR) characters, U+000A LINE FEED (LF) characters, or pairs of U+000D CARRIAGE RETURN (CR), U+000A LINE FEED (LF) characters in that order. #ja HTML の改行は U+000D CARRIAGE RETURN (CR) 文字か、U+000A LINE FEED (LF) 文字か、U+000D CARRIAGE RETURN (CR) 文字と U+000A LINE FEED (LF) 文字の組をこの順序で用いるかのいずれかによって表現して[[MAY:構いません]]。 #pattern * Character references #ja $1 文字参照 #en In certain cases described in other sections, text may be mixed with character references. These can be used to escape characters that couldn't otherwise legally be included in text. #ja 他の節で述べたいくつかの場合において、テキストには 文字参照を混在させて[[MAY:構いません]]。 文字参照は、通常合法的にテキストに含めることができない文字を逃避するために使うことができます。 #en Character references must start with a U+0026 AMPERSAND (&). Following this, there are three possible kinds of character references: #ja 文字参照は、U+0026 AMPERSAND (&) により始まらなければ[[MUST:なりません]]。 この文字に続けて、3種類の文字参照があります。 #en Named character references #ja 名前付き文字参照 #en The ampersand must be followed by one of the names given in the named character references section, using the same case. The name must be one that is terminated by a U+003B SEMICOLON (;) character. #ja アンド記号の後には、 名前付き文字参照の節にある名前のいずれかを、 同じ大文字・小文字の組み合わせによって続けなければ[[MUST:なりません]]。 名前は U+003B SEMICOLON (;) 文字で終わるものでなければ[[MUST:なりません]]。 #en Decimal numeric character reference #ja 十進数値文字参照 #en The ampersand must be followed by a U+0023 NUMBER SIGN (#) character, followed by one or more digits in the range U+0030 DIGIT ZERO .. U+0039 DIGIT NINE, representing a base-ten integer that itself is a Unicode code point that is not U+0000, U+000D, in the range U+0080 .. U+009F, or in the range 0xD800 .. 0xDFFF (surrogates). The digits must then be followed by a U+003B SEMICOLON character (;). #ja アンド記号の後には、 U+0023 NUMBER SIGN (#) 文字が続き、 Unicode 符号位置であって U+0000、U+000D、範囲 U+0080 ~ U+009F、範囲 0xD800~0xDFFF (代理) でない十進整数を表す1文字以上の範囲 U+0030 DIGIT ZERO ~ U+0039 DIGIT NINE の数字が続かなければ[[MUST:なりません]]。 数字の後には U+003B SEMICOLON 文字 (;) が続かなければ[[MUST:なりません]]。 #en Hexadecimal numeric character reference #ja 十六進数値文字参照 #en The ampersand must be followed by a U+0023 NUMBER SIGN (#) character, which must be followed by either a U+0078 LATIN SMALL LETTER X or a U+0058 LATIN CAPITAL LETTER X character, which must then be followed by one or more digits in the range U+0030 DIGIT ZERO .. U+0039 DIGIT NINE, U+0061 LATIN SMALL LETTER A .. U+0066 LATIN SMALL LETTER F, and U+0041 LATIN CAPITAL LETTER A .. U+0046 LATIN CAPITAL LETTER F, representing a base-sixteen integer that itself is a Unicode code point that is not U+0000, U+000D, in the range U+0080 .. U+009F, or in the range 0xD800 .. 0xDFFF (surrogates). The digits must then be followed by a U+003B SEMICOLON character (;). #ja アンド記号の後には、 U+0023 NUMBER SIGN (#) 文字が続き、その後に U+0078 LATIN SMALL LETTER X 文字か U+0058 LATIN CAPITAL LETTER X 文字が続き、その後に Unicode 符号位置であって U+0000、U+000D、範囲 U+0080 ~ U+009F、 範囲 0xD800 .. 0xDFFF (代理) でない十六進整数を表す1文字以上の範囲 U+0030 DIGIT ZERO ~ U+0039 DIGIT NINE、U+0061 LATIN SMALL LETTER A ~ U+0066 LATIN SMALL LETTER F、 U+0041 LATIN CAPITAL LETTER A ~ U+0046 LATIN CAPITAL LETTER F の数字が続かなければ[[MUST:なりません]]。 数字の後には U+003B SEMICOLON 文字 (;) が続かなければ[[MUST:なりません]]。 #en An ambiguous ampersand is a U+0026 AMPERSAND (&) character that is followed by some text other than a space character, a U+003C LESS-THAN SIGN character ('<'), or another U+0026 AMPERSAND (&) character. #ja 曖昧アンド記号は、 間隔文字、U+003C LESS-THAN SIGN 文字 ('<')、別の U+0026 AMPERSAND (&) 文字以外の テキストが続く U+0026 AMPERSAND (&) 文字です。 #pattern * CDATA sections #ja $1 CDATA 区間 #en CDATA sections must start with the character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+005B LEFT SQUARE BRACKET, U+0043 LATIN CAPITAL LETTER C, U+0044 LATIN CAPITAL LETTER D, U+0041 LATIN CAPITAL LETTER A, U+0054 LATIN CAPITAL LETTER T, U+0041 LATIN CAPITAL LETTER A, U+005B LEFT SQUARE BRACKET (<![CDATA[). Following this sequence, the CDATA section may have text, with the additional restriction that the text must not contain the three character sequence U+005D RIGHT SQUARE BRACKET, U+005D RIGHT SQUARE BRACKET, U+003E GREATER-THAN SIGN (]]>). Finally, the CDATA section must be ended by the three character sequence U+005D RIGHT SQUARE BRACKET, U+005D RIGHT SQUARE BRACKET, U+003E GREATER-THAN SIGN (]]>). #ja CDATA 区間は、 文字列 U+003C LESS-THAN SIGN、U+0021 EXCLAMATION MARK、U+005B LEFT SQUARE BRACKET、U+0043 LATIN CAPITAL LETTER C、 U+0044 LATIN CAPITAL LETTER D、U+0041 LATIN CAPITAL LETTER A、U+0054 LATIN CAPITAL LETTER T、U+0041 LATIN CAPITAL LETTER A、U+005B LEFT SQUARE BRACKET (<![CDATA[) で始まらなければ[[MUST:なりません]]。 CDATA 区間は、この文字列に続けて、 テキストを持って[[MAY:構いません]]。 ただし、追加の制限として、このテキストは3文字の列 U+005D RIGHT SQUARE BRACKET、U+005D RIGHT SQUARE BRACKET、U+003E GREATER-THAN SIGN (]]>) を含んでは[[MUST NOT:なりません]]。 最後に、CDATA 区間は、3文字の列 U+005D RIGHT SQUARE BRACKET、U+005D RIGHT SQUARE BRACKET、U+003E GREATER-THAN SIGN (]]>) で終わらなければ[[MUST:なりません]]。 #pattern * Comments #ja $1 注釈 #en Comments must start with the four character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS (<!--). Following this sequence, the comment may have text, with the additional restriction that the text must not start with a single U+003E GREATER-THAN SIGN ('>') character, nor start with a U+002D HYPHEN-MINUS (-) character followed by a U+003E GREATER-THAN SIGN ('>') character, nor contain two consecutive U+002D HYPHEN-MINUS (-) characters, nor end with a U+002D HYPHEN-MINUS (-) character. Finally, the comment must be ended by the three character sequence U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E GREATER-THAN SIGN (-->). #ja 注釈は、 4文字の列 U+003C LESS-THAN SIGN、U+0021 EXCLAMATION MARK、U+002D HYPHEN-MINUS、U+002D HYPHEN-MINUS (<!--) で始まらなければ[[MUST:なりません]]。 注釈は、この文字列に続けて、 テキストを持って[[MAY:構いません]]。 ただし、追加の制限として、このテキストは U+003E GREATER-THAN SIGN ('>') 文字1文字から始まったり、 U+002D HYPHEN-MINUS (-) 文字の後に U+003E GREATER-THAN SIGN ('>') 文字が続く列から始まったり、 2つの連続する U+002D HYPHEN-MINUS (-) 文字を含んだり、 U+002D HYPHEN-MINUS (-) 文字で終わったりしては[[MUST NOT:なりません]]。 最後に、注釈は3文字の列 U+002D HYPHEN-MINUS、U+002D HYPHEN-MINUS、U+003E GREATER-THAN SIGN (-->) で終わらなければ[[MUST:なりません]]。 #en This specification defines the parsing rules for HTML documents, whether they are syntactically correct or not. Certain points in the parsing algorithm are said to be parse errors. The error handling for parse errors is well-defined: user agents must either act as described below when encountering such problems, or must abort processing at the first error that they encounter for which they do not wish to apply the rules described below. #ja この仕様書は、 HTML 文書を、それが構文的に正しいか否かによらず、その構文解析を行うための規則を定義します。 この構文解析算法のいくつかの地点は構文解析誤りであるといいます。 構文解析誤りの誤りの取り扱いは明確に定義するところであり、 利用者エージェントは、 そのような問題に遭遇した時に後述の通りに作用するか、 または後述の規則を適用したくないような最初の誤りの時点で処理を停止するかのいずれかでなければ[[MUST NOT:なりません]]。