Parent Directory
|
Revision Log
by remote user 'guest'
| 1 | apache | 1.7 | #pattern |
| 2 | <span class=secno>* </span>Parsing HTML documents | ||
| 3 | apache | 1.4 | #ja |
| 4 | apache | 1.7 | <span class=secno>$1 </span>HTML 文書の構文解析 |
| 5 | apache | 1.4 | |
| 6 | #en | ||
| 7 | <em>This section only applies to user agents, data mining tools, and | ||
| 8 | conformance checkers.</em> | ||
| 9 | #ja | ||
| 10 | <em>この節は利用者エージェント、データ・マイニング・ツール、 | ||
| 11 | 適合性検査器のみに適用されます。</em> | ||
| 12 | |||
| 13 | #en | ||
| 14 | wakaba | 1.59 | The rules for parsing <a href=#xml-documents>XML documents</a> (and |
| 15 | thus <a href=#xhtml5>XHTML</a> documents) into DOM trees are covered by | ||
| 16 | apache | 1.4 | the XML and Namespaces in XML specifications, and are out of scope of this |
| 17 | wakaba | 1.59 | specification. <a href=#refsXML>[XML]</a> <a |
| 18 | href=#refsXMLNS>[XMLNS]</a> <!-- XXX refs --> | ||
| 19 | apache | 1.4 | #ja |
| 20 | wakaba | 1.59 | <a href=#xml-documents>XML 文書</a> (や <a href=#xhtml5>XHTML</a> 文書) |
| 21 | apache | 1.4 | を構文解析して DOM 木を得るための規則は XML や XML 名前空間の仕様書で扱われており、 |
| 22 | wakaba | 1.59 | この仕様書の適用範囲外です。 <a href=#refsXML>[XML]</a> <a |
| 23 | apache | 1.4 | |
| 24 | #en | ||
| 25 | wakaba | 1.59 | For <a href=#html-documents>HTML documents</a>, user agents must use the |
| 26 | apache | 1.4 | parsing rules described in this section to generate the DOM trees. |
| 27 | Together, these rules define what is referred to as the <dfn | ||
| 28 | wakaba | 1.59 | id=html-parser>HTML parser</dfn>. |
| 29 | apache | 1.4 | #ja |
| 30 | wakaba | 1.59 | <a href=#html-documents>HTML 文書</a>については、利用者エージェントは、 DOM |
| 31 | apache | 1.4 | 木を生成するためにこの節で説明する構文解析規則を使用しなければ[[MUST:なりません]]。 |
| 32 | また、この規則は<dfn | ||
| 33 | wakaba | 1.59 | id=html-parser>HTML 構文解析器</dfn>と呼ばれるものを定義します。 |
| 34 | apache | 1.4 | |
| 35 | #en | ||
| 36 | While the HTML form of HTML5 bears a close resemblance to SGML and XML, | ||
| 37 | it is a separate language with its own parsing rules. | ||
| 38 | #ja | ||
| 39 | HTML5 の HTML 形式は SGML や XML によく似ていますが、 | ||
| 40 | 独自の構文解析規則を持つ別の言語です。 | ||
| 41 | |||
| 42 | #en | ||
| 43 | Some earlier versions of HTML (in particular from HTML2 to HTML4) were | ||
| 44 | based on SGML and used SGML parsing rules. However, few (if any) web | ||
| 45 | browsers ever implemented true SGML parsing for HTML documents; the only | ||
| 46 | user agents to strictly handle HTML as an SGML application have | ||
| 47 | historically been validators. The resulting confusion — with | ||
| 48 | validators claiming documents to have one representation while widely | ||
| 49 | deployed Web browsers interoperably implemented a different | ||
| 50 | representation — has wasted decades of productivity. This version | ||
| 51 | of HTML thus returns to a non-SGML basis. | ||
| 52 | #ja | ||
| 53 | 以前のいくつかの版の HTML (特に HTML2 から HTML4 まで) は SGML | ||
| 54 | に基づき、 SGML の構文解析規則を用いていました。しかし、 HTML | ||
| 55 | 文書用に真の SGML 構文解析を実装していたウェブ・ブラウザは (あったとしても) | ||
| 56 | 皆無に近い数でした。 HTML を厳密に SGML 応用として扱う唯一の利用者エージェントは歴史的に妥当性検証器だけでした。 | ||
| 57 | その結果、妥当性検査器は文書がある形式であることを要求し、 | ||
| 58 | 一方で広く実用されている Web ブラウザはそれとは異なる形式を相互運用可能な形で実装するという混乱が生じ、 | ||
| 59 | 生産性を大きく低下させています。 | ||
| 60 | ですので、この版の HTML は非 SGML ベースに回帰します。 | ||
| 61 | |||
| 62 | #en | ||
| 63 | Authors interested in using SGML tools in their authoring pipeline are | ||
| 64 | encouraged to use XML tools and the XML serialization of HTML5. | ||
| 65 | #ja | ||
| 66 | 文書準備の過程で SGML ツールを使いたいと考える著者には、 | ||
| 67 | XML ツールと HTML5 の XML 直列化を用いることをお勧めします。 | ||
| 68 | |||
| 69 | #en | ||
| 70 | This specification defines the parsing rules for HTML documents, whether | ||
| 71 | they are syntactically correct or not. Certain points in the parsing | ||
| 72 | wakaba | 1.59 | algorithm are said to be <dfn id=parse-a-date-string title="parse error">parse |
| 73 | apache | 1.4 | errors</dfn>. The error handling for parse errors is well-defined: user |
| 74 | agents must either act as described below when encountering such problems, | ||
| 75 | or must abort processing at the first error that they encounter for which | ||
| 76 | they do not wish to apply the rules described below. | ||
| 77 | #ja | ||
| 78 | この仕様書は、構文的に正しいか否かに関わらず HTML | ||
| 79 | wakaba | 1.59 | 文書を構文解析する規則を定義します。構文解析算法中のいくつかの箇所は<dfn id=parse-a-date-string title="parse error">構文解析誤り</dfn>であるとしています。 |
| 80 | apache | 1.4 | 構文解析誤りの処理は明確に定義します。利用者エージェントは、 |
| 81 | そのような問題に遭遇したときに後述のように動作するか、または後述の規則を適用することを望まないような誤りにはじめて遭遇した箇所で処理を停止しなければ[[MUST:なりません]]。 | ||
| 82 | |||
| 83 | #en | ||
| 84 | Conformance checkers must report at least one parse error condition to | ||
| 85 | the user if one or more parse error conditions exist in the document and | ||
| 86 | must not report parse error conditions if none exist in the document. | ||
| 87 | Conformance checkers may report more than one parse error condition if | ||
| 88 | more than one parse error conditions exist in the document. Conformance | ||
| 89 | checkers are not required to recover from parse errors. | ||
| 90 | #ja | ||
| 91 | 適合性検査器は、文書中に1つ以上の構文解析誤り条件が存在する場合、利用者に最低1つの構文解析誤り条件を報告しなければ[[MUST:ならず]]、 | ||
| 92 | 文書に誤りが存在しない場合、構文解析誤り条件を報告しては[[MUST NOT:なりません]]。 | ||
| 93 | 適合性検査器は、文書中に複数の構文解析誤り条件が存在する場合、 | ||
| 94 | 複数の構文解析誤り条件を報告して[[MAY:構いません]]。 | ||
| 95 | 適合性検査器は構文解析誤りから回復することを[[REQUIRED:要求]]されません。 | ||
| 96 | |||
| 97 | #en | ||
| 98 | Parse errors are only errors with the <em>syntax</em> of | ||
| 99 | HTML. In addition to checking for parse errors, conformance checkers will | ||
| 100 | also verify that the document obeys all the other conformance requirements | ||
| 101 | described in this specification. | ||
| 102 | #ja | ||
| 103 |