#pattern * Common microsyntaxes #ja $1 共通マイクロ構文 #en There are various places in HTML that accept particular data types, such as dates or numbers. This section describes what the conformance criteria for content in those formats is, and how to parse them. #ja HTML 中のいろいろな場所で、日付や数値のような特定のデータ型を使うことができます。 この節では、そのような書式の内容の適合基準は何か、 どう構文解析するかを説明します。 #en Need to go through the whole spec and make sure all the attribute values are clearly defined either in terms of microsyntaxes or in terms of other specs, or as "Text" or some such. #ja 仕様書全体について、すべての属性値がマイクロ構文を使ってか他の仕様書を使ってか「文章」などとして定義されるようにする必要があります。 #pattern * Common parser idioms #ja $1 構文解析器共通慣用句 #en The space characters, for the purposes of this specification, are U+0020 SPACE, U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF), U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR). #ja 間隔文字は、 この仕様書においては、 U+0020 SPACE, U+0009 CHARACTER TABULATION (tab)、U+000A LINE FEED (LF)、U+000C FORM FEED (FF)、 U+000D CARRIAGE RETURN (CR) です。 #en Some of the micro-parsers described below follow the pattern of having an input variable that holds the string being parsed, and having a position variable pointing at the next character to parse in input. #ja これ以降で説明するマイクロ構文解析器のいくつかは、構文解析される文字列を保持する input 変数を持ち、 input 中で次に構文解析する文字を指す position 変数を持つというパターンに従っています。 #en For parsers based on this pattern, a step that requires the user agent to collect a sequence of characters means that the following algorithm must be run, with characters being the set of characters that can be collected: #ja このパターンに従う構文解析器において、利用者エージェントが文字列を集めることを要求している段階は、 次の算法を、 characters が収集できる文字の集合であるとして実行しなければ[[MUST:ならない]]ことを意味しています。 #en Let input and position be the same variables as those of the same name in the algorithm that invoked these steps. #ja inputposition を、これらの段階を呼び出した算法中の同名の変数と同じものとします。 #en Let result be the empty string. #ja result を空文字列とします。 #en While position doesn't point past the end of input and the character at position is one of the characters, append that character to the end of result and advance position to the next character in input. #ja positioninput の終わりの更に先を指しておらず、 position の文字が characters のうちの1つである間、 その文字を result の終わりに追加し、 positioninput の次の文字に進めます。 #en Return result. #ja result を返します。 #en The step skip whitespace means that the user agent must collect a sequence of characters that are space characters. The step skip Zs characters means that the user agent must collect a sequence of characters that are in the Unicode character class Zs. In both cases, the collected characters are not used. [UNICODE] #ja 空白を飛ばす段階は、 利用者エージェントが間隔文字である文字列を集めなければ[[MUST:ならない]]ことを意味します。 Zs 文字を飛ばす段階は、 利用者エージェントが Unicode 文字クラス Zs に含まれる文字列を集めなければ[[MUST:ならない]]ことを意味します。文字列を集めなければ[[MUST:ならない]]ことを意味します。 どちらの場合も、集めた文字は使いません。 [UNICODE] #pattern * Boolean attributes #ja $1 ブール型属性 #en A number of attributes in HTML5 are boolean attributes. The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value. #ja HTML5 の数々の属性はブール型属性です。要素にブール型属性が存在すると真の値を表し、 存在しないと偽の値を表します。 #en If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute's canonical name, with no leading or trailing whitespace. #ja 属性が存在する場合、その値は空文字列か、または ASCII 大文字・小文字不区別で属性の正準名と一致するような (先頭にも末尾にも空白がない) 値のいずれかでなければ[[MUST:なりません]]。 #pattern * Numbers #ja $1 数値 #pattern * Unsigned integers #ja $1 符号無し整数 #en A string is a valid non-negative integer if it consists of one of more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). #ja 文字列は、範囲 U+0030 DIGIT ZERO (0) ~ U+0039 DIGIT NINE (9) の文字1文字以上で構成される場合、妥当な非負整数です。 #en The rules for parsing non-negative integers are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will either return zero, a positive integer, or an error. Leading spaces are ignored. Trailing spaces and indeed any trailing garbage characters are ignored. #ja 非負整数を構文解析する規則は次の算法で与えられるものです。 この算法が呼び出された時には、与えられた順に段階に従い、 値を返す最初の段階で中断しなければ[[MUST:なりません]]。 この算法は零か正整数か誤りを返します。 先頭の間隔は無視されます。末尾の空白、というかごみ文字列はすべて無視されます。 #en Let input be the string being parsed. #ja input を構文解析される文字列とします。 #en Let position be a pointer into input, initially pointing at the start of the string. #ja positioninput 中の指示子とし、初期位置を文字列の始めとします。 #en Let value have the value 0. #ja value を値 0 にします。 #en Skip whitespace. #ja 空白を読み飛ばします。 #en If position is past the end of input, return an error. #ja positioninput の終わりを過ぎていれば、誤りを返します。 #en If the next character is not one of U+0030 DIGIT ZERO (0) .. U+0039 DIGIT NINE (9), then return an error. #ja 次の文字が U+0030 DIGIT ZERO (0) 〜 U+0039 DIGIT NINE (9) のうちの1つでない場合、誤りを返します。 #en If the next character is one of U+0030 DIGIT ZERO (0) .. U+0039 DIGIT NINE (9): #ja 次の文字が U+0030 DIGIT ZERO (0) 〜 U+0039 DIGIT NINE (9) のうちの1つである場合: #en Multiply value by ten. #ja value を10倍します。 #en Add the value of the current character (0..9) to value. #ja 現在の文字の値 (0〜9) を value に加えます。 #en Advance position to the next character. #ja position を次の文字に進めます。 #pattern If position is not past the end of input, return to the top of step * in the overall algorithm (that's the step within which these substeps find themselves). #ja positioninput の終わりを過ぎていなければ、 算法全体の段階 $1 (これらの部分段階自体が含まれている段階) の先頭に返ります。 #en Return value. #ja value を返します。 #pattern * Signed integers #ja $1 符号付き整数 #en A string is a valid integer if it consists of one of more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), optionally prefixed with a U+002D HYPHEN-MINUS ("-") character. #ja 文字列は、範囲 U+0030 DIGIT ZERO (0) ~ U+0039 DIGIT NINE (9) の文字1文字以上で構成され、任意選択で接頭辞として U+002D HYPHEN-MINUS ("-") 文字がある場合、妥当な整数です。 #en The rules for parsing integers are similar to the rules for non-negative integers, and are as given in the following algorithm. When invoked, the steps must be followed in the order given, aborting at the first step that returns a value. This algorithm will either return an integer or an error. Leading spaces are ignored. Trailing spaces and trailing garbage characters are ignored. #ja 整数を構文解析する規則は、非負整数用の規則と似ており、 次の算法により与えられます。これらの段階は、呼び出された場合、 与えられた順序に従い実行し、初めて値を返す段階で停止しなければ[[MUST:なりません]]。 この算法は整数か誤りのいずれかを返します。先頭の間隔は無視されます。 末尾の間隔や末尾のごみ文字は無視されます。 #en Let sign have the value "positive". #ja sign を、「正」という値を持つようにします。 #en If the character indicated by position (the first character) is a U+002D HYPHEN-MINUS ("-") character: #ja position が示す文字 (最初の文字) が U+002D HYPHEN-MINUS ("-") 文字である場合、 #en Let sign be "negative". #ja sign を「負」とします。 #en If sign is "positive", return value, otherwise return 0-value. #ja sign が「正」の場合、 value を返します。そうでない場合、 0-value を返します。