1<?xml version="1.0"?> 2<!DOCTYPE spec SYSTEM "spec.dtd" [ 3 4<!-- 日本語訳のための解析対象実体(ここから) --> 5 6<!ENTITY TR-or-Rec "仕様書"> 7<!-- <!ENTITY TR-or-Rec "標準情報(TR)"> --> 8<!ENTITY eTR-or-Rec "specification"> 9<!-- <!ENTITY eTR-or-Rec "technical report(TR)"> --> 10<!ENTITY application "アプリケーション"> 11<!ENTITY error "エラー"> 12<!ENTITY fatal-error "致命的エラー"> 13<!ENTITY parsed-data "解析されるデータ"> 14<!ENTITY unparsed-data "解析されないデータ"> 15<!ENTITY parsed-entity "解析対象実体"> 16<!ENTITY parser "パーサ"> 17<!ENTITY unparsed-entity "解析対象外実体"> 18<!ENTITY well-formed "整形式"> 19<!ENTITY valid "妥当"> 20<!ENTITY validity "妥当性"> 21<!ENTITY escape "別扱い"> 22<!ENTITY prolog "書き"> 23<!ENTITY surrogate-blocks "サロゲートブロック"> 24<!ENTITY letter "字"> 25<!ENTITY ideographic "統合漢字"> 26<!ENTITY markup "マーク付け"> 27<!ENTITY left-angle-bracket "不等号(小なり)"> 28<!ENTITY right-angle-bracket "不等号(大なり)"> 29<!ENTITY string "文字列"> 30<!ENTITY char-string "文字列"><!-- string of chararacters, 31 character strings, strings, 32 characters はすべて文字列とする --> 33<!ENTITY replacement-text "置換テキスト"> 34<!ENTITY single-quote "一重引用符"> 35<!ENTITY double-quote "二重引用符"> 36<!ENTITY adaptations-annex "適用附属書"> 37<!ENTITY root "ルート"> 38<!ENTITY base-character "基底文字"> 39<!ENTITY diacritical-mark "発音符"><!--(ダイアクリティカルマーク)を初出のとき補う--> 40<!ENTITY composed-form "合成形式"> 41<!ENTITY standalone "スタンドアロン"> 42<!ENTITY double-hyphen "二連ハイフン"> 43<!--<!ENTITY case-fold "大文字か小文字への統一">--> 44<!-- <!ENTITY case-fold "比較のとき,大文字と小文字の同一視">--> 45<!ENTITY parameter "パラメタ"> 46<!ENTITY stream "ストリーム"> 47<!ENTITY validating "妥当性を検証する"> 48<!ENTITY non-validating "妥当性を検証しない"> 49<!ENTITY user "ユーザ"> 50<!--<!ENTITY at-user-option "ユーザがオプションを指定したとき">--> 51<!ENTITY at-user-option "ユーザのオプション指定によっては"> 52<!ENTITY content-particle "内容素子"> 53<!ENTITY processor "プロセサ"> 54<!ENTITY default "デフォルト"> 55<!ENTITY default-value "デフォルト値"> 56<!ENTITY header "ヘッダ"> 57<!ENTITY target "ターゲット"> 58<!ENTITY mixed-content "混合内容"> 59<!ENTITY country-code "国コード"> 60<!ENTITY language-code "言語コード"> 61<!ENTITY version "版"> <!-- version 1.0は第1.0版 --> 62<!ENTITY match "マッチ"> 63<!ENTITY character-value "文字番号"> 64<!ENTITY byte-order-mark "バイト順マーク"> 65<!ENTITY bypass "処理しない"> 66<!ENTITY identifier "識別子"> 67<!-- <!ENTITY identify "識別する"> --> 68<!ENTITY identify "特定する"> 69<!-- <!ENTITY identified "識別される"> --> 70<!ENTITY identified "特定される"> 71<!ENTITY combining-character "結合文字"> 72<!ENTITY subset "サブセット"> 73<!ENTITY token "トークン"> 74<!ENTITY literal "リテラル"> 75 76<!ENTITY parenthesis "かっこ"> 77<!ENTITY left-parenthesis "開きかっこ"> 78<!ENTITY right-parenthesis "閉じかっこ"> 79 80<!-- あとで気がついたもの JIS X0221を見る必要あり --> 81 82<!ENTITY extender "エクステンダ"> 83<!ENTITY property "プロパティ"> 84<!ENTITY property-list "プロパティリスト"> 85<!ENTITY property-file "プロパティファイル"> 86<!ENTITY font-decomposition "フォント分解"> 87<!ENTITY compatibility-decomposition "互換性分解"> 88<!ENTITY compatibility-area "互換性領域"> 89 90<!ENTITY language-identification "言語識別"> 91 92<!ENTITY space-character "スペース文字"> 93<!ENTITY space "スペース"> 94<!ENTITY code-value "コード値"> 95<!ENTITY normative "規定の"> 96<!ENTITY hueristics "ヒューリスティック"> 97<!ENTITY informative ""> 98 99<!ENTITY WebSGML 'ISO 8879へのWebSGML&adaptations-annex;'> 100<!ENTITY XML.version "1.0"> 101<!ENTITY doc.date "1997年12月8日"> 102<!ENTITY iso6.doc.date "971208"> 103<!ENTITY w3c.doc.date "97年12月3日"> 104<!ENTITY draft.day '8日'> 105<!ENTITY draft.month '12月'> 106<!ENTITY draft.year '1997年'> 107 108<!-- 日本語訳のための解析対象実体(ここまで) --> 109 110<!-- LAST TOUCHED BY: Tim Bray, 3 Dec 1997 --> 111 112<!-- The words 'FINAL EDIT' in comments mark places where changes 113need to be made after approval of the document by the ERB, before 114publication. --> 115 116<!ENTITY XML.version "1.0"> 117<!ENTITY doc.date "8 December 1997"> 118<!ENTITY iso6.doc.date "971208"> 119<!ENTITY w3c.doc.date "03-Dec-97"> 120<!ENTITY draft.day '8'> 121<!ENTITY draft.month 'December'> 122<!ENTITY draft.year '1997'> 123 124<!ENTITY WebSGML 125 'WebSGML Adaptations Annex to ISO 8879'> 126 127<!ENTITY newline " "> 128<!-- old: <!ENTITY newline "
"> --> 129<!ENTITY gt ">"> 130<!--<!ENTITY amp "&"> --> 131<!ENTITY xmlpio "'<?xml'"> 132<!ENTITY pic "'?>'"> 133<!ENTITY br "\n"> 134<!ENTITY cellback '#c0d9c0'> 135<!ENTITY mdash "--"> <!-- was: <!ENTITY mdash "&#151;"> --> 136<!ENTITY com "--"> 137<!ENTITY como "--"> 138<!ENTITY comc "--"> 139<!ENTITY hcro "&#x"> 140<!-- <!ENTITY nbsp ""> --> 141<!ENTITY nbsp " "> 142<!ENTITY magicents "<code>amp</code>, 143<code>lt</code>, 144<code>gt</code>, 145<code>apos</code>, 146<code>quot</code>"> 147 148<!--日本語訳について: コメントは翻訳対象から外しました。鈴木和夫 --> 149<!-- audience and distribution status: for use at publication time --> 150<!-- --> 151<!ENTITY doc.audience "公開レビュー及び議論"> 152<!ENTITY doc.distribution "テキスト及び法律上の注意を改変しない限り, 153自由に配布してもよい"> 154 155]> 156 157<!-- for Panorama *--> 158<?VERBATIM "eg" ?> 159 160<spec> 161<header> 162<title>拡張可能な&markup;言語 (XML)</title> 163<version>第1.0&version;</version> 164<w3c-designation>PR-xml-&iso6.doc.date;</w3c-designation> 165<w3c-doctype>World Wide Web Consortium</w3c-doctype> 166<pubdate><day>&draft.day;</day><month>&draft.month;</month><year>&draft.year;</year></pubdate> 167<notice><p>この草案は,XML WG及び他の関係者によるレビューのためのものであって,公開の議論のためのものではない。 168<!-- FINAL EDIT: FIX --></p></notice> 169<publoc> 170<loc href="http://www.w3.org/TR/PR-xml-&iso6.doc.date;"> 171http://www.w3.org/TR/PR-xml-&iso6.doc.date;</loc></publoc> 172<prevlocs> 173<loc href='http://www.w3.org/TR/WD-xml-961114'> 174http://www.w3.org/TR/WD-xml-961114</loc> 175<loc href='http://www.w3.org/TR/WD-xml-lang-970331'> 176http://www.w3.org/TR/WD-xml-lang-970331</loc> 177<loc href='http://www.w3.org/TR/WD-xml-lang-970630'> 178http://www.w3.org/TR/WD-xml-lang-970630</loc> 179<loc href='http://www.w3.org/TR/WD-xml-970807'> 180http://www.w3.org/TR/WD-xml-970807</loc> 181<loc href='http://www.w3.org/TR/WD-xml-971117'> 182http://www.w3.org/TR/WD-xml-971117</loc> 183</prevlocs> 184<authlist> 185<author><name>Tim Bray</name> 186<affiliation>Textuality and Netscape</affiliation> 187<email 188href="mailto:tbray@textuality.com">tbray@textuality.com</email></author> 189<author><name>Jean Paoli</name> 190<affiliation>Microsoft</affiliation> 191<email href="mailto:jeanpa@microsoft.com">jeanpa@microsoft.com</email></author> 192<author><name>C. M. Sperberg-McQueen</name> 193<affiliation>University of Illinois at Chicago</affiliation> 194<email href="mailto:cmsmcq@uic.edu">cmsmcq@uic.edu</email></author> 195</authlist> 196<status> 197 <p>この&TR-or-Rec;は, 1997年12月にWorld Wide Web Consortiumから 198公表された勧告案Extensible Markup Language version第1.0版を翻訳し, 技 199術的内容を変更することなく作成した&TR-or-Rec;である。This &eTR-or-Rec; 200is a translation of the XML proposed recommendation 1.0 201published by the World Wide Web Consortium in December 1997. It is 202intended that &eTR-or-Rec; is technically identical to the original.</p> 203 204<p>原文にある、著作権に関しての記述を次に示す。The 205original copyright notice is shown below:</p> 206 207<p>この版のXMLの規定は,公開レビュー及び議論を 208目的とする。テキスト及び法律上の注意を改変しない限り,自由に 209配布してもよい。This version of the XML specification is for 210public review and discussion. It may be distributed freely, 211as long as all text and legal notices remain intact.</p> 212 213<p>この&TR-or-Rec;の元となったXML勧告案は,1998年2月にWorld 214Wide Web Consortiumから公表されたXML勧告によってすでに置き換 215えられている。この標準情報は,XML勧告に従って訂正することを 216予定している。The XML Proposed Recommendation is superseded 217by the XML Recommendation which was published by the World 218Wide Web Consortium in February 1998. It is intended that 219this &eTR-or-Rec; be revised accordingly in the near future.</p> 220 221<p>この&TR-or-Rec;は,安定したものであって,昨年来の<loc 222href='http://www.w3.org/XML'>XML活動</loc>を通じて作成された,一連の作 223業草案を元とする。現在,広範囲に使用されている国際的なテキスト処理の標 224準(標準一般化&markup;言語,Standard Generalized Markup Language, ISO 2258879:1986に追加及び訂正を加えたもの)の,WWW上での使用のために⊂ 226化した言語を,この&TR-or-Rec;は,規定する。ISO 8879のどの機能をこの 227⊂に残すか,という決定についての詳細は,<loc 228href='http://www.w3.org/XML/#WG-decisions'>別途用意する</loc>。XMLは, 229既にいくつかの商品でサポートされ,XMLをサポートする<loc 230href='http://www.w3.org/XML/#software'>フリーウェア</loc>の数も増えて 231いる。XMLに関する公開の論議も,オンラインで<loc 232href='http://www.w3.org/XML/#discussion'>入手できる</loc>。It is a 233stable document derived from a series of working drafts produced over 234the last year as deliverables of the <loc 235href='http://www.w3.org/XML'>XML activity</loc>. It specifies a 236language created by subsetting an existing, widely used international 237text processing standard (Standard Generalized Markup Language, ISO 2388879:1986 as amended and corrected) for use on the World Wide Web. 239Details of the decisions regarding which features of ISO 8879 to 240retain in the subset <loc 241href='http://www.w3.org/XML/#WG-decisions'>are available 242separately</loc>. XML is already supported by some commercial 243products, and there are a growing number of <loc 244href='http://www.w3.org/XML/#software'>free implementations</loc>. 245Public discussions of XML <loc 246href='http://www.w3.org/XML/#discussion'>are accessible 247online</loc>.</p> 248 249<p>この&TR-or-Rec;では,<bibref ref="Berners-Lee"/>に定義する 250URI(Uniform Resource Identifier)を使用する。URIの制定作業は進行中であっ 251て,<bibref ref="RFC1738"/>及び<bibref ref="RFC1808"/>を更新する予定と 252なっている。この作業がRFCとして受け入れられない場合は,この規程内のURI 253への参照は,URL(Uniform Resource Locator)への参照に代わる。This 254specification uses the term URI, which is defined by <bibref 255ref="Berners-Lee"/>, a work in progress expected to update <bibref 256ref="RFC1738"/> and <bibref ref="RFC1808"/>. Should the work not be 257accepted as an RFC, the references to uniform resource identifiers 258(URIs) in this specification will become references to uniform 259resource locators (URLs).</p> 260 261 <p>XMLの仕様に準拠しているかどうかの基準となるはW3Cのサイトにあ 262る原文である。The normative version of the specification is 263the English version found at the W3C site.</p> 264 265 <p>この標準情報は原仕様と技術的に同一であることを意図しているが、 266翻訳上の誤りはあり得る。Although this technical report is 267intended to be technically identical to the original, it may 268contain errors from the translation.</p> 269 270 <p>備考: 原規定との規定箇所の対応関係を明らかにするため、この 271&TR-or-Rec;の節構成及び節番号は、原規定のそれらをできるだけ保存してい 272る。この&TR-or-Rec;のWeb版は、原規定のHTMLタグをそのまま保存している。 273</p> 274</status> 275<!-- out of date 276<statusp>This is a W3C Working Draft for review by W3C members and other 277interested parties. It is a draft document and may be updated, 278replaced, or obsoleted by other documents at any time. It is 279inappropriate to use W3C Working Drafts as reference material or to 280cite them as other than "work in progress". A list of current W3C 281working drafts can be found at 282<loc href="http://www.w3.org/TR">http://www.w3.org/TR</loc>.</statusp> 283<statusp><emph>Note:</emph> Since working drafts are subject to frequent 284change, you are advised to reference the above URL, rather than the 285URLs for working drafts themselves.</statusp> 286<statusp>This work is part of the W3C SGML Activity (for current 287status, see <loc href="http://www.w3.org/MarkUp/SGML/Activity" 288>http://www.w3.org/MarkUp/SGML/Activity</loc>).</statusp> 289<p>The current 290draft of this specification 291presupposes the successful completion of the current 292work on the &WebSGML;, being prepared by ISO/IEC JTC1 293at the time this draft specification was drafted. 294If it is not 295adopted in the expected form, some clauses of this specification 296may change, and some 297recommendations now labeled "<termref def="dt-interop">for 298interoperability</termref>" will become requirements labeled 299"<termref def="dt-compat">for compatibility</termref>". 300</p> 301<p>The current draft of this specification uses the term 302URI, which is defined by 303<bibref ref="Berners-Lee"/>, 304which is work in progress expected to update 305<bibref ref="RFC1738"/> and <bibref ref="RFC1808"/>. 306Should the work in this draft not be accepted as an RFC, the 307references to uniform resource identifiers (URIs) in this 308specification will become references to uniform resource 309locators (URLs).</p> 310</status> --> 311<abstract> 312<p>拡張可能な&markup;言語(XML)はSGMLの簡単な方言であって,この&TR-or-Rec;で,そのすべてを規定する。XMLの目標は,現在のHTMLと同様に,一般性のあるSGMLをウェブ上で配布,受信及び処理できることとする。XMLは実装が容易であって,SGML及びHTMLのどちらに対しても相互運用性を保つ設計がなされている。</p> 313</abstract> 314<pubstmt> 315<p>Chicago, Vancouver, Mountain View, et al.: 316World-Wide Web Consortium, XML作業グループ, 1996, 1997.</p> 317</pubstmt> 318<sourcedesc> 319<p>Created in electronic form.</p> 320</sourcedesc> 321<langusage> 322<language id='EN'>English</language> 323<language id='ebnf'>Extended Backus-Naur Form (formal grammar)</language> 324</langusage> 325<revisiondesc> 326<slist> 327<sitem>1997-12-03 : CMSMcQ : yet further changes</sitem> 328<sitem>1997-12-02 : TB : further changes (see TB to XML WG, 3292 December 1997)</sitem> 330<sitem>1997-12-02 : CMSMcQ : deal with as many corrections and 331comments from the proofreaders as possible: 332entify hard-coded document date in pubdate element, 333change expansion of entity WebSGML, 334update status description as per Dan Connolly (am not sure 335about refernece to Berners-Lee et al.), 336add 'The' to abstract as per WG decision, 337move Relationship to Existing Standards to back matter and 338combine with References, 339re-order back matter so normative appendices come first, 340re-tag back matter so informative appendices are tagged informdiv1, 341remove XXX XXX from list of 'normative' specs in prose, 342move some references from Other References to Normative References, 343add RFC 1738, 1808, and 2141 to Other References (they are not 344normative since we do not require the processor to enforce any 345rules based on them), 346add reference to 'Fielding draft' (Berners-Lee et al.), 347move notation section to end of body, 348drop URIchar non-terminal and use SkipLit instead, 349lose stray reference to defunct nonterminal 'markupdecls', 350move reference to Aho et al. into appendix (Tim's right), 351add prose note saying that hash marks and fragment identifiers are 352NOT part of the URI formally speaking, and are NOT legal in 353system identifiers (processor 'may' signal an error). 354Work through: 355Tim Bray reacting to James Clark, 356Tim Bray on his own, 357Eve Maler, 358 359NOT DONE YET: 360change binary / text to unparsed / parsed. 361handle James's suggestion about < in attriubte values 362uppercase hex characters, 363namechar list, 364</sitem> 365<sitem>1997-12-01 : JB : add some column-width parameters</sitem> 366<sitem>1997-12-01 : CMSMcQ : begin round of changes to incorporate 367recent WG decisions and other corrections: 368binding sources of character encoding info (27 Aug / 3 Sept), 369correct wording of Faust quotation (restore dropped line), 370drop SDD from EncodingDecl, 371change text at version number 1.0, 372drop misleading (wrong!) sentence about ignorables and extenders, 373modify definition of PCData to make bar on msc grammatical, 374change grammar's handling of internal subset (drop non-terminal markupdecls), 375change definition of includeSect to allow conditional sections, 376add integral-declaration constraint on internal subset, 377drop misleading / dangerous sentence about relationship of 378entities with system storage objects, 379change table body tag to htbody as per EM change to DTD, 380add rule about space normalization in public identifiers, 381add description of how to generate our name-space rules from 382Unicode character database (needs further work!). 383</sitem> 384<sitem>1997-10-08 : TB : Removed %-constructs again, new rules 385for PE appearance.</sitem> 386<sitem>1997-10-01 : TB : Case-sensitive markup; cleaned up 387element-type defs, lotsa little edits for style</sitem> 388<sitem>1997-09-25 : TB : Change to elm's new DTD, with 389substantial detail cleanup as a side-effect</sitem> 390<sitem>1997-07-24 : CMSMcQ : correct error (lost *) in definition 391of ignoreSectContents (thanks to Makoto Murata)</sitem> 392<sitem>Allow all empty elements to have end-tags, consistent with 393SGML TC (as per JJC).</sitem> 394<sitem>1997-07-23 : CMSMcQ : pre-emptive strike on pending corrections: 395introduce the term 'empty-element tag', note that all empty elements 396may use it, and elements declared EMPTY must use it. 397Add WFC requiring encoding decl to come first in an entity. 398Redefine notations to point to PIs as well as binary entities. 399Change autodetection table by removing bytes 3 and 4 from 400examples with Byte Order Mark. 401Add content model as a term and clarify that it applies to both 402mixed and element content. 403</sitem> 404<sitem>1997-06-30 : CMSMcQ : change date, some cosmetic changes, 405changes to productions for choice, seq, Mixed, NotationType, 406Enumeration. Follow James Clark's suggestion and prohibit 407conditional sections in internal subset. TO DO: simplify 408production for ignored sections as a result, since we don't 409need to worry about parsers which don't expand PErefs finding 410a conditional section.</sitem> 411<sitem>1997-06-29 : TB : various edits</sitem> 412<sitem>1997-06-29 : CMSMcQ : further changes: 413Suppress old FINAL EDIT comments and some dead material. 414Revise occurrences of % in grammar to exploit Henry Thompson's pun, 415especially markupdecl and attdef. 416Remove RMD requirement relating to element content (?). 417</sitem> 418<sitem>1997-06-28 : CMSMcQ : Various changes for 1 July draft: 419Add text for draconian error handling (introduce 420the term Fatal Error). 421RE deleta est (changing wording from 422original announcement to restrict the requirement to validating 423parsers). 424Tag definition of validating processor and link to it. 425Add colon as name character. 426Change def of %operator. 427Change standard definitions of lt, gt, amp. 428Strip leading zeros from #x00nn forms.</sitem> 429<sitem>1997-04-02 : CMSMcQ : final corrections of editorial errors 430found in last night's proofreading. Reverse course once more on 431well-formed: Webster's Second hyphenates it, and that's enough 432for me.</sitem> 433<sitem>1997-04-01 : CMSMcQ : corrections from JJC, EM, HT, and self</sitem> 434<sitem>1997-03-31 : Tim Bray : many changes</sitem> 435<sitem>1997-03-29 : CMSMcQ : some Henry Thompson (on entity handling), 436some Charles Goldfarb, some ERB decisions (PE handling in miscellaneous 437declarations. Changed Ident element to accept def attribute. 438Allow normalization of Unicode characters. move def of systemliteral 439into section on literals.</sitem> 440<sitem>1997-03-28 : CMSMcQ : make as many corrections as possible, from 441Terry Allen, Norbert Mikula, James Clark, Jon Bosak, Henry Thompson, 442Paul Grosso, and self. Among other things: give in on "well formed" 443(Terry is right), tentatively rename QuotedCData as AttValue 444and Literal as EntityValue to be more informative, since attribute 445values are the <emph>only</emph> place QuotedCData was used, and 446vice versa for entity text and Literal. (I'd call it Entity Text, 447but 8879 uses that name for both internal and external entities.)</sitem> 448<sitem>1997-03-26 : CMSMcQ : resynch the two forks of this draft, reapply 449my changes dated 03-20 and 03-21. Normalize old 'may not' to 'must not' 450except in the one case where it meant 'may or may not'.</sitem> 451<sitem>1997-03-21 : TB : massive changes on plane flight from Chicago 452to Vancouver</sitem> 453<sitem>1997-03-21 : CMSMcQ : correct as many reported errors as possible. 454</sitem> 455<sitem>1997-03-20 : CMSMcQ : correct typos listed in CMSMcQ hand copy of spec.</sitem> 456<sitem>1997-03-20 : CMSMcQ : cosmetic changes preparatory to revision for 457WWW conference April 1997: restore some of the internal entity 458references (e.g. to docdate, etc.), change character xA0 to &nbsp; 459and define nbsp as &#160;, and refill a lot of paragraphs for 460legibility.</sitem> 461<sitem>1996-11-12 : CMSMcQ : revise using Tim's edits: 462Add list type of NUMBERED and change most lists either to 463BULLETS or to NUMBERED. 464Suppress QuotedNames, Names (not used). 465Correct trivial-grammar doc type decl. 466Rename 'marked section' as 'CDATA section' passim. 467Also edits from James Clark: 468Define the set of characters from which [^abc] subtracts. 469Charref should use just [0-9] not Digit. 470Location info needs cleaner treatment: remove? (ERB 471question). 472One example of a PI has wrong pic. 473Clarify discussion of encoding names. 474Encoding failure should lead to unspecified results; don't 475prescribe error recovery. 476Don't require exposure of entity boundaries. 477Ignore white space in element content. 478Reserve entity names of the form u-NNNN. 479Clarify relative URLs. 480And some of my own: 481Correct productions for content model: model cannot 482consist of a name, so "elements ::= cp" is no good. 483</sitem> 484<sitem>1996-11-11 : CMSMcQ : revise for style. 485Add new rhs to entity declaration, for parameter entities.</sitem> 486<sitem>1996-11-10 : CMSMcQ : revise for style. 487Fix / complete section on names, characters. 488Add sections on parameter entities, conditional sections. 489Still to do: Add compatibility note on deterministic content models. 490Finish stylistic revision.</sitem> 491<sitem>1996-10-31 : TB : Add Entity Handling section</sitem> 492<sitem>1996-10-30 : TB : Clean up term & termdef. Slip in 493ERB decision re EMPTY.</sitem> 494<sitem>1996-10-28 : TB : Change DTD. Implement some of Michael's 495suggestions. Change comments back to //. Introduce language for 496XML namespace reservation. Add section on white-space handling. 497Lots more cleanup.</sitem> 498<sitem>1996-10-24 : CMSMcQ : quick tweaks, implement some ERB 499decisions. Characters are not integers. Comments are /* */ not //. 500Add bibliographic refs to 10646, HyTime, Unicode. 501Rename old Cdata as MsData since it's <emph>only</emph> seen 502in marked sections. Call them attribute-value pairs not 503name-value pairs, except once. Internal subset is optional, needs 504'?'. Implied attributes should be signaled to the app, not 505have values supplied by processor.</sitem> 506<sitem>1996-10-16 : TB : track down & excise all DSD references; 507introduce some EBNF for entity declarations.</sitem> 508<sitem>1996-10-?? : TB : consistency check, fix up scraps so 509they all parse, get formatter working, correct a few productions.</sitem> 510<sitem>1996-10-10/11 : CMSMcQ : various maintenance, stylistic, and 511organizational changes: 512Replace a few literals with xmlpio and 513pic entities, to make them consistent and ensure we can change pic 514reliably when the ERB votes. 515Drop paragraph on recognizers from notation section. 516Add match, exact match to terminology. 517Move old 2.2 XML Processors and Apps into intro. 518Mention comments, PIs, and marked sections in discussion of 519delimiter escaping. 520Streamline discussion of doctype decl syntax. 521Drop old section of 'PI syntax' for doctype decl, and add 522section on partial-DTD summary PIs to end of Logical Structures 523section. 524Revise DSD syntax section to use Tim's subset-in-a-PI 525mechanism.</sitem> 526<sitem>1996-10-10 : TB : eliminate name recognizers (and more?)</sitem> 527<sitem>1996-10-09 : CMSMcQ : revise for style, consistency through 2.3 528(Characters)</sitem> 529<sitem>1996-10-09 : CMSMcQ : re-unite everything for convenience, 530at least temporarily, and revise quickly</sitem> 531<sitem>1996-10-08 : TB : first major homogenization pass</sitem> 532<sitem>1996-10-08 : TB : turn "current" attribute on div type into 533CDATA</sitem> 534<sitem>1996-10-02 : TB : remould into skeleton + entities</sitem> 535<sitem>1996-09-30 : CMSMcQ : add a few more sections prior to exchange 536 with Tim.</sitem> 537<sitem>1996-09-20 : CMSMcQ : finish transcribing notes.</sitem> 538<sitem>1996-09-19 : CMSMcQ : begin transcribing notes for draft.</sitem> 539<sitem>1996-09-13 : CMSMcQ : made outline from notes of 09-06, 540do some housekeeping</sitem> 541</slist> 542</revisiondesc> 543</header> 544<body> 545<div1 id='sec-intro'> 546<head>一般事項</head> 547<!-- <div2 id='sec-scope'> 548 <head>適用範囲</head> --> 549<p>拡張可能な&markup;言語XML(eXtensible Markup Language)は,<termref def="dt-xml-doc">XML文書</termref>というデータオブジェクトのクラスを規定し,XML文書を処理するプログラムの動作の一部を規定する。XMLは,SGML(標準一般化&markup;言語,Standard Generalized Markup Language)<bibref ref='ISO8879'/>の制限した⊂とする。構造上,XML文書は,かならずSGML規格に適合する。</p> 550<p>XML文書は,<termref def="dt-entity">実体</termref>という記憶単位からなり,実体は,&parsed-data;又は&unparsed-data;からなる。&parsed-data;は,<termref def="dt-character">文字</termref>からなり,その一部は,文書の<termref def="dt-chardata">文字データ</termref>を構成し,一部は,<termref def="dt-markup">&markup;</termref>を構成する。&markup;は,文書の記憶レイアウト及び論理構造についての記述を表す符号とする。XMLは,記憶レイアウト及び論理構造についての制約条件を記述する機構を提供する。</p> 551<p><termdef id="dt-xml-proc" term="XML&processor;"><term>XML&processor;</term>というソフトウェアモジュールは,XML文書を読み込み,その内容及び構造へのアクセスを提供するために用いる。 </termdef> <termdef id="dt-app" term="&application;">XML&processor;は,他のモジュールのために動作することを前提とし,そのモジュールを<term>&application;</term>という。</termdef>この&TR-or-Rec;は,XML&processor;が行わなければならない振舞いを規定する。つまり,XMLデータの読込み方法を規定し,&application;に提供する情報を規定する。</p> 552<!-- </div2> --> 553<div2 id='sec-origin-goals'> 554<head>経緯及び目標</head> 555<p>1996年にWorld Wide Web Consortium(W3C)の中に設立したXML作業グループ(以前は, SGML編集レビュー委員会と呼ばれた)が,XMLを開発した。この作業グループの議長を,Sun MicrosystemsのJon Bosakが勤める。W3Cが組織し,以前はSGML作業グループと呼ばれたXML SIG(Special Interest Group)も,XMLの制定に非常に活発に参画した。 556<!--JISでは? XML作業グループのメンバを付録に示す。-->Dan Connollyは,作業グループのW3Cにおける連絡係を務めた。</p> 557<p>XMLの設計目標を,次に示す。<ulist> 558<item><p>a) XMLは,Internet上でそのまま使用できる。</p></item> 559<item><p>b) XMLは,広範囲の&application;を支援する。</p></item> 560<item><p>c) XMLは,SGMLと互換性をもつ。</p></item> 561<item><p>d) XML文書を処理するプログラムを書くことは,容易でなければならない。</p></item> 562<item><p>e) XMLでは,オプションの機能はできるだけ少なくし,一つも存在しないことを目指す。</p></item> 563<item><p>f) XML文書は,人間にとって読みやすく,十分に理解しやすい。</p></item> 564<item><p>g) XMLの設計は,すみやかに行えなければならない。</p></item> 565<item><p>h) XMLの設計は,厳密及び簡潔でなければならない。</p></item> 566<item><p>i) XML文書は,容易に作成できる。</p></item> 567<item><p>j) XMLでは,&markup;の数を減らすことは,重要ではない。</p></item></ulist> 568</p> 569<p>XML第&XML.version;&version;を理解し,それを処理する計算機プログラムを書くために十分な情報は,この&TR-or-Rec;及び関連する規格(文字用として,Unicode及びISO/IEC 10646,<!--* XXX for Uniform Resource Identifiers, *-->&language-identification;タグ用として,インタネット RFC 1766,&language-code;用として,ISO 639,並びに&country-code;用として,ISO 3166)で,すべて示す。</p> 570<p>この&version;のXMLの規定<!-- (&doc.date;) -->は,公開レビュー及び議論を目的とする。テキスト及び法律上の注意を改変しない限り,自由に配布してもよい。</p> 571</div2> 572<div2 id='sec-terminology'> 573<head>定義</head> 574<p>XML文書の規定のために使用する用語は,この&TR-or-Rec;内で定義する。次に示す語句は,それらの用語を定義するため,及びXML&processor;の動きを規定するために使用する。 575<glist> 576<gitem> 577<label>1.2.1 してもよい(may)</label> 578<def><p><termdef id="dt-may" term="してもよい">適合する文書又はXML&processor;は,記述されたとおりに動作してもよいが,そのとおりにする必要はない。</termdef></p></def> 579</gitem> 580<gitem> 581<label>1.2.2 しなければならない(must)</label> 582<def><p>適合する文書又はXML&processor;は,記述されたとおりに動作することが要求される。そうでなければ,&error;とする。<!-- do NOT change this! this is what defines a violation ofa 'must' clause as 'an error'. -MSM --> 583</p></def> 584</gitem> 585<gitem> 586<label>1.2.3 &error;(error)</label> 587<def><p><termdef id="dt-error" term="&error;">この&TR-or-Rec;が定める規則に対する違反。結果は定義しない。適合するソフトウェアは,&error;を検出して報告してもよく,&error;から回復してもよい。</termdef></p></def> 588</gitem> 589<gitem> 590<label>1.2.4 &fatal-error;(fatal error)</label> 591<def><p><termdef id="dt-fatal" term="&fatal-error;">適合する<termref def="dt-xml-proc">XML&processor;</termref>が検出しなければならず,&application;に報告しなければならない&error;。&fatal-error;を発見したあと,&processor;は,それ以降の&error;を探すためにデータ処理を続行してもよく,&error;を発見した場合は,その&error;を&application;に報告してもよい。&error;訂正をサポートするために,&processor;は,未処理データ(文字データ及び&markup;の混在したもの)を文書から取り出し,&application;に渡してもよい。しかし,一度,&fatal-error;を検出したら,&processor;は,通常の処理を続行してはならない。つまり,&processor;は,文字データ及び文書の論理構造についての情報を,通常の方法で&application;に渡し続けてはならない。</termdef></p></def> 592</gitem> 593<gitem> 594<label>1.2.5 &at-user-option;(at user option)</label> 595<def><p>適合するソフトウエアは,記述されたとおりに振る舞ってもよい(may),又は振る舞わなくてはならない(must)(文章中の助動詞による。)。そのとおりに振る舞う場合は,記述された振舞いを選択又は拒否する手段を&user;に提供しなければならない。</p></def> 596</gitem> 597<gitem> 598<label>1.2.6 &validity;制約(validity constraint)</label> 599<def><p>すべての<termref def="dt-valid">&valid;な</termref>XML文書に適用する規則。&validity;制約の違反は,&error;とする。&at-user-option;,<termref def="dt-validating">検証を行うXML&processor;</termref>は,この&error;を報告しなければならない。</p></def> 600</gitem> 601<gitem> 602<label>1.2.7 &well-formed;制約(well-formedness constraint)</label> 603<def><p>すべての<termref def="dt-wellformed">&well-formed;</termref>のXML文書に適用する規則。&well-formed;制約の違反は,<termref def="dt-fatal">&fatal-error;</termref>とする。</p></def> 604</gitem> 605<gitem> 606<label>1.2.8 &match;(match)</label> 607<def><p>a) <termdef id="dt-match" term="&match;">&string;又は名前の&match; 比較する二つの&string;又は名前は,同一でなければならない。ISO/IEC 10646において,複数の表現が可能な文字[例えば,&composed-form;及び基底+&diacritical-mark;(ダイアクリティカルマーク)形式]は,どちらの&string;も同じ表現のときに限り,&match;する。&at-user-option;,&processor;は,その文字を標準形に正規化してもよい。比較のとき、大文字と小文字との区別をする。<!-- Note that no processing of characters with respect to case is part of the matching process. --><BR>b) &string;と文法中の規則との&match; ある生成規則から生成する言語に,ある&string;が属するとき,この&string;は,この生成規則に&match;するという。<BR>c) 内容と内容モデルとの&match; ある要素が,<titleref href='elementvalid'>要素の&validity;</titleref>の制約に示す意味で適合するとき,この要素は,その宣言に&match;するという。</termdef></p></def> 608</gitem> 609<gitem> 610<label>1.2.9 互換性のため(for compatibility)</label> 611<def><p><termdef id="dt-compat" term="互換性のため">XMLの機能であって,XMLがSGMLと互換であることを保証するためだけに導入されるもの。</termdef></p></def> 612</gitem> 613<gitem> 614<label>1.2.10 相互運用性のため(for interoperability)</label> 615<def><p><termdef id="dt-interop" term="相互運用性のため">拘束力はもたない推奨事項。&WebSGML;以前から存在するSGML&processor;が,XML文書を処理できる可能性を高めるために取り入れるもの。</termdef></p></def> 616</gitem> 617</glist> 618</p> 619</div2> 620</div1> 621<!-- &Docs; --> 622<div1 id='sec-documents'> 623<head>文書</head> 624<p><termdef id="dt-xml-doc" term="XML文書"> 625<!-- A textual object --> 626この&TR-or-Rec;で定義する意味で,<termref def="dt-wellformed">&well-formed;</termref>とするデータオブジェクトを,<term>XML文書</term>という。&well-formed;のXML文書が,さらに,ある制約条件を満足すれば,<termref def="dt-valid">&valid;</termref>なXML文書とする。 627</termdef></p> 628 629<!-- why this div? -TB 630<div2 id='sec-log-phys'> 631<head>Logical and Physical Structure</head> --> 632 633<p>いずれのXML文書も,論理構造及び物理構造をもつ。物理的には,文書は,<termref def="dt-entity">実体</termref>と呼ぶ単位からなる。ある実体は,文書内に他の実体を含むために,その他の実体を<termref def="dt-entref">参照</termref>してもよい。文書は,“ルート”すなわち<termref def="dt-docent">文書実体</termref>から始まる。論理的には,文書は,宣言,要素,コメント,文字参照及び処理命令を含み,これらすべては,文書内で明示的な&markup;によって示す。論理構造及び物理構造は,<titleref href="wf-entities">以降</titleref>に示すとおりに,厳密に入れ子になっていなければならない。</p> 634 635<!-- 636</div2> --> 637 638<div2 id='sec-well-formed'> 639<head>&well-formed;のXML文書</head> 640<p><termdef id="dt-wellformed" term="&well-formed;">あるテキストオブジェクトが,次のいずれかのとき,そのテキストオブジェクトを&well-formed;のXML文書と呼ぶ。</termdef> 641<ulist> 642<item><p>a) 全体として,<nt def='NT-document'>document</nt>というラベルをもつ生成規則に&match;する。</p></item> 643<item><p>b) この&TR-or-Rec;で定義する,すべての&well-formed;制約に従う。</p> 644</item> 645<item><p>c) それぞれの<termref def='dt-parsedent'>&parsed-entity;</termref>が,<titleref href='wf-entities'>&well-formed;</titleref>となる。</p></item> 646</ulist></p> 647<p> 648<scrap lang='ebnf' id='document'> 649<head>文書</head> 650<prod id='NT-document'><lhs>document</lhs> 651<rhs><nt def='NT-prolog'>prolog</nt> 652<nt def='NT-element'>element</nt> 653<nt def='NT-Misc'>Misc</nt>*</rhs></prod> 654</scrap> 655</p> 656<p><nt def="NT-document">document</nt>生成規則に&match;するとは,次を意味する。 657<ulist> 658<item><p>a) 一つ以上の<termref def="dt-element">要素</termref>を含む。</p> 659</item> 660 661<!--* N.B. some readers (notably JC) find the following 662paragraph awkward and redundant. I agree it's logically redundant: 663it *says* it is summarizing the logical implications of 664matching the grammar, and that means by definition it's 665logically redundant. I don't think it's rhetorically 666redundant or unnecessary, though, so I'm keeping it. It 667could however use some recasting when the editors are feeling 668stronger. -MSM *--> 669 670<item><p>b) <termdef id="dt-root" term="ルート要素"><term>ルート</term>又は文書要素という要素が一つだけ存在し,これは,他の要素の<termref def="dt-content">内容</termref>に含まれない。</termdef>これ以外のすべての要素は,その開始タグが他の要素の内容に含まれれば,対応する終了タグも同じ要素の内容に含まれる。つまり,要素は,開始タグ及び終了タグによって区切られ,入れ子構造をなす。 671</p></item> 672</ulist> 673</p> 674<p><termdef id="dt-parentchild" term="親要素/子要素">これらの結果として,文書内のどの非ルート要素<code>C</code>に対しても,ある他の要素<code>P</code>が存在し,<code>C</code>は,<code>P</code>の内容に含まれるが,<code>P</code>の内容に含まれる他の要素に含まれることはない。このとき,<code>P</code>を<code>C</code>の<code>親</code>といい,<code>C</code>を<code>P</code>の<code>子</code>という。</termdef></p> 675</div2> 676<div2 id="charsets"> 677<head>文字</head> 678<p> 679 680<!--The data stored in an XML <termref def="dt-entity">entity</termref> is 681either <termref def="dt-text">parsed</termref> or <termref 682def="dt-unparsed">unparsed</termref>. --> 683 684<termdef id="dt-text" term="テキスト">&parsed-entity;は,<term>テキスト</term>(<termref def="dt-character">文字</termref>の並びであって,&markup;又は文字データを表してもよい。)を含む。</termdef><termdef id="dt-character" term="文字"><term>文字</term>は,テキストの最小単位であって,ISO/IEC 10646<bibref ref="ISO10646"/>に規定される。<!--Users may extend the ISO/IEC 10646 character repertoire by exploiting the private use areas. -->許容する文字は,タブ,改行,復帰並びにUnicode及びISO/IEC 10646が許容する図形文字とする。</termdef> 685<scrap lang="ebnf" id="char32"> 686<head>文字の範囲</head> 687<prodgroup pcw2="4" pcw4="17.5" pcw5="11"> 688<prod id="NT-Char"><lhs>Char</lhs> 689<rhs>#x9 | #xA | #xD | [#x20-#D7FF] | [#xE000-#xFFFD] 690| [#x10000-#x10FFFF]</rhs> 691<com>任意のUnicode文字。ただし,&surrogate-blocks;,FFFE及びFFFFは除く。</com> 692</prod> 693</prodgroup> 694</scrap> 695</p> 696<p>&character-value;をビットパタンに符号化する機構は,実体ごとに違ってもよい。すべてのXML&processor;は,ISO/IEC 10646のUTF-8符号化及びUTF-16符号化を受け付けなければならない。二つのどちらが用いられているかを明示するための機構,及び他の符号化方法を利用するための機構は,<titleref href='charencoding'>文字の符号化</titleref>に記述する。</p> 697<p>どの符号化方法を用いるかに関係なく,ISO/IEC 10646の文字集合にあるすべての文字は,そのUCS-4&code-value;<!-- bit string. -->と等価な10進数又は16進数によって,参照できる。</p> 698</div2> 699 700<div2 id='sec-common-syn'> 701<head>共通の構文構成子</head> 702 703<p>2.3では,文法内で広く使用するいくつかの記号を定義する。</p> 704<p><nt def="NT-S">S</nt> (空白)は,一つ若しくは複数の&space-character;(#x20),復帰,改行又はタブから成る。 705 706<scrap lang="ebnf" id='white'> 707<head>空白</head> 708<prodgroup pcw2="4" pcw4="17.5" pcw5="11"> 709<prod id='NT-S'><lhs>S</lhs> 710<rhs>(#x20 | #x9 | #xD | #xA)+</rhs> 711</prod> 712</prodgroup> 713</scrap></p> 714<p>便宜上,文字を,&letter;,数字又は他の文字に分類する。&letter;は,アルファベット的又は表音的である基本文字(一つ又は複数の&combining-character;が,後に続くこともある。),&ideographic;から成る。 715<!-- 716Certain layout and format-control characters defined by ISO/IEC 10646 717should be ignored when recognizing identifiers; these are defined by the 718classes <nt def='NT-Ignorable'>Ignorable</nt> and <nt def='NT- 719Extender'>Extender</nt>. 720--> 721各クラスにおける実際の文字についての完全な定義は,<titleref href='CharClasses'>文字クラス</titleref>に関する付録に規定する。</p> 722<p><termdef id="dt-name" term="Name"><term>Name</term>は,&letter;又はいくつかの区切り文字の一つで始まり,その後に&letter;,数字,ハイフン,下線,コロン又はピリオドが続く(これらを名前文字という。)。</termdef>&string;"<code>xml</code>"又は<code>(('X'|'x') ('M'|'m') ('L'|'l'))</code>に&match;する任意の&string;で始まる名前は,この&TR-or-Rec;の現在の版又は将来の版での標準化のために予約する。 723</p> 724<note> 725<p>XMLの名前の中のコロンは,名前空間での実験のために予約する。コロンの意味は,将来のある時点で標準化するものとし,そのときには,実験的な目的でコロンを使用する文書を更新する必要が生じる可能性がある。XMLで採用する名前空間の機構が,区切り子として実際にコロンを使用するという保証はない。事実上,これは,名前空間の実験の一つとして以外には,XMLの名前の中でコロンを使用しないほうがよいことを意味する。しかし,XML&processor;は,名前文字としてコロンを受け付けることが望ましい。 726</p> 727</note> 728<p> 729<nt def='NT-Nmtoken'>Nmtoken</nt> (名前&token;)は,名前文字で構成する列とする。 730<scrap lang='ebnf'> 731<head>名前及び&token;</head> 732<!-- 733<prod id='NT-MiscName'><lhs>MiscName</lhs> 734<rhs></rhs> 735</prod>--> 736<prod id='NT-NameChar'><lhs>NameChar</lhs> 737<rhs><nt def="NT-Letter">Letter</nt> 738| <nt def='NT-Digit'>Digit</nt> 739<!--| <nt def='NT-MiscName'>MiscName</nt>--> 740| '.' | '-' | '_' | ':' 741| <nt def='NT-CombiningChar'>CombiningChar</nt> 742<!-- | <nt def='NT-Ignorable'>Ignorable</nt> --> 743| <nt def='NT-Extender'>Extender</nt></rhs> 744</prod> 745<prod id='NT-Name'><lhs>Name</lhs> 746<rhs>(<nt def='NT-Letter'>Letter</nt> | '_' | ':') 747(<nt def='NT-NameChar'>NameChar</nt>)*</rhs></prod> 748<prod id='NT-Names'><lhs>Names</lhs> 749<rhs><nt def='NT-Name'>Name</nt> 750(<nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt>)*</rhs></prod> 751<prod id='NT-Nmtoken'><lhs>Nmtoken</lhs> 752<rhs>(<nt def='NT-NameChar'>NameChar</nt>)+</rhs></prod> 753<prod id='NT-Nmtokens'><lhs>Nmtokens</lhs> 754<rhs><nt def='NT-Nmtoken'>Nmtoken</nt> (<nt def='NT-S'>S</nt> <nt 755def='NT-Nmtoken'>Nmtoken</nt>)*</rhs></prod> 756</scrap> 757</p> 758<p>&literal;データは,引用符で囲まれた&string;とし,その列の区切り子として使用する引用符は含まない。&literal;は,内部実体(<nt def='NT-EntityValue'>EntityValue</nt>),属性値(<nt def='NT-AttValue'>AttValue</nt>),外部&identifier;(<nt def="NT-SystemLiteral">SystemLiteral</nt>)の内容の指定に使用する。目的によっては,&literal;全体を,その中の&markup;の走査を行なわずに,スキップすることがある(<nt def='NT-SkipLit'>SkipLit</nt>。)。 759<scrap lang='ebnf'> 760<head>&literal;</head> 761<!-- is marked section end legal in entity values etc.? 762James says yes. Handbook page 392, sec. 10.4 seems to me to say no. 763If James is right, leave as is. Otherwise, uncomment 764the next comment and ... 765--> 766<!-- 767<prod id='NT-EntityValue'><lhs>EntityValue</lhs> 768<rhs>' " ' 769(([^%&"] 770| <nt def='NT-PEReference'>PEReference</nt> 771| <nt def='NT-Reference'>Reference</nt>)* 772- (<nt def='NT-Char'>Char</nt>* ']]>' <nt def='NT-char'>Char</nt>*)) 773' " ' 774</rhs> 775<rhs>| 776" ' " 777(([^%&'] 778| <nt def='NT-PEReference'>PEReference</nt> 779| <nt def='NT-Reference'>Reference</nt>)* 780- (<nt def='NT-Char'>Char</nt>* ']]>' <nt def='NT-char'>Char</nt>*)) 781" ' "</rhs> 782</prod> 783<prod id='NT-AttValue'><lhs>AttValue</lhs> 784<rhs>'"' 785(([^<&"] 786| <nt def='NT-Reference'>Reference</nt>)* 787- (<nt def='NT-Char'>Char</nt>* ']]>' <nt def='NT-char'>Char</nt>*)) 788' " ' 789</rhs> 790<rhs>| 791" ' " 792(([^<&'] 793| <nt def='NT-Reference'>Reference</nt>)* 794- (<nt def='NT-Char'>Char</nt>* ']]>' <nt def='NT-char'>Char</nt>*)) 795" ' "</rhs> 796<wfc def="CleanAttrVals"/> 797</prod> 798--> 799<!-- ... and comment out the following, down to ... --> 800<prod id='NT-EntityValue'><lhs>EntityValue</lhs> 801<rhs>' " ' 802([^%&"] 803| <nt def='NT-PEReference'>PEReference</nt> 804| <nt def='NT-Reference'>Reference</nt>)* 805' " ' 806</rhs> 807<rhs>| 808" ' " 809([^%&'] 810| <nt def='NT-PEReference'>PEReference</nt> 811| <nt def='NT-Reference'>Reference</nt>)* 812" ' "</rhs> 813</prod> 814<prod id='NT-AttValue'><lhs>AttValue</lhs> 815<rhs>' " ' 816([^<&"] 817| <nt def='NT-Reference'>Reference</nt>)* 818' " ' 819</rhs> 820<rhs>| 821" ' " 822([^<&'] 823| <nt def='NT-Reference'>Reference</nt>)* 824" ' "</rhs> 825<!--<wfc def="WF-Attvaldelim"/>--> 826</prod> 827<!-- ... down to here. --> 828<prod id="NT-SystemLiteral"><lhs>SystemLiteral</lhs> 829<rhs><nt def='NT-SkipLit'>SkipLit</nt></rhs> 830</prod> 831<!-- <prod id="NT-URIchar"><lhs>URIchar</lhs> 832<rhs><com>See <loc href="http://www.w3.org/XXX">XXX</loc></com> 833</rhs></prod> 834--> 835<prod id="NT-PubidLiteral"><lhs>PubidLiteral</lhs> 836<rhs>' " ' <nt def='NT-PubidChar'>PubidChar</nt>* 837' " ' 838| " ' " (<nt def='NT-PubidChar'>PubidChar</nt> - " ' ")* " ' "</rhs> 839</prod> 840<prod id="NT-PubidChar"><lhs>PubidChar</lhs> 841<rhs>#x20 | #xD | #xA 842| [a-zA-Z0-9] 843| [-'()+,./:=?]</rhs> 844</prod> 845<prod id="NT-SkipLit"><lhs>SkipLit</lhs> 846<rhs>(' " ' [^"]* ' " ') 847| (" ' " [^']* " ' ")</rhs> 848</prod> 849<!-- alternate form, making ms end illegal: --> 850<!-- 851<prod id="NT-SkipLit"><lhs>SkipLit</lhs> 852<rhs>(' " ' ([^"]* - ([^"]* ']]>' [^"]*)) ' " ') 853| (" ' " ([^']* - ([^']* ']]>' [^']*)) " ' ")</rhs> 854</prod> 855--> 856</scrap> 857</p> 858<!-- 859<wfcnote id="WF-Attvaldelim"> 860<head>Delimiters in Attribute Values</head> 861<p>After the expansion of character and entity references, 862an attribute value must not contain a "<code><</code>" 863or "<code>&</code>" character unless that character was 864introduced by the expansion of a character reference 865or one of the entities &magicents;.</p> 866</wfcnote>--> 867<!-- 868This is not quite right: < should be legal, should it not? 869Suppress this WFC until we get it right. 870--> 871<!-- Henry Thompson suggests (in substance, not form: the wording needs 872to be clarified): 873"Cooked Attribute values must not contain < & or the 874quote which closed their uncooked literal, 875unless arising from the expansion of a character reference or 876magic reference 877directly contained in their uncooked literal." 878I'm not sure I agree with this rule, but it's at least coherent, 879which is more than I can say for my attempt. 880--> 881</div2> 882 883<div2 id='syntax'> 884<head>文字データ及び&markup;</head> 885<p><termref def='dt-text'>テキスト</termref>は,<termref def="dt-chardata">文字データ</termref>及び&markup;が混在するものとして構成する。<termdef id="dt-markup" term="Markup"><term>&markup;</term>は,<termref def="dt-stag">開始タグ</termref>,<termref def="dt-etag">終了タグ</termref>,<termref def="dt-empty">空要素</termref>,<termref def="dt-entref">実体参照</termref>,<termref def="dt-charref">文字参照</termref>,<termref def="dt-comment">コメント</termref>,<termref def="dt-cdsection">CDATAセクション</termref> の区切り子,<termref def="dt-doctype">文書型宣言</termref>及び<termref def="dt-pi">処理命令</termref>の形を取る。 886</termdef> 887</p> 888<p><termdef id="dt-chardata" term="Character Data">&markup;ではないすべてのテキストは,文書の<term>文字データ</term>を構成する。</termdef></p> 889<p>アンパサンド文字 (&)及び&left-angle-bracket; (<)は,&markup;の区切り子として,又は<termref def="dt-comment">コメント</termref>,<termref def="dt-pi">処理命令</termref>若しくは<termref def="dt-cdsection">CDATAセクション</termref>内で使用する場合に<emph>だけ</emph>,そのままの形で出現してよい。これらの文字は,内部実体宣言の<termref def='dt-litentval'>&literal;実体値</termref>内に記述してもよい。 詳しくは,<titleref href='wf-entities'>&well-formed;の実体</titleref>に関する規定を参照。<!-- FINAL EDIT: restore internal entity decl or leave it out. -->これらの文字が他の部分で必要な場合,数値による文字参照又は&string;"<code>&amp;</code>"及び&string;"<code>&lt;</code>"を使用し,<termref def="dt-escape">&escape;</termref>しなければならない。&right-angle-bracket; (>) は,&string;"<code>&gt;</code>"を使用して表現してもよい。内容の中で列"<code>]]></code>"を使用するときは,それが,<termref def="dt-cdsection">CDATAセクション</termref>の終了を&markup;しない限り,<termref def='dt-compat'>互換性のため</termref>,"<code>&gt;</code>"又は文字参照を使用し,&escape;しなければならない。</p> 890 891<p>要素の内容では,文字データは,いかなる&markup;の開始区切り子を含まない任意の&char-string;とする。CDATAセクションでは,文字データとは,CDATAセクションの終了区切り子"<code>]]></code>"を含まない任意の&char-string;とする。 892</p> 893<p> 894属性値に&single-quote;及び&double-quote;を含むためには,アポストロフィ又は&single-quote;(') は,"<code>&apos;</code>"として表現し,&double-quote;(")は,"<code>&quot;</code>"として表現する。 895<scrap lang="ebnf"> 896<head>文字データ</head> 897<prod id='NT-CharData'> 898<lhs>CharData</lhs> 899<rhs>[^<&]* - ([^<&]* ']]>' [^<&]*)</rhs> 900</prod> 901</scrap> 902</p> 903</div2> 904 905<div2 id='sec-comments'> 906<head>コメント</head> 907 908<p><termdef id="dt-comment" term="Comment"><term>コメント</term>は,他の<termref def='dt-markup'>&markup;</termref>の外ならば,文書のどこに現れてもよい。さらに,文書型宣言内で,文法が許す場所に現れてもよい。 909<!-- TB 910except in a <termref def="dt-cdsection">CDATA section</termref>, i.e. within 911<termref def="dt-elemcontent">element content</termref>, in 912<termref def="dt-mixed">mixed content</termref>, or in the prolog. They must 913not occur within declarations or tags. --> 914コメントは,文書の<termref def="dt-chardata">文字データ</termref>の一部ではない。XML&processor;は,&application;がコメントのテキストを取り出すことを可能としてもよいが,そうしなくともよい。 915<termref def="dt-compat">互換性のため</termref>,&string;"<code>--</code>" (&double-hyphen;)は,コメント内で現れてはならない。 916<scrap lang="ebnf"> 917<head>コメント</head> 918<prod id='NT-Comment'><lhs>Comment</lhs> 919<rhs>'<!--' 920((<nt def='NT-Char'>Char</nt> - '-') 921| ('-' (<nt def='NT-Char'>Char</nt> - '-')))* 922'-->'</rhs> 923<!-- 924<rhs>'<!&como;' 925(<nt def='NT-Char'>Char</nt>* - 926(<nt def='NT-Char'>Char</nt>* '&comc;' <nt def='NT-Char'>Char</nt>*)) 927'&comc;>'</rhs> --> 928</prod> 929</scrap> 930</termdef></p> 931<p>コメントの例を次に示す。 932<eg><!&como; declarations for <head> & <body> &comc;></eg> 933</p> 934</div2> 935 936<div2 id='sec-pi'> 937<head>処理命令</head> 938 939<p><termdef id="dt-pi" term="Processing instruction"><term>処理命令</term>(PI)によって,&application;のための命令を文書に入れることができる。 940 941<scrap lang="ebnf"> 942<head>処理命令</head> 943<prod id='NT-PI'><lhs>PI</lhs> 944<rhs>'<?' <nt def='NT-PITarget'>PITarget</nt> 945(<nt def='NT-S'>S</nt> 946(<nt def='NT-Char'>Char</nt>* - 947(<nt def='NT-Char'>Char</nt>* &pic; <nt def='NT-Char'>Char</nt>*)))? 948&pic;</rhs></prod> 949<prod id='NT-PITarget'><lhs>PITarget</lhs> 950<rhs><nt def='NT-Name'>Name</nt> - 951(('X' | 'x') ('M' | 'm') ('L' | 'l'))</rhs> 952</prod> 953</scrap></termdef> 954PIは,文書の<termref def="dt-chardata">文字データ</termref>の一部ではないが,&application;に渡されなければならない。PIは,命令が渡される&application;を&identify;ために使用する⌖ (<nt def='NT-PITarget'>PITarget</nt>) で始まる。⌖名 "<code>XML</code>","<code>xml</code>"などは,この&TR-or-Rec;の現在の版又は将来の版の規格化用に予約する。XMLの<termref def='dt-notation'>記法</termref>機構を,PIの⌖を宣言するために使用してもよい。 955</p> 956</div2> 957 958<div2 id='sec-cdata-sect'> 959<head>CDATAセクション</head> 960 961<p><termdef id="dt-cdsection" term="CDATA Section"><term>CDATAセクション</term>は,文字データが出現するところであれば,どこに出現してもよい。これは,そうでなければ,&markup;として認識する文字を含む,テキストの区画を&escape;するのに使用する。CDATAセクションは,&string;"<code><![CDATA[</code>"で始まり,&string; 962"<code>]]></code>"で終わる。 963<scrap lang="ebnf"> 964<head>CDATAセクション</head> 965<prod id='NT-CDSect'><lhs>CDSect</lhs> 966<rhs><nt def='NT-CDStart'>CDStart</nt> 967<nt def='NT-CData'>CData</nt> 968<nt def='NT-CDEnd'>CDEnd</nt></rhs></prod> 969<prod id='NT-CDStart'><lhs>CDStart</lhs> 970<rhs>'<![CDATA['</rhs> 971</prod> 972<prod id='NT-CData'><lhs>CData</lhs> 973 974<rhs>(<nt def='NT-Char'>Char</nt>* - 975(<nt def='NT-Char'>Char</nt>* ']]>' <nt def='NT-Char'>Char</nt>*)) 976</rhs> 977</prod> 978<prod id='NT-CDEnd'><lhs>CDEnd</lhs> 979<rhs>']]>'</rhs> 980</prod> 981</scrap> 982 983CDATAセクション内では,列<nt def='NT-CDEnd'>CDEnd</nt>だけを&markup;として認識するので,&left-angle-bracket;及びアンパサンドは,その&literal;形式で出現してよい。それらは,"<code>&lt;</code>"及び"<code>&amp;</code>"を使用して&escape;する必要はない。CDATAセクションは,入れ子にはできない。 984</termdef> 985</p> 986 987<p>"<code><greeting></code>"及び"<code></greeting></code>"を,<termref def='dt-markup'>&markup;</termref>ではなく,<termref def='dt-chardata'>文字データ</termref>として認識するCDATAセクションの例を,次に示す。 988<eg><![CDATA[<greeting>Hello, world!</greeting>]]></eg> 989</p> 990</div2> 991 992<div2 id='sec-prolog-dtd'> 993<head>&prolog;及び文書型宣言</head> 994 995<p><termdef id='dt-xmldecl' term='XML Declaration'>XML文書は,使用するXMLの&version;を指定する<term>XML宣言</term>で始めてもよく,又そうするのが望ましい。 996</termdef> 997</p> 998<p>この&TR-or-Rec;のこの&version;に適合することを示すためには,&version;番号 "<code>1.0</code>" を使用しなければならない。ある文書が,この&TR-or-Rec;のこの&version;に適合しないとき,値"<code>1.0</code>"を使用するのは,&error;とする。この&TR-or-Rec;の今後の&version;に"<code>1.0</code>"以外の値を付与することが,XML作業グループの意図だが,XMLの将来の&version;を作成することの確約を示すわけではなく,作成したとしても,番号付けについて,特定の方法を使用することの確約を示すわけでもない。将来の&version;の可能性を除外しないので,必要な場合,自動的な&version;の認識を可能とする手段として,この構成子を提供する。&processor;は,サポートしていない&version;でラベル付けした文書を受け取ったとき,&error;を通知してもよい。 999</p> 1000<p>XML文書内の&markup;の機能は,記憶構造及び論理構造を記述すること,並びに属性及び属性値の対を論理構造に関連づけることにある。XMLは,論理構造についての制約条件を定義するため,及びあらかじめ定義された記憶単位を使用できるための機構として,<termref def="dt-doctype">文書型宣言</termref>を提供する。<!-- old 1001The function of the markup in an XML document is to describe its 1002storage and logical structures, and associate attribute-value pairs with the 1003logical structure. 1004XML provides a 1005mechanism, the <termref def="dt-doctype">document type declaration</termref>, 1006to 1007define constraints on that logical structure and to support the use of 1008predefined storage units. --><termdef id="dt-valid" term="Validity">XML文書が<term>&valid;</term>とは,文書型宣言をもち,その文書型宣言に示す制約条件を満たすこととする。 1009</termdef></p> 1010<p>文書型宣言は,文書の最初の<termref def="dt-element">要素</termref>の前に現れなければならない。 1011<scrap lang="ebnf" id='xmldoc'> 1012<head>&prolog;</head> 1013<prodgroup pcw2="6" pcw4="17.5" pcw5="9"> 1014<prod id='NT-prolog'><lhs>prolog</lhs> 1015<rhs><nt def='NT-XMLDecl'>XMLDecl</nt>? 1016<nt def='NT-Misc'>Misc</nt>* 1017(<nt def='NT-doctypedecl'>doctypedecl</nt> 1018<nt def='NT-Misc'>Misc</nt>*)?</rhs></prod> 1019<prod id='NT-XMLDecl'><lhs>XMLDecl</lhs> 1020<rhs>&xmlpio; 1021<nt def='NT-VersionInfo'>VersionInfo</nt> 1022<nt def='NT-EncodingDecl'>EncodingDecl</nt>? 1023<nt def='NT-SDDecl'>SDDecl</nt>? 1024<nt def="NT-S">S</nt>? 1025&pic;</rhs> 1026</prod> 1027<prod id='NT-VersionInfo'><lhs>VersionInfo</lhs> 1028<rhs><nt def="NT-S">S</nt> 'version' <nt def='NT-Eq'>Eq</nt> 1029('"<nt def="NT-VersionNum">VersionNum</nt>"' 1030| "'<nt def="NT-VersionNum">VersionNum</nt>'")</rhs> 1031</prod> 1032<prod id='NT-Eq'><lhs>Eq</lhs> 1033<rhs><nt def='NT-S'>S</nt>? '=' <nt def='NT-S'>S</nt>?</rhs></prod> 1034<prod id="NT-VersionNum"> 1035<lhs>VersionNum</lhs> 1036<rhs>([a-zA-Z0-9_.:] | '-')+</rhs> 1037</prod> 1038<prod id='NT-Misc'><lhs>Misc</lhs> 1039<rhs><nt def='NT-Comment'>Comment</nt> | <nt def='NT-PI'>PI</nt> | 1040<nt def='NT-S'>S</nt></rhs></prod> 1041</prodgroup> 1042</scrap></p> 1043 1044<p> 1045例えば,次に示す完全なXML文書は,<termref def="dt-wellformed">&well-formed;</termref>であるが<termref def="dt-valid">&valid;</termref>ではない。 1046<eg><![CDATA[<?xml version="1.0"?> 1047<greeting>Hello, world!</greeting> 1048]]></eg> 1049次の文書も同様とする。 1050<eg><![CDATA[<greeting>Hello, world!</greeting> 1051]]></eg> 1052</p> 1053<p><termdef id="dt-doctype" term="Document Type Declaration"> 1054XMLの<term>文書型宣言</term>は,ある文書クラスのための文法を提供する<termref def='dt-markupdecl'>&markup;宣言</termref>を含むか,又は参照する。この文法を,文書型定義又は<term>DTD</term>という。文書型宣言は,&markup;宣言を含んだ外部⊂(特別な種類の<termref def='dt-extent'>外部実体</termref>)を参照でき,又は内部⊂に直接&markup;宣言を含むこともできる。さらに,その両方も可能とする。ある文書のDTDは,両方の⊂をまとめたものとして構成する。</termdef> 1055</p> 1056<p><termdef id="dt-markupdecl" term="markup declaration"> 1057<term>&markup;宣言</term>は,<termref def="dt-eldecl">要素型宣言</termref>, <termref def="dt-attdecl">属性リスト宣言</termref>,<termref def="dt-entdecl">実体宣言</termref>又は<termref def="dt-notdecl">記法宣言</termref>とする。</termdef>次に示す&well-formed;制約及び&validity;制約に規定するが,これらの宣言は,<termref def='dt-PE'>¶meter;実体</termref>内に全体又は一部が含まれてもよい。詳しい規定は,<titleref xml-link="simple" href="sec-physical-struct">物理構造</titleref>に関する規定を参照のこと。</p> 1058<scrap lang="ebnf" id='dtd'> 1059<head>文書型定義</head> 1060<prodgroup pcw2="6" pcw4="17.5" pcw5="9"> 1061<prod id='NT-doctypedecl'><lhs>doctypedecl</lhs> 1062<rhs>'<!DOCTYPE' <nt def='NT-S'>S</nt> 1063<nt def='NT-Name'>Name</nt> (<nt def='NT-S'>S</nt> 1064<nt def='NT-ExternalID'>ExternalID</nt>)? 1065<nt def='NT-S'>S</nt>? ('[' 1066(<nt def='NT-markupdecl'>markupdecl</nt> 1067| <nt def='NT-PEReference'>PEReference</nt> 1068| <nt def='NT-S'>S</nt>)* 1069']' 1070<nt def='NT-S'>S</nt>?)? '>'</rhs> 1071<vc def="vc-roottype"/> 1072<!--<vc def="vc-nonnullDTD"/>--> 1073</prod> 1074<!-- 1075<prod id='NT-markupdecls'><lhs>markupdecls</lhs> 1076<rhs> 1077(<nt def='NT-S'>S</nt>? 1078<nt def='NT-markupdecl'>markupdecl</nt> 1079<nt def='NT-S'>S</nt>?)* 1080</rhs></prod> 1081--> 1082<prod id='NT-markupdecl'><lhs>markupdecl</lhs> 1083<rhs><nt def='NT-elementdecl'>elementdecl</nt> 1084| <nt def='NT-AttlistDecl'>AttlistDecl</nt> 1085| <nt def='NT-EntityDecl'>EntityDecl</nt> 1086| <nt def='NT-NotationDecl'>NotationDecl</nt> 1087| <nt def='NT-PI'>PI</nt> 1088| <nt def='NT-Comment'>Comment</nt> 1089<!--| <nt def='NT-InternalPERef'>InternalPERef</nt> --></rhs> 1090<vc def='vc-PEinMarkupDecl'/> 1091<wfc def="wfc-PEinInternalSubset"/> 1092</prod> 1093<!-- 1094<prod id="NT-InternalPERef"><lhs>InternalPERef</lhs> 1095<rhs><nt def="NT-PEReference">PEReference</nt></rhs> 1096<wfc def="wfc-integraldec"/> 1097</prod> 1098--> 1099</prodgroup> 1100</scrap> 1101<vcnote id="vc-roottype"> 1102<head>&root;要素型</head> 1103<p> 1104文書型宣言における<nt def='NT-Name'>Name</nt>は,&root;要素の型と&match;しなければならない。 1105</p> 1106</vcnote> 1107<!-- 1108<vcnote id="vc-nonnullDTD"> 1109<head>Non-null DTD</head> 1110<p> 1111The internal and external subsets of the DTD must not both 1112be empty. 1113</p> 1114</vcnote> 1115--> 1116<vcnote id='vc-PEinMarkupDecl'> 1117<head>宣言及び¶meter;実体が厳密に入れ子をなすこと</head> 1118<p>¶meter;実体<termref def='dt-repltext'>の&replacement-text;</termref>は,&markup;宣言内において,厳密に入れ子になっていなければならない。つまり,&markup;宣言(<nt def='NT-markupdecl'>markupdecl</nt>)の最初又は最後の文字が,<termref def='dt-PERef'>¶meter;実体参照</termref>の対象となる&replacement-text;に含まれれば,両方とも同じ&replacement-text;に含まれなければならない。</p> 1119</vcnote> 1120<wfcnote id="wfc-PEinInternalSubset"> 1121<head>内部⊂内の¶meter;実体</head> 1122<p>DTDの内部⊂では,<termref def='dt-PERef'>¶meter;実体参照</termref>は,&markup;宣言が出現可能な場所だけに出現できる。&markup;宣言内には出現できない(この制約は,外部¶meter;実体又は外部⊂での参照には適用しない。)。 1123</p> 1124</wfcnote> 1125<p> 1126内部⊂のときと同様に,外部⊂及びDTDにおいて参照する任意の外部¶meter;実体は,非終端記号<nt def="NT-markupdecl">markupdecl</nt>によって許される型の,一連の完全な&markup;宣言で構成されなければならない。&markup;宣言の間には,空白又は<termref def="dt-PERef">¶meter;実体参照</termref>を置いてもよい。しかし,外部⊂又は外部¶meter;実体の内容の一部は,<termref def="dt-cond-section">条件付きセクション</termref>を使用して無視してもよい。内部サブセットでは,これは許されない。 1127<!--In the external subset, however, parameter-entity references can 1128be used to replace constructs prefixed by "<code>%</code>" in a production of 1129the grammar, and <termref def="dt-cond-section">conditional sections</termref> 1130may occur. 1131In the internal subset, by contrast, conditional sections may not 1132occur and the only parameter-entity references 1133allowed are those which match the non-terminal 1134<nt def="NT-InternalPERef">InternalPERef</nt> 1135within the rule for <nt def="NT-doctypedecl">markupdecl</nt>. 1136--> 1137<scrap id="ext-Subset"> 1138<head>外部⊂</head> 1139<prodgroup pcw2="6" pcw4="17.5" pcw5="9"> 1140<prod id='NT-extSubset'><lhs>extSubset</lhs> 1141<rhs>( 1142<nt def='NT-markupdecl'>markupdecl</nt> 1143| <nt def='NT-conditionalSect'>conditionalSect</nt> 1144| <nt def='NT-PEReference'>PEReference</nt> 1145| <nt def='NT-S'>S</nt> 1146)*</rhs> 1147</prod> 1148</prodgroup> 1149</scrap></p> 1150<p>外部⊂及び外部¶meter;実体は,その内では,¶meter;実体が&markup;宣言の<emph>間</emph>だけでなく,&markup;宣言の<emph>内</emph>でも認識される,という点でも内部⊂とは異なる。 1151</p> 1152<p>文書型宣言付きのXML文書の例を,次に示す。 1153<eg><![CDATA[<?xml version="1.0"?> 1154<!DOCTYPE greeting SYSTEM "hello.dtd"> 1155<greeting>Hello, world!</greeting> 1156]]></eg> 1157<termref def="dt-sysid">システム&identifier;</termref> "<code>hello.dtd</code>"が,文書のDTDのURIとなる。</p> 1158<p>次の例のとおり,宣言を局所的に与えることもできる。 1159<eg><![CDATA[<?xml version="1.0" encoding="UTF-8" ?> 1160<!DOCTYPE greeting [ 1161 <!ELEMENT greeting (#PCDATA)> 1162]> 1163<greeting>Hello, world!</greeting> 1164]]></eg> 1165外部⊂及び内部⊂の両方を使用するときは,内部⊂が外部⊂より先に出現したと見なす。<!--* 'is considered to'? boo. whazzat mean? -->これは,内部⊂の実体及び属性リスト宣言が,外部⊂の実体及び属性リスト宣言より優先するという効果をもたらす。 1166</p> 1167</div2> 1168 1169<div2 id='sec-rmd'> 1170<head>&standalone;文書宣言</head> 1171<p><termref def="dt-xml-proc">XML&processor;</termref>は,&application;に文書の内容を渡すが,&markup;宣言は,この内容に影響を与えることがある。属性の&default-value;及び実体宣言をその例とする。XML宣言の一部分として出現できる&standalone;文書宣言は,文書が,その&markup;宣言の存在によって影響されないことを指し示す(普通,その&markup;宣言が存在しないために,これがいえる。)。 1172<scrap lang="ebnf" id='fulldtd'> 1173<head>&standalone;文書宣言</head> 1174<prodgroup pcw2="4" pcw4="19.5" pcw5="9"> 1175<prod id='NT-SDDecl'><lhs>SDDecl</lhs> 1176<rhs> 1177<nt def="NT-S">S</nt> 1178'standalone' <nt def='NT-Eq'>Eq</nt> "'" ('yes' | 'no') "'" 1179</rhs> 1180<rhs> 1181| <nt def="NT-S">S</nt> 1182'standalone' <nt def='NT-Eq'>Eq</nt> '"' ('yes' | 'no') '"' 1183</rhs><vc def='vc-check-rmd'/></prod> 1184</prodgroup> 1185</scrap></p> 1186<p>&standalone;文書宣言においては, "<code>yes</code>"の値は,<termref def='dt-docent'>文書実体</termref>の外部に(DTDの外部⊂内に,又は内部⊂から参照される外部パラメタ実体内に),XML&processor;から&application;へと渡される情報に影響する&markup;宣言が存在しないことを意味する。"<code>no</code>"の値は,その外部&markup;宣言が存在するか,又は存在する可能性があることを意味する。&standalone;文書宣言は,その<emph>宣言</emph>が文書外部に存在するかどうかを示すだけに注意すること。外部実体への参照が文書内に存在していても,その実体が内部的に宣言されているときは,文書の&standalone;の状態には影響を与えない。</p> 1187 1188<p>外部に&markup;宣言が存在しなければ,&standalone;文書宣言は意味をもたない。外部に&markup;宣言が存在し,&standalone;文書宣言が存在しない場合は,<code>"no"</code> の値の設定を仮定する。</p> 1189<p>XML文書で <code>standalone="no"</code> が設定されているものは,あるアルゴリズムで&standalone;文書に変換でき,この文書は,ネットワーク配信&application;にとって望ましいかもしれない。</p> 1190<vcnote id='vc-check-rmd'> 1191<head>&standalone;文書宣言</head> 1192<p>&standalone;文書宣言は,何らかの外部&markup;宣言が次のいずれかを宣言しているときは,値 "<code>no</code>" を取らなければならない。 1193<ulist> 1194<item><p>a) <termref def="dt-default">&default;</termref>値付きの属性であって,この属性が適用される要素が,属性値を指定せずに文書内に現れるもの。</p></item> 1195<item><p>b) &magicents;以外の実体であって,その実体に対する<termref def="dt-entref">参照</termref>が文書内に出現するもの。</p> 1196</item> 1197<item><p>c) 値が<titleref href='AVNormalize'>正規化</titleref>の対象となる属性であって,正規化の結果として変化する値が文書内で属性に指定されるもの。</p></item> 1198<item> 1199<p>d) <termref def="dt-elemcontent">要素内容</termref>をもつ要素型であって,空白がその要素型のいずれかのインスタンス内に直接現れるもの。 1200</p></item> 1201</ulist> 1202</p> 1203</vcnote> 1204<p>&standalone;文書宣言付きのXML宣言の例を,次に示す。 1205<eg><?xml version="&XML.version;" standalone='yes'?></eg></p> 1206</div2> 1207<div2 id='sec-white-space'> 1208<head>空白の取扱い</head> 1209<p>XML文書を編集するときは,&markup;を目立たせ読みやすくするために,“空白”(&space;,タブ及び空白行。この&TR-or-Rec;では,非終端記号の<nt def='NT-S'>S</nt>で表す)を使うと便利なことが多い。その空白は,配布する&version;の文書の一部として含めることを意図しないのを普通とする。しかし,“意味のある”空白であって,配布する&version;に残さなければならないものも多い。例えば,詩及びソースコードにおける空白がある。</p> 1210<p><termref def='dt-xml-proc'>XML&processor;</termref>は,文書内の&markup;以外のすべての文字を,そのまま変更せずに&application;に渡さなければならない。<termref def='dt-validating'>&validating;XML&processor;</termref>は,<termref def="dt-elemcontent">要素内容</termref>の中の空白を他の非&markup;文字から区別し,&application;側に要素内容の中の空白が重要でないということを伝えなければならない。</p> 1211<p> 1212"<code>xml:space</code>"という特別な<termref def='dt-attr'>属性</termref>を文書に挿入することによって,空白を重要とする意図を示してもよい。この属性を適用する要素に現れる空白を,アプリケーションが重要なものとして扱うことを要求する,という意図を示す。</p> 1213<p>&valid;な文書では,この属性を使用する場合は,他の属性と同じように<termref def="dt-attdecl">宣言</termref>しなければならない。宣言するときは,取り得る値を"<code>default</code>"及び "<code>preserve</code>"だけとする<termref def='dt-enumerated'>列挙型</termref>でなければならない。 1214</p> 1215<p>値"<code>default</code>"は,&application;の&default;の空白処理モードを,その要素に適用可能とすることを意味する。値"<code>preserve</code>"は,&application;がすべての空白を保存することを意味する。この宣言の意図は,"<code>xml:space</code>" 属性の別の指定で上書きしない限り,要素の内容に現れるすべての要素に適用すると解釈する。</p> 1216<p>文書の<termref def='dt-root'>&root;要素</termref>については,この属性の値を指定するか,又はこの属性の&default-value;がある場合を除いては,&application;による空白の取扱いについて,いかなる意図も示さないと解釈する。</p> 1217<p>例を次に示す。 1218<eg><![CDATA[ <!ATTLIST poem xml:space (default|preserve) 'preserve'>]]></eg> 1219</p> 1220</div2> 1221<div2 id='sec-line-ends'> 1222<head>行末の取扱い</head> 1223<p>XMLの<termref def='dt-parsedent'>構文&parsed-entity;</termref>は,通常コンピュータのファイル内に保存され,編集の便宜のために複数の行に分けることが多い。これらの行は,普通は,<code>CR</code> (#xD)コード及び <code>LF</code> (#xA)コードの何らかの組合せによって分けられる。</p> 1224<p><termref def='dt-app'>&application;</termref>の処理を簡単にするため,外部&parsed-entity;又は内部&parsed-entity;の&literal;実体値が,"<code>#xD#xA</code>" の2文字の連続とする&literal;又は<code>#xD</code>の単独の&literal;を含む場合に,<termref def='dt-xml-proc'>XML&processor;</termref>は,&application;に単一の文字<code>#xA</code>だけを渡さなければならない(この処理は,入力内に存在する改行コードを構文解析の前に正規化することによって,容易に実現できる。)。</p> 1225</div2> 1226<div2 id='sec-lang-tag'> 1227<head>&language-identification;</head> 1228<p>文書処理においては,その文書の中身がどんな自然言語又は形式言語で書かれているか明示することが,役に立つことが多い。<!--ここで使用する“言語”という言葉の意味は,"Español" 及び"EBNF"の双方で例示される意味とする。--><!-- x00F1: spanish's small ntilde--></p> 1229<!--; この情報は(例をあげれば)文書の文字の表示,並びに情報抽出のための語幹・形態素解析及びテキストブロックの整形に影響を及ぼす可能性がある。--> 1230<p>XML文書内の要素のもつ内容又は属性値において使用する<!--自然又は形式-->言語を指定するために,"<code>xml:lang</code>" という名前の特別な<termref def="dt-attr">属性</termref>を,文書内に挿入してもよい。 1231<!--; この属性はXML規定の一部として,複数のXML&application;の相互運用性を高めるために定義する。--> 1232属性の値は,<bibref ref="RFC1766"/>“RFC1766:&language-identification;のためのタグ”によって規定される&language-identification;コードに従う。 1233<scrap lang='ebnf'> 1234<head>&language-identification;</head> 1235<prod id='NT-LanguageID'><lhs>LanguageID</lhs> 1236<rhs><nt def='NT-Langcode'>Langcode</nt> 1237('-' <nt def='NT-Subcode'>Subcode</nt>)*</rhs></prod> 1238<prod id='NT-Langcode'><lhs>Langcode</lhs> 1239<rhs><nt def='NT-ISO639Code'>ISO639Code</nt> | 1240<nt def='NT-IanaCode'>IanaCode</nt> | 1241<nt def='NT-UserCode'>UserCode</nt></rhs> 1242</prod> 1243<prod id='NT-ISO639Code'><lhs>ISO639Code</lhs> 1244<rhs>([a-z] | [A-Z]) ([a-z] | [A-Z])</rhs></prod> 1245<prod id='NT-IanaCode'><lhs>IanaCode</lhs> 1246<rhs>('i' | 'I') '-' ([a-z] | [A-Z])+</rhs></prod> 1247<prod id='NT-UserCode'><lhs>UserCode</lhs> 1248<rhs>('x' | 'X') '-' ([a-z] | [A-Z])+</rhs></prod> 1249<prod id='NT-Subcode'><lhs>Subcode</lhs> 1250<rhs>([a-z] | [A-Z])+</rhs></prod> 1251</scrap> 1252<nt def='NT-Langcode'>Langcode</nt>は,次のどれでもよい。 1253<ulist> 1254<item><p>a) <bibref ref="ISO639"/>“言語の名前表現のためのコード”で規定される2文字の&language-code;</p></item> 1255<item><p>b) Internet Assigned Numbers Authority (IANA)で登録されている&language-code;。これは,先頭が "<code>i-</code>" (又は"<code>I-</code>")で始まる。</p></item> 1256<item><p>c) &user;によって定められた&language-code;,又は私的な使用のために複数の団体間が取り決めたコード。これらは,今後IANAにおいて標準化又は登録されるコードとの競合を避けるために,先頭を"<code>x-</code>" 又は "<code>X-</code>" で始める。</p></item> 1257</ulist></p> 1258<p><nt def='NT-Subcode'>Subcode</nt>は,複数回使ってもよい。最初のサブコードが存在し,その内容が二つの文字から成るときは,<bibref ref="ISO3166"/>ISO3166の“国名を表すコード(国コード)”でなければならない。最初のサブコードが3文字以上から成るときは,<nt def='NT-Langcode'>Langcode</nt>の先頭が,"<code>x-</code>" 又は "<code>X-</code>"で始まらない限り,指定した言語に対するサブコードとし,IANAに登録されたものでなければならない。</p> 1259<p>&language-code;は,小文字での表記を,&country-code;は,(存在するならば)大文字での表記を慣行とする。しかし,XML文書内における他の名前とは異なり,これらの値については,大文字及び小文字の区別をしないことに注意すること。</p> 1260<p>例を次に示す。 1261<eg><![CDATA[<p xml:lang="en">The quick brown fox jumps over the lazy dog.</p> 1262<p xml:lang="en-GB">What colour is it?</p> 1263<p xml:lang="en-US">What color is it?</p> 1264<sp who="Faust" desc='leise' xml:lang="de"> 1265 <l>Habe nun, ach! Philosophie,</l> 1266 <l>Juristerei, und Medizin</l> 1267 <l>und leider auch Theologie</l> 1268 <l>]]><!-- x00DF german's es-zet; x00FC german's u-umlaut -->durchaus studiert mit heißem Bemüh'n.<![CDATA[</l> 1269 </sp>]]></eg></p> 1270<!--<p>xml:lang の値は,要素の内容及び(属性の&default-value;で定めない限り)フリーテキスト(CDATA)の値をもつその要素へのすべての属性の値について,その両方に適用する。--> 1271<p><code>xml:lang</code>で宣言する意図は,<code>xml:lang</code>の別の指定で上書しない限り,指定した要素の内容に含むすべての要素に適用する。</p> 1272<!--ある要素における xml:lang 属性の値が定められておらず,DTDにおいてその&default-value;が定められていない場合,その要素のxml:lang 属性の値は,親要素での値が存在する場合は,それを引き継ぐ。 次の例における二つの<term>という名前の専門用語を表す要素は,xml:langの値に関しては,実際上,同じ値をもつ。 1273 1274 <p xml:lang="en">Here the keywords are 1275 <term xml:lang="en">shift</term> and 1276 <term>reduce</term>. ...</p> 1277 1278XML&processor;ではなく&application;が,この属性値の継承について責任をもつ。 1279--> 1280<p> 1281&valid;な文書においては,この&TR-or-Rec;の他の場所で規定するとおり,この属性を必ず宣言しなければならない。通常,宣言は,次の形とする。 1282<eg>xml:lang NMTOKEN #IMPLIED</eg> 1283必要ならば,特定の&default-value;を与えてもよい。英語を母語とする学生用のフランス語の詩集では,説明及び注を英語で記述すれば,xml:lang 属性を次のとおりに宣言することとなる。 1284<eg><![CDATA[ <!ATTLIST poem xml:lang NMTOKEN 'fr'> 1285 <!ATTLIST gloss xml:lang NMTOKEN 'en'> 1286 <!ATTLIST note xml:lang NMTOKEN 'en'>]]></eg> 1287</p> 1288<!-- 1289DTDの設計者は,スクリプトを言語(及びその派生体)に包摂して扱うのではなく,スクリプト及び言語を同次元で扱うのが適当な場合,言語属性と同様にスクリプト属性が存在すれば有用だと思うかもしれない。リンク要素において,参照された又はリンクされたリソースにおける(主要な)言語(場合によっては複数)を表す要素を定義するのも望ましい。しかし,これらの&application;は,この&TR-or-Rec;が規定する範囲外とする。--> 1290</div2> 1291</div1> 1292<!-- &Elements; --> 1293 1294<div1 id='sec-logical-struct'> 1295<head>論理構造</head> 1296 1297<p><termdef id="dt-element" term="Element">いかなる<termref def="dt-xml-doc">XML文書</termref>も,一つ以上の<term>要素</term>を含む。要素の境界は, <termref def="dt-stag">開始タグ</termref>及び<termref def="dt-etag">終了タグ</termref>によって区切る。要素が<termref def="dt-empty">空</termref>要素のときは,<termref def="dt-eetag">空要素タグ</termref>で示す。各々の要素は,型をもつ。要素型は名前(共通&identifier;(generic identifier)又はGIと呼ぶことがある。)によって&identified;。要素は,いくつかの属性をもつことができる。</termdef>属性は,<termref def="dt-attrname">名前</termref>及び<termref def="dt-attrval">値</termref>をもつ。</p> 1298 1299<scrap lang='ebnf'><head>要素</head> 1300<prod id='NT-element'><lhs>element</lhs> 1301<rhs><nt def='NT-EmptyElemTag'>EmptyElemTag</nt></rhs> 1302<rhs>| <nt def='NT-STag'>STag</nt> <nt def='NT-content'>content</nt> 1303<nt def='NT-ETag'>ETag</nt></rhs><wfc def='GIMatch'/></prod> 1304</scrap> 1305<p>この&TR-or-Rec;は,要素型及び属性の意味,使用方法,又は(構文に関することを除き)名前に制約を与えない。ただし,先頭が<code>(('X'|'x')('M'|'m')('L'|'l'))</code>に&match;する名前は,この版又は今後の版のこの&TR-or-Rec;での標準化のために予約する。</p> 1306 1307<wfcnote id='GIMatch'><head>要素型の&match;</head> 1308<p>要素の終了タグの<nt def='NT-Name'>名前</nt>は,その要素の開始タグにおける型と&match;しなければならない。</p> 1309</wfcnote> 1310 1311<div2 id='sec-starttags'> 1312<head>開始タグ,終了タグ及び空要素タグ</head> 1313<p><termdef id="dt-stag" term="Start-Tag">空でない任意のXML要素の始まりは,<term>開始タグ</term>によって&markup;する。 1314<scrap lang='ebnf'><head>開始タグ</head> 1315<prodgroup pcw2="6" pcw4="15" pcw5="11.5"> 1316<prod id='NT-STag'><lhs>STag</lhs><rhs>'<' <nt def='NT-Name'>Name</nt> (<nt def='NT-S'>S</nt> <nt def='NT-Attribute'>Attribute</nt>)* <nt def='NT-S'>S</nt>? '>'</rhs><wfc def="uniqattspec"/></prod> 1317<prod id='NT-Attribute'><lhs>Attribute</lhs><rhs><nt def='NT-Name'>Name</nt> <nt def='NT-Eq'>Eq</nt> <nt def='NT-AttValue'>AttValue</nt></rhs><vc def='ValueType'/><wfc def='NoExternalRefs'/><wfc def='CleanAttrVals'/></prod> 1318</prodgroup> 1319</scrap> 1320開始タグ及び終了タグ内の<nt def='NT-Name'>Name</nt>は,要素の<term>型</term>を表わす。</termdef><termdef id="dt-attr" term="Attribute"><nt def='NT-Name'>Name</nt>及び<nt def='NT-AttValue'>AttValue</nt>の対を要素の<term>属性指定</term>といい</termdef>,<termdef id="dt-attrname" term="Attribute Name">個々の対における<nt def='NT-Name'>Name</nt>は,<term>属性名</term></termdef>及び<termdef id="dt-attrval" term="Attribute Value"><nt def='NT-AttValue'>AttValue</nt>の内容(区切り子<code>'</code>又は<code>"</code>の間の&string;)を<term>属性値</term>という。</termdef></p> 1321 1322<wfcnote id='uniqattspec'><head>属性指定の一意性</head> 1323<p>開始タグ又は空要素タグでは,同一の属性名が2度以上出現してはならない。</p></wfcnote> 1324<vcnote id='ValueType'><head>属性値の型</head> 1325<p>属性は宣言されていなければならない。属性値の型は,その属性に対して宣言した型でなければならない(属性の型については,<titleref href='AttDecls'>属性リスト宣言</titleref>についての規定を参照。)。</p></vcnote> 1326<wfcnote id='NoExternalRefs'><head>外部実体への参照がないこと</head> 1327<p>属性値には,外部実体への直接的又は間接的な参照を含むことはできない。</p></wfcnote> 1328<wfcnote id='CleanAttrVals'><head>属性値に<code><</code>を含まないこと</head> 1329<p>属性値内で直接的又は間接的に参照する実体(<code>&lt;</code>を除く。)の<termref def='dt-repltext'>&replacement-text;</termref>には,<code><</code>を含んではならない。</p></wfcnote> 1330 1331<p>開始タグの例を,次に示す。 1332<eg><termdef id="dt-dog" term="dog"></eg></p> 1333<p><termdef id="dt-etag" term="End Tag">開始タグで始まる要素の終わりは,<term>終了タグ</term>で&markup;しなければならない。この終了タグは,対応する開始タグの要素型と同じ名前をもつ。 1334<scrap lang='ebnf'><head>終了タグ</head><prodgroup pcw2="6" pcw4="15" pcw5="11.5"><prod id='NT-ETag'><lhs>ETag</lhs><rhs>'</' <nt def='NT-Name'>Name</nt> <nt def='NT-S'>S</nt>? '>'</rhs></prod></prodgroup></scrap></termdef></p> 1335<p>終了タグの例を,次に示す。 1336<eg></termdef></eg></p> 1337 1338<p><termdef id="dt-content" term="Content">要素の開始タグと終了タグとの間の<termref def='dt-text'>テキスト</termref>を,その要素の<term>内容</term>という。 1339<scrap lang='ebnf'><head>要素の内容</head> 1340<prodgroup pcw2="6" pcw4="15" pcw5="11.5"><prod id='NT-content'><lhs>content</lhs><rhs>(<nt def='NT-element'>element</nt> | <nt def='NT-CharData'>CharData</nt> | <nt def='NT-Reference'>Reference</nt> | <nt def='NT-CDSect'>CDSect</nt> | <nt def='NT-PI'>PI</nt> | <nt def='NT-Comment'>Comment</nt>)*</rhs></prod></prodgroup></scrap></termdef></p> 1341 1342<p><termdef id="dt-empty" term="Empty">要素が<term>空</term>のとき,その要素は,直後に終了タグをもつ開始タグ又は空要素タグで表現しなければならない。</termdef><termdef id="dt-eetag" term="empty-element tag"><term>空要素タグ</term>は,次の特別な形式をとる。 1343<scrap lang='ebnf'><head>空要素のためのタグ</head><prodgroup pcw2="6" pcw4="15" pcw5="11.5"><prod id='NT-EmptyElemTag'><lhs>EmptyElemTag</lhs><rhs>'<' <nt def='NT-Name'>Name</nt> (<nt def='NT-S'>S</nt> <nt def='NT-Attribute'>Attribute</nt>)* <nt def='NT-S'>S</nt>? '/>'</rhs><wfc def="uniqattspec"/></prod></prodgroup></scrap></termdef></p> 1344 1345<!-- 門馬:上の“空要素のためのタグ(tags for empty elements)”は“空要素タグ(empty-element tag)”とすべきだと思いますが,いかがでしょうか --> 1346 1347<p>空要素タグは,内容をもたない任意の要素の表現に利用できる。空要素タグで表現する要素を,キーワード<kw>EMPTY</kw>を用いて宣言しなくともよい。</p> 1348<p>空要素の例を,次に示す。 1349<eg><IMG align="left" src="http://www.w3.org/Icons/WWW/w3c_home" /><br></br><br/></eg></p> 1350</div2> 1351 1352<div2 id='elemdecls'><head>要素宣言</head> 1353<p><termref def="dt-valid">&validity;</termref>を保証するため,要素宣言及び属性リスト宣言を用いて<termref def="dt-xml-doc">XML文書</termref>の<termref def="dt-element">要素</termref>の構造に,制約を加えることができる。</p> 1354<p>要素宣言は,要素の<termref def="dt-content">内容</termref>についての制約とする。</p> 1355<p>要素宣言は,要素の<termref def="dt-parentchild">子</termref>として出現可能な要素型について,制約を加えることが多い。&at-user-option;,要素宣言をもたない要素型が他の要素宣言によって参照されれば,XML&processor;は,警告を出してもよい。しかし,これは&error;とはしない。</p> 1356 1357<p><termdef id="dt-eldecl" term="Element Type declaration"><term>要素型宣言</term>は,次の形式をとる。 1358<scrap lang='ebnf'><head>要素型宣言</head><prodgroup pcw2="5.5" pcw4="18" pcw5="9"> 1359<prod id='NT-elementdecl'><lhs>elementdecl</lhs> 1360<rhs>'<!ELEMENT' <nt def='NT-S'>S</nt> 1361<nt def='NT-Name'>Name</nt> 1362<nt def='NT-S'>S</nt> 1363<nt def='NT-contentspec'>contentspec</nt> 1364<nt def='NT-S'>S</nt>? '>'</rhs> 1365<vc def='EDUnique'/></prod> 1366<prod id='NT-contentspec'><lhs>contentspec</lhs> 1367<rhs>'EMPTY' 1368| 'ANY' 1369| <nt def='NT-Mixed'>Mixed</nt> 1370| <nt def='NT-children'>children</nt> 1371</rhs> 1372<vc def='elementvalid'/> 1373</prod> 1374</prodgroup> 1375</scrap> 1376ここで,<nt def='NT-Name'>Name</nt>は,宣言されている要素の型とする。</termdef></p> 1377 1378<vcnote id='EDUnique'><head>要素宣言の一意性</head> 1379<p>要素型を2度以上宣言できない。</p></vcnote> 1380 1381<vcnote id='elementvalid'><head>要素の&validity;</head> 1382<p>要素が<!-- said to be -->&valid;とは,<nt def='NT-elementdecl'>elementdecl</nt>に&match;する宣言であって,その<nt def='NT-Name'>Name</nt>がその要素型と&match;し,次のいずれかの条件を満たす場合とする。<ulist> 1383<item><p>a) 宣言が<kw>EMPTY</kw>に&match;し,要素が<termref def='dt-content'>内容</termref>をもたない。</p></item> 1384<item><p>b) 宣言が<nt def='NT-children'>children</nt>に&match;し,要素の<termref def="dt-parentchild">子要素</termref>の並びが,内容モデルの正規表現によって生成される言語に属する。</p></item> 1385<item><p>c) 宣言が<nt def='NT-Mixed'>mixed</nt>に&match;し,要素の内容が<termref def='dt-chardata'>文字データ</termref>及び<termref def='dt-parentchild'>子要素</termref>からなる。子要素の要素型は,要素の内容モデルに出現する名前に&match;する。</p></item> 1386<item><p>d) 宣言が<kw>ANY</kw>に&match;し,どの<termref def='dt-parentchild'>子要素</termref>の要素型も宣言されている。</p></item></ulist> 1387 1388</p></vcnote> 1389<!-- with the new VC, I don't think the next few paras add anything -TWB 1390<p><termdef id="dt-model" term="content model">An element can declared using a <term>content model</term>, in which case its content can be categorized as <termref def="dt-elemcontent">element content</termref> or <termref def='dt-mixed'>mixed content</termref>, as explained below.</termdef></p> 1391<p>An element whose type declared using the keyword <kw>EMPTY</kw> must be <termref def="dt-empty">empty</termref> and may be tagged using an <termref def="dt-eetag">empty-element tag</termref> when it appears in the document.</p> 1392<p>If an element type is declared using the keyword <kw>ANY</kw>, then there are no validity constraints on its content: it may contain <termref def='dt-parentchild'>child elements</termref> of any type and number, interspersed with character data.</p> --> 1393 1394<p>要素宣言の例を,次に示す。 1395<eg> 1396<!ELEMENT br EMPTY> 1397<!ELEMENT p (#PCDATA|emph)* > 1398<!ELEMENT %name.para; %content.para; > 1399<!ELEMENT container ANY> 1400</eg></p> 1401 1402<div3 id='sec-element-content'><head>要素内容</head> 1403 1404<p><termdef id='dt-elemcontent' term='Element content'>ある型の要素が<termref def='dt-parentchild'>子</termref>要素だけを含む(文字データを含まない。)とき,その要素<termref def="dt-stag">型</termref>は,<term>要素内容</term>をもつ,という。</termdef>この場合,制約は,内容モデルを含む。内容モデルは,子要素の型及び子要素の出現順序を制御する簡単な文法とする。この文法は,&content-particle;(<nt def='NT-cp'>cp</nt>s)からなる。&content-particle;は,名前,&content-particle;の選択リスト又は&content-particle;の列リストから構成される。 1405<scrap lang='ebnf'><head>要素内容モデル</head><prodgroup pcw2="5.5" pcw4="16" pcw5="11"> 1406<prod id='NT-children'><lhs>children</lhs><rhs>(<nt def='NT-choice'>choice</nt> | <nt def='NT-seq'>seq</nt>) ('?' | '*' | '+')?</rhs></prod><prod id='NT-cp'><lhs>cp</lhs><rhs>(<nt def='NT-Name'>Name</nt> | <nt def='NT-choice'>choice</nt> | <nt def='NT-seq'>seq</nt>) ('?' | '*' | '+')?</rhs></prod> 1407<prod id='NT-choice'><lhs>choice</lhs><rhs>'(' <nt def='NT-S'>S</nt>? cp ( <nt def='NT-S'>S</nt>? '|' <nt def='NT-S'>S</nt>? <nt def='NT-cp'>cp</nt> )*<nt def='NT-S'>S</nt>? ')'</rhs><vc def='vc-PEinGroup'/></prod> 1408<prod id='NT-seq'><lhs>seq</lhs><rhs>'(' <nt def='NT-S'>S</nt>? cp ( <nt def='NT-S'>S</nt>? ',' <nt def='NT-S'>S</nt>? <nt def='NT-cp'>cp</nt> )*<nt def='NT-S'>S</nt>? ')'</rhs><vc def='vc-PEinGroup'/></prod> 1409<!-- <prod id='NT-cps'><lhs>cps</lhs><rhs><nt def='NT-S'>S</nt>? <nt def='NT-cp'>cp</nt> <nt def='NT-S'>S</nt>?</rhs></prod> 1410<prod id='NT-choice'><lhs>choice</lhs><rhs>'(' <nt def='NT-S'>S</nt>? <nt def='NT-ctokplus'>ctokplus</nt> (<nt def='NT-S'>S</nt>? '|' <nt def='NT-S'>S</nt>? <nt def='NT-ctoks'>ctoks</nt>)* <nt def='NT-S'>S</nt>? ')'</rhs></prod> 1411<prod id="NT-ctokplus"><lhs>ctokplus</lhs><rhs><nt def="NT-cps">cps</nt>('|' <nt def="NT-cps">cps</nt>)+</rhs></prod> 1412<prod id="NT-ctoks"><lhs>ctoks</lhs><rhs><nt def="NT-cps">cps</nt>('|' <nt def="NT-cps">cps</nt>)*</rhs></prod> 1413<prod id='NT-seq'><lhs>seq</lhs><rhs>'(' <nt def='NT-S'>S</nt>?<nt def='NT-stoks'>stoks</nt> (<nt def='NT-S'>S</nt>? ',' <nt def='NT-S'>S</nt>? <nt def='NT-stoks'>stoks</nt>)*<nt def='NT-S'>S</nt>? ')'</rhs></prod> 1414<prod id="NT-stoks"><lhs>stoks</lhs><rhs><nt def="NT-cps">cps</nt>(',' <nt def="NT-cps">cps</nt>)*</rhs></prod> 1415--> 1416</prodgroup></scrap> 1417ここで,<nt def='NT-Name'>Name</nt>は,<termref def="dt-parentchild">子</termref>として出現してよい要素の型を示す。この文法で選択リストが現れる位置では,選択リスト内のいずれの&content-particle;も<termref def="dt-elemcontent">要素内容</termref>の中に現れてよい。列リストに現れる&content-particle;は,リストで指定する順番のとおりに,<termref def="dt-elemcontent">要素内容</termref>に現れなければならない。名前又はリストの後に出現するオプションの文字<!-- 門馬:characterを文字と訳しました -->は,リスト内の要素又は&content-particle;が,1回以上任意の回数(<code>+</code>),0回以上任意の回数(<code>*</code>)又は0回若しくは1回(<code>?</code>)出現可能なことを規定する。ここで示す構文及び意味は,この&TR-or-Rec;における生成規則で用いるものと同一とする。</p> 1418 1419<!-- 門馬:上の文では,“name又はlistの後に続く文字”が“listの出現を規定する”とあって,nameの出現を規定するとは書いてありません。修正が必要と考えます。 --> 1420 1421<p>要素の内容が内容モデルに&match;するのは,列,選択及び繰返し演算子にしたがって,内容の中の要素と内容モデル内の要素型とを&match;させながら,内容モデル内の一つのパスをたどれるときに限る。<termref def='dt-compat'>互換性のため</termref>,文書内の要素が,内容モデルにおける要素型の複数の出現位置と&match;することは,&error;とする。詳細な規定については,附属書の<titleref xml-link="simple" href="determinism">決定的内容モデル</titleref>の項を参照。 1422<!-- appendix <specref ref="determinism"/>. --> 1423<!-- appendix on deterministic content models. --> 1424</p> 1425 1426<vcnote id='vc-PEinGroup'> 1427<head>グループ及びパラメタ実体が厳密な入れ子をなしていること</head> 1428<p>パラメタ実体の<termref def='dt-repltext'>&replacement-text;</termref>は,&parenthesis;で囲まれたグループによって,厳密な入れ子を構成しなければならない。つまり,<nt def='NT-choice'>選択</nt>,<nt def='NT-seq'>列</nt>又は<nt def='NT-Mixed'>混在</nt>部品に,&left-parenthesis;又は&right-parenthesis;のいずれか一方が<termref def='dt-PERef'>パラメタ実体</termref>の&replacement-text;に含れれば,他方も同じ&replacement-text;に含まれなければならない。</p> 1429<p><termref def='dt-interop'>相互運用性のため</termref>,パラメタ実体参照が<nt def='NT-choice'>選択</nt>,<nt def='NT-seq'>列</nt>又は<nt def='NT-Mixed'>混在</nt>内容に含まれれば,その&replacement-text;は空でないことが望ましく,&replacement-text;の先頭及び末尾の空白でない文字は,コネクタ(<code>|</code>又は<code>,</code>)でない方がよい。 1430</p> 1431</vcnote> 1432<p>要素内容モデルのいくつかの例を,次に示す。 1433<eg><!ELEMENT spec (front, body, back?)> 1434<!ELEMENT div1 (head, (p | list | note)*, div2*)> 1435<!ELEMENT dictionary-body (%div.mix; | %dict.mix;)*></eg></p> 1436</div3> 1437 1438<div3 id='sec-mixed-content'> 1439<head>&mixed-content;</head> 1440 1441<p><termdef id='dt-mixed' term='Mixed Content'>ある要素型の要素内に,<termref def="dt-parentchild">子</termref>要素に混在して文字データが含まれる可能性があるとき,その要素<termref def='dt-stag'>型</termref>は,<term>&mixed-content;</term>をもつという。</termdef>この場合,子要素の型についての制約が存在してもよい<!-- 門馬:“may be constrained”を単に「制約される」と訳しました。 -->が,子要素の順序又は出現回数についての制約はないとする。 1442<scrap lang='ebnf'> 1443<head>&mixed-content;宣言</head> 1444<prodgroup pcw2="5.5" pcw4="16" pcw5="11"> 1445<prod id='NT-Mixed'><lhs>Mixed</lhs> 1446<rhs>'(' <nt def='NT-S'>S</nt>? 1447'#PCDATA' 1448(<nt def='NT-S'>S</nt>? 1449'|' 1450<nt def='NT-S'>S</nt>? 1451<nt def='NT-Name'>Name</nt>)* 1452<nt def='NT-S'>S</nt>? 1453')*' </rhs> 1454<rhs>| '(' <nt def='NT-S'>S</nt>? '#PCDATA' <nt def='NT-S'>S</nt>? ')' 1455</rhs><vc def='vc-PEinGroup'/> 1456<vc def='vc-MixedChildrenUnique'/> 1457</prod> 1458<!-- 1459<prod id="NT-Mtoks"><lhs>Mtoks</lhs> 1460<rhs><nt def="NT-Name">Name</nt> 1461(<nt def='NT-S'>S</nt>? 1462'|' 1463<nt def='NT-S'>S</nt>? 1464<nt def="NT-Name">Name</nt>)* 1465</rhs> 1466</prod> 1467--> 1468</prodgroup> 1469</scrap> 1470ここで,<nt def='NT-Name'>Name</nt>は,子として出現してもよい要素の型を示す。 1471</p> 1472 1473<vcnote id='vc-MixedChildrenUnique'> 1474<head>要素型の重複の禁止</head> 1475<p>一つの&mixed-content;宣言内に,同じ名前が複数回出現してはならない。 1476</p></vcnote> 1477<p>&mixed-content;宣言の例を,次に示す。 1478<eg><!ELEMENT p (#PCDATA|a|ul|b|i|em)*> 1479<!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* > 1480<!ELEMENT b (#PCDATA)></eg></p> 1481</div3> 1482</div2> 1483 1484 1485<div2 id='attdecls'> 1486<head>属性リスト宣言</head> 1487<p> 1488<termref def="dt-attr">属性</termref>は,名前及び値の対を<termref def="dt-element">要素</termref>に関連付けるために用いる。属性指定は,<termref def="dt-stag">開始タグ</termref>又は<termref def="dt-eetag">空要素</termref>タグ内でだけ可能とする。したがって,属性を認識するための生成規則は,<titleref href='sec-starttags'>開始タグ</titleref>についての規定で示す。属性リスト宣言は,次の目的で用いる。 1489<ulist> 1490<item><p>a) ある要素型に適用する属性の集合を規定する。</p></item> 1491<item><p>b) 属性への型制約を設定する。</p></item> 1492<item><p>c) 属性の<termref def="dt-default">&default-value;</termref>を規定する。</p></item> 1493</ulist> 1494</p> 1495<p> 1496<termdef id="dt-attdecl" term="Attribute-List Declaration"> 1497<term>属性リスト宣言</term>は,ある要素型と関連付けられた各属性に対し,名前,データ型及び(存在すれば)&default-value;を規定する。 1498<scrap lang='ebnf'> 1499<head>属性リスト宣言</head> 1500<prod id='NT-AttlistDecl'><lhs>AttlistDecl</lhs> 1501<rhs>'<!ATTLIST' <nt def='NT-S'>S</nt> 1502<nt def='NT-Name'>Name</nt> 1503<nt def='NT-AttDef'>AttDef</nt>* 1504<nt def='NT-S'>S</nt>? '>'</rhs> 1505</prod> 1506<prod id='NT-AttDef'><lhs>AttDef</lhs> 1507<rhs><nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt> 1508<nt def='NT-S'>S</nt> <nt def='NT-AttType'>AttType</nt> 1509<nt def='NT-S'>S</nt> <nt def='NT-Default'>Default</nt></rhs> 1510</prod> 1511</scrap> 1512 1513<nt def='NT-AttlistDecl'>AttlistDecl</nt>規則に存在する<nt def="NT-Name">Name</nt>は,要素型の名前とする。&at-user-option;,宣言していない要素型に対し属性を宣言したならば,XML&processor;は,警告を出してもよい。しかし,これは&error;とはしない。 1514<nt def='NT-AttDef'>AttDef</nt>規則における<nt def='NT-Name'>Name</nt>は,属性の名前とする。 1515</termdef> 1516</p> 1517<p> 1518ある要素に対して,複数の<nt def='NT-AttlistDecl'>AttlistDecl</nt>を与える場合,これらすべての内容はマージする。ある要素型の同じ属性に,複数の定義を与える場合には,最初の宣言を有効とし,他の宣言は無視する。<termref def='dt-interop'>相互運用性のために</termref>,DTDの作成者は,ある要素型には高々一つの属性リスト宣言しか与えない,ある属性名には高々一つの属性定義しか与えない,及びすべての属性リスト宣言には少なくとも一つの属性定義を与える,という選択をしてもよい。相互運用性のために,XML&processor;は,&at-user-option;,ある要素型に複数の属性リスト宣言を与えたり,ある属性に複数の属性定義を与えたりしたときに,警告を出してもよい。しかし,これは,&error;とはしない。 1519</p> 1520 1521<div3 id='sec-attribute-types'> 1522<head>属性の型</head> 1523<p> 1524XMLの属性の型は,3種類とする。これらは,&string;型,&token;化型及び列挙型とする。&string;型は,値として任意の&string;をとる。&token;化型は,次に示す字句及び意味に関する様々な制約をもつ。 1525 1526<scrap lang='ebnf'> 1527<head>Attribute Types</head> 1528<prodgroup pcw4="14" pcw5="11.5"> 1529<prod id='NT-AttType'><lhs>AttType</lhs> 1530<rhs><nt def='NT-StringType'>StringType</nt> 1531| <nt def='NT-TokenizedType'>TokenizedType</nt> 1532| <nt def='NT-EnumeratedType'>EnumeratedType</nt> 1533</rhs> 1534</prod> 1535<prod id='NT-StringType'><lhs>StringType</lhs> 1536<rhs>'CDATA'</rhs> 1537</prod> 1538<prod id='NT-TokenizedType'><lhs>TokenizedType</lhs> 1539<rhs>'ID'</rhs> 1540<vc def='id'/> 1541<vc def='one-id-per-el'/> 1542<vc def='id-default'/> 1543<rhs>| 'IDREF'</rhs> 1544<vc def='idref'/> 1545<rhs>| 'IDREFS'</rhs> 1546<vc def='idref'/> 1547<rhs>| 'ENTITY'</rhs> 1548<vc def='entname'/> 1549<rhs>| 'ENTITIES'</rhs> 1550<vc def='entname'/> 1551<rhs>| 'NMTOKEN'</rhs> 1552<vc def='nmtok'/> 1553<rhs>| 'NMTOKENS'</rhs> 1554<vc def='nmtok'/></prod> 1555</prodgroup> 1556</scrap> 1557</p> 1558 1559<vcnote id='id' > 1560<head>ID</head> 1561<p> 1562この型の値は,生成規則<code>Name</code>に&match;しなければならない。一つのXML文書内では,一つの名前が,この型の値として複数回現れてはならない。つまり,IDの値は,要素を一意に&identify;しなければならない。 1563</p> 1564</vcnote> 1565<vcnote id='one-id-per-el'> 1566<head>1要素ごとに1ID</head> 1567<p> 1568要素型は,複数のID属性値をもってはならない。 1569</p> 1570</vcnote> 1571<vcnote id='id-default'> 1572<head>ID属性の&default;</head> 1573<p> 1574ID属性は,&default;として,<code>#IMPLIED</code>又は<code>#REQUIRED</code>を宣言しなければならない。 1575</p> 1576</vcnote> 1577<vcnote id='idref'> 1578<head>IDREF</head> 1579<p> 1580<kw>IDREF</kw>型の値は,生成規則<nt def="NT-Name">Name</nt>に&match;しなければならない。<kw>IDREFS</kw>型の値は,生成規則<nt def="NT-Names">Names</nt>に&match;しなければならない。各々の<nt def='NT-Name'>Name</nt>は,XML文書内に存在する要素のID属性の値と&match;しなければならない。つまり,<kw>IDREF</kw>の値は,あるID属性の値と&match;しなければならない。 1581</p> 1582</vcnote> 1583<vcnote id='entname'> 1584<head>実体名</head> 1585<p> 1586<kw>ENTITY</kw>型の値は,生成規則<nt def="NT-Name">Name</nt>に&match;しなければならない。<kw>ENTITIES</kw>型の値は,生成規則<nt def="NT-Names">Names</nt>に&match;しなければならない。各々の<nt def="NT-Name">Name</nt>は,<termref def="dt-doctype">DTD</termref>で宣言する<termref def="dt-unparsed">&unparsed-entity;</termref>と&match;しなければならない。 1587</p> 1588</vcnote> 1589<vcnote id='nmtok'> 1590<head>名前&token;</head> 1591<p> 1592<kw>NMTOKEN</kw>型の値は,非終端記号<termref def="NT-Nmtoken">Nmtoken</termref>と&match;する&string;から構成されなければならない。<kw>NMTOKENS</kw>型の値は,非終端記号<termref def="NT-Nmtokens">Nmtokens</termref>と&match;する&string;から構成されなければならない。 1593</p> 1594</vcnote> 1595<p> 1596XML&processor;は,&application;に属性値を渡す前に,<titleref href="AVNormalize">属性値の正規化</titleref>で規定するとおりに,属性値を正規化しなければならない。 1597</p> 1598<p> 1599<termdef id='dt-enumerated' term='Enumerated Attribute Values'><term>列挙型の属性</term>は,宣言した値の一つを取ることができる。</termdef>列挙型には,2種類ある。 1600 1601<scrap lang='ebnf'> 1602<head>列挙属性の型</head> 1603<prod id='NT-EnumeratedType'><lhs>EnumeratedType</lhs> 1604<rhs><nt def='NT-NotationType'>NotationType</nt> 1605| <nt def='NT-Enumeration'>Enumeration</nt> 1606</rhs></prod> 1607<prod id='NT-NotationType'><lhs>NotationType</lhs> 1608<rhs>'NOTATION' 1609<nt def='NT-S'>S</nt> 1610'(' 1611<nt def='NT-S'>S</nt>? 1612<nt def='NT-Name'>Name</nt> 1613(<nt def='NT-S'>S</nt>? '|' <nt def='NT-Name'>Name</nt>)* 1614<nt def='NT-S'>S</nt>? ')' 1615</rhs> 1616<vc def='notatn' /></prod> 1617<prod id='NT-Enumeration'><lhs>Enumeration</lhs> 1618<rhs>'(' <nt def='NT-S'>S</nt>? 1619<nt def='NT-Nmtoken'>Nmtoken</nt> 1620(<nt def='NT-S'>S</nt>? '|' 1621<nt def='NT-S'>S</nt>? 1622<nt def='NT-Nmtoken'>Nmtoken</nt>)* 1623<nt def='NT-S'>S</nt>? 1624')'</rhs> 1625<vc def='enum'/></prod> 1626</scrap> 1627</p> 1628 1629<vcnote id='notatn'> 1630<head>記法属性</head> 1631<p>この型の値は,宣言している<titleref href='Notations'>記法</titleref>の名前の一つと&match;しなければならない。つまり,宣言に存在する記法名は,すべて宣言されていなければならない。 1632</p> 1633</vcnote> 1634<vcnote id='enum'> 1635<head>列挙</head> 1636<p> 1637この型の値は,宣言に存在する<nt def='NT-Nmtoken'>Nmtoken</nt>&token;の一つと&match;しなければならない。 1638</p> 1639</vcnote> 1640<p> 1641<termref def='dt-interop'>相互運用性のため</termref>,同じ<nt def='NT-Nmtoken'>Nmtoken</nt>は,単一要素型の列挙型の属性として,複数回現れない方がよい。 1642</p> 1643</div3> 1644 1645<div3 id='sec-attr-defaults'> 1646<head>属性の&default;</head> 1647 1648<p> 1649<termref def="dt-attdecl">属性宣言</termref>は,属性の指定が必須かどうかについての情報を与える。必須でない場合には,文書内で属性を指定しないとき,XML&processor;の処理方法の情報も与える。 1650 1651<scrap lang='ebnf'> 1652<head>属性の&default;</head> 1653<prodgroup pcw4="14" pcw5="11.5"> 1654<prod id='NT-Default'><lhs>Default</lhs> 1655<rhs>'#REQUIRED' 1656| '#IMPLIED' </rhs> 1657<rhs>| (('#FIXED' S)? <nt def='NT-AttValue'>AttValue</nt>)</rhs> 1658<vc def='defattrvalid'/> 1659<wfc def="CleanAttrVals"/> 1660</prod> 1661</prodgroup> 1662</scrap> 1663<!-- improved by bosak 1664<scrap lang='ebnf'> 1665<head>Attribute Defaults</head> 1666<prod id='NT-Default'><lhs>Default</lhs> 1667<rhs>'#REQUIRED' 1668| '#IMPLIED' </rhs> 1669<vc def='defattrvalid'/> 1670<wfc def="CleanAttrVals"/> 1671<rhs>| (('#FIXED' S)? <nt def='NT-AttValue'>AttValue</nt>)</rhs> 1672</prod> 1673</scrap>--> 1674</p> 1675 1676<vcnote id='defattrvalid'> 1677<head>属性&default;の正しさ</head> 1678<p> 1679宣言した&default-value;は,宣言した属性型の字句制約を満たさなければならない。 1680</p> 1681</vcnote> 1682<p> 1683<kw>#REQUIRED</kw>を指定したとき,この要素型の<termref def="dt-stag">開始タグ</termref>であって,この属性に値を与えないものをXML&processor;が見つけたならば,その文書は<termref def="dt-valid">&valid;</termref>とはしない。<kw>#IMPLIED</kw>を指定したとき,この属性を省略したら,XML&processor;は,属性値を指定しないことをアプリケーションに伝えなければならない。このとき,&application;の振舞いについての制約はない。 1684</p> 1685<p> 1686<termdef id="dt-default" term="Attribute Default"> 1687属性が<kw>#REQUIRED</kw>でも<kw>#IMPLIED</kw>でもないときには,<nt def='NT-AttValue'>AttValue</nt>の値が,<term>&default-value;</term>となる。<kw>#FIXED</kw>の場合,&default-value;と異なる値が指定されれば,その文書は,<termref def="dt-valid">&valid;</termref>としない。&default-value;を宣言している場合,この属性の省略を見つけたら,宣言した&default-value;を属性値に指定しているとして,XML&processor;は振る舞うことが望ましい。 1688</termdef></p> 1689 1690<p>属性リスト宣言の例を,次に示す。 1691 1692<eg><!ATTLIST termdef 1693 id ID #REQUIRED 1694 name CDATA #IMPLIED> 1695<!ATTLIST list 1696 type (bullets|ordered|glossary) "ordered"> 1697<!ATTLIST form 1698 method CDATA #FIXED "POST"></eg></p> 1699</div3> 1700 1701<div3 id='AVNormalize'> 1702<head>属性値の正規化</head> 1703<p> 1704XML&processor;は,属性値を&application;に渡す前に,次のとおりに正規化しなければならない。 1705 1706<ulist> 1707<item> 1708<p>a) まず,属性値及びその中の実体内で,行末又は行境界(又はシステムによってはレコード境界)として使われる&string;を,&space-character;(#x20)一つに置き換えなければならない(「<titleref xml-link="simple" href="sec-line-ends">行末の扱い</titleref>」も参照のこと。)。 1709</p></item> 1710<item> 1711<p>b) 次に,文字参照及び内部&parsed-entity;への参照は,展開しなければならない。外部実体への参照は,&error;とする。 1712</p></item> 1713<item> 1714<p>c) 最後に,属性の型が<kw>CDATA</kw>でなければ,空白&string;は,すべて&space-character;(#x20)一つに正規化し,残りの空白文字は,削除しなければならない。 1715</p></item> 1716</ulist> 1717 1718&non-validating;&parser;は,宣言が見つからない属性は,すべて,<kw>CDATA</kw>を宣言しているとして扱うことが望ましい。</p> 1719</div3> 1720</div2> 1721 1722<div2 id='sec-condition-sect'> 1723<head>条件付きセクション</head> 1724<p> 1725<termdef id='dt-cond-section' term='conditional section'> 1726<term>条件付きセクション</term>とは,<termref def='dt-doctype'>文書型宣言の外部⊂</termref>の一部とし,制御キーワードの指定によって,DTDの論理構造に含めたり,除いたりする部分とする。 1727</termdef> 1728 1729<scrap lang='ebnf'> 1730<head>条件付きセクション</head> 1731<prodgroup pcw2="9" pcw4="14.5"> 1732<prod id='NT-conditionalSect'><lhs>conditionalSect</lhs> 1733<rhs><nt def='NT-includeSect'>includeSect</nt> 1734| <nt def='NT-ignoreSect'>ignoreSect</nt> 1735</rhs> 1736</prod> 1737<prod id='NT-includeSect'><lhs>includeSect</lhs> 1738<rhs>'<![' S? 'INCLUDE' S? '[' 1739<!-- (<nt def='NT-markupdecl'>markupdecl</nt> 1740 | <nt def="NT-conditionalSect">conditionalSect</nt> 1741 | <nt def="NT-S">S</nt>)* 1742--> 1743<nt def="NT-extSubset">extSubset</nt> 1744']]>' 1745</rhs> 1746</prod> 1747<prod id='NT-ignoreSect'><lhs>ignoreSect</lhs> 1748<rhs>'<![' S? 'IGNORE' S? '[' 1749<nt def="NT-ignoreSectContents">ignoreSectContents</nt>* 1750']]>'</rhs> 1751</prod> 1752<prod id='NT-ignoreSectContents'><lhs>ignoreSectContents</lhs> 1753<rhs><nt def='NT-Ignore'>Ignore</nt> 1754('<![' <nt def='NT-ignoreSectContents'>ignoreSectContents</nt> 1755']]>' 1756<nt def='NT-Ignore'>Ignore</nt>)*</rhs></prod> 1757<prod id='NT-Ignore'><lhs>Ignore</lhs> 1758<rhs><nt def='NT-Char'>Char</nt>* - 1759(<nt def='NT-Char'>Char</nt>* ('<![' | ']]>') 1760<nt def='NT-Char'>Char</nt>*) 1761</rhs></prod> 1762<!--<rhs> 1763((<nt def='NT-SkipLit'>SkipLit</nt> 1764| <nt def='NT-Comment'>Comment</nt> 1765| <nt def='NT-PI'>PI</nt>) - 1766(<nt def='NT-Char'>Char</nt>* ']]>' <nt def='NT-Char'>Char</nt>*)) 1767| ('<![' <nt def='NT-ignoreSectContents'>ignoreSectContents</nt>* 1768']]>') 1769</rhs> 1770<rhs> 1771| (<nt def='NT-Char'>Char</nt> - (']' | [<'"])) 1772</rhs> 1773<rhs> 1774| ('<!' (<nt def='NT-Char'>Char</nt> - ('-' | '['))) 1775</rhs>--> 1776</prodgroup> 1777</scrap> 1778</p> 1779 1780<p>条件付きセクションは,DTDの内部⊂及び外部⊂と同様に,完全な宣言,コメント又は入れ子になった条件付きセクションを,いくつか含んでよい。これらの間に,空白が現れてもよい。 1781</p> 1782<p> 1783条件付きセクションのキーワードが<code>INCLUDE</code>ならば,XML&processor;は,この条件付きセクションの内容を,文書の一部として扱わなければならない。条件付きセクションのキーワードが<code>IGNORE</code>ならば,その条件付きセクションの内容は,文書の一部として扱わない。構文解析を正しく行うためには,無視する条件付きセクション(IGNORE)に関しても,内容を読まなければならないことに注意すること。これは,入れ子になった条件付きセクションを見つけ,(無視する)最も外側の条件付きセクションを正しく検出するためとする。キーワードを<code>INCLUDE</code>とする小さな条件付きセクションが,キーワードを<code>IGNORE</code>とするより大きな条件付きセクションに含まれるならば,外側及び内側の条件付きセクションの両方とも無視する。 1784</p> 1785<p> 1786条件付きセクションのキーワードがパラメタ実体参照ならば,XML&processor;は条件付きセクションの扱いを判断する前に,このパラメタ実体を展開しなければならない。 1787</p> 1788 1789<p>例を次に示す。 1790 1791<eg><!ENTITY % draft 'INCLUDE' > 1792<!ENTITY % final 'IGNORE' > 1793 1794<![%draft;[ 1795<!ELEMENT book (comments*, title, body, supplements?)> 1796]]> 1797<![%final;[ 1798<!ELEMENT book (title, body, supplements?)> 1799]]> 1800</eg> 1801</p> 1802</div2> 1803<!-- 1804<div2 id='sec-pass-to-app'> 1805<head>XML Processor Treatment of Logical Structure</head> 1806<p>When an XML processor encounters a start-tag, it must make 1807at least the following information available to the application: 1808<ulist> 1809<item> 1810<p>the element type's generic identifier</p> 1811</item> 1812<item> 1813<p>the names of attributes known to apply to this element type 1814(validating processors must make available names of all attributes 1815declared for the element type; non-validating processors must 1816make available at least the names of the attributes for which 1817values are specified. 1818</p> 1819</item> 1820</ulist> 1821</p> 1822</div2> 1823--> 1824 1825</div1> 1826<!-- &Entities; --> 1827 1828<div1 id='sec-physical-struct'> 1829<head>物理構造</head> 1830 1831<p> 1832<termdef id="dt-entity" term="Entity"> 1833XML文書は,一つ以上の記憶単位から構成する。この記憶単位を,<term>実体</term>という。実体は,<term>内容</term>をもち,文書実体(以降参照)及び<termref def='dt-doctype'>外部DTD⊂</termref>を除いて,<term>名前</term>で&identified;。 1834</termdef> 1835 1836<!-- Added for CFG --> 1837<!-- obscurity amputated by TWB --> 1838<!-- entire sentence amputated by CMSMcQ: no one but NO ONE is 1839ready for entities declared as 1840<!ENTITY foo "http://www.foo.com/bar.xml#id"> 1841and it's pointless to suggest that it's possible 1842under current circumstances. --> 1843<!-- An entity may be stored in, --> 1844<!--but need not be coterminous with, --> 1845<!-- but need not comprise the whole of, --> 1846<!-- a single physical storage object such as a file or --> 1847<!-- database field. --> 1848<!-- End sentence added for CFG -->各XML文書は,<termref def="dt-docent">文書実体</termref>と呼ぶ実体を一つもつ。<termref def="dt-xml-proc">XML&processor;</termref>は,この文書実体から処理を開始する。文書実体が,文書のすべてを含んでもよい。</p> 1849 1850<p>実体は,&parsed-entity;又は&unparsed-entity;とする。<termdef id="dt-parsedent" term="Text Entity"><term>&parsed-entity;</term>の内容は,&parsed-entity;の<termref def='dt-repltext'>&replacement-text;</termref>と呼ぶ。この<termref def="dt-text">テキスト</termref>は,文書の本体の一部として解釈する。 1851</termdef> 1852</p> 1853 1854<p> 1855<termdef id="dt-unparsed" term="Unparsed Entity"> 1856<term>&unparsed-entity;</term>は,内容が<termref def='dt-text'>テキスト</termref>でもそうでなくともよいリソースとする。テキストの場合,XMLでなくともよい。各&unparsed-entity;には,<termref def="dt-notation">記法</termref>が関連付けられ,この記法は,名前で&identified;。記法の名前及び関連付けられた&identifier;を,XML&processor;が&application;に渡すという要件以外は,XMLは,&unparsed-entity;の内容を制限しない。 1857</termdef> 1858</p> 1859 1860<p>&parsed-entity;は,実体参照によって名前で呼び出す。&unparsed-entity;は,<kw>ENTITY</kw>型又は<kw>ENTITIES</kw>型の属性の値として,名前で参照する。</p> 1861 1862<p> 1863<termdef id='gen-entity' term='general entity'><term>一般実体</term>は,文書内容の中で使用する&parsed-entity;とする。あいまいにならない限り,この&TR-or-Rec;では,一般実体を単に<emph>実体</emph>と呼ぶ。</termdef><termdef id='dt-PE' term='Parameter entity'>パラメタ実体は,DTD内で使用する&parsed-entity;とする。</termdef>これらの2種類の実体は,異なる書式で参照し,異なる文脈で認識する。</p> 1864 1865<!-- 1866<div2 id='sec-synchro'> 1867<head>Logical and Physical Structures</head> 1868<p>The logical and physical structures (elements and entities) 1869in an XML document must 1870be properly nested. 1871<termref def='dt-stag'>Tags</termref> and <termref def='dt-element'>elements</termref> must 1872each begin and end in the same <termref def='dt-entity'>entity</termref>, but may 1873refer to other 1874entities internally; <termref def='dt-comment'>comments</termref>, 1875<termref def='dt-pi'>processing instructions</termref>, 1876<termref def='dt-charref'>character 1877references</termref>, and 1878<termref def='dt-entref'>entity references</termref> must each be contained entirely 1879within a single entity. Entities must each contain an integral number 1880of elements, comments, processing instructions, and references, 1881possibly together with character data not contained within any element 1882in the entity, or else they must contain non-textual data, which by 1883definition contains no elements.</p></div2> 1884--> 1885 1886<div2 id='sec-references'> 1887<head>文字参照及び実体参照</head> 1888<p> 1889<termdef id="dt-charref" term="Character Reference"> 1890<term>文字参照</term>は,ISO/IEC 10646文字集合の特定の文字,例えば,入力機器から直接入力不可能な文字を参照する。 1891 1892<scrap lang='ebnf'> 1893<head>文字参照</head> 1894<prod id='NT-CharRef'><lhs>CharRef</lhs> 1895<rhs>'&#' [0-9]+ ';' </rhs> 1896<rhs>| '&hcro;' [0-9a-fA-F]+ ';'</rhs> 1897<wfc def="wf-Legalchar"/> 1898</prod> 1899</scrap> 1900<wfcnote id="wf-Legalchar"> 1901<head>正当な文字</head> 1902<p>文字参照で参照する文字は,非終端記号<termref def="NT-Char">Char</termref>に従わなければならない。</p> 1903</wfcnote> 1904文字が "<code>&#x</code>" で始まれば,終端の "<code>;</code>" までの数字及びアルファベットは,ISO/IEC 10646 の文字コードの16進数表現とする。 1905<!--日本語訳について: letterはアルファベットと訳した。 三好 --> 1906文字が "<code>&#</code>" で始まれば,終端の "<code>;</code>" までの数字は,文字コードの10進数表現とする。 1907</termdef> 1908</p> 1909 1910<p> 1911<termdef id="dt-entref" term="Entity Reference"> 1912<term>実体参照</term>は,名前の付いた実体の内容を参照する。</termdef><termdef id='dt-GERef' term='General Entity Reference'>一般実体への参照は,アンパサンド(<code>&</code>)及びセミコロン(<code>;</code>)を区切り子として用いる。</termdef><termdef id='dt-PERef' term='Parameter-entity reference'><term>パラメタ実体</term>への参照は,パーセント記号(<code>%</code>)及びセミコロン(<code>;</code>)を区切り子として用いる。 1913</termdef> 1914</p> 1915 1916<scrap lang="ebnf"> 1917<head>実体参照</head> 1918<prod id='NT-Reference'><lhs>Reference</lhs> 1919<rhs><nt def='NT-EntityRef'>EntityRef</nt> 1920| <nt def='NT-CharRef'>CharRef</nt></rhs></prod> 1921<prod id='NT-EntityRef'><lhs>EntityRef</lhs> 1922<rhs>'&' <nt def='NT-Name'>Name</nt> ';'</rhs> 1923<wfc def='wf-entdeclared'/> 1924<vc def='vc-entdeclared'/> 1925<wfc def='textent'/> 1926<wfc def='norecursion'/> 1927</prod> 1928<prod id='NT-PEReference'><lhs>PEReference</lhs> 1929<rhs>'%' <nt def='NT-Name'>Name</nt> ';'</rhs> 1930<wfc def='wf-entdeclared'/> 1931<vc def='vc-entdeclared'/> 1932<wfc def='textent'/> 1933<wfc def='norecursion'/> 1934<wfc def='indtd'/> 1935</prod> 1936</scrap> 1937 1938<wfcnote id='wf-entdeclared'> 1939<head>実体が宣言されていること</head> 1940<p>DTDをもたない文書,パラメタ実体参照を含まない内部DTD⊂だけをもつ文書,又は "<code>standalone='yes'</code>" をもつ文書において,実体参照で用いる <nt def='NT-Name'>Name</nt> は,その実体の宣言で与える名前と,<termref def="dt-match">&match;</termref>しなければならない。ただし,&well-formed;の文書は,実体&magicents; を宣言する必要はない。パラメタ実体の場合は,宣言は,参照に先行しなければならない。同様に,一般実体の場合は,属性リスト宣言の&default-value;内での参照より先に,宣言が現れなければならない。</p> 1941 1942<p>外部⊂又は外部パラメタ実体で実体を宣言するとき,&non-validating;&processor;が,宣言を読み,処理することを<titleref href='include-if-valid'>義務づけない</titleref>。それらの文書では,実体は宣言されなければならないという規則は,&well-formed;制約ではない。 1943</p> 1944</wfcnote> 1945 1946<vcnote id="vc-entdeclared"> 1947<head>実体が宣言されていること</head> 1948<p> 1949外部⊂又は外部パラメタ実体をもっていて,"<code>standalone='no'</code>"をもつ文書において,実体参照で用いる <nt def='NT-Name'>Name</nt> は,その実体の宣言で与える名前と<termref def="dt-match">&match;</termref>しなければならない。相互運用性のため,&valid;な文書は<titleref href="sec-escapes">あらかじめ定義した実体の規定</titleref>で指定した書式によって,実体 &magicents;を宣言することが望ましい。パラメタ実体の場合は,宣言は,参照に先行しなければならない。同様に,一般実体の場合は,属性リスト宣言の&default-value;内での参照よりも先に,宣言が現れなければならない。 1950</p> 1951</vcnote> 1952 1953<!-- FINAL EDIT: is this duplication too clumsy? --> 1954 1955<wfcnote id='textent'> 1956<head>&parsed-entity;</head> 1957<p> 1958実体参照は,<termref def="dt-unparsed">&unparsed-entity;</termref>の名前を含んでいてはならない。&unparsed-entity;は,<kw>ENTITY</kw>型又は<kw>ENTITIES</kw> 型として宣言した<termref def="dt-attrval">属性値</termref>としてだけ参照できる。 1959</p> 1960</wfcnote> 1961 1962<wfcnote id='norecursion'> 1963<head>再帰なし</head> 1964<p>&parsed-entity;は,それ自体への参照を,直接にも間接にも含んではならない。</p> 1965</wfcnote> 1966 1967<wfcnote id='indtd'> 1968<head>DTDの中</head> 1969<p> 1970パラメタ実体参照は,<termref def='dt-doctype'>DTD</termref>内にだけ,出現してよい。 1971<!-- 1972In the external DTD subset, a parameter-entity reference is 1973recognized only at the locations where 1974the nonterminal <nt def="NT-PEReference">PEReference</nt> or the 1975special operator <code>%</code> appears in a production of the 1976grammar. In the internal subset, parameter-entity references 1977are recognized only when they match 1978the <nt def="NT-InternalPERef">InternalPERef</nt> non-terminal 1979in the production for <nt def="NT-markupdecl">markupdecl</nt>. 1980--> 1981</p> 1982</wfcnote> 1983 1984<p> 1985文字参照及び実体参照の例を,次に示す。 1986<eg>Type <key>less-than</key> (&hcro;3C;) to save options. 1987This document was prepared on &docdate; and 1988is classified &security-level;.</eg> 1989</p> 1990 1991<p> 1992パラメタ実体参照の例を,次に示す。 1993<eg><!ENTITY % ISOLat2 1994 SYSTEM "http://www.xml.com/iso/isolat2-xml.entities" > 1995%ISOLat2; 1996</eg> 1997</p> 1998</div2> 1999 2000<div2 id='sec-entity-decl'> 2001<head>実体宣言</head> 2002 2003<p> 2004<termdef id="dt-entdecl" term="entity declaration"> 2005実体は,次のとおりに宣言する。 2006<scrap lang='ebnf'> 2007<head>実体宣言</head> 2008<prodgroup pcw2="5" pcw4="18.5"> 2009<prod id='NT-EntityDecl'><lhs>EntityDecl</lhs> 2010<rhs><nt def="NT-GEDecl">GEDecl</nt></rhs><com>一般実体</com> 2011<rhs>| <nt def="NT-PEDecl">PEDecl</nt></rhs><com>パラメタ実体</com> 2012</prod> 2013<prod id='NT-GEDecl'><lhs>GEDecl</lhs> 2014<rhs>'<!ENTITY' <nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt> 2015<nt def='NT-S'>S</nt> <nt def='NT-EntityDef'>EntityDef</nt> 2016<nt def='NT-S'>S</nt>? '>'</rhs> 2017</prod> 2018<prod id='NT-PEDecl'><lhs>PEDecl</lhs> 2019<rhs>| '<!ENTITY' <nt def='NT-S'>S</nt> '%' <nt def='NT-S'>S</nt> 2020<nt def='NT-Name'>Name</nt> <nt def='NT-S'>S</nt> 2021<nt def='NT-PEDef'>PEDef</nt> <nt def='NT-S'>S</nt>? '>'</rhs> 2022<com>パラメタ実体</com> 2023</prod> 2024<prod id='NT-EntityDef'><lhs>EntityDef</lhs> 2025<rhs><nt def='NT-EntityValue'>EntityValue</nt> 2026</rhs> 2027<!--<wfc def="WF-EntityValue"/>--> 2028<rhs>| <nt def='NT-ExternalDef'>ExternalDef</nt></rhs> 2029<!--<wfc def="WF-External"/>--> 2030</prod> 2031<!-- FINAL EDIT: what happened to WFs here? --> 2032<prod id='NT-PEDef'><lhs>PEDef</lhs> 2033<rhs><nt def='NT-EntityValue'>EntityValue</nt> 2034| <nt def='NT-ExternalID'>ExternalID</nt></rhs></prod> 2035</prodgroup> 2036</scrap> 2037 2038<nt def='NT-Name'>Name</nt> は,<termref def="dt-entref">実体参照</termref>において実体を&identify;。&unparsed-entity;ならば,<kw>ENTITY</kw> 型又は<kw>ENTITIES</kw>型の属性値内で,実体を&identify;。同一の実体が一回以上宣言されれば,最初の宣言を用いる。&at-user-option;,複数回宣言される実体に関し,XML&processor;は,警告を出してもよい。 2039</termdef> 2040</p> 2041 2042<!-- 2043<wfcnote id="WF-Entityvalue"> 2044<head>Well-Formed Internal Entity</head> 2045<p>General entities defined by an <nt 2046def="NT-EntityValue">EntityValue</nt> must be well-formed, as defined 2047in section <specref ref="wf-entities"/>. 2048</p> 2049</wfcnote> 2050<wfcnote id="WF-External"> 2051<head>Well-Formed External Entity</head> 2052<p>General text entities defined by an <nt 2053def="NT-ExternalDef">ExternalDef</nt>, must be well-formed, as defined 2054in the section on <titleref xml-link="simple" 2055href="wf-entities">well-formed entities.</titleref>.</p> 2056</wfcnote> 2057--> 2058 2059<div3 id='sec-internal-ent'> 2060<head>内部実体</head> 2061<p> 2062<termdef id='dt-internent' term="Internal Entity Replacement Text"> 2063実体の定義が <nt def='NT-EntityValue'>EntityValue</nt>のとき,これを<term>内部実体</term>という。これは,別個の物理的記憶単位をもたず,実体の内容は,宣言内で与える。</termdef>正しく<termref def='dt-repltext'>&replacement-text;</termref>を生成するには,<termref def='dt-litentval'>&literal;実体値</termref>内での実体参照及び文字参照の処理が,必要となるかもしれないことに注意する。詳細は,<titleref href='intern-replacement'>内部実体の&replacement-text;の構築</titleref>を参照。 2064 2065<!-- redundant -TWB 2066Within the <nt def="NT-EntityValue">EntityValue</nt>, 2067parameter-entity references and character references are recognized 2068and expanded immediately. 2069General-entity references within the 2070replacement text are not recognized 2071at the time the entity declaration is parsed, though they may be 2072recognized when the entity itself is referred to. 2073--> 2074 2075</p> 2076 2077<p> 2078内部実体は,<termref def="dt-parsedent">&parsed-entity;</termref>とする。 2079</p> 2080 2081<p>内部実体宣言の例を,次に示す。 2082<eg><!ENTITY Pub-Status "This is a pre-release of the specification."></eg></p> 2083</div3> 2084 2085<div3 id='sec-external-ent'> 2086<head>外部実体</head> 2087<p> 2088<termdef id="dt-extent" term="External Entity"> 2089実体が内部実体でなければ,<term>外部実体</term>とし,次のとおりに宣言する。 2090 2091<scrap lang='ebnf'> 2092<head>外部実体宣言</head> 2093<prod id='NT-ExternalDef'><lhs>ExternalDef</lhs> 2094<rhs><nt def='NT-ExternalID'>ExternalID</nt> 2095<nt def='NT-NDataDecl'>NDataDecl</nt>?</rhs></prod> 2096<prod id='NT-ExternalID'><lhs>ExternalID</lhs> 2097<rhs>'SYSTEM' <nt def='NT-S'>S</nt> 2098<nt def='NT-SystemLiteral'>SystemLiteral</nt></rhs> 2099<rhs>| 'PUBLIC' <nt def='NT-S'>S</nt> 2100<nt def='NT-PubidLiteral'>PubidLiteral</nt> 2101<nt def='NT-S'>S</nt> 2102<nt def='NT-SystemLiteral'>SystemLiteral</nt> 2103</rhs> 2104</prod> 2105<prod id='NT-NDataDecl'><lhs>NDataDecl</lhs> 2106<rhs><nt def='NT-S'>S</nt> 'NDATA' <nt def='NT-S'>S</nt> 2107<nt def='NT-Name'>Name</nt></rhs> 2108<vc def='not-declared'/></prod> 2109</scrap> 2110 2111<nt def='NT-NDataDecl'>NDataDecl</nt> が存在すれば,この実体は,<termref def="dt-unparsed">&unparsed-entity;</termref>とし,そうでなければ,&parsed-entity;とする。</termdef> 2112</p> 2113 2114<vcnote id='not-declared'> 2115<head>記法が宣言されていること</head> 2116<p> 2117<nt def='NT-Name'>Name</nt> は,宣言した<termref def="dt-notation">記法</termref>の名前と&match;しなければならない。 2118</p> 2119</vcnote> 2120 2121<p> 2122<termdef id="dt-sysid" term="System Identifier"> 2123キーワード <kw>SYSTEM</kw> の後の <nt def='NT-SystemLiteral'>SystemLiteral</nt> を,実体の<term>システム&identifier;</term>と呼ぶ。これはURIとし,その実体の内容を取り出すのに用いてもよい。</termdef>URIと共に使うことの多いハッシュ("<code>#</code>")及びフラグメント&identifier;は,正式には,URI自体の一部とはしない。フラグメント&identifier;が,システム&identifier;の部分として与えられている場合,XML&processor;は,&error;を出してもよい。この&TR-or-Rec;の範囲外の情報(例えば,ある特定のDTDの特別なXML要素又は特定の&application;の仕様によって定義された処理命令)によって上書きされない限り,相対的なURIは,その実体の位置,すなわち,その実体の宣言があるファイルに相対的とする。したがって,DTDの内部⊂にある実体宣言での相対的なURIは,文書の位置について相対的とする。外部⊂にある実体宣言での相対的なURIは,その外部⊂を含むファイルの位置に相対的とする。 2124</p> 2125 2126<p> 2127<termdef id="dt-pubid" term="Public identifier"> 2128システム&identifier;以外に,外部実体は,<term>公開&identifier;</term>を含んでもよい。 2129</termdef> 2130実体の内容を取り出すXML&processor;は,この公開&identifier;を用いて,代わりのURIの生成を試みてもよい。XML&processor;がこれに失敗した場合は,システム&literal;として指定したURIを用いなければならない。&match;する前に,公開&identifier;内にある空白文字からなる&string;は,すべて単一の&space-character;(#x20)に正規化しなければならず,前後の空白文字は削除しなければならない。 2131</p> 2132 2133<p>外部実体宣言の例を,次に示す。 2134<eg><!ENTITY open-hatch 2135 SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml"> 2136<!ENTITY open-hatch 2137 PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" 2138 "http://www.textuality.com/boilerplate/OpenHatch.xml"> 2139<!ENTITY hatch-pic 2140 SYSTEM "../grafix/OpenHatch.gif" 2141 NDATA gif ></eg></p> 2142</div3> 2143 2144</div2> 2145 2146<div2 id='TextEntities'> 2147<head>&parsed-entity;</head> 2148<div3 id='sec-TextDecl'> 2149<head>テキスト宣言</head> 2150<p>外部&parsed-entity;は,<term>テキスト宣言</term>で始まってもよい。 2151<scrap lang='ebnf'> 2152<head>テキスト宣言</head> 2153<prodgroup pcw4="12.5" pcw5="13"> 2154<prod id='NT-TextDecl'><lhs>TextDecl</lhs> 2155<rhs>&xmlpio; 2156<nt def='NT-VersionInfo'>VersionInfo</nt>? 2157<nt def='NT-EncodingDecl'>EncodingDecl</nt> 2158<nt def='NT-S'>S</nt>? &pic;</rhs> 2159<!-- <wfc def='wfc-xmldecliteral'/> --> 2160<!-- <wfc def='wfc-no-nonleading-encdec'/> --> 2161</prod> 2162</prodgroup> 2163</scrap> 2164</p> 2165<p>テキスト宣言は,そのままの形で現れなければならず,&parsed-entity;への参照を経由してはならないことに注意する。</p> 2166<p>外部&parsed-entity;において,テキスト宣言は,先頭以外のいかなる位置にも出現しない。</p> 2167</div3> 2168<div3 id='wf-entities'> 2169<head>&well-formed;の&parsed-entity;</head> 2170<p>ラベル<nt def='NT-document'>document</nt>をもつ生成規則に&match;すれば,文書実体は,&well-formed;とする。ラベル<nt def='NT-ExtParsedEnt'>ExtParsedEnt</nt>をもつ生成規則に&match;すれば,外部の一般&parsed-entity;は,&well-formed;とする。ラベル<nt def='NT-ExtPE'>ExtPE</nt>をもつ生成規則に&match;すれば,外部パラメタ実体は,&well-formed;とする。 2171 2172<scrap lang='ebnf'> 2173<head>&well-formed;の&parsed-entity;</head> 2174<prod id='NT-ExtParsedEnt'><lhs>ExtParsedEnt</lhs> 2175<rhs><nt def='NT-TextDecl'>TextDecl</nt>? 2176<nt def='NT-content'>content</nt></rhs> 2177</prod> 2178<prod id='NT-ExtPE'><lhs>ExtPE</lhs> 2179<rhs><nt def='NT-TextDecl'>TextDecl</nt>? 2180<nt def='NT-extSubset'>extSubset</nt></rhs> 2181</prod> 2182</scrap> 2183&replacement-text;が,ラベル<nt def='NT-content'>content</nt>をもつ生成規則に&match;すれば,内部の一般&parsed-entity;は,&well-formed;とする。DTDを最後まで読み込まないと,確実にこれを判定できないことに注意。すべての内部のパラメタ実体は,定義によって&well-formed;とする。 2184</p> 2185<p>実体が&well-formed;な結果として,XML文書の論理的及び物理的構造は,正しく入れ子となる。<termref def='dt-stag'>開始タグ</termref>,<termref def='dt-etag'>終了タグ</termref>,<termref def="dt-empty">空要素タグ</termref>,<termref def='dt-element'>要素</termref>,<termref def='dt-comment'>コメント</termref>,<termref def='dt-pi'>処理命令</termref>,<termref def='dt-charref'>文字参照</termref>及び<termref def='dt-entref'>実体参照</termref>が,一つの実体で開始し,別の実体で終了することはない。</p> 2186</div3> 2187<div3 id='charencoding'> 2188<head>実体における文字符号化</head> 2189 2190<p>XML文書内の外部&parsed-entity;は,各々,別の文字符号化方式を用いてもよい。すべてのXML&processor;は,UTF-8で符号化した実体,UTF-16で符号化した実体を処理できなければならない。 2191<!-- 2192It is recognized that for some purposes, the use of additional 2193ISO/IEC 10646 planes other than the Basic Multilingual Plane 2194may be required. 2195A facility for handling characters in these planes is therefore a 2196desirable characteristic in XML processors and applications. 2197--> 2198</p> 2199<p>UTF-16で符号化した実体は,ISO/IEC 10646の付録E及びUnicodeの付録Bで規定する&byte-order-mark;(ZERO WIDTH NO-BREAK SPACE文字,#xFEFF)で始まらなければならない。これは,符号化の標識であって,XML文書の&markup;の一部でも,文字データの一部でもない。XML&processor;は,UTF-8で符号化した文書とUTF-16で符号化した文書との区別を行うために,この文字を使用可能でなければならない。</p> 2200<p>XML&processor;は,UTF-8及びUTF-16で符号化した実体だけを読むことを必須とするが,他の符号化を世界では用いており,それらの符号化を用いる実体をXML&processor;が処理できることが望ましい。UTF-8又はUTF-16以外の符号化方式を用いて格納する&parsed-entity;は,符号化宣言を含む<titleref href='TextDecl'>テキスト宣言</titleref>で始めなければならない。 2201<scrap lang='ebnf'> 2202<head>符号化宣言</head> 2203<prod id='NT-EncodingDecl'><lhs>EncodingDecl</lhs> 2204<rhs><nt def="NT-S">S</nt> 2205'encoding' <nt def='NT-Eq'>Eq</nt> 2206'"' <nt def='NT-EncName'>EncName</nt> '"' | "'" 2207<nt def='NT-EncName'>EncName</nt> "'" 2208</rhs> 2209</prod> 2210<prod id='NT-EncName'><lhs>EncName</lhs> 2211<rhs>[A-Za-z] ([A-Za-z0-9._] | '-')*</rhs> 2212<com>ラテン文字だけを含む符号化名</com> 2213</prod> 2214</scrap> 2215<termref def='dt-docent'>文書実体</termref>では,符号化宣言は,<termref def="dt-xmldecl">XML宣言</termref>の一部とする。<nt def="NT-EncName">EncName</nt>は,使用する符号化方式の名前とする。 2216</p> 2217<!-- FINAL EDIT: check name of IANA and charset names --> 2218<p>符号化宣言では,値<code>UTF-8</code>,<code>UTF-16</code>,<code>ISO-10646-UCS-2</code>及び<code>ISO-10646-UCS-4</code>は,Unicode及びISO/IEC 10646の各種符号化のために用いる。値<code>ISO-8859-1</code>から<code>ISO-8859-9</code>までは,ISO 8859の対応するパートのために用いる。値<code>ISO-2022-JP</code>,<code>Shift_JIS</code>及び<code>EUC-JP</code>は,JIS X-0208-1997の各種符号化のために用いる。XML&processor;は,それ以外の符号化方式を認識してもよい。Internet Assigned Numbers Authority (IANA)に,(<emph>charset</emph>sとして)登録された文字符号化方式については,これら以外についても,登録された名前で参照することが望ましい。これらの登録された名前は,大文字・小文字の区別をせずに定義されているので,これらに対する比較を試みる&processor;は,大文字・小文字の区別をしない方法をとるのが望ましいことに注意する。</p> 2219<p>XML処理系に渡された実体が,符号化宣言を含むにもかかわらず,宣言で示したもの以外の方式で符号化されていたり,符号化宣言が,外部実体の最初以外の位置に出現すれば,<termref def="dt-error">&error;</termref>とする。 2220</p> 2221<p>&byte-order-mark;でも符号化宣言でも始まらない実体は,UTF-8符号化でなければならない。</p> 2222 2223<p><!-- XML processors should make an effort to use all available 2224information, internal and external, to aid in detecting an entity's correct 2225encoding. Such information may include, but is not limited to: 2226<ulist><item><p>An HTTP header</p></item> 2227<item><p>A MIME header obtained other than through HTTP</p></item> 2228<item><p>Metadata provided by the native OS file system or by document 2229management software</p></item> 2230<item><p>The bit patterns at the front of an entity, which may 2231be analyzed to determine if 2232the application of any known encoding yields a valid encoding 2233declaration. See <titleref href='sec-guessing'>the appendix on 2234autodetection of character sets</titleref> 2235for a fuller description.</p></item></ulist> --> 2236処理できない符号化をもった実体をXML&processor;が発見したときは,&application;にその事実を通知し,<termref def='dt-fatal'>&fatal-error;</termref>として,処理を終了しなければならない。 2237<!-- 2238inform the application of this fact and 2239may 2240allow the application to 2241request either that the entity should be treated as an <termref 2242def="dt-unparsed">unparsed entity</termref>, or that processing should 2243cease.--> 2244</p> 2245<p>符号化宣言の例を,次に示す。 2246<eg><?xml encoding='UTF-8'?> 2247<?xml encoding='EUC-JP'?></eg></p> 2248</div3> 2249</div2> 2250<div2 id='entproc'> 2251<head>XML&processor;による実体及び参照の扱い</head> 2252<p>次の表は,文字参照,実体参照及び&unparsed-entity;の呼出しが現れる文脈及び各々の場合における<termref def='dt-xml-proc'>XML&processor;</termref>に要求する振舞いを要約する。一番左の列のラベルは,認識の文脈を示す。 2253<glist> 2254<gitem><label>内容における参照</label> 2255<def><p>要素の<termref def='dt-stag'>開始タグ</termref>及び<termref def='dt-etag'>終了タグ</termref>の間の任意の場所での参照。非終端記号<nt def='NT-content'>content</nt>に対応する。</p></def> 2256</gitem> 2257<gitem> 2258<label>属性値における参照</label> 2259<def><p><termref def='dt-stag'>開始タグ</termref>の属性の値,又は<termref def='dt-attdecl'>属性宣言</termref>における&default-value;のいずれかでの参照。非終端記号<nt def='NT-AttValue'>AttValue</nt>に対応する。</p></def></gitem> 2260<gitem> 2261<label>属性値として出現</label> 2262<def><p>参照ではなく,<nt def='NT-Name'>Name</nt>として出現。<code>ENTITY</code>型として宣言した属性の値,又は<code>ENTITIES</code>型として宣言した属性の値における&space;で区切る&token;の一つとして出現する。</p> 2263</def></gitem> 2264<gitem><label>実体値における参照</label> 2265<def><p>実体の宣言における,パラメタ又は内部実体の<termref def='dt-litentval'>&literal;実体値</termref>内の参照。非終端記号<nt def='NT-EntityValue'>EntityValue</nt>に対応する。</p></def></gitem> 2266<gitem><label>DTDにおける参照</label> 2267<def><p><termref def='dt-doctype'>DTD</termref>の内部⊂又は外部⊂での参照。ただし,<nt def='NT-EntityValue'>EntityValue</nt>又は<nt def="NT-AttValue">AttValue</nt>の外側とする。</p></def> 2268</gitem> 2269</glist></p> 2270<!-- border value changed by bosak --> 2271<htable border='1' cellpadding='7' align='center'> 2272<!-- tbody wrapper added by bosak --> 2273<htbody> 2274<tr><td bgcolor='&cellback;' rowspan='2' colspan='1'></td> 2275<td bgcolor='&cellback;' align='center' valign='bottom' colspan='4'>実体の型</td> 2276<td bgcolor='&cellback;' rowspan='2' align='center'>文字</td> 2277</tr> 2278<tr align='center' valign='bottom'> 2279<td bgcolor='&cellback;'>パラメタ</td> 2280<td bgcolor='&cellback;'>内部&newline;一般</td> 2281<td bgcolor='&cellback;'>外部&newline;&parsed-entity;&newline;一般</td> 2282<td bgcolor='&cellback;'>&unparsed-entity;</td> 2283</tr> 2284<tr align='center' valign='middle'> 2285<!--<td bgcolor='&cellback;' rowspan='4'>Recognition 2286Context</td>--> 2287<td bgcolor='&cellback;' align='right'>内容での&newline;参照</td> 2288<td bgcolor='&cellback;'><titleref href='not-recognized'>認識&newline;しない</titleref></td> 2289<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td> 2290<td bgcolor='&cellback;'><titleref href='include-if-valid'>検証のために取込み</titleref></td> 2291<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td> 2292<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td> 2293</tr> 2294<tr align='center' valign='middle'> 2295<td bgcolor='&cellback;' align='right'>属性値での&newline;参照</td> 2296<td bgcolor='&cellback;'><titleref href='not-recognized'>認識&newline;しない</titleref></td> 2297<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td> 2298<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td> 2299<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td> 2300<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td> 2301</tr> 2302<tr align='center' valign='middle'> 2303<td bgcolor='&cellback;' align='right'>属性値として&newline;出現</td> 2304<td bgcolor='&cellback;'><titleref href='not-recognized'>認識&newline;しない</titleref></td> 2305<td bgcolor='&cellback;'><titleref href='not-recognized'>禁止</titleref></td> 2306<td bgcolor='&cellback;'><titleref href='not-recognized'>禁止</titleref></td> 2307<td bgcolor='&cellback;'><titleref href='notify'>通知</titleref></td> 2308<td bgcolor='&cellback;'><titleref href='not recognized'>認識&newline;しない</titleref></td> 2309</tr> 2310<tr align='center' valign='middle'> 2311<td bgcolor='&cellback;' align='right'>実体値での&newline;参照</td> 2312<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td> 2313<td bgcolor='&cellback;'><titleref href='bypass'>&bypass;</titleref></td> 2314<td bgcolor='&cellback;'><titleref href='bypass'>&bypass;</titleref></td> 2315<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td> 2316<td bgcolor='&cellback;'><titleref href='included'>取込み</titleref></td> 2317</tr> 2318<tr align='center' valign='middle'> 2319<td bgcolor='&cellback;' align='right'>DTDでの&newline;参照</td> 2320<td bgcolor='&cellback;'><titleref href='as-PE'>PEとして&newline;取込み</titleref></td> 2321<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td> 2322<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td> 2323<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td> 2324<td bgcolor='&cellback;'><titleref href='forbidden'>禁止</titleref></td> 2325</tr> 2326</htbody> 2327</htable> 2328<div3 id='not-recognized'> 2329<head>“認識しない”</head> 2330<p>DTDの外では,<code>%</code>文字は,いかなる特定の意味も,もたない。したがって,DTDではパラメタ実体参照として認識するものであっても,<nt def='NT-content'>content</nt>内では&markup;としては認識しない。同様に,適切に宣言した属性の値の中に現れる場合を除き,&unparsed-entity;の名前は,認識しない。 2331</p> 2332</div3> 2333<div3 id='included'> 2334<head>“取込み”</head> 2335<p><termdef id="dt-include" term="Include">実体は,その<termref def='dt-repltext'>&replacement-text;</termref>を取り出し,処理すると,参照自体の代わりに,参照があった位置で,文書の一部として含まれるかのように<term>取り込まれる</term>。&replacement-text;は,<termref def='dt-chardata'>文字データ</termref>及び(パラメタ実体を除く。)<termref def="dt-markup">&markup;</termref>のいずれを含んでもよく,これらは,通常の方法で認識されなければならない。ただし,&markup;の区切り子を&escape;するために用いる実体(&magicents;)の&replacement-text;は,常にデータとして扱う(&string;"<code>AT&amp;T;</code>"は,"<code>AT&T;</code>"に展開され,残されたアンパサンドは,実体参照の区切り子としては認識しない。)。文字参照は,示した文字を参照自体の代わりに処理するとき,<term>取り込まれる</term>。 2336</termdef></p> 2337</div3> 2338<div3 id='include-if-valid'> 2339<head>“検証のために取込み”</head> 2340<p>文書の&validity;を<termref def="dt-valid">検証</termref>するには,XML&processor;が&parsed-entity;への参照を認識したとき,その&replacement-text;を<termref def="dt-include">取り込ま</termref>なければならない。実体が外部実体であって,XML文書の&validity;を検証しなければ,実体の&replacement-text;を取り込んでも<termref def="dt-may">よい</termref>が,そうしなくともよい。</p> 2341<p>この取決めは,SGML及びXMLの実体の機構が提供する自動取込み機能が,文書作成時のモジュール化を主な目的として設計されており,その他の&application;(特に,文書のブラウズ)には,必ずしも適切ではない,という認識による。例えば,ブラウザは外部&parsed-entity;への参照を見つけると,その実体が存在するという表示だけを行い,表示を要求されたときにだけ,内容を取り出すかもしれない。 2342</p> 2343</div3> 2344<div3 id='forbidden'> 2345<head>“禁止”</head> 2346<p>次は禁止されており,<termref def='dt-fatal'>&fatal-error;</termref>とする。 2347<ulist> 2348<item><p>a) <termref def='dt-unparsed'>&unparsed-entity;</termref>への参照の出現。 2349</p></item> 2350<item><p>b) DTDの<nt def='NT-EntityValue'>EntityValue</nt>又は<nt def="NT-AttValue">AttValue</nt>以外の部分における,文字参照又は一般実体への参照の出現。</p></item> 2351<item><p>c) 属性値内の外部実体への参照。</p> 2352</item> 2353</ulist> 2354</p> 2355</div3> 2356<div3 id='notify'> 2357<head>“通知”</head> 2358<p><termref def='dt-unparsed'>&unparsed-entity;</termref>の名前が,<kw>ENTITY</kw>又は<kw>ENTITIES</kw>の属性の値において&token;として現れたとき,&processor;は,&application;に対して,関連付けられた<termref def="dt-notation">記法</termref>名,記法に対する<termref def='dt-sysid'>システム</termref>&identifier;及び(存在すれば)<termref def='dt-pubid'>公開</termref>&identifier;を通知しなければならない。</p> 2359</div3> 2360<div3 id='bypass'> 2361<head>“&bypass;”</head> 2362<p>一般実体参照が,実体宣言における<nt def='NT-EntityValue'>EntityValue</nt>内に現れるとき,それは無視され,そのまま残る。</p> 2363</div3> 2364<div3 id='as-PE'> 2365<head>“PEとして取込み”</head> 2366<p>外部&parsed-entity;の場合と同様に,パラメタ実体は,&validity;を<titleref href='include-if-valid'>検証するときだけ取り込まれる</titleref>必要がある。パラメタ実体参照をDTD内に認識して取り込むとき,その<termref def='dt-repltext'>&replacement-text;</termref>は,その前後に一つの&space-character;(#x20)の付加によって引き伸ばされる。この意図は,パラメタ実体の&replacement-text;が,DTD内のいくつかの文法的&token;を完全に含むと,制約することにある。 2367</p> 2368</div3> 2369<!-- 2370<div3 id='gen-char-entproc'> 2371<head>General and Character Entity Processing</head> 2372<p>General-entity and character references are recognized in three 2373contexts: wherever the nonterminal <nt def='NT-content'>content</nt> may 2374appear, at any point within the nonterminal 2375<nt def='NT-AttValue'>AttValue</nt>, 2376and within the 2377<termref def='dt-litentval'>literal entity value</termref> 2378(<nt def='NT-EntityValue'>EntityValue</nt>) 2379of an internal entity declaration. 2380This section discusses the first two cases; the third 2381is discussed <titleref href='intern-replacement'>below</titleref>. 2382When an <termref def="dt-xml-proc">XML processor</termref> encounters 2383such a reference, or the name of an unparsed entity as the value 2384of an <kw>ENTITY</kw> or <kw>ENTITIES</kw> attribute, then: 2385<olist> 2386 2387<item><p>In all cases, the XML processor may 2388inform the application of the reference's occurrence and its identifier 2389(for an entity reference, the name; for a character 2390reference, 2391the character number in decimal, hexadecimal, or binary form).</p></item> 2392 2393<item><p>For both character and entity references, the processor must 2394remove the reference itself from the <termref def="dt-text">text</termref> data 2395before passing the data to the application. 2396</p></item> 2397 2398<item><p>For character references, the processor must 2399pass the character indicated 2400to the application in 2401place of the reference. 2402</p></item> 2403 2404<item><p>For an external entity, the processor must inform the 2405application of the entity's <termref def="dt-sysid">system 2406identifier</termref>, and <termref def="dt-pubid">public identifier</termref> 2407if any. 2408All strings 2409of white space in the public identifier must be normalized to single space characters (#x20), 2410and leading and trailing white space must be removed.</p></item> 2411 2412<item><p>If the external entity is binary, the processor must inform the 2413application of the associated <termref def="dt-notation">notation</termref> 2414name, and the notation's associated <termref def='dt-sysid'>system</termref> 2415and <termref def='dt-pubid'>public</termref> (if any) 2416identifiers.</p></item> 2417 2418<item><p><termdef id="dt-include" term="Include">For an internal 2419(parsed) entity, the processor must <term>include</term> the 2420entity; that is, retrieve its replacement text 2421and process it as a part of the document 2422(i.e. as <nt def="NT-content">content</nt> or <nt 2423def="NT-AttValue">AttValue</nt>, whichever was being processed when 2424the reference was recognized), passing the result to the application 2425in place of the reference. The replacement text may contain both 2426<termref def='dt-chardata'>character data</termref> 2427and <termref def="dt-markup">markup</termref>, which must be recognized in 2428the usual way, except that the replacement text of entities used to escape 2429markup delimiters (the entities &magicents;) is always treated as 2430data. (The string "<code>AT&amp;T;</code>" expands to 2431"<code>AT&T;</code>" since the ampersand replacing "<code>&amp;</code>" 2432is not recognized 2433as an entity-reference delimiter.) </termdef></p> 2434<p>Since the entity may contain other entity references, 2435an XML processor may have to repeat the inclusion process recursively.</p> 2436</item> 2437<item><p>If the entity is an external parsed entity, then in order to 2438<termref def="dt-valid">validate</termref> the XML document, the processor must 2439<termref def="dt-include">include</termref> the content of the 2440entity.</p></item> 2441 2442<item><p>If the entity is an external parsed entity, and the processor is not 2443attempting to <termref def="dt-valid">validate</termref> the XML document, the 2444processor <termref def="dt-may">may</termref>, but need not, <termref 2445def="dt-include">include</termref> the entity's content.</p> 2446<p>This rule is based on the recognition that the automatic inclusion 2447provided by the SGML and XML entity mechanism, primarily designed 2448to support modularity in authoring, is not necessarily 2449appropriate for other applications, in particular document browsing. 2450Browsers, for example, when encountering an external parsed entity reference, 2451might choose to provide a visual indication of the entity's 2452presence and retrieve it for display only on demand. 2453</p></item> 2454</olist> 2455</p> 2456<p><termdef id="dt-escape" term="escape">Entity and character 2457references can both be used to <term>escape</term> the left angle bracket, 2458ampersand, and other delimiters. A set of general entities 2459(&magicents;) is specified for this purpose. 2460Numeric character references may also be used; they are 2461expanded immediately when recognized, and must be treated as 2462character data, so the numeric character references 2463"<code>&#60;</code>" and "<code>&#38;</code>" may be used to 2464escape <code><</code> and <code>&</code> when they occur 2465in character data.</termdef></p> 2466</div3> 2467<div3 id='PE-proc'> 2468<head>Parameter Entity Processing</head> 2469<p>Parameter-entity references are only recognized in the 2470<termref def='dt-doctype'>DTD</termref>. 2471Their processing, when they appear 2472within the 2473<termref def='dt-litentval'>literal entity value</termref> 2474(<nt def='NT-EntityValue'>EntityValue</nt>) 2475of an internal entity declaration, 2476is discussed <titleref href='intern-replacement'>below</titleref>. 2477They have these intended uses: 2478<olist> 2479<item><p>as a replacement for one or more complete markup declarations</p></item> 2480<item><p>as a replacement for one or more complete "groups" in 2481element declarations</p></item> 2482<item><p>as a replacement for one or more complete "tokens" in 2483markup declarations</p></item> 2484</olist> 2485</p> 2486<p>The constraints requiring that PE replacement texts be properly nested 2487with <titleref href='vc-PEinMarkupDecl'>markup declarations</titleref> 2488and <titleref href='vc-PEinGroup'>content groups</titleref> 2489govern the first two usages.</p> 2490<p>To support the third intended usage, 2491when an XML processor encounters a parameter-entity reference 2492(outside of the 2493<termref def='dt-litentval'>literal entity value</termref> in an entity 2494declaration), 2495it must <termref def="dt-include">include</termref> 2496the named entity, but first expand its 2497<termref def='dt-repltext'>replacement text</termref> by attaching 2498space (#x20) characters to its beginning and the end, before 2499processing it.</p> 2500<p>The DTD text must match the relevant 2501rules of this specification's grammar after all parameter-entity 2502references have been expanded. 2503<!-In addition, parameter entities referred to in specific 2504contexts are required to satisfy certain constraints in their 2505replacement text; for example, a parameter entity referred to within 2506the internal DTD subset must match the rule for <nt 2507def="NT-markupdecl">markupdecl</nt>. -> 2508</p> 2509</div3> 2510--> 2511</div2> 2512<div2 id='intern-replacement'> 2513<head>内部実体&replacement-text;の構築</head> 2514<p>内部実体の取扱いの規定で,実体値を二つの形式に区別することは役に立つ。<termdef id="dt-litentval" term='Literal Entity Value'><term>&literal;実体値</term>は,実体宣言内に実際に存在する,引用符で囲む&string;とする。これは,非終端記号<nt def='NT-EntityValue'>EntityValue</nt>に&match;する。</termdef><termdef id='dt-repltext' term='Replacement Text'><term>&replacement-text;</term>は,文字参照及び¶meter;実体参照の置換え後における,実体の内容とする。</termdef></p> 2515 2516<p>内部実体宣言内で与える&literal;実体値<!-- replacement text -->(<nt def='NT-EntityValue'>EntityValue</nt>)は,文字参照,¶meter;実体参照及び一般実体参照を含んでよい。これらの参照は,<!-- replacement text. -->&literal;実体値内に完全に含まれていなければならない。<termref def='dt-include'>展開する</termref>実際の&replacement-text;(先に示したもの)は,参照する¶meter;実体の<emph>&replacement-text;</emph>を含まなければならず,&literal;実体値内での文字参照の代わりに参照した文字を含まなければならない。しかし,一般実体参照は,そのまま残し, 展開してはならない。 2517<!-- in the replacement text that is to be included. --> 2518例えば,次の宣言を与えたとする。 2519 2520<eg><![CDATA[<!ENTITY % pub "Éditions Gallimard" > 2521<!ENTITY rights "All rights reserved" > 2522<!ENTITY book "La Peste: Albert Camus, 2523© 1947 %pub;. &rights;" >]]></eg> 2524実体の&replacement-text;"<code>book</code>"は,次のとおりとなる。 2525<eg>La Peste: Albert Camus, 2526© 1947 Éditions Gallimard. &rights;</eg> 2527参照"<code>&book;</code>"が,文書の内容又は属性値内に出現していれば,一般実体参照"<code>&rights;</code>"は,展開されている。</p> 2528<p>これらの単純な規則は,複合相互作用をもつ。 2529<!-- 日本語訳について: interaction = 相互作用(金本)--> 2530難しい例についての詳細は,<titleref href='sec-entexpand'>実体参照の展開の付録</titleref>を参照のこと。 2531</p> 2532<!-- Replaced by the above -TB 2533<p>Implementors of XML processors need to know the rules for 2534expansion of references in more detail. These rules only come into 2535play when the replacement text for an internal entity itself contains 2536other references. 2537<olist> 2538<item><p>In the replacement text of an internal entity, parameter-entity 2539references and character references in the replacement text 2540are recognized and resolved 2541when the entity declaration is parsed, 2542before the replacement text is stored in 2543the processor's symbol table. 2544General-entity references in the replacement text are not 2545resolved when the entity declaration is parsed.</p></item> 2546<item><p>In the document, when a general-entity reference is 2547resolved, its replacement text is parsed. Character references 2548encountered in the replacement text are 2549resolved immediately; general-entity references encountered in the 2550replacement text may be resolved or left unresolved, as described 2551<titleref href="entproc">above</titleref>. 2552Character and general-entity references must be 2553contained entirely within the entity's replacement text. 2554</p></item> 2555</olist> 2556</p> 2557 2558<p>Simple character references do not suffice to escape delimiters 2559within the replacement text of an internal entity: they will be 2560expanded when the entity declaration is parsed, before the replacement 2561text is stored in the symbol table. When the entity itself is 2562referred to, the replacement text will be parsed again, and the 2563delimiters (no longer character references) 2564will be recognized as delimiters. To escape the 2565characters &magicents; in an entity replacement text, use 2566a general-entity reference or a doubly-escaped character reference. 2567See <titleref href='sec-entexpand'>the appendix on expansion 2568of entity references</titleref> 2569for detailed examples.</p> 2570--> 2571 2572 2573</div2> 2574<div2 id='sec-predefined-ent'> 2575<head>定義済み実体</head> 2576<p><termdef id="dt-escape" term="escape"> 2577実体参照及び文字参照のいずれも,&left-angle-bracket;,アンバサンド及び他の区切り子を<term>&escape;</term>するために使用できる。いくつかの一般実体(&magicents;)を,この目的のために指定する。数値による文字参照も,同様の目的のために使用できる。文字参照は,認識されると直ちに展開され,文字データとして扱われるので,数値による文字参照"<code>&#60;</code>"及び"<code>&#38;</code>"は,文字データ内に出現する<code><</code>及び<code>&</code>を&escape;するために使用できる。</termdef></p> 2578<p>すべてのXML&processor;は,宣言されているかどうかに関係なく,これらの実体を認識しなくてはならない。<termref def='dt-interop'>相互運用性のため</termref>,&valid;なXML文書は,これらの実体を使用する前に,他の実体と同様に,宣言することが望ましい。実体を宣言する場合は,&replacement-text;を&escape;する一文字とする内部実体として,次のとおりに宣言しなければならない。 2579<eg><![CDATA[<!ENTITY lt "&#60;"> 2580<!ENTITY gt ">"> 2581<!ENTITY amp "&#38;"> 2582<!ENTITY apos "'"> 2583<!ENTITY quot """> 2584]]></eg> 2585"<code>lt</code>"及び"<code>amp</code>"宣言内の"<code><</code>"及び"<code>&</code>"文字は,実体の置換テキストが,&well-formed;となるように二重に&escape;されることに注意。 2586</p> 2587</div2> 2588 2589 2590<div2 id='Notations'> 2591<head>記法宣言</head> 2592 2593 2594<p> 2595<termdef id="dt-notation" term="Notation"> 2596<term>記法</term>は,<termref def="dt-extent">&unparsed-entity;</termref>の形式を&identify;名前か,又は<termref def="dt-pi">処理命令</termref>の対象とする&application;を&identify;名前とする。</termdef></p> 2597<p><termdef id="dt-notdecl" term="Notation Declaration"> 2598<term>記法宣言</term>は,記法の名前及び外部&identifier;を提供する。この名前は,実体及び属性リスト宣言並びに属性指定に用いる。外部&identifier;は,与えられた記法のデータを処理できるヘルパ&application;を,XML&processor;又はクライアントアプリケーションが探すために,利用できる。 2599<scrap lang='ebnf'> 2600<head>記法宣言</head> 2601<prod id='NT-NotationDecl'><lhs>NotationDecl</lhs> 2602<rhs>'<!NOTATION' <nt def='NT-S'>S</nt> <nt def='NT-Name'>Name</nt> 2603<nt def='NT-S'>S</nt> 2604(<nt def='NT-ExternalID'>ExternalID</nt> | 2605<nt def='NT-PublicID'>PublicID</nt>) 2606<nt def='NT-S'>S</nt>? '>'</rhs></prod> 2607<prod id='NT-PublicID'><lhs>PublicID</lhs> 2608<rhs>'PUBLIC' <nt def='NT-S'>S</nt> 2609<nt def='NT-PubidLiteral'>PubidLiteral</nt> 2610</rhs></prod> 2611</scrap> 2612</termdef></p> 2613<p>宣言し,属性値,属性定義又は実体宣言で参照するすべての記法について,XML&processor;は,記法の名前及び外部&identifier;を&application;に提供しなければならない。さらに,外部&identifier;を,<termref def="dt-sysid">システム&identifier;</termref>,ファイル名又はその他の情報に展開してもよく,これらを用いて,&application;は,その記法のデータを処理する&processor;を起動する。(しかし,XML&processor;又は&application;が動作するシステムでは利用できない記法を,XML文書が宣言し参照しても,これは,&error;とはしない。)</p> 2614</div2> 2615 2616 2617<div2 id='sec-doc-entity'> 2618<head>文書実体</head> 2619 2620<p><termdef id="dt-docent" term="Document Entity"><term>文書実体</term>は,実体の形成する木構造の&root;であって,<termref def="dt-xml-proc">XML&processor;</termref>が,処理を開始する地点とする。</termdef>この&TR-or-Rec;は,XML&processor;が,文書実体の存在する場所をどのように見つけるかは,規定しない。他の実体と異なり,文書実体は名前をもたず,いかなる識別もなしに&processor;への入力&stream;に出現してもよい。</p> 2621</div2> 2622 2623 2624</div1> 2625<!-- &Conformance; --> 2626<div1 id='sec-conformance'> 2627<head>適合性</head> 2628 2629<p>適合する<termref def="dt-xml-proc">XML&processor;</termref>は,&validating;もの及び&non-validating;ものの,二つに分類される。</p> 2630<p>&validating;システム及び&non-validating;システムは,この&TR-or-Rec;が規定する&well-formed;制約への違反を報告しなければならない。</p> 2631<p><termdef id="dt-validating" term="Validating Processor"><term>&validating;&processor;</term>は,<termref def="dt-doctype">DTD</termref>内の宣言によって示された,制約への違反を報告しなければならない。さらに,この&TR-or-Rec;が規定する&validity;制約への違反を,すべて報告しなければならない。 2632</termdef> 2633</p> 2634</div1> 2635 2636<div1 id='sec-notation'> 2637<head>記法</head> 2638 2639<p>XMLの形式的な文法は,簡単な拡張Backus-Naur Form(EBNF)記法によって与える。文法の各規則は,次の形式で,記号を一つ定義する。 2640<eg>symbol ::= expression</eg></p> 2641<p>記号は,正規表現で定義するときは大文字で始め,そうでなければ,小文字で始める。&string;&literal;は,引用符で囲む。 2642<!--* The distinction between symbols which can and cannot be 2643recognized using simple regular expressions may be used to set the 2644boundary between an implementation's lexical scanner and its parser, 2645but this specification neither constrains the placement of that 2646boundary nor presupposes that all implementations will have one. *--> 2647</p> 2648 2649<p>規則の右側の式内では,一つ又は複数の文字からなる&string;と&match;するために,次の式を使用する。 2650<glist> 2651<gitem> 2652<label><code>#xN</code></label> 2653<def><p>ここで,<code>N</code>は16進の整数とする。ISO/IEC 10646の文字であって,正規形(UCS-4)の&code-value;を符号なし2進数として解釈したとき,指定した値と等しいものと&match;する。<code>#xN</code>形式の先頭にゼロがいくつか現れるかは,意味をもたない。&code-value;<!-- bit string -->における先頭のゼロの数は,文字の符号化によって決定されるので,XMLにとっては意味がない。 2654</p></def> 2655</gitem> 2656<gitem> 2657<label><code>[a-zA-Z]</code>, <code>[#xN-#xN]</code></label> 2658<def><p>指定した範囲の値(両端の値を含む。)をもつ任意の<termref def='dt-character'>文字</termref>と&match;する。</p></def> 2659</gitem> 2660<gitem> 2661<label><code>[^a-z]</code>, <code>[^#xN-#xN]</code></label> 2662<def><p>指定した範囲<emph>外</emph>の値をもつ任意の<termref def='dt-character'>文字</termref>と&match;する。</p></def> 2663</gitem> 2664<gitem> 2665<label><code>[^abc]</code>, <code>[^#xN#xN#xN]</code></label> 2666<def><p>指定した文字以外の値をもつ任意の<termref def='dt-character'>文字</termref>と&match;する。</p></def> 2667</gitem> 2668<gitem> 2669<label><code>"string"</code></label> 2670<def><p>&double-quote;で囲む&string;&literal;と<termref def="dt-match">&match;している</termref>&string;&literal;と&match;する。</p></def> 2671</gitem> 2672<gitem> 2673<label><code>'string'</code></label> 2674<def><p>&single-quote;で囲む&string;&literal;と<termref def="dt-match">&match;している</termref>&string;&literal;と&match;する。</p></def> 2675</gitem> 2676</glist> 2677これらの記号は,次の形式の組合せで使用する。ここで,<code>A</code>及び<code>B</code>は,単純な式とする。 2678<glist> 2679<gitem> 2680<label>(<code>expression</code>)</label> 2681<def><p><code>expression</code>は,一つのまとまりとして扱い,ここに示す組合せで使ってもよい。</p></def> 2682</gitem> 2683<gitem> 2684<label><code>A?</code></label> 2685<def><p><code>A</code>又は何もなしと&match;する(オプションの<code>A</code>)。</p></def> 2686</gitem> 2687<gitem> 2688<label><code>A B</code></label> 2689<def><p><code>A</code>の次に<code>B</code>が出現するものと&match;する。 2690</p></def> 2691</gitem> 2692<gitem> 2693<label><code>A | B</code></label> 2694<def><p><code>A</code>又は<code>B</code>,ただし,両方ではない,と&match;する。 2695</p></def> 2696</gitem> 2697<gitem> 2698<label><code>A - B</code></label> 2699<def><p><code>A</code>と&match;するが,<code>B</code>とは&match;しない,任意の&string;と&match;する。</p></def> 2700</gitem> 2701<gitem> 2702<label><code>A+</code></label> 2703<def><p><code>A</code>の1回以上の繰返しと&match;する。</p></def> 2704</gitem> 2705<gitem> 2706<label><code>A*</code></label> 2707<def><p><code>A</code>の0回以上の繰返しと&match;する。</p></def> 2708</gitem> 2709<!-- DEATH TO %'s 2710<gitem> 2711<label><code>%a</code></label> 2712<def><p>specifies that <emph>in the external DTD subset</emph> a 2713<termref def='dt-param-entity'>parameter entity</termref> may occur in the 2714text at the position where <code>a</code> may occur; if so, its 2715replacement text must match <code>S? a S?</code>. If 2716the expression <code>a</code> is governed by a suffix operator, then 2717the suffix operator determines both the maximum number of parameter-entity 2718references allowed and the number of occurrences of <code>a</code> 2719in the replacement text of the parameter entities: <code>%a*</code> 2720means that <code>a</code> must occur zero or more times, and 2721that some of its occurrences may be replaced by references to 2722parameter entities whose replacement text must contain zero or 2723more occurrences of <code>a</code>; it is thus a more compact way 2724of writing <code>%(a*)*</code>. 2725Similarly, <code>%a+</code> means that <code>a</code> 2726must occur one or more times, and may be replaced by 2727parameter entities with replacement text matching 2728<code>S? (a S?)+</code>. 2729The recognition of parameter entities in the internal subset is much more 2730highly constrained. 2731</p></def> 2732</gitem> 2733--> 2734</glist> 2735生成規則内で使用する他の記法を,次に示す。 2736<glist> 2737<gitem> 2738<label><code>/* ... */</code></label> 2739<def><p>コメント。</p></def> 2740</gitem> 2741<gitem> 2742<label><code>[ wfc: ... ]</code></label> 2743<def><p>&well-formed;制約。生成規則に付与した,<termref def="dt-wellformed">&well-formed;</termref>の文書に関する制約を,名前によって&identify;。</p></def> 2744</gitem> 2745<gitem> 2746<label><code>[ vc: ... ]</code></label> 2747<def><p>&validity;制約。生成規則に付与した,<termref def="dt-valid">&valid;</termref>な文書に関する制約を,名前によって&identify;。 2748</p></def> 2749</gitem> 2750</glist> 2751</p></div1> 2752 2753</body> 2754<back> 2755<!-- &SGML; --> 2756 2757<!-- &Biblio; --> 2758<div1 id='sec-bibliography'> 2759 2760<head>参考文献</head> 2761<div2 id='sec-existing-stds'> 2762<head>&normative;参考文献</head> 2763<!--* <ulist><item> 2764<p>Unicode and ISO/IEC 10646. This specification depends on the 2765international standard ISO/IEC 10646 (with amendments AM 1 through AM 7) 2766and the Unicode Standard, Version 2.0 <bibref ref='Unicode'/>, 2767which define the encodings and meanings of 2768the <termref def="dt-character">characters</termref> which 2769make up XML <termref def="dt-text">text</termref>. 2770All the characters in ISO/IEC 10646 are present, at the same code points, 2771in Unicode.</p></item> 2772<item><p>XXX XXX defines the syntax and semantics of 2773Uniform Resource Identifiers, or URIs.</p></item> 2774<item><p>IETF RFC 1766, with ISO 639 and 3166, 2775describe the codes that may be used in the 2776special <titleref href='sec-lang-tag'>xml:lang</titleref> attribute.</p> 2777</item></ulist> 2778*--> 2779 2780<blist> 2781 2782<bibl id='RFC1766' key='IETF RFC 1766'> 2783IETF (Internet Engineering Task Force). 2784<emph>RFC 1766: Tags for the Identification of Languages</emph>, 2785ed. H. Alvestrand. 27861995. 2787</bibl> 2788 2789<bibl id='ISO639' key='ISO 639'> 2790(International Organization for Standardization). 2791<emph>ISO 8879:1988 (E). 2792Code for the representation of names of languages.</emph> 2793[Geneva]: International Organization for 2794Standardization, 1988.</bibl> 2795 2796<bibl id='ISO3166' key='ISO 3166'> 2797(International Organization for Standardization). 2798<emph>ISO 3166-1:1997 (E). 2799Codes for the representation of names of countries and their subdivisions 2800— Part 1: Country codes</emph> 2801[Geneva]: International Organization for 2802Standardization, 1997.</bibl> 2803 2804<bibl id='ISO10646' key='ISO/IEC 10646'>ISO 2805(International Organization for Standardization). 2806<emph>ISO/IEC 10646-1993 (E). Information technology — Universal 2807Multiple-Octet Coded Character Set (UCS) — Part 1: 2808Architecture and Basic Multilingual Plane.</emph> 2809[Geneva]: International Organization for 2810Standardization, 1993 (plus amendments AM 1 through AM 7). 2811</bibl> 2812 2813<bibl id='Unicode' key='Unicode'>The Unicode Consortium. 2814<emph>The Unicode Standard, Version 2.0.</emph> 2815Reading, Mass.: Addison-Wesley Developers Press, 1996.</bibl> 2816 2817</blist> 2818 2819</div2> 2820 2821<div2><head>他の参考文献</head> 2822 2823<blist> 2824 2825<bibl id='Aho' key='Aho/Ullman'>Aho, Alfred V., 2826Ravi Sethi, and Jeffrey D. Ullman. 2827<emph>Compilers: Principles, Techniques, and Tools</emph>. 2828Reading: Addison-Wesley, 1986, rpt. corr. 1988.</bibl> 2829 2830<bibl id="Berners-Lee" xml-link="simple" key="Berners-Lee et al."> 2831Berners-Lee, T., R. Fielding, and L. Masinter. 2832<emph>Uniform Resource Identifiers (URI): Generic Syntax and 2833Semantics</emph>. 28341997. 2835(Work in progress; see updates to RFC1738.)</bibl> 2836 2837<bibl id='ABK' key='Brüggemann-Klein'>Brüggemann-Klein, Anne. 2838<emph>Regular Expressions into Finite Automata</emph>. 2839Extended abstract in I. Simon, Hrsg., LATIN 1992, 2840S. 97-98. Springer-Verlag, Berlin 1992. 2841Full Version in Theoretical Computer Science 120: 197-213, 1993. 2842<!-- 2843Universitat Freiburg, Institut fur Informatik, 2844Bericht 33, Juli 1991.--> 2845</bibl> 2846 2847<bibl id='ABKDW' key='Brüggemann-Klein and Wood'>Brüggemann-Klein, Anne, 2848and Derick Wood. 2849<emph>Deterministic Regular Languages</emph>. 2850Universität Freiburg, Institut für Informatik, 2851Bericht 38, Oktober 1991. 2852</bibl> 2853 2854<bibl id="RFC1738" xml-link="simple" key="IETF RFC1738"> 2855IETF (Internet Engineering Task Force). 2856<emph>RFC 1738: Uniform Resource Locators (URL)</emph>, 2857ed. T. Berners-Lee, L. Masinter, M. McCahill. 28581994. 2859</bibl> 2860 2861<bibl id="RFC1808" xml-link="simple" key="IETF RFC1808"> 2862IETF (Internet Engineering Task Force). 2863<emph>RFC 1808: Relative Uniform Resource Locators</emph>, 2864ed. R. Fielding. 28651995. 2866</bibl> 2867 2868<bibl id="RFC2141" xml-link="simple" key="IETF RFC2141"> 2869IETF (Internet Engineering Task Force). 2870<emph>RFC 2141: URN Syntax</emph>, 2871ed. R. Moats. 28721997. 2873</bibl> 2874 2875<bibl id='ISO8879' key='ISO/IEC 8879'>ISO 2876(International Organization for Standardization). 2877<emph>ISO/IEC 8879-1986 (E). Information processing — Text and Office 2878Systems — Standard Generalized Markup Language (SGML).</emph> First 2879edition — 1986-10-15. [Geneva]: International Organization for 2880Standardization, 1986. 2881</bibl> 2882 2883 2884<bibl id='ISO10744' key='ISO/IEC 10744'>ISO 2885(International Organization for Standardization). 2886<emph>ISO/IEC 10744-1992 (E). Information technology — 2887Hypermedia/Time-based Structuring Language (HyTime). 2888</emph> 2889[Geneva]: International Organization for 2890Standardization, 1992. 2891<emph>Extended Facilities Annexe.</emph> 2892[Geneva]: International Organization for 2893Standardization, 1996. 2894</bibl> 2895 2896 2897 2898</blist> 2899</div2> 2900</div1> 2901<div1 id='CharClasses'> 2902<head>文字クラス</head> 2903 2904<p>Unicode標準に定義する&property;にしたがって,文字は,&base-character;(BaseChar)(これらは,&diacritical-mark;を除くラテンアルファベットのアルファベット文字を含む),&ideographic;(ideographic)及び&combining-character;(CombiningChar)(このクラスは,ほとんどの&diacritical-mark;を含む)にクラス分けする。これらのクラスは,結合し,&letter;(Letter)のクラスとなる。10進数値(Digit)及び&extender;(Extender)も区別する。 2905<scrap lang="ebnf" id="CHARACTERS"> 2906<head>文字</head> 2907<prodgroup pcw3="3" pcw4="15"> 2908<prod id="NT-Letter"><lhs>Letter</lhs> 2909<rhs><nt def="NT-BaseChar">BaseChar</nt> 2910| <nt def="NT-Ideographic">Ideographic</nt></rhs> </prod> 2911<prod id='NT-BaseChar'><lhs>BaseChar</lhs> 2912<rhs>[#x0041-#x005A] 2913| [#x0061-#x007A] 2914| [#x00C0-#x00D6] 2915| [#x00D8-#x00F6] 2916| [#x00F8-#x00FF] 2917| [#x0100-#x0131] 2918| [#x0134-#x013E] 2919| [#x0141-#x0148] 2920| [#x014A-#x017E] 2921| [#x0180-#x01C3] 2922| [#x01CD-#x01F0] 2923| [#x01F4-#x01F5] 2924| [#x01FA-#x0217] 2925| [#x0250-#x02A8] 2926| [#x02BB-#x02C1] 2927| #x0386 2928| [#x0388-#x038A] 2929| #x038C 2930| [#x038E-#x03A1] 2931| [#x03A3-#x03CE] 2932| [#x03D0-#x03D6] 2933| #x03DA 2934| #x03DC 2935| #x03DE 2936| #x03E0 2937| [#x03E2-#x03F3] 2938| [#x0401-#x040C] 2939| [#x040E-#x044F] 2940| [#x0451-#x045C] 2941| [#x045E-#x0481] 2942| [#x0490-#x04C4] 2943| [#x04C7-#x04C8] 2944| [#x04CB-#x04CC] 2945| [#x04D0-#x04EB] 2946| [#x04EE-#x04F5] 2947| [#x04F8-#x04F9] 2948| [#x0531-#x0556] 2949| #x0559 2950| [#x0561-#x0586] 2951| [#x05D0-#x05EA] 2952| [#x05F0-#x05F2] 2953| [#x0621-#x063A] 2954| [#x0641-#x064A] 2955| [#x0671-#x06B7] 2956| [#x06BA-#x06BE] 2957| [#x06C0-#x06CE] 2958| [#x06D0-#x06D3] 2959| #x06D5 2960| [#x06E5-#x06E6] 2961| [#x0905-#x0939] 2962| #x093D 2963| [#x0958-#x0961] 2964| [#x0985-#x098C] 2965| [#x098F-#x0990] 2966| [#x0993-#x09A8] 2967| [#x09AA-#x09B0] 2968| #x09B2 2969| [#x09B6-#x09B9] 2970| [#x09DC-#x09DD] 2971| [#x09DF-#x09E1] 2972| [#x09F0-#x09F1] 2973| [#x0A05-#x0A0A] 2974| [#x0A0F-#x0A10] 2975| [#x0A13-#x0A28] 2976| [#x0A2A-#x0A30] 2977| [#x0A32-#x0A33] 2978| [#x0A35-#x0A36] 2979| [#x0A38-#x0A39] 2980| [#x0A59-#x0A5C] 2981| #x0A5E 2982| [#x0A72-#x0A74] 2983| [#x0A85-#x0A8B] 2984| #x0A8D 2985| [#x0A8F-#x0A91] 2986| [#x0A93-#x0AA8] 2987| [#x0AAA-#x0AB0] 2988| [#x0AB2-#x0AB3] 2989| [#x0AB5-#x0AB9] 2990| #x0ABD 2991| #x0AE0 2992| [#x0B05-#x0B0C] 2993| [#x0B0F-#x0B10] 2994| [#x0B13-#x0B28] 2995| [#x0B2A-#x0B30] 2996| [#x0B32-#x0B33] 2997| [#x0B36-#x0B39] 2998| #x0B3D 2999| [#x0B5C-#x0B5D] 3000| [#x0B5F-#x0B61] 3001| [#x0B85-#x0B8A] 3002| [#x0B8E-#x0B90] 3003| [#x0B92-#x0B95] 3004| [#x0B99-#x0B9A] 3005| #x0B9C 3006| [#x0B9E-#x0B9F] 3007| [#x0BA3-#x0BA4] 3008| [#x0BA8-#x0BAA] 3009| [#x0BAE-#x0BB5] 3010| [#x0BB7-#x0BB9] 3011| [#x0C05-#x0C0C] 3012| [#x0C0E-#x0C10] 3013| [#x0C12-#x0C28] 3014| [#x0C2A-#x0C33] 3015| [#x0C35-#x0C39] 3016| [#x0C60-#x0C61] 3017| [#x0C85-#x0C8C] 3018| [#x0C8E-#x0C90] 3019| [#x0C92-#x0CA8] 3020| [#x0CAA-#x0CB3] 3021| [#x0CB5-#x0CB9] 3022| #x0CDE 3023| [#x0CE0-#x0CE1] 3024| [#x0D05-#x0D0C] 3025| [#x0D0E-#x0D10] 3026| [#x0D12-#x0D28] 3027| [#x0D2A-#x0D39] 3028| [#x0D60-#x0D61] 3029| [#x0E01-#x0E2E] 3030| #x0E30 3031| [#x0E32-#x0E33] 3032| [#x0E40-#x0E45] 3033| [#x0E81-#x0E82] 3034| #x0E84 3035| [#x0E87-#x0E88] 3036| #x0E8A 3037| #x0E8D 3038| [#x0E94-#x0E97] 3039| [#x0E99-#x0E9F] 3040| [#x0EA1-#x0EA3] 3041| #x0EA5 3042| #x0EA7 3043| [#x0EAA-#x0EAB] 3044| [#x0EAD-#x0EAE] 3045| #x0EB0 3046| [#x0EB2-#x0EB3] 3047| #x0EBD 3048| [#x0EC0-#x0EC4] 3049| [#x0F40-#x0F47] 3050| [#x0F49-#x0F69] 3051| [#x10A0-#x10C5] 3052| [#x10D0-#x10F6] 3053| #x1100 3054| [#x1102-#x1103] 3055| [#x1105-#x1107] 3056| #x1109 3057| [#x110B-#x110C] 3058| [#x110E-#x1112] 3059| #x113C 3060| #x113E 3061| #x1140 3062| #x114C 3063| #x114E 3064| #x1150 3065| [#x1154-#x1155] 3066| #x1159 3067| [#x115F-#x1161] 3068| #x1163 3069| #x1165 3070| #x1167 3071| #x1169 3072| [#x116D-#x116E] 3073| [#x1172-#x1173] 3074| #x1175 3075| #x119E 3076| #x11A8 3077| #x11AB 3078| [#x11AE-#x11AF] 3079| [#x11B7-#x11B8] 3080| #x11BA 3081| [#x11BC-#x11C2] 3082| #x11EB 3083| #x11F0 3084| #x11F9 3085| [#x1E00-#x1E9B] 3086| [#x1EA0-#x1EF9] 3087| [#x1F00-#x1F15] 3088| [#x1F18-#x1F1D] 3089| [#x1F20-#x1F45] 3090| [#x1F48-#x1F4D] 3091| [#x1F50-#x1F57] 3092| #x1F59 3093| #x1F5B 3094| #x1F5D 3095| [#x1F5F-#x1F7D] 3096| [#x1F80-#x1FB4] 3097| [#x1FB6-#x1FBC] 3098| #x1FBE 3099| [#x1FC2-#x1FC4] 3100| [#x1FC6-#x1FCC] 3101| [#x1FD0-#x1FD3] 3102| [#x1FD6-#x1FDB] 3103| [#x1FE0-#x1FEC] 3104| [#x1FF2-#x1FF4] 3105| [#x1FF6-#x1FFC] 3106| #x2126 3107| [#x212A-#x212B] 3108| #x212E 3109| [#x2180-#x2182] 3110| [#x3041-#x3094] 3111| [#x30A1-#x30FA] 3112| [#x3105-#x312C] 3113| [#xAC00-#xD7A3] 3114</rhs></prod> 3115<prod id='NT-Ideographic'><lhs>Ideographic</lhs> 3116<rhs>[#x4E00-#x9FA5] 3117| #x3007 3118| [#x3021-#x3029] 3119</rhs></prod> 3120<prod id='NT-CombiningChar'><lhs>CombiningChar</lhs> 3121<rhs>[#x0300-#x0345] 3122| [#x0360-#x0361] 3123| [#x0483-#x0486] 3124| [#x0591-#x05A1] 3125| [#x05A3-#x05B9] 3126| #x05BB#x05BD 3127| #x05BF 3128| [#x05C1-#x05C2] 3129| #x05C4 3130| #x064B#x0652 3131| #x0670 3132| [#x06D6-#x06DC] 3133| #x06DD#x06DF 3134| [#x06E0-#x06E4] 3135| [#x06E7-#x06E8] 3136| [#x06EA-#x06ED] 3137| [#x0901-#x0903] 3138| #x093C 3139| [#x093E-#x094C] 3140| #x094D 3141| [#x0951-#x0954] 3142| [#x0962-#x0963] 3143| [#x0981-#x0983] 3144| #x09BC 3145| #x09BE 3146| #x09BF 3147| [#x09C0-#x09C4] 3148| [#x09C7-#x09C8] 3149| [#x09CB-#x09CD] 3150| #x09D7 3151| [#x09E2-#x09E3] 3152| #x0A02 3153| #x0A3C 3154| #x0A3E 3155| #x0A3F 3156| [#x0A40-#x0A42] 3157| [#x0A47-#x0A48] 3158| [#x0A4B-#x0A4D] 3159| [#x0A70-#x0A71] 3160| [#x0A81-#x0A83] 3161| #x0ABC 3162| [#x0ABE-#x0AC5] 3163| [#x0AC7-#x0AC9] 3164| [#x0ACB-#x0ACD] 3165| [#x0B01-#x0B03] 3166| #x0B3C 3167| [#x0B3E-#x0B43] 3168| [#x0B47-#x0B48] 3169| [#x0B4B-#x0B4D] 3170| [#x0B56-#x0B57] 3171| [#x0B82-#x0B83] 3172| [#x0BBE-#x0BC2] 3173| [#x0BC6-#x0BC8] 3174| [#x0BCA-#x0BCD] 3175| #x0BD7 3176| [#x0C01-#x0C03] 3177| [#x0C3E-#x0C44] 3178| [#x0C46-#x0C48] 3179| [#x0C4A-#x0C4D] 3180| [#x0C55-#x0C56] 3181| [#x0C82-#x0C83] 3182| [#x0CBE-#x0CC4] 3183| [#x0CC6-#x0CC8] 3184| [#x0CCA-#x0CCD] 3185| [#x0CD5-#x0CD6] 3186| [#x0D02-#x0D03] 3187| [#x0D3E-#x0D43] 3188| [#x0D46-#x0D48] 3189| [#x0D4A-#x0D4D] 3190| #x0D57 3191| #x0E31 3192| [#x0E34-#x0E3A] 3193| [#x0E47-#x0E4E] 3194| #x0EB1 3195| [#x0EB4-#x0EB9] 3196| [#x0EBB-#x0EBC] 3197| [#x0EC8-#x0ECD] 3198| [#x0F18-#x0F19] 3199| #x0F35 3200| #x0F37 3201| #x0F39 3202| #x0F3E 3203| #x0F3F 3204| [#x0F71-#x0F84] 3205| [#x0F86-#x0F8B] 3206| [#x0F90-#x0F95] 3207| #x0F97 3208| [#x0F99-#x0FAD] 3209| [#x0FB1-#x0FB7] 3210| #x0FB9 3211| [#x20D0-#x20DC] 3212| #x20E1 3213| [#x302A-#x302F] 3214| #x3099 3215| #x309A 3216</rhs></prod> 3217<prod id='NT-Digit'><lhs>Digit</lhs> 3218<rhs>[#x0030-#x0039] 3219| [#x0660-#x0669] 3220| [#x06F0-#x06F9] 3221| [#x0966-#x096F] 3222| [#x09E6-#x09EF] 3223| [#x0A66-#x0A6F] 3224| [#x0AE6-#x0AEF] 3225| [#x0B66-#x0B6F] 3226| [#x0BE7-#x0BEF] 3227| [#x0C66-#x0C6F] 3228| [#x0CE6-#x0CEF] 3229| [#x0D66-#x0D6F] 3230| [#x0E50-#x0E59] 3231| [#x0ED0-#x0ED9] 3232| [#x0F20-#x0F29] 3233</rhs></prod> 3234<prod id='NT-Extender'><lhs>Extender</lhs> 3235<rhs>#x00B7 3236| #x02D0 3237| #x02D1 3238| #x0387 3239| #x0640 3240| #x0E46 3241| #x0EC6 3242| #x3005 3243| [#x3031-#x3035] 3244| [#x309D-#x309E] 3245| [#x30FC-#x30FE] 3246</rhs></prod> 3247 3248</prodgroup> 3249</scrap> 3250</p> 3251<p>ここで定義する文字クラスは,Unicode文字データベースから,次のとおりに得ることができる。 3252<ulist> 3253<item> 3254<p>a) 名前開始文字は,Ll, Lu, Lo, Lt, Nlカテゴリ内の一つでなければならない。</p> 3255</item> 3256<item> 3257<p>b) 名前開始文字以外の名前文字は,Mc, Me, Mn, Lm, Ndカテゴリ内の一つでなければならない。</p> 3258</item> 3259<item> 3260<p>c) &compatibility-area;にある文字(文字符号で#xF900より大きく#xFFFEより小さい文字)は,XMLにおける名前としては,許されない。</p> 3261</item> 3262<item> 3263<p>d) &font-decomposition;か&compatibility-decomposition;をもつ文字(つまり,データベース内の5番目のフィールドに"compatibility formatting tag"があるもの。これは,5番目のフィールドが,"<"で始まることによってマーク付けされる。)は,許されない。</p> 3264</item> 3265<item> 3266<p>e) 次の文字は,名前開始文字として扱う。これは,&property-file;が,これらの文字をアルファベットに類似すると見なすことによる。それらは 3267[#x02BB-#x02C1], #x0559, #x06E5, #x06E6とする。</p> 3268</item> 3269<item> 3270<p>f) 文字符号が#x20DD-#x20E0の文字は,(Unicode の5.14にしたがって)除外する。</p> 3271</item> 3272<item> 3273<p>g) 文字符号が#x00B7の文字は,&property-list;にしたがって,&extender;(extender)に分類する。</p> 3274</item> 3275<item> 3276<p>h) 文字#x0387は,これに相当する正規形が#x00B7なので,名前文字に追加する。</p> 3277</item> 3278<item> 3279<p>i) 文字':'及び'_'は,名前開始文字として許す。</p> 3280</item> 3281<item> 3282<p>j) 文字'-'及び'.'は,名前文字として許す。</p> 3283</item> 3284</ulist> 3285</p> 3286</div1> 3287<inform-div1 id="sec-xml-and-sgml"> 3288<head>XML及びSGML</head> 3289 3290<p>XMLは,SGMLの⊂として設計されている。すなわち,すべての<termref def="dt-valid">&valid;</termref>なXML文書は,規格に適合するSGML文書にもなる。SGMLが文書に課す制限以外に,XMLがいかなる制限を課すかに関する詳細は,別の<loc href='http://www.w3.org/TR/NOTE-sgml-xml'>規程</loc>を参照のこと。この規程は,XMLの制約条件を示すSGML宣言を含み,これは,SGML&parser;に使用できる。 3291</p> 3292</inform-div1> 3293<inform-div1 id="sec-entexpand"> 3294<head>実体参照及び文字参照の展開</head> 3295<p>この付録は,実体参照及び文字参照を認識し,展開する,一連の流れを,例に使って示す。</p> 3296<p> 3297DTDが,次の宣言を含む場合を考える。 3298<eg><![CDATA[<!ENTITY example "<p>An ampersand (&#38;) may be escaped 3299numerically (&#38;#38;) or with a general entity 3300(&amp;).</p>" > 3301]]></eg> 3302XML&processor;は,実体の宣言を構文解析した時点で文字参照を認識し,これを解決する。実体"<code>example</code>"の値として,次の&string;を保存する。 3303<eg><![CDATA[<p>An ampersand (&) may be escaped 3304numerically (&#38;) or with a general entity 3305(&amp;).</p> 3306]]></eg> 3307文書内で"<code>&example;</code>"を参照すると,このテキストは,再び構文解析される。このとき,要素"<code>p</code>"の開始タグ及び終了タグを認識し,三つの参照を認識し展開する。その結果,要素"<code>p</code>"は,次の内容をもつ(すべてデータとし,区切り子又は&markup;は存在しない。)。 3308<eg><![CDATA[An ampersand (&) may be escaped 3309numerically (&) or with a general entity 3310(&). 3311]]></eg> 3312</p> 3313<p>規則及びその効果をより詳細に示すため,さらに複雑な例を示す。次の例で,行番号は,参照の便宜のためだけに付ける。 3314<eg><![CDATA[1 <?xml version='1.0'?> 33152 <!DOCTYPE test [ 33163 <!ELEMENT test (#PCDATA) > 33174 <!ENTITY % xx '%zz;'> 33185 <!ENTITY % zz '<!ENTITY tricky "error-prone" >' > 33196 %xx; 33207 ]> 33218 <test>This sample shows a &tricky; method.</test> 3322]]></eg> 3323これを処理すると,次のとおりとなる。 3324<ulist spacing="compact"> 3325<item><p>a) 4行目で,37番目の文字への参照を直ちに展開し,パラメタ実体"<code>xx</code>"を,シンボルテーブルに"<code>%zz;</code>"という値とともに保存する。&replacement-text;を再び走査することはないので,パラメタ実体"<code>zz</code>"への参照は認識しない("<code>zz</code>"は,まだ宣言されていないので,走査されれば,&error;となる。)。</p></item> 3326<item><p>b) 5行目で,文字参照"<code>&#60;</code>"を直ちに展開し,パラメタ実体"<code>zz</code>"を"<code><!ENTITY tricky "error-prone" ></code>"という&replacement-text;とともに保存する。これは,&well-formed;の実体宣言とする。</p></item> 3327<item><p>c) 6行目で,"<code>xx</code>"への参照を認識し,"<code>xx</code>"の&replacement-text;(すなわち,"<code>%zz;</code>")を構文解析する。"<code>zz</code>"への参照を続いて認識し,&replacement-text;("<code><!ENTITY tricky "error-prone" ></code>")を構文解析する。一般実体"<code>tricky</code>"は,この時点では,宣言されており,その&replacement-text;は,"<code>error-prone</code>"とする。 </p></item> 3328<item><p>d) 8行目で,一般実体"<code>tricky</code>"への参照を認識し,展開する。要素"<code>test</code>"の完全な内容は,次の(内容をそれ自体表現する。)&string;となる。つまり,<emph>This sample shows a error-prone method.</emph> 3329</p></item> 3330</ulist> 3331</p> 3332</inform-div1> 3333<inform-div1 id="determinism"> 3334<head>決定的内容モデル</head> 3335<p><termref def='dt-compat'>互換性のため</termref>,要素宣言における内容モデルは,決定的とする必要がある。 3336</p> 3337<!-- FINAL EDIT: WebSGML allows ambiguity? --> 3338<p>SGMLは,決定的内容モデル(SGMLでは,非あいまいと呼ぶ。)を要求する。SGMLシステムを用いて作成したXML&processor;は,非決定的内容モデルを&error;としてもよい。</p> 3339<p>例えば,内容モデル<code>((b, c) | (b, d))</code>は非決定的となる。これは,最初に<code>b</code>を与えたとき,モデル内のいずれの<code>b</code>と&match;するのが望ましいか,その次の要素を先読みすることなしには,&parser;は知ることができないことによる。この場合は,<code>b</code>への二つの参照は,一つの参照にまとめることができ,モデルは,<code>(b, (c | d))</code>となる。これで,最初の<code>b</code>が,内容モデル内の一つの名前とだけ&match;することは明らかとなる。&parser;は,先読みして,次に来るものを知る必要がない。<code>c</code>も<code>d</code>も,受理される。</p> 3340<p>形式的に示す。Aho, Sethi, and Ullman <bibref ref='Aho'/>の3.9のアルゴリズム3.5の標準的なアルゴリズムを用いて,内容モデルから有限オートマトンを構成することができる。この種の多くのアルゴリズムでは,正規表現における各々の位置(つまり,正規表現の構文木における各々の末端ノード)に対して,follow set(次にどの位置に移動可能かを表すもの)を構成する。ある位置に対するfollow setにおいて,複数の位置が同じ要素型名でラベル付けされていれば,その内容モデルは&error;となり,&error;を返す場合もある。 3341</p> 3342<p>すべての非決定的内容モデルを等価な決定的内容モデルに変換することはできないが,多くの非決定的内容モデルを変換するアルゴリズムが存在する。Brüggemann-Klein 1991 <bibref ref='ABK'/>を参照のこと。</p> 3343</inform-div1> 3344<inform-div1 id="sec-guessing"> 3345<head>文字符号化の自動検出</head> 3346<p> 3347XMLの符号化宣言は,各実体の内部ラベルとして機能し,どの文字符号化を使用するかを示す。しかし,XML&processor;は,内部ラベルを読む前に,どの文字符号化を使用するかを知る必要があり,これが,内部ラベルが示そうとすることになる。一般的には,これは,絶望的な状態となる。しかし,XMLにおいては,完全には絶望的ではない。これは,XMLが,次の二つの点で一般的な場合に対する制限を加えることによる。一つの制限は,どの実装も有限個の文字符号化だけのサポートを想定することとする。他の一つの制限は,各実体で使用する文字符号化を自動検出可能とする,XMLの符号化宣言の位置及び内容に関する制限とする。多くの場合に,XMLのデータストリームに加え,他の情報が利用できる。ここでは,XMLの実体が&processor;に渡されるとき,(外部)情報を伴うかどうかによって,二つの場合に分ける。まず最初の場合を示す。</p> 3348<p> 3349UTF-8形式又はUTF-16形式ではないXML実体は,最初の文字を‘<code><?xml</code>'とするXML符号化宣言で始まら<emph>なければならない</emph>ので,どの適合した&processor;も,入力にある2オクテット又は4オクテットを調べれば,次のどの場合があてはまるかを検出できる。このリストを読む際には,UCS-4の'<'が"<code>#x0000003C</code>",'?'が"<code>#x0000003F</code>",及びUTF-16のデータ&stream;の必要とする&byte-order-mark;が"<code>#xFEFF</code>"ということを知っておくと役立つかもしれない。</p> 3350<p> 3351<ulist> 3352<item> 3353<p>a) <code>00 00 00 3C</code>: UCS-4, big-endian マシン (1234順)</p> 3354</item> 3355<item> 3356<p>b) <code>3C 00 00 00</code>: UCS-4, little-endian マシン (4321順)</p> 3357</item> 3358<item> 3359<p>c) <code>00 00 3C 00</code>: UCS-4, 普通ではないオクテット順 (2143)</p> 3360</item> 3361<item> 3362<p>d) <code>00 3C 00 00</code>: UCS-4, 普通ではないオクテット順 (3412)</p> 3363</item> 3364<item> 3365<p>e) <code>FE FF</code>: UTF-16, big-endian</p> 3366</item> 3367<item> 3368<p>f) <code>FF FE</code>: UTF-16, little-endian</p> 3369</item> 3370<item> 3371<p>g) <code>00 3C 00 3F</code>: UTF-16, big-endian, &byte-order-mark;なし(したがって,厳密にいえば,&error;とする。)。</p> 3372</item> 3373<item> 3374<p>h) <code>3C 00 3F 00</code>: UTF-16, little-endian, &byte-order-mark;なし(したがって,厳密にいえば,&error;とする。)。</p> 3375</item> 3376<item> 3377<p>i) <code>3C 3F 78 6D</code>: UTF-8, ISO 646, ASCII, ISO 8859の各パート,Shift-JIS,EUC,並びに任意の他の7ビット,8ビット又は混在幅の符号化であって,ASCII文字を通常の位置,幅及び値とすることを保証するもの。これらのどれに対応するかを検出するためには,実際の符号化宣言を読み込まなければならない。しかし,これらすべての符号化は,ASCII文字に対して同じビットパターンを使用するので,符号化宣言自体は,正確に読込み可能とする。 3378</p> 3379</item> 3380<item> 3381<p>j) <code>4C 6F A7 94</code>: EBCDIC (又はその変種。どのコードページを使用するかを知るためには,符号化宣言全体を読み込まれなければならない。)</p> 3382</item> 3383<item> 3384<p>k) その他: 符号化宣言なしのUTF-8。そうでないときには,データ&stream;が壊れているか,断片的になっているか,何らかの形式にしたがって埋め込まれている。</p> 3385</item> 3386</ulist> 3387</p> 3388<p> 3389この程度の自動判別でも,XMLの符号化宣言を読み込み,文字符号化の&identifier;を解析するには十分とする。&identifier;の解析は,類似する各々の符号化の一つ一つを区別するために必要とする(例えば,UTF-8及び8859を区別するため,8859の各パートを区別するため,使用している特定のEBCDICコードページを区別するため,など。)。 3390</p> 3391<p> 3392符号化宣言の内容をASCII文字に限定しているので,どの分類の符号化を使用するかを検出すれば,&processor;は,符号化宣言全体を正確に読み込むことができる。現実問題として,広く使用されている文字符号化は,上の分類のいずれかにあてはまるので,オペレーティングシステム又は伝送プロトコルが与える外部情報を信頼不可能なときでさえも,内部ラベルで文字符号化をかなり正確に示すことが,XML符号化宣言によって可能となる。 3393</p> 3394<p> 3395&processor;が使用する文字符号化を検出しさえすれば,それぞれの場合に対して別個の入力ルーチンを呼び出す,又は入力する各文字に対し適切な変換関数を呼び出すことによって,適切な動作が可能となる。</p> 3396<p> 3397自分自体にラベル付けをするいかなるシステムでも同様だが,ソフトウェアが,符号化宣言を更新せずに実体の文字集合又は符号化を変えたならば,XMLの符号化宣言は,機能しない。文字符号化ルーチンの実装者は,実体のラベル付けに使用する内部及び外部の情報の正確さの保証に注意するのが望ましい。 3398</p> 3399<p>2番目の場合は,XMLの実体の他に,符号化情報が存在するときであって,いくつかのファイルシステム及びネットワークプロトコルでは,その符号化情報が存在する。複数の情報が利用できるとき,<!-- (e.g. both the 3400internal encoding declaration and an external label), -->それらの相対的な優先度及びそれらが矛盾したときの望ましい処理方法は,XMLの配送に使用する,より高水準のプロトコルの一部として規程するのがよい。例えば,内部ラベル及び外部&header;に存在するMIME形式のラベルの相対的な優先度に対する規則は,text/xml及びapplication/xmlのMIME型を定義するRFC文書の一部となる方がよい。しかし,相互運用性のために,次の規則に従うことが望ましい。 3401<ulist> 3402<item><p>a) XMLの実体がファイルに存在すれば,&byte-order-mark;及び符号化宣言PIは,(存在すれば)文字符号化を決定するために使用する。他のすべての&hueristics;及び情報は,&error;回復のためだけに用いる。 3403</p></item> 3404<item><p>b) XMLの実体をMIME型text/xmlで配送するときは,このMIME型のもつcharsetパラメタが文字符号化方法を決定する。他のすべての&hueristics;及び情報は,&error;回復のためだけに用いる。 3405</p></item> 3406<item><p>c) XMLの実体を <!-- via the HTTP protocol -->MIME型application/xmlで配送するときは,&byte-order-mark;及び符号化宣言PIを(存在すれば)文字符号化の決定のために使用する。他のすべての&hueristics;及び情報は&error;回復のためだけに用いる。 3407</p></item> 3408</ulist> 3409これらの規則は,プロトコルについての資料がないときにだけ用いる。特に,MIME型text/xml及びapplication/xmlを定義したら,これらを規定するRFCに存在する規定が,これらの規則に取って代わる。 3410</p> 3411</inform-div1> 3412<!-- 3413<div1 id='sec-trival-grammar'> 3414<head>A Trivial Grammar for XML Documents</head> 3415<p>The grammar given in the body of this specification is relatively 3416simple, but for some purposes it is convenient to have an even simpler 3417one. 3418A very simple, though non-conforming, <termref def="dt-xml-proc">XML 3419processor</termref> could parse a <termref 3420def="dt-wellformed">well-formed</termref> XML document using the 3421following simplified grammar, recognizing all element boundaries 3422correctly, though not expanding entity references and not detecting 3423all errors: 3424 3425<scrap lang="ebnf"> 3426<head>Trivial text grammar</head> 3427<prodgroup pcw2="5.5" pcw4="17" pcw5="10"> 3428<prod id='NT-simpleDoc'><lhs>simpleDoc</lhs> 3429<rhs>(<nt def='NT-SimpleData'>SimpleData</nt> 3430| <nt def='NT-Markup'>Markup</nt>)*</rhs></prod> 3431<prod id="NT-SimpleData"><lhs>SimpleData</lhs> 3432<rhs>[^<&]*</rhs> 3433<com>cf. PCData</com> 3434</prod> 3435<prod id="NT-SimpleLit"><lhs>SimpleLit</lhs> 3436<rhs>('"' [^"]* '"')</rhs> 3437<rhs>| ("'" [^']* "'")</rhs> 3438<com>cf. SkipLit</com> 3439</prod> 3440<prod id='NT-Markup'><lhs>Markup</lhs> 3441<rhs>'<' <nt def='NT-Name'>Name</nt> 3442(<nt def='NT-S'>S</nt> 3443<nt def='NT-Name'>Name</nt> 3444<nt def='NT-S'>S</nt>? '=' <nt def='NT-S'>S</nt>? 3445<nt def='NT-SimpleLit'>SimpleLit</nt>)* 3446<nt def='NT-S'>S</nt>? '>'</rhs><com>start-tags </com> 3447<rhs>| '<' <nt def='NT-Name'>Name</nt> 3448(<nt def='NT-S'>S</nt> 3449<nt def='NT-Name'>Name</nt> 3450<nt def='NT-S'>S</nt>? '=' <nt def='NT-S'>S</nt>? 3451<nt def='NT-SimpleLit'>SimpleLit</nt>)* 3452<nt def='NT-S'>S</nt>? '/>'</rhs><com>empty elements</com> 3453<rhs>| '</' 3454<nt def='NT-Name'>Name</nt> 3455<nt def='NT-S'>S</nt>? '>'</rhs> 3456<com>end-tags </com> 3457<rhs>| '&' <nt def='NT-Name'>Name</nt> ';'</rhs> 3458<com>entity references </com> 3459<rhs>| '&#' [0-9]+ ';'</rhs> 3460<com>decimal character references </com> 3461<rhs>| '&hcro;' [0-9a-fA-F]+ ';'</rhs> 3462<com>hexadecimal character references </com> 3463<rhs>| '<!&como;' 3464(<nt def='NT-Char'>Char</nt>* - 3465(<nt def='NT-Char'>Char</nt>* '&comc;' <nt def='NT-Char'>Char</nt>*)) 3466'&comc;>'</rhs> 3467<com>comments </com> 3468<rhs>| '<?' 3469(<nt def='NT-Char'>Char</nt>* - 3470(<nt def='NT-Char'>Char</nt>* &pic; <nt def='NT-Char'>Char</nt>*)) 3471'&pic;'</rhs> 3472<com>processing instructions </com> 3473<rhs>| '<![CDATA[' 3474(<nt def='NT-Char'>Char</nt>* - 3475(<nt def='NT-Char'>Char</nt>* ']]>' <nt def='NT-Char'>Char</nt>*)) 3476']]>'</rhs> 3477<com>CDATA sections</com> 3478<rhs>| '<!DOCTYPE' 3479(<nt def="NT-Char">Char</nt> - ('[' | ']'))+ 3480('[' 3481<nt def="NT-simpleDTD">simpleDTD</nt>* 3482']')? '>'</rhs> 3483<com>doc type declaration</com> 3484</prod> 3485<prod id="NT-simpleDTD"><lhs>simpleDTD</lhs> 3486<rhs>'<!&como;' 3487(<nt def='NT-Char'>Char</nt>* - 3488(<nt def='NT-Char'>Char</nt>* '&comc;' <nt def='NT-Char'>Char</nt>*)) 3489'&comc;>'</rhs> 3490<com>comment </com> 3491<rhs>| '<?' 3492(<nt def='NT-Char'>Char</nt>* - 3493(<nt def='NT-Char'>Char</nt>* &pic; <nt def='NT-Char'>Char</nt>*)) 3494'&pic;'</rhs> 3495<com>processing instruction </com> 3496<rhs><nt def="NT-SimpleLit">SimpleLit</nt></rhs> 3497<rhs>(<nt def="NT-Char">Char</nt> - (']' | '<' | '"' | "'"))+ 3498</rhs> 3499 3500<rhs>'<!' (<nt def="NT-Char">Char</nt> - ('-'))+</rhs> 3501<com>declarations other than comment</com> 3502</prod> 3503</prodgroup> 3504</scrap> 3505Most processors will require the more complex 3506grammar given in the body of this specification. 3507 3508</p> 3509</div1> 3510--> 3511 3512<inform-div1 id="sec-xml-wg"> 3513<head>&informative;W3C XML ワーキンググループ</head> 3514 3515<p>この&TR-or-Rec;は,W3C XML ワーキンググループ(WG)が準備し,公開を承認した。WGがこの&TR-or-Rec;を承認するということは,WGのすべての委員が承認投票を行ったということを必ずしも意味しない。XML WGの現在の委員及び以前の委員を次に示す。</p> 3516 3517<!-- parens and spaces removed from role elements by bosak 1997.11.07 --> 3518<orglist> 3519<member><name>Jon Bosak, Sun</name><role>Chair</role></member> 3520<member><name>James Clark</name><role>Technical Lead</role></member> 3521<member><name>Tim Bray, Textuality and Netscape</name><role>XML Co-editor</role></member> 3522<member><name>Jean Paoli, Microsoft</name><role>XML Co-editor</role></member> 3523<member><name>C. M. Sperberg-McQueen, U. of Ill.</name><role>XML Co-editor</role></member> 3524<member><name>Dan Connolly, W3C</name></member> 3525<member><name>Steve DeRose, INSO</name></member> 3526<member><name>Dave Hollander, HP</name></member> 3527<member><name>Eliot Kimber, Highland</name></member> 3528<member><name>Eve Maler, ArborText</name></member> 3529<member><name>Tom Magliery, NCSA</name></member> 3530<member><name>Murray Maloney, Muzmo and Grif</name></member> 3531<member><name>村田 真,富士ゼロックス情報システム(株)</name></member> 3532<member><name>Joel Nava, Adobe</name></member> 3533<member><name>Peter Sharpe, SoftQuad</name></member> 3534<member><name>John Tigue, DataChannel</name></member> 3535</orglist> 3536 3537</inform-div1> 3538</back> 3539</spec> 3540<!-- Keep this comment at the end of the file 3541Local variables: 3542mode: sgml 3543sgml-omittag:t 3544sgml-shorttag:t 3545End: 3546--> 3547 3548 3549