home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 October / PCWorld_2000-10_cd1.bin / Software / TemaCD / xmlspy / xmlspy30c.exe / Main / REC-xml-19980210.xml < prev    next >
Encoding:
Extensible Markup Language  |  2000-09-11  |  167.6 KB  |  4,656 lines

  1. <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
  2. <!-- edited with XML Spy v2.5 NT  - http://www.xmlspy.com -->
  3. <!DOCTYPE spec SYSTEM "spec.dtd" [
  4.     <!-- LAST TOUCHED BY: Tim Bray, 8 February 1997 -->
  5.     <!-- The words 'FINAL EDIT' in comments mark places where changes
  6. need to be made after approval of the document by the ERB, before
  7. publication.  -->
  8.     <!ENTITY XML.version "1.0">
  9.     <!ENTITY doc.date "10 February 1998">
  10.     <!ENTITY iso6.doc.date "19980210">
  11.     <!ENTITY w3c.doc.date "02-Feb-1998">
  12.     <!ENTITY draft.day '10'>
  13.     <!ENTITY draft.month 'February'>
  14.     <!ENTITY draft.year '1998'>
  15.     <!ENTITY WebSGML 'WebSGML Adaptations Annex to ISO 8879'>
  16.     <!ENTITY xmlpio "'<?xml'">
  17.     <!ENTITY pic "'?>'">
  18.     <!ENTITY br "\n">
  19.     <!ENTITY cellback '#c0d9c0'>
  20.     <!ENTITY mdash "--">
  21.     <!-- —, but nsgmls doesn't grok hex -->
  22.     <!ENTITY com "--">
  23.     <!ENTITY como "--">
  24.     <!ENTITY comc "--">
  25.     <!ENTITY hcro "&#x">
  26.     <!-- <!ENTITY nbsp "á"> -->
  27.     <!ENTITY nbsp " ">
  28.     <!ENTITY magicents "<code>amp</code>,
  29. <code>lt</code>,
  30. <code>gt</code>,
  31. <code>apos</code>,
  32. <code>quot</code>">
  33.     <!-- audience and distribution status:  for use at publication time -->
  34.     <!ENTITY doc.audience "public review and discussion">
  35.     <!ENTITY doc.distribution "may be distributed freely, as long as
  36. all text and legal notices remain intact">
  37. ]>
  38. <!-- for Panorama *-->
  39. <?VERBATIM "eg" ?>
  40. <spec>
  41.     <header>
  42.         <title>Extensible Markup Language (XML) 1.0</title>
  43.         <version/>
  44.         <w3c-designation>REC-xml-&iso6.doc.date;</w3c-designation>
  45.         <w3c-doctype>W3C Recommendation</w3c-doctype>
  46.         <pubdate>
  47.             <day>&draft.day;</day>
  48.             <month>&draft.month;</month>
  49.             <year>&draft.year;</year>
  50.         </pubdate>
  51.         <publoc>
  52.             <loc href="http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;">
  53. http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;</loc>
  54.             <loc href="http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.xml">
  55. http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.xml</loc>
  56.             <loc href="http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.html">
  57. http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.html</loc>
  58.             <loc href="http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.pdf">
  59. http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.pdf</loc>
  60.             <loc href="http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.ps">
  61. http://www.w3.org/TR/1998/REC-xml-&iso6.doc.date;.ps</loc>
  62.         </publoc>
  63.         <latestloc>
  64.             <loc href="http://www.w3.org/TR/REC-xml">
  65. http://www.w3.org/TR/REC-xml</loc>
  66.         </latestloc>
  67.         <prevlocs>
  68.             <loc href="http://www.w3.org/TR/PR-xml-971208">
  69. http://www.w3.org/TR/PR-xml-971208</loc>
  70.             <!--
  71. <loc  href='http://www.w3.org/TR/WD-xml-961114'>
  72. http://www.w3.org/TR/WD-xml-961114</loc>
  73. <loc  href='http://www.w3.org/TR/WD-xml-lang-970331'>
  74. http://www.w3.org/TR/WD-xml-lang-970331</loc>
  75. <loc  href='http://www.w3.org/TR/WD-xml-lang-970630'>
  76. http://www.w3.org/TR/WD-xml-lang-970630</loc>
  77. <loc  href='http://www.w3.org/TR/WD-xml-970807'>
  78. http://www.w3.org/TR/WD-xml-970807</loc>
  79. <loc  href='http://www.w3.org/TR/WD-xml-971117'>
  80. http://www.w3.org/TR/WD-xml-971117</loc>-->
  81.         </prevlocs>
  82.         <authlist>
  83.             <author>
  84.                 <name>Tim Bray</name>
  85.                 <affiliation>Textuality and Netscape</affiliation>
  86.                 <email href="mailto:tbray@textuality.com">tbray@textuality.com</email>
  87.             </author>
  88.             <author>
  89.                 <name>Jean Paoli</name>
  90.                 <affiliation>Microsoft</affiliation>
  91.                 <email href="mailto:jeanpa@microsoft.com">jeanpa@microsoft.com</email>
  92.             </author>
  93.             <author>
  94.                 <name>C. M. Sperberg-McQueen</name>
  95.                 <affiliation>University of Illinois at Chicago</affiliation>
  96.                 <email href="mailto:cmsmcq@uic.edu">cmsmcq@uic.edu</email>
  97.             </author>
  98.         </authlist>
  99.         <status>
  100.             <p>This document has been reviewed by W3C Members and
  101. other interested parties and has been endorsed by the
  102. Director as a W3C Recommendation. It is a stable
  103. document and may be used as reference material or cited
  104. as a normative reference from another document. W3C's
  105. role in making the Recommendation is to draw attention
  106. to the specification and to promote its widespread
  107. deployment. This enhances the functionality and
  108. interoperability of the Web.</p>
  109.             <p>
  110. This document specifies a syntax created by subsetting an existing,
  111. widely used international text processing standard (Standard
  112. Generalized Markup Language, ISO 8879:1986(E) as amended and
  113. corrected) for use on the World Wide Web.  It is a product of the W3C
  114. XML Activity, details of which can be found at <loc href="http://www.w3.org/XML">http://www.w3.org/XML</loc>.  A list of
  115. current W3C Recommendations and other technical documents can be found
  116. at <loc href="http://www.w3.org/TR">http://www.w3.org/TR</loc>.
  117. </p>
  118.             <p>This specification uses the term URI, which is defined by <bibref ref="Berners-Lee"/>, a work in progress expected to update <bibref ref="RFC1738"/> and <bibref ref="RFC1808"/>. 
  119. </p>
  120.             <p>The list of known errors in this specification is 
  121. available at 
  122. <loc href="http://www.w3.org/XML/xml-19980210-errata">http://www.w3.org/XML/xml-19980210-errata</loc>.</p>
  123.             <p>Please report errors in this document to 
  124. <loc href="mailto:xml-editor@w3.org">xml-editor@w3.org</loc>.
  125. </p>
  126.         </status>
  127.         <abstract>
  128.             <p>The Extensible Markup Language (XML) is a subset of
  129. SGML that is completely described in this document. Its goal is to
  130. enable generic SGML to be served, received, and processed on the Web
  131. in the way that is now possible with HTML. XML has been designed for
  132. ease of implementation and for interoperability with both SGML and
  133. HTML.</p>
  134.         </abstract>
  135.         <pubstmt>
  136.             <p>Chicago, Vancouver, Mountain View, et al.:
  137. World-Wide Web Consortium, XML Working Group, 1996, 1997.</p>
  138.         </pubstmt>
  139.         <sourcedesc>
  140.             <p>Created in electronic form.</p>
  141.         </sourcedesc>
  142.         <langusage>
  143.             <language id="EN">English</language>
  144.             <language id="ebnf">Extended Backus-Naur Form (formal grammar)</language>
  145.         </langusage>
  146.         <revisiondesc>
  147.             <slist>
  148.                 <sitem>1997-12-03 : CMSMcQ : yet further changes</sitem>
  149.                 <sitem>1997-12-02 : TB : further changes (see TB to XML WG,
  150. 2 December 1997)</sitem>
  151.                 <sitem>1997-12-02 : CMSMcQ : deal with as many corrections and
  152. comments from the proofreaders as possible:
  153. entify hard-coded document date in pubdate element,
  154. change expansion of entity WebSGML,
  155. update status description as per Dan Connolly (am not sure
  156. about refernece to Berners-Lee et al.),
  157. add 'The' to abstract as per WG decision,
  158. move Relationship to Existing Standards to back matter and
  159. combine with References,
  160. re-order back matter so normative appendices come first,
  161. re-tag back matter so informative appendices are tagged informdiv1,
  162. remove XXX XXX from list of 'normative' specs in prose,
  163. move some references from Other References to Normative References,
  164. add RFC 1738, 1808, and 2141 to Other References (they are not
  165. normative since we do not require the processor to enforce any 
  166. rules based on them),
  167. add reference to 'Fielding draft' (Berners-Lee et al.),
  168. move notation section to end of body,
  169. drop URIchar non-terminal and use SkipLit instead,
  170. lose stray reference to defunct nonterminal 'markupdecls',
  171. move reference to Aho et al. into appendix (Tim's right),
  172. add prose note saying that hash marks and fragment identifiers are
  173. NOT part of the URI formally speaking, and are NOT legal in 
  174. system identifiers (processor 'may' signal an error).
  175. Work through:
  176. Tim Bray reacting to James Clark,
  177. Tim Bray on his own,
  178. Eve Maler,
  179.  
  180. NOT DONE YET:
  181. change binary / text to unparsed / parsed.
  182. handle James's suggestion about < in attriubte values
  183. uppercase hex characters,
  184. namechar list,
  185. </sitem>
  186.                 <sitem>1997-12-01 : JB : add some column-width parameters</sitem>
  187.                 <sitem>1997-12-01 : CMSMcQ : begin round of changes to incorporate
  188. recent WG decisions and other corrections:
  189. binding sources of character encoding info (27 Aug / 3 Sept),
  190. correct wording of Faust quotation (restore dropped line),
  191. drop SDD from EncodingDecl,
  192. change text at version number 1.0,
  193. drop misleading (wrong!) sentence about ignorables and extenders,
  194. modify definition of PCData to make bar on msc grammatical,
  195. change grammar's handling of internal subset (drop non-terminal markupdecls),
  196. change definition of includeSect to allow conditional sections,
  197. add integral-declaration constraint on internal subset,
  198. drop misleading / dangerous sentence about relationship of
  199. entities with system storage objects,
  200. change table body tag to htbody as per EM change to DTD,
  201. add rule about space normalization in public identifiers,
  202. add description of how to generate our name-space rules from 
  203. Unicode character database (needs further work!).
  204. </sitem>
  205.                 <sitem>1997-10-08 : TB : Removed %-constructs again, new rules
  206. for PE appearance.</sitem>
  207.                 <sitem>1997-10-01 : TB : Case-sensitive markup; cleaned up
  208. element-type defs, lotsa little edits for style</sitem>
  209.                 <sitem>1997-09-25 : TB : Change to elm's new DTD, with
  210. substantial detail cleanup as a side-effect</sitem>
  211.                 <sitem>1997-07-24 : CMSMcQ : correct error (lost *) in definition 
  212. of ignoreSectContents (thanks to Makoto Murata)</sitem>
  213.                 <sitem>Allow all empty elements to have end-tags, consistent with
  214. SGML TC (as per JJC).</sitem>
  215.                 <sitem>1997-07-23 : CMSMcQ : pre-emptive strike on pending corrections:
  216. introduce the term 'empty-element tag', note that all empty elements
  217. may use it, and elements declared EMPTY must use it.
  218. Add WFC requiring encoding decl to come first in an entity.
  219. Redefine notations to point to PIs as well as binary entities.
  220. Change autodetection table by removing bytes 3 and 4 from 
  221. examples with Byte Order Mark.
  222. Add content model as a term and clarify that it applies to both
  223. mixed and element content.
  224. </sitem>
  225.                 <sitem>1997-06-30 : CMSMcQ : change date, some cosmetic changes,
  226. changes to productions for choice, seq, Mixed, NotationType,
  227. Enumeration.  Follow James Clark's suggestion and prohibit 
  228. conditional sections in internal subset.  TO DO:  simplify
  229. production for ignored sections as a result, since we don't 
  230. need to worry about parsers which don't expand PErefs finding
  231. a conditional section.</sitem>
  232.                 <sitem>1997-06-29 : TB : various edits</sitem>
  233.                 <sitem>1997-06-29 : CMSMcQ : further changes:
  234. Suppress old FINAL EDIT comments and some dead material.
  235. Revise occurrences of % in grammar to exploit Henry Thompson's pun,
  236. especially markupdecl and attdef.
  237. Remove RMD requirement relating to element content (?).
  238. </sitem>
  239.                 <sitem>1997-06-28 : CMSMcQ : Various changes for 1 July draft:
  240. Add text for draconian error handling (introduce
  241. the term Fatal Error).
  242. RE deleta est (changing wording from 
  243. original announcement to restrict the requirement to validating
  244. parsers).
  245. Tag definition of validating processor and link to it.
  246. Add colon as name character.
  247. Change def of %operator.
  248. Change standard definitions of lt, gt, amp.
  249. Strip leading zeros from #x00nn forms.</sitem>
  250.                 <sitem>1997-04-02 : CMSMcQ : final corrections of editorial errors
  251. found in last night's proofreading.  Reverse course once more on
  252. well-formed:   Webster's Second hyphenates it, and that's enough
  253. for me.</sitem>
  254.                 <sitem>1997-04-01 : CMSMcQ : corrections from JJC, EM, HT, and self</sitem>
  255.                 <sitem>1997-03-31 : Tim Bray : many changes</sitem>
  256.                 <sitem>1997-03-29 : CMSMcQ : some Henry Thompson (on entity handling),
  257. some Charles Goldfarb, some ERB decisions (PE handling in miscellaneous
  258. declarations.  Changed Ident element to accept def attribute.
  259. Allow normalization of Unicode characters.  move def of systemliteral
  260. into section on literals.</sitem>
  261.                 <sitem>1997-03-28 : CMSMcQ : make as many corrections as possible, from
  262. Terry Allen, Norbert Mikula, James Clark, Jon Bosak, Henry Thompson,
  263. Paul Grosso, and self.  Among other things:  give in on "well formed"
  264. (Terry is right), tentatively rename QuotedCData as AttValue
  265. and Literal as EntityValue to be more informative, since attribute
  266. values are the <emph>only</emph> place QuotedCData was used, and
  267. vice versa for entity text and Literal. (I'd call it Entity Text, 
  268. but 8879 uses that name for both internal and external entities.)</sitem>
  269.                 <sitem>1997-03-26 : CMSMcQ : resynch the two forks of this draft, reapply
  270. my changes dated 03-20 and 03-21.  Normalize old 'may not' to 'must not'
  271. except in the one case where it meant 'may or may not'.</sitem>
  272.                 <sitem>1997-03-21 : TB : massive changes on plane flight from Chicago
  273. to Vancouver</sitem>
  274.                 <sitem>1997-03-21 : CMSMcQ : correct as many reported errors as possible.
  275. </sitem>
  276.                 <sitem>1997-03-20 : CMSMcQ : correct typos listed in CMSMcQ hand copy of spec.</sitem>
  277.                 <sitem>1997-03-20 : CMSMcQ : cosmetic changes preparatory to revision for
  278. WWW conference April 1997:  restore some of the internal entity 
  279. references (e.g. to docdate, etc.), change character xA0 to &nbsp;
  280. and define nbsp as &#160;, and refill a lot of paragraphs for
  281. legibility.</sitem>
  282.                 <sitem>1996-11-12 : CMSMcQ : revise using Tim's edits:
  283. Add list type of NUMBERED and change most lists either to
  284. BULLETS or to NUMBERED.
  285. Suppress QuotedNames, Names (not used).
  286. Correct trivial-grammar doc type decl.
  287. Rename 'marked section' as 'CDATA section' passim.
  288. Also edits from James Clark:
  289. Define the set of characters from which [^abc] subtracts.
  290. Charref should use just [0-9] not Digit.
  291. Location info needs cleaner treatment:  remove?  (ERB
  292. question).
  293. One example of a PI has wrong pic.
  294. Clarify discussion of encoding names.
  295. Encoding failure should lead to unspecified results; don't
  296. prescribe error recovery.
  297. Don't require exposure of entity boundaries.
  298. Ignore white space in element content.
  299. Reserve entity names of the form u-NNNN.
  300. Clarify relative URLs.
  301. And some of my own:
  302. Correct productions for content model:  model cannot
  303. consist of a name, so "elements ::= cp" is no good.
  304. </sitem>
  305.                 <sitem>1996-11-11 : CMSMcQ : revise for style.
  306. Add new rhs to entity declaration, for parameter entities.</sitem>
  307.                 <sitem>1996-11-10 : CMSMcQ : revise for style.
  308. Fix / complete section on names, characters.
  309. Add sections on parameter entities, conditional sections.
  310. Still to do:  Add compatibility note on deterministic content models.
  311. Finish stylistic revision.</sitem>
  312.                 <sitem>1996-10-31 : TB : Add Entity Handling section</sitem>
  313.                 <sitem>1996-10-30 : TB : Clean up term & termdef.  Slip in
  314. ERB decision re EMPTY.</sitem>
  315.                 <sitem>1996-10-28 : TB : Change DTD.  Implement some of Michael's
  316. suggestions.  Change comments back to //.  Introduce language for
  317. XML namespace reservation.  Add section on white-space handling.
  318. Lots more cleanup.</sitem>
  319.                 <sitem>1996-10-24 : CMSMcQ : quick tweaks, implement some ERB
  320. decisions.  Characters are not integers.  Comments are /* */ not //.
  321. Add bibliographic refs to 10646, HyTime, Unicode.
  322. Rename old Cdata as MsData since it's <emph>only</emph> seen
  323. in marked sections.  Call them attribute-value pairs not
  324. name-value pairs, except once.  Internal subset is optional, needs
  325. '?'.  Implied attributes should be signaled to the app, not
  326. have values supplied by processor.</sitem>
  327.                 <sitem>1996-10-16 : TB : track down & excise all DSD references;
  328. introduce some EBNF for entity declarations.</sitem>
  329.                 <sitem>1996-10-?? : TB : consistency check, fix up scraps so
  330. they all parse, get formatter working, correct a few productions.</sitem>
  331.                 <sitem>1996-10-10/11 : CMSMcQ : various maintenance, stylistic, and
  332. organizational changes:
  333. Replace a few literals with xmlpio and
  334. pic entities, to make them consistent and ensure we can change pic
  335. reliably when the ERB votes.
  336. Drop paragraph on recognizers from notation section.
  337. Add match, exact match to terminology.
  338. Move old 2.2 XML Processors and Apps into intro.
  339. Mention comments, PIs, and marked sections in discussion of
  340. delimiter escaping.
  341. Streamline discussion of doctype decl syntax.
  342. Drop old section of 'PI syntax' for doctype decl, and add
  343. section on partial-DTD summary PIs to end of Logical Structures
  344. section.
  345. Revise DSD syntax section to use Tim's subset-in-a-PI
  346. mechanism.</sitem>
  347.                 <sitem>1996-10-10 : TB : eliminate name recognizers (and more?)</sitem>
  348.                 <sitem>1996-10-09 : CMSMcQ : revise for style, consistency through 2.3
  349. (Characters)</sitem>
  350.                 <sitem>1996-10-09 : CMSMcQ : re-unite everything for convenience,
  351. at least temporarily, and revise quickly</sitem>
  352.                 <sitem>1996-10-08 : TB : first major homogenization pass</sitem>
  353.                 <sitem>1996-10-08 : TB : turn "current" attribute on div type into 
  354. CDATA</sitem>
  355.                 <sitem>1996-10-02 : TB : remould into skeleton + entities</sitem>
  356.                 <sitem>1996-09-30 : CMSMcQ : add a few more sections prior to exchange
  357.                             with Tim.</sitem>
  358.                 <sitem>1996-09-20 : CMSMcQ : finish transcribing notes.</sitem>
  359.                 <sitem>1996-09-19 : CMSMcQ : begin transcribing notes for draft.</sitem>
  360.                 <sitem>1996-09-13 : CMSMcQ : made outline from notes of 09-06,
  361. do some housekeeping</sitem>
  362.             </slist>
  363.         </revisiondesc>
  364.     </header>
  365.     <body>
  366.         <div1 id="sec-intro">
  367.             <head>Introduction</head>
  368.             <p>Extensible Markup Language, abbreviated XML, describes a class of
  369. data objects called <termref def="dt-xml-doc">XML documents</termref> and
  370. partially describes the behavior of 
  371. computer programs which process them. XML is an application profile or
  372. restricted form of SGML, the Standard Generalized Markup 
  373. Language <bibref ref="ISO8879"/>.
  374. By construction, XML documents 
  375. are conforming SGML documents.
  376. </p>
  377.             <p>XML documents are made up of storage units called <termref def="dt-entity">entities</termref>, which contain either parsed
  378. or unparsed data.
  379. Parsed data is made up of <termref def="dt-character">characters</termref>,
  380. some 
  381. of which form <termref def="dt-chardata">character data</termref>, 
  382. and some of which form <termref def="dt-markup">markup</termref>.
  383. Markup encodes a description of the document's storage layout and
  384. logical structure. XML provides a mechanism to impose constraints on
  385. the storage layout and logical structure.</p>
  386.             <p>
  387.                 <termdef id="dt-xml-proc" term="XML Processor">A software module
  388. called an <term>XML processor</term> is used to read XML documents
  389. and provide access to their content and structure.</termdef>
  390.                 <termdef id="dt-app" term="Application">It is assumed that an XML processor is
  391. doing its work on behalf of another module, called the
  392. <term>application</term>.</termdef> This specification describes the
  393. required behavior of an XML processor in terms of how it must read XML
  394. data and the information it must provide to the application.</p>
  395.             <div2 id="sec-origin-goals">
  396.                 <head>Origin and Goals</head>
  397.                 <p>XML was developed by an XML Working Group (originally known as the
  398. SGML Editorial Review Board) formed under the auspices of the World
  399. Wide Web Consortium (W3C) in 1996.
  400. It was chaired by Jon Bosak of Sun
  401. Microsystems with the active participation of an XML Special
  402. Interest Group (previously known as the SGML Working Group) also
  403. organized by the W3C. The membership of the XML Working Group is given
  404. in an appendix. Dan Connolly served as the WG's contact with the W3C.
  405. </p>
  406.                 <p>The design goals for XML are:<olist>
  407.                         <item>
  408.                             <p>XML shall be straightforwardly usable over the
  409. Internet.</p>
  410.                         </item>
  411.                         <item>
  412.                             <p>XML shall support a wide variety of applications.</p>
  413.                         </item>
  414.                         <item>
  415.                             <p>XML shall be compatible with SGML.</p>
  416.                         </item>
  417.                         <item>
  418.                             <p>It shall be easy to write programs which process XML
  419. documents.</p>
  420.                         </item>
  421.                         <item>
  422.                             <p>The number of optional features in XML is to be kept to the
  423. absolute minimum, ideally zero.</p>
  424.                         </item>
  425.                         <item>
  426.                             <p>XML documents should be human-legible and reasonably
  427. clear.</p>
  428.                         </item>
  429.                         <item>
  430.                             <p>The XML design should be prepared quickly.</p>
  431.                         </item>
  432.                         <item>
  433.                             <p>The design of XML shall be formal and concise.</p>
  434.                         </item>
  435.                         <item>
  436.                             <p>XML documents shall be easy to create.</p>
  437.                         </item>
  438.                         <item>
  439.                             <p>Terseness in XML markup is of minimal importance.</p>
  440.                         </item>
  441.                     </olist>
  442.                 </p>
  443.                 <p>This specification, 
  444. together with associated standards
  445. (Unicode and ISO/IEC 10646 for characters,
  446. Internet RFC 1766 for language identification tags, 
  447. ISO 639 for language name codes, and 
  448. ISO 3166 for country name codes),
  449. provides all the information necessary to understand 
  450. XML Version &XML.version;
  451. and construct computer programs to process it.</p>
  452.                 <p>This version of the XML specification
  453. <!-- is for &doc.audience;.-->
  454. &doc.distribution;.</p>
  455.             </div2>
  456.             <div2 id="sec-terminology">
  457.                 <head>Terminology</head>
  458.                 <p>The terminology used to describe XML documents is defined in the body of
  459. this specification.
  460. The terms defined in the following list are used in building those
  461. definitions and in describing the actions of an XML processor:
  462. <glist>
  463.                         <gitem>
  464.                             <label>may</label>
  465.                             <def>
  466.                                 <p>
  467.                                     <termdef id="dt-may" term="May">Conforming documents and XML
  468. processors are permitted to but need not behave as
  469. described.</termdef>
  470.                                 </p>
  471.                             </def>
  472.                         </gitem>
  473.                         <gitem>
  474.                             <label>must</label>
  475.                             <def>
  476.                                 <p>Conforming documents and XML processors 
  477. are required to behave as described; otherwise they are in error.
  478. <!-- do NOT change this! this is what defines a violation of
  479. a 'must' clause as 'an error'. -MSM -->
  480.                                 </p>
  481.                             </def>
  482.                         </gitem>
  483.                         <gitem>
  484.                             <label>error</label>
  485.                             <def>
  486.                                 <p>
  487.                                     <termdef id="dt-error" term="Error">A violation of the rules of this
  488. specification; results are
  489. undefined.  Conforming software may detect and report an error and may
  490. recover from it.</termdef>
  491.                                 </p>
  492.                             </def>
  493.                         </gitem>
  494.                         <gitem>
  495.                             <label>fatal error</label>
  496.                             <def>
  497.                                 <p>
  498.                                     <termdef id="dt-fatal" term="Fatal Error">An error
  499. which a conforming <termref def="dt-xml-proc">XML processor</termref>
  500. must detect and report to the application.
  501. After encountering a fatal error, the
  502. processor may continue
  503. processing the data to search for further errors and may report such
  504. errors to the application.  In order to support correction of errors,
  505. the processor may make unprocessed data from the document (with
  506. intermingled character data and markup) available to the application.
  507. Once a fatal error is detected, however, the processor must not
  508. continue normal processing (i.e., it must not
  509. continue to pass character data and information about the document's
  510. logical structure to the application in the normal way).
  511. </termdef>
  512.                                 </p>
  513.                             </def>
  514.                         </gitem>
  515.                         <gitem>
  516.                             <label>at user option</label>
  517.                             <def>
  518.                                 <p>Conforming software may or must (depending on the modal verb in the
  519. sentence) behave as described; if it does, it must
  520. provide users a means to enable or disable the behavior
  521. described.</p>
  522.                             </def>
  523.                         </gitem>
  524.                         <gitem>
  525.                             <label>validity constraint</label>
  526.                             <def>
  527.                                 <p>A rule which applies to all 
  528. <termref def="dt-valid">valid</termref> XML documents.
  529. Violations of validity constraints are errors; they must, at user option, 
  530. be reported by 
  531. <termref def="dt-validating">validating XML processors</termref>.</p>
  532.                             </def>
  533.                         </gitem>
  534.                         <gitem>
  535.                             <label>well-formedness constraint</label>
  536.                             <def>
  537.                                 <p>A rule which applies to all <termref def="dt-wellformed">well-formed</termref> XML documents.
  538. Violations of well-formedness constraints are 
  539. <termref def="dt-fatal">fatal errors</termref>.</p>
  540.                             </def>
  541.                         </gitem>
  542.                         <gitem>
  543.                             <label>match</label>
  544.                             <def>
  545.                                 <p>
  546.                                     <termdef id="dt-match" term="match">(Of strings or names:) 
  547. Two strings or names being compared must be identical.
  548. Characters with multiple possible representations in ISO/IEC 10646 (e.g.
  549. characters with 
  550. both precomposed and base+diacritic forms) match only if they have the
  551. same representation in both strings.
  552. At user option, processors may normalize such characters to
  553. some canonical form.
  554. No case folding is performed. 
  555. (Of strings and rules in the grammar:)  
  556. A string matches a grammatical production if it belongs to the
  557. language generated by that production.
  558. (Of content and content models:)
  559. An element matches its declaration when it conforms
  560. in the fashion described in the constraint
  561. <specref ref="elementvalid"/>.
  562. </termdef>
  563.                                 </p>
  564.                             </def>
  565.                         </gitem>
  566.                         <gitem>
  567.                             <label>for compatibility</label>
  568.                             <def>
  569.                                 <p>
  570.                                     <termdef id="dt-compat" term="For Compatibility">A feature of
  571. XML included solely to ensure that XML remains compatible with SGML.
  572. </termdef>
  573.                                 </p>
  574.                             </def>
  575.                         </gitem>
  576.                         <gitem>
  577.                             <label>for interoperability</label>
  578.                             <def>
  579.                                 <p>
  580.                                     <termdef id="dt-interop" term="For interoperability">A
  581. non-binding recommendation included to increase the chances that XML
  582. documents can be processed by the existing installed base of SGML
  583. processors which predate the
  584. &WebSGML;.</termdef>
  585.                                 </p>
  586.                             </def>
  587.                         </gitem>
  588.                     </glist>
  589.                 </p>
  590.             </div2>
  591.         </div1>
  592.         <!-- &Docs; -->
  593.         <div1 id="sec-documents">
  594.             <head>Documents</head>
  595.             <p>
  596.                 <termdef id="dt-xml-doc" term="XML Document">
  597. A data object is an
  598. <term>XML document</term> if it is
  599. <termref def="dt-wellformed">well-formed</termref>, as
  600. defined in this specification.
  601. A well-formed XML document may in addition be
  602. <termref def="dt-valid">valid</termref> if it meets certain further 
  603. constraints.</termdef>
  604.             </p>
  605.             <p>Each XML document has both a logical and a physical structure.
  606. Physically, the document is composed of units called <termref def="dt-entity">entities</termref>.  An entity may <termref def="dt-entref">refer</termref> to other entities to cause their
  607. inclusion in the document. A document begins in a "root"  or <termref def="dt-docent">document entity</termref>.
  608. Logically, the document is composed of declarations, elements, 
  609. comments,
  610. character references, and
  611. processing
  612. instructions, all of which are indicated in the document by explicit
  613. markup.
  614. The logical and physical structures must nest properly, as described  
  615. in <specref ref="wf-entities"/>.
  616. </p>
  617.             <div2 id="sec-well-formed">
  618.                 <head>Well-Formed XML Documents</head>
  619.                 <p>
  620.                     <termdef id="dt-wellformed" term="Well-Formed">
  621. A textual object is 
  622. a well-formed XML document if:</termdef>
  623.                     <olist>
  624.                         <item>
  625.                             <p>Taken as a whole, it
  626. matches the production labeled <nt def="NT-document">document</nt>.</p>
  627.                         </item>
  628.                         <item>
  629.                             <p>It
  630. meets all the well-formedness constraints given in this specification.</p>
  631.                         </item>
  632.                         <item>
  633.                             <p>Each of the <termref def="dt-parsedent">parsed entities</termref> 
  634. which is referenced directly or indirectly within the document is
  635. <titleref href="wf-entities">well-formed</titleref>.</p>
  636.                         </item>
  637.                     </olist>
  638.                 </p>
  639.                 <p>
  640.                     <scrap lang="ebnf" id="document">
  641.                         <head>Document</head>
  642.                         <prod id="NT-document">
  643.                             <lhs>document</lhs>
  644.                             <rhs>
  645.                                 <nt def="NT-prolog">prolog</nt>
  646.                                 <nt def="NT-element">element</nt>
  647.                                 <nt def="NT-Misc">Misc</nt>*</rhs>
  648.                         </prod>
  649.                     </scrap>
  650.                 </p>
  651.                 <p>Matching the <nt def="NT-document">document</nt> production 
  652. implies that:
  653. <olist>
  654.                         <item>
  655.                             <p>It contains one or more
  656. <termref def="dt-element">elements</termref>.</p>
  657.                         </item>
  658.                         <!--* N.B. some readers (notably JC) find the following
  659. paragraph awkward and redundant.  I agree it's logically redundant:
  660. it *says* it is summarizing the logical implications of
  661. matching the grammar, and that means by definition it's
  662. logically redundant.  I don't think it's rhetorically
  663. redundant or unnecessary, though, so I'm keeping it.  It
  664. could however use some recasting when the editors are feeling
  665. stronger. -MSM *-->
  666.                         <item>
  667.                             <p>
  668.                                 <termdef id="dt-root" term="Root Element">There is  exactly
  669. one element, called the <term>root</term>, or document element,  no
  670. part of which appears in the <termref def="dt-content">content</termref> of any other element.</termdef>
  671. For all other elements, if the start-tag is in the content of another
  672. element, the end-tag is in the content of the same element.  More
  673. simply stated, the elements, delimited by start- and end-tags, nest
  674. properly within each other.
  675. </p>
  676.                         </item>
  677.                     </olist>
  678.                 </p>
  679.                 <p>
  680.                     <termdef id="dt-parentchild" term="Parent/Child">As a consequence 
  681. of this,
  682. for each non-root element
  683. <code>C</code> in the document, there is one other element <code>P</code>
  684. in the document such that 
  685. <code>C</code> is in the content of <code>P</code>, but is not in
  686. the content of any other element that is in the content of
  687. <code>P</code>.  
  688. <code>P</code> is referred to as the
  689. <term>parent</term> of <code>C</code>, and <code>C</code> as a
  690. <term>child</term> of <code>P</code>.</termdef>
  691.                 </p>
  692.             </div2>
  693.             <div2 id="charsets">
  694.                 <head>Characters</head>
  695.                 <p>
  696.                     <termdef id="dt-text" term="Text">A parsed entity contains
  697. <term>text</term>, a sequence of 
  698. <termref def="dt-character">characters</termref>, 
  699. which may represent markup or character data.</termdef>
  700.                     <termdef id="dt-character" term="Character">A <term>character</term> 
  701. is an atomic unit of text as specified by
  702. ISO/IEC 10646 <bibref ref="ISO10646"/>.
  703. Legal characters are tab, carriage return, line feed, and the legal
  704. graphic characters of Unicode and ISO/IEC 10646.
  705. The use of "compatibility characters", as defined in section 6.8
  706. of <bibref ref="Unicode"/>, is discouraged.
  707. </termdef>
  708.                     <scrap lang="ebnf" id="char32">
  709.                         <head>Character Range</head>
  710.                         <prodgroup pcw2="4" pcw4="17.5" pcw5="11">
  711.                             <prod id="NT-Char">
  712.                                 <lhs>Char</lhs>
  713.                                 <rhs>#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] 
  714. | [#x10000-#x10FFFF]</rhs>
  715.                                 <com>any Unicode character, excluding the
  716. surrogate blocks, FFFE, and FFFF.</com>
  717.                             </prod>
  718.                         </prodgroup>
  719.                     </scrap>
  720.                 </p>
  721.                 <p>The mechanism for encoding character code points into bit patterns may
  722. vary from entity to entity. All XML processors must accept the UTF-8
  723. and UTF-16 encodings of 10646; the mechanisms for signaling which of
  724. the two is in use, or for bringing other encodings into play, are
  725. discussed later, in <specref ref="charencoding"/>.
  726. </p>
  727.                 <!--
  728. <p>Regardless of the specific encoding used, any character in the ISO/IEC
  729. 10646 character set may be referred to by the decimal or hexadecimal
  730. equivalent of its 
  731. UCS-4 code value.
  732. </p>-->
  733.             </div2>
  734.             <div2 id="sec-common-syn">
  735.                 <head>Common Syntactic Constructs</head>
  736.                 <p>This section defines some symbols used widely in the grammar.</p>
  737.                 <p>
  738.                     <nt def="NT-S">S</nt> (white space) consists of one or more space (#x20)
  739. characters, carriage returns, line feeds, or tabs.
  740.  
  741. <scrap lang="ebnf" id="white">
  742.                         <head>White Space</head>
  743.                         <prodgroup pcw2="4" pcw4="17.5" pcw5="11">
  744.                             <prod id="NT-S">
  745.                                 <lhs>S</lhs>
  746.                                 <rhs>(#x20 | #x9 | #xD | #xA)+</rhs>
  747.                             </prod>
  748.                         </prodgroup>
  749.                     </scrap>
  750.                 </p>
  751.                 <p>Characters are classified for convenience as letters, digits, or other
  752. characters.  Letters consist of an alphabetic or syllabic 
  753. base character possibly
  754. followed by one or more combining characters, or of an ideographic
  755. character.  
  756. Full definitions of the specific characters in each class
  757. are given in <specref ref="CharClasses"/>.</p>
  758.                 <p>
  759.                     <termdef id="dt-name" term="Name">A <term>Name</term> is a token
  760. beginning with a letter or one of a few punctuation characters, and continuing
  761. with letters, digits, hyphens, underscores, colons, or full stops, together
  762. known as name characters.</termdef>
  763. Names beginning with the string "<code>xml</code>", or any string
  764. which would match <code>(('X'|'x') ('M'|'m') ('L'|'l'))</code>, are
  765. reserved for standardization in this or future versions of this
  766. specification.
  767. </p>
  768.                 <note>
  769.                     <p>The colon character within XML names is reserved for experimentation with
  770. name spaces.  
  771. Its meaning is expected to be
  772. standardized at some future point, at which point those documents 
  773. using the colon for experimental purposes may need to be updated.
  774. (There is no guarantee that any name-space mechanism
  775. adopted for XML will in fact use the colon as a name-space delimiter.)
  776. In practice, this means that authors should not use the colon in XML
  777. names except as part of name-space experiments, but that XML processors
  778. should accept the colon as a name character.</p>
  779.                 </note>
  780.                 <p>An
  781. <nt def="NT-Nmtoken">Nmtoken</nt> (name token) is any mixture of
  782. name characters.
  783. <scrap lang="ebnf">
  784.                         <head>Names and Tokens</head>
  785.                         <prod id="NT-NameChar">
  786.                             <lhs>NameChar</lhs>
  787.                             <rhs>
  788.                                 <nt def="NT-Letter">Letter</nt> 
  789. | <nt def="NT-Digit">Digit</nt> 
  790. | '.' | '-' | '_' | ':'
  791. | <nt def="NT-CombiningChar">CombiningChar</nt> 
  792. | <nt def="NT-Extender">Extender</nt>
  793.                             </rhs>
  794.                         </prod>
  795.                         <prod id="NT-Name">
  796.                             <lhs>Name</lhs>
  797.                             <rhs>(<nt def="NT-Letter">Letter</nt> | '_' | ':')
  798. (<nt def="NT-NameChar">NameChar</nt>)*</rhs>
  799.                         </prod>
  800.                         <prod id="NT-Names">
  801.                             <lhs>Names</lhs>
  802.                             <rhs>
  803.                                 <nt def="NT-Name">Name</nt> 
  804. (<nt def="NT-S">S</nt>
  805.                                 <nt def="NT-Name">Name</nt>)*</rhs>
  806.                         </prod>
  807.                         <prod id="NT-Nmtoken">
  808.                             <lhs>Nmtoken</lhs>
  809.                             <rhs>(<nt def="NT-NameChar">NameChar</nt>)+</rhs>
  810.                         </prod>
  811.                         <prod id="NT-Nmtokens">
  812.                             <lhs>Nmtokens</lhs>
  813.                             <rhs>
  814.                                 <nt def="NT-Nmtoken">Nmtoken</nt> (<nt def="NT-S">S</nt>
  815.                                 <nt def="NT-Nmtoken">Nmtoken</nt>)*</rhs>
  816.                         </prod>
  817.                     </scrap>
  818.                 </p>
  819.                 <p>Literal data is any quoted string not containing
  820. the quotation mark used as a delimiter for that string.
  821. Literals are used
  822. for specifying the content of internal entities
  823. (<nt def="NT-EntityValue">EntityValue</nt>),
  824. the values of attributes (<nt def="NT-AttValue">AttValue</nt>), 
  825. and external identifiers 
  826. (<nt def="NT-SystemLiteral">SystemLiteral</nt>).  
  827. Note that a <nt def="NT-SystemLiteral">SystemLiteral</nt>
  828. can be parsed without scanning for markup.
  829. <scrap lang="ebnf">
  830.                         <head>Literals</head>
  831.                         <prod id="NT-EntityValue">
  832.                             <lhs>EntityValue</lhs>
  833.                             <rhs>'"' 
  834. ([^%&"] 
  835. | <nt def="NT-PEReference">PEReference</nt> 
  836. | <nt def="NT-Reference">Reference</nt>)*
  837. '"' 
  838. </rhs>
  839.                             <rhs>|  
  840. "'" 
  841. ([^%&'] 
  842. | <nt def="NT-PEReference">PEReference</nt> 
  843. | <nt def="NT-Reference">Reference</nt>)* 
  844. "'"</rhs>
  845.                         </prod>
  846.                         <prod id="NT-AttValue">
  847.                             <lhs>AttValue</lhs>
  848.                             <rhs>'"' 
  849. ([^<&"] 
  850. | <nt def="NT-Reference">Reference</nt>)* 
  851. '"' 
  852. </rhs>
  853.                             <rhs>|  
  854. "'" 
  855. ([^<&'] 
  856. | <nt def="NT-Reference">Reference</nt>)* 
  857. "'"</rhs>
  858.                         </prod>
  859.                         <prod id="NT-SystemLiteral">
  860.                             <lhs>SystemLiteral</lhs>
  861.                             <rhs>('"' [^"]* '"') | ("'" [^']* "'")
  862. </rhs>
  863.                         </prod>
  864.                         <prod id="NT-PubidLiteral">
  865.                             <lhs>PubidLiteral</lhs>
  866.                             <rhs>'"' <nt def="NT-PubidChar">PubidChar</nt>* 
  867. '"' 
  868. | "'" (<nt def="NT-PubidChar">PubidChar</nt> - "'")* "'"</rhs>
  869.                         </prod>
  870.                         <prod id="NT-PubidChar">
  871.                             <lhs>PubidChar</lhs>
  872.                             <rhs>#x20 | #xD | #xA 
  873. | [a-zA-Z0-9]
  874. | [-'()+,./:=?;!*#@$_%]</rhs>
  875.                         </prod>
  876.                     </scrap>
  877.                 </p>
  878.             </div2>
  879.             <div2 id="syntax">
  880.                 <head>Character Data and Markup</head>
  881.                 <p>
  882.                     <termref def="dt-text">Text</termref> consists of intermingled 
  883. <termref def="dt-chardata">character
  884. data</termref> and markup.
  885. <termdef id="dt-markup" term="Markup">
  886.                         <term>Markup</term> takes the form of
  887. <termref def="dt-stag">start-tags</termref>,
  888. <termref def="dt-etag">end-tags</termref>,
  889. <termref def="dt-empty">empty-element tags</termref>,
  890. <termref def="dt-entref">entity references</termref>,
  891. <termref def="dt-charref">character references</termref>,
  892. <termref def="dt-comment">comments</termref>,
  893. <termref def="dt-cdsection">CDATA section</termref> delimiters,
  894. <termref def="dt-doctype">document type declarations</termref>, and
  895. <termref def="dt-pi">processing instructions</termref>.
  896. </termdef>
  897.                 </p>
  898.                 <p>
  899.                     <termdef id="dt-chardata" term="Character Data">All text that is not markup
  900. constitutes the <term>character data</term> of
  901. the document.</termdef>
  902.                 </p>
  903.                 <p>The ampersand character (&) and the left angle bracket (<)
  904. may appear in their literal form <emph>only</emph> when used as markup
  905. delimiters, or within a <termref def="dt-comment">comment</termref>, a
  906. <termref def="dt-pi">processing instruction</termref>, 
  907. or a <termref def="dt-cdsection">CDATA section</termref>.  
  908.  
  909. They are also legal within the <termref def="dt-litentval">literal entity
  910. value</termref> of an internal entity declaration; see
  911. <specref ref="wf-entities"/>.
  912. <!-- FINAL EDIT:  restore internal entity decl or leave it out. -->
  913. If they are needed elsewhere,
  914. they must be <termref def="dt-escape">escaped</termref>
  915. using either <termref def="dt-charref">numeric character references</termref>
  916. or the strings
  917. "<code>&amp;</code>" and "<code>&lt;</code>" respectively. 
  918. The right angle
  919. bracket (>) may be represented using the string
  920. "<code>&gt;</code>", and must, <termref def="dt-compat">for
  921. compatibility</termref>, 
  922. be escaped using
  923. "<code>&gt;</code>" or a character reference 
  924. when it appears in the string
  925. "<code>]]></code>"
  926. in content, 
  927. when that string is not marking the end of 
  928. a <termref def="dt-cdsection">CDATA section</termref>. 
  929. </p>
  930.                 <p>
  931. In the content of elements, character data 
  932. is any string of characters which does
  933. not contain the start-delimiter of any markup.  
  934. In a CDATA section, character data
  935. is any string of characters not including the CDATA-section-close
  936. delimiter, "<code>]]></code>".</p>
  937.                 <p>
  938. To allow attribute values to contain both single and double quotes, the
  939. apostrophe or single-quote character (') may be represented as
  940. "<code>&apos;</code>", and the double-quote character (") as
  941. "<code>&quot;</code>".
  942. <scrap lang="ebnf">
  943.                         <head>Character Data</head>
  944.                         <prod id="NT-CharData">
  945.                             <lhs>CharData</lhs>
  946.                             <rhs>[^<&]* - ([^<&]* ']]>' [^<&]*)</rhs>
  947.                         </prod>
  948.                     </scrap>
  949.                 </p>
  950.             </div2>
  951.             <div2 id="sec-comments">
  952.                 <head>Comments</head>
  953.                 <p>
  954.                     <termdef id="dt-comment" term="Comment">
  955.                         <term>Comments</term> may 
  956. appear anywhere in a document outside other 
  957. <termref def="dt-markup">markup</termref>; in addition,
  958. they may appear within the document type declaration
  959. at places allowed by the grammar.
  960. They are not part of the document's <termref def="dt-chardata">character
  961. data</termref>; an XML
  962. processor may, but need not, make it possible for an application to
  963. retrieve the text of comments.
  964. <termref def="dt-compat">For compatibility</termref>, the string
  965. "<code>--</code>" (double-hyphen) must not occur within
  966. comments.
  967. <scrap lang="ebnf">
  968.                             <head>Comments</head>
  969.                             <prod id="NT-Comment">
  970.                                 <lhs>Comment</lhs>
  971.                                 <rhs>'<!--'
  972. ((<nt def="NT-Char">Char</nt> - '-') 
  973. | ('-' (<nt def="NT-Char">Char</nt> - '-')))* 
  974. '-->'</rhs>
  975.                             </prod>
  976.                         </scrap>
  977.                     </termdef>
  978.                 </p>
  979.                 <p>An example of a comment:
  980. <eg><!&como; declarations for <head> & <body> &comc;></eg>
  981.                 </p>
  982.             </div2>
  983.             <div2 id="sec-pi">
  984.                 <head>Processing Instructions</head>
  985.                 <p>
  986.                     <termdef id="dt-pi" term="Processing instruction">
  987.                         <term>Processing
  988. instructions</term> (PIs) allow documents to contain instructions
  989. for applications.
  990.  
  991. <scrap lang="ebnf">
  992.                             <head>Processing Instructions</head>
  993.                             <prod id="NT-PI">
  994.                                 <lhs>PI</lhs>
  995.                                 <rhs>'<?' <nt def="NT-PITarget">PITarget</nt> 
  996. (<nt def="NT-S">S</nt> 
  997. (<nt def="NT-Char">Char</nt>* - 
  998. (<nt def="NT-Char">Char</nt>* &pic; <nt def="NT-Char">Char</nt>*)))?
  999. &pic;</rhs>
  1000.                             </prod>
  1001.                             <prod id="NT-PITarget">
  1002.                                 <lhs>PITarget</lhs>
  1003.                                 <rhs>
  1004.                                     <nt def="NT-Name">Name</nt> - 
  1005. (('X' | 'x') ('M' | 'm') ('L' | 'l'))</rhs>
  1006.                             </prod>
  1007.                         </scrap>
  1008.                     </termdef>
  1009. PIs are not part of the document's <termref def="dt-chardata">character
  1010. data</termref>, but must be passed through to the application. The
  1011. PI begins with a target (<nt def="NT-PITarget">PITarget</nt>) used
  1012. to identify the application to which the instruction is directed.  
  1013. The target names "<code>XML</code>", "<code>xml</code>", and so on are
  1014. reserved for standardization in this or future versions of this
  1015. specification.
  1016. The 
  1017. XML <termref def="dt-notation">Notation</termref> mechanism
  1018. may be used for
  1019. formal declaration of PI targets.
  1020. </p>
  1021.             </div2>
  1022.             <div2 id="sec-cdata-sect">
  1023.                 <head>CDATA Sections</head>
  1024.                 <p>
  1025.                     <termdef id="dt-cdsection" term="CDATA Section">
  1026.                         <term>CDATA sections</term>
  1027. may occur 
  1028. anywhere character data may occur; they are
  1029. used to escape blocks of text containing characters which would
  1030. otherwise be recognized as markup.  CDATA sections begin with the
  1031. string "<code><![CDATA[</code>" and end with the string
  1032. "<code>]]></code>":
  1033. <scrap lang="ebnf">
  1034.                             <head>CDATA Sections</head>
  1035.                             <prod id="NT-CDSect">
  1036.                                 <lhs>CDSect</lhs>
  1037.                                 <rhs>
  1038.                                     <nt def="NT-CDStart">CDStart</nt>
  1039.                                     <nt def="NT-CData">CData</nt>
  1040.                                     <nt def="NT-CDEnd">CDEnd</nt>
  1041.                                 </rhs>
  1042.                             </prod>
  1043.                             <prod id="NT-CDStart">
  1044.                                 <lhs>CDStart</lhs>
  1045.                                 <rhs>'<![CDATA['</rhs>
  1046.                             </prod>
  1047.                             <prod id="NT-CData">
  1048.                                 <lhs>CData</lhs>
  1049.                                 <rhs>(<nt def="NT-Char">Char</nt>* - 
  1050. (<nt def="NT-Char">Char</nt>* ']]>' <nt def="NT-Char">Char</nt>*))
  1051. </rhs>
  1052.                             </prod>
  1053.                             <prod id="NT-CDEnd">
  1054.                                 <lhs>CDEnd</lhs>
  1055.                                 <rhs>']]>'</rhs>
  1056.                             </prod>
  1057.                         </scrap>
  1058.  
  1059. Within a CDATA section, only the <nt def="NT-CDEnd">CDEnd</nt> string is
  1060. recognized as markup, so that left angle brackets and ampersands may occur in
  1061. their literal form; they need not (and cannot) be escaped using
  1062. "<code>&lt;</code>" and "<code>&amp;</code>".  CDATA sections
  1063. cannot nest.</termdef>
  1064.                 </p>
  1065.                 <p>An example of a CDATA section, in which "<code><greeting></code>" and 
  1066. "<code></greeting></code>"
  1067. are recognized as <termref def="dt-chardata">character data</termref>, not
  1068. <termref def="dt-markup">markup</termref>:
  1069. <eg><![CDATA[<greeting>Hello, world!</greeting>]]></eg>
  1070.                 </p>
  1071.             </div2>
  1072.             <div2 id="sec-prolog-dtd">
  1073.                 <head>Prolog and Document Type Declaration</head>
  1074.                 <p>
  1075.                     <termdef id="dt-xmldecl" term="XML Declaration">XML documents 
  1076. may, and should, 
  1077. begin with an <term>XML declaration</term> which specifies
  1078. the version of
  1079. XML being used.</termdef>
  1080. For example, the following is a complete XML document, <termref def="dt-wellformed">well-formed</termref> but not
  1081. <termref def="dt-valid">valid</termref>:
  1082. <eg>
  1083.                         <![CDATA[<?xml version="1.0"?>
  1084. <greeting>Hello, world!</greeting>
  1085. ]]>
  1086.                     </eg>
  1087. and so is this:
  1088. <eg>
  1089.                         <![CDATA[<greeting>Hello, world!</greeting>
  1090. ]]>
  1091.                     </eg>
  1092.                 </p>
  1093.                 <p>The version number "<code>1.0</code>" should be used to indicate
  1094. conformance to this version of this specification; it is an error
  1095. for a document to use the value "<code>1.0</code>" 
  1096. if it does not conform to this version of this specification.
  1097. It is the intent
  1098. of the XML working group to give later versions of this specification
  1099. numbers other than "<code>1.0</code>", but this intent does not
  1100. indicate a
  1101. commitment to produce any future versions of XML, nor if any are produced, to
  1102. use any particular numbering scheme.
  1103. Since future versions are not ruled out, this construct is provided 
  1104. as a means to allow the possibility of automatic version recognition, should
  1105. it become necessary.
  1106. Processors may signal an error if they receive documents labeled with 
  1107. versions they do not support. 
  1108. </p>
  1109.                 <p>The function of the markup in an XML document is to describe its
  1110. storage and logical structure and to associate attribute-value pairs
  1111. with its logical structures.  XML provides a mechanism, the <termref def="dt-doctype">document type declaration</termref>, to define
  1112. constraints on the logical structure and to support the use of
  1113. predefined storage units.
  1114.  
  1115. <termdef id="dt-valid" term="Validity">An XML document is 
  1116. <term>valid</term> if it has an associated document type
  1117. declaration and if the document
  1118. complies with the constraints expressed in it.</termdef>
  1119.                 </p>
  1120.                 <p>The document type declaration must appear before
  1121. the first <termref def="dt-element">element</termref> in the document.
  1122. <scrap lang="ebnf" id="xmldoc">
  1123.                         <head>Prolog</head>
  1124.                         <prodgroup pcw2="6" pcw4="17.5" pcw5="9">
  1125.                             <prod id="NT-prolog">
  1126.                                 <lhs>prolog</lhs>
  1127.                                 <rhs>
  1128.                                     <nt def="NT-XMLDecl">XMLDecl</nt>? 
  1129. <nt def="NT-Misc">Misc</nt>* 
  1130. (<nt def="NT-doctypedecl">doctypedecl</nt>
  1131.                                     <nt def="NT-Misc">Misc</nt>*)?</rhs>
  1132.                             </prod>
  1133.                             <prod id="NT-XMLDecl">
  1134.                                 <lhs>XMLDecl</lhs>
  1135.                                 <rhs>&xmlpio; 
  1136. <nt def="NT-VersionInfo">VersionInfo</nt>
  1137.                                     <nt def="NT-EncodingDecl">EncodingDecl</nt>? 
  1138. <nt def="NT-SDDecl">SDDecl</nt>? 
  1139. <nt def="NT-S">S</nt>? 
  1140. &pic;</rhs>
  1141.                             </prod>
  1142.                             <prod id="NT-VersionInfo">
  1143.                                 <lhs>VersionInfo</lhs>
  1144.                                 <rhs>
  1145.                                     <nt def="NT-S">S</nt> 'version' <nt def="NT-Eq">Eq</nt> 
  1146. (' <nt def="NT-VersionNum">VersionNum</nt> ' 
  1147. | " <nt def="NT-VersionNum">VersionNum</nt> ")</rhs>
  1148.                             </prod>
  1149.                             <prod id="NT-Eq">
  1150.                                 <lhs>Eq</lhs>
  1151.                                 <rhs>
  1152.                                     <nt def="NT-S">S</nt>? '=' <nt def="NT-S">S</nt>?</rhs>
  1153.                             </prod>
  1154.                             <prod id="NT-VersionNum">
  1155.                                 <lhs>VersionNum</lhs>
  1156.                                 <rhs>([a-zA-Z0-9_.:] | '-')+</rhs>
  1157.                             </prod>
  1158.                             <prod id="NT-Misc">
  1159.                                 <lhs>Misc</lhs>
  1160.                                 <rhs>
  1161.                                     <nt def="NT-Comment">Comment</nt> | <nt def="NT-PI">PI</nt> | 
  1162. <nt def="NT-S">S</nt>
  1163.                                 </rhs>
  1164.                             </prod>
  1165.                         </prodgroup>
  1166.                     </scrap>
  1167.                 </p>
  1168.                 <p>
  1169.                     <termdef id="dt-doctype" term="Document Type Declaration">The XML
  1170. <term>document type declaration</term> 
  1171. contains or points to 
  1172. <termref def="dt-markupdecl">markup declarations</termref> 
  1173. that provide a grammar for a
  1174. class of documents.  
  1175. This grammar is known as a document type definition,
  1176. or <term>DTD</term>.  
  1177. The document type declaration can point to an external subset (a
  1178. special kind of 
  1179. <termref def="dt-extent">external entity</termref>) containing markup
  1180. declarations, or can 
  1181. contain the markup declarations directly in an internal subset, or can do
  1182. both.   
  1183. The DTD for a document consists of both subsets taken
  1184. together.</termdef>
  1185.                 </p>
  1186.                 <p>
  1187.                     <termdef id="dt-markupdecl" term="markup declaration">
  1188. A <term>markup declaration</term> is 
  1189. an <termref def="dt-eldecl">element type declaration</termref>, 
  1190. an <termref def="dt-attdecl">attribute-list declaration</termref>, 
  1191. an <termref def="dt-entdecl">entity declaration</termref>, or
  1192. a <termref def="dt-notdecl">notation declaration</termref>.
  1193. </termdef>
  1194. These declarations may be contained in whole or in part
  1195. within <termref def="dt-PE">parameter entities</termref>,
  1196. as described in the well-formedness and validity constraints below.
  1197. For fuller information, see
  1198. <specref ref="sec-physical-struct"/>.</p>
  1199.                 <scrap lang="ebnf" id="dtd">
  1200.                     <head>Document Type Definition</head>
  1201.                     <prodgroup pcw2="6" pcw4="17.5" pcw5="9">
  1202.                         <prod id="NT-doctypedecl">
  1203.                             <lhs>doctypedecl</lhs>
  1204.                             <rhs>'<!DOCTYPE' <nt def="NT-S">S</nt>
  1205.                                 <nt def="NT-Name">Name</nt> (<nt def="NT-S">S</nt>
  1206.                                 <nt def="NT-ExternalID">ExternalID</nt>)? 
  1207. <nt def="NT-S">S</nt>? ('[' 
  1208. (<nt def="NT-markupdecl">markupdecl</nt> 
  1209. | <nt def="NT-PEReference">PEReference</nt> 
  1210. | <nt def="NT-S">S</nt>)*
  1211. ']' 
  1212. <nt def="NT-S">S</nt>?)? '>'</rhs>
  1213.                             <vc def="vc-roottype"/>
  1214.                         </prod>
  1215.                         <prod id="NT-markupdecl">
  1216.                             <lhs>markupdecl</lhs>
  1217.                             <rhs>
  1218.                                 <nt def="NT-elementdecl">elementdecl</nt> 
  1219. | <nt def="NT-AttlistDecl">AttlistDecl</nt> 
  1220. | <nt def="NT-EntityDecl">EntityDecl</nt> 
  1221. | <nt def="NT-NotationDecl">NotationDecl</nt> 
  1222. | <nt def="NT-PI">PI</nt> 
  1223. | <nt def="NT-Comment">Comment</nt>
  1224.                             </rhs>
  1225.                             <vc def="vc-PEinMarkupDecl"/>
  1226.                             <wfc def="wfc-PEinInternalSubset"/>
  1227.                         </prod>
  1228.                     </prodgroup>
  1229.                 </scrap>
  1230.                 <p>The markup declarations may be made up in whole or in part of
  1231. the <termref def="dt-repltext">replacement text</termref> of 
  1232. <termref def="dt-PE">parameter entities</termref>.
  1233. The productions later in this specification for
  1234. individual nonterminals (<nt def="NT-elementdecl">elementdecl</nt>,
  1235. <nt def="NT-AttlistDecl">AttlistDecl</nt>, and so on) describe 
  1236. the declarations <emph>after</emph> all the parameter entities have been 
  1237. <termref def="dt-include">included</termref>.</p>
  1238.                 <vcnote id="vc-roottype">
  1239.                     <head>Root Element Type</head>
  1240.                     <p>
  1241. The <nt def="NT-Name">Name</nt> in the document type declaration must
  1242. match the element type of the <termref def="dt-root">root element</termref>.
  1243. </p>
  1244.                 </vcnote>
  1245.                 <vcnote id="vc-PEinMarkupDecl">
  1246.                     <head>Proper Declaration/PE Nesting</head>
  1247.                     <p>Parameter-entity 
  1248. <termref def="dt-repltext">replacement text</termref> must be properly nested
  1249. with markup declarations. 
  1250. That is to say, if either the first character
  1251. or the last character of a markup
  1252. declaration (<nt def="NT-markupdecl">markupdecl</nt> above)
  1253. is contained in the replacement text for a 
  1254. <termref def="dt-PERef">parameter-entity reference</termref>,
  1255. both must be contained in the same replacement text.</p>
  1256.                 </vcnote>
  1257.                 <wfcnote id="wfc-PEinInternalSubset">
  1258.                     <head>PEs in Internal Subset</head>
  1259.                     <p>In the internal DTD subset, 
  1260. <termref def="dt-PERef">parameter-entity references</termref>
  1261. can occur only where markup declarations can occur, not
  1262. within markup declarations.  (This does not apply to
  1263. references that occur in
  1264. external parameter entities or to the external subset.)
  1265. </p>
  1266.                 </wfcnote>
  1267.                 <p>
  1268. Like the internal subset, the external subset and 
  1269. any external parameter entities referred to in the DTD 
  1270. must consist of a series of complete markup declarations of the types 
  1271. allowed by the non-terminal symbol
  1272. <nt def="NT-markupdecl">markupdecl</nt>, interspersed with white space
  1273. or <termref def="dt-PERef">parameter-entity references</termref>.
  1274. However, portions of the contents
  1275. of the 
  1276. external subset or of external parameter entities may conditionally be ignored
  1277. by using 
  1278. the <termref def="dt-cond-section">conditional section</termref>
  1279. construct; this is not allowed in the internal subset.
  1280.  
  1281. <scrap id="ext-Subset">
  1282.                         <head>External Subset</head>
  1283.                         <prodgroup pcw2="6" pcw4="17.5" pcw5="9">
  1284.                             <prod id="NT-extSubset">
  1285.                                 <lhs>extSubset</lhs>
  1286.                                 <rhs>
  1287.                                     <nt def="NT-TextDecl">TextDecl</nt>?
  1288. <nt def="NT-extSubsetDecl">extSubsetDecl</nt>
  1289.                                 </rhs>
  1290.                             </prod>
  1291.                             <prod id="NT-extSubsetDecl">
  1292.                                 <lhs>extSubsetDecl</lhs>
  1293.                                 <rhs>(
  1294. <nt def="NT-markupdecl">markupdecl</nt> 
  1295. | <nt def="NT-conditionalSect">conditionalSect</nt> 
  1296. | <nt def="NT-PEReference">PEReference</nt> 
  1297. | <nt def="NT-S">S</nt>
  1298. )*</rhs>
  1299.                             </prod>
  1300.                         </prodgroup>
  1301.                     </scrap>
  1302.                 </p>
  1303.                 <p>The external subset and external parameter entities also differ 
  1304. from the internal subset in that in them,
  1305. <termref def="dt-PERef">parameter-entity references</termref>
  1306. are permitted <emph>within</emph> markup declarations,
  1307. not only <emph>between</emph> markup declarations.</p>
  1308.                 <p>An example of an XML document with a document type declaration:
  1309. <eg>
  1310.                         <![CDATA[<?xml version="1.0"?>
  1311. <!DOCTYPE greeting SYSTEM "hello.dtd">
  1312. <greeting>Hello, world!</greeting>
  1313. ]]>
  1314.                     </eg>
  1315. The <termref def="dt-sysid">system identifier</termref> 
  1316. "<code>hello.dtd</code>" gives the URI of a DTD for the document.</p>
  1317.                 <p>The declarations can also be given locally, as in this 
  1318. example:
  1319. <eg>
  1320.                         <![CDATA[<?xml version="1.0" encoding="UTF-8" ?>
  1321. <!DOCTYPE greeting [
  1322.   <!ELEMENT greeting (#PCDATA)>
  1323. ]>
  1324. <greeting>Hello, world!</greeting>
  1325. ]]>
  1326.                     </eg>
  1327. If both the external and internal subsets are used, the 
  1328. internal subset is considered to occur before the external subset.
  1329. <!-- 'is considered to'? boo. whazzat mean? -->
  1330. This has the effect that entity and attribute-list declarations in the
  1331. internal subset take precedence over those in the external subset.
  1332. </p>
  1333.             </div2>
  1334.             <div2 id="sec-rmd">
  1335.                 <head>Standalone Document Declaration</head>
  1336.                 <p>Markup declarations can affect the content of the document,
  1337. as passed from an <termref def="dt-xml-proc">XML processor</termref> 
  1338. to an application; examples are attribute defaults and entity
  1339. declarations.
  1340. The standalone document declaration,
  1341. which may appear as a component of the XML declaration, signals
  1342. whether or not there are such declarations which appear external to 
  1343. the <termref def="dt-docent">document entity</termref>.
  1344. <scrap lang="ebnf" id="fulldtd">
  1345.                         <head>Standalone Document Declaration</head>
  1346.                         <prodgroup pcw2="4" pcw4="19.5" pcw5="9">
  1347.                             <prod id="NT-SDDecl">
  1348.                                 <lhs>SDDecl</lhs>
  1349.                                 <rhs>
  1350.                                     <nt def="NT-S">S</nt> 
  1351. 'standalone' <nt def="NT-Eq">Eq</nt> 
  1352. (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
  1353. </rhs>
  1354.                                 <vc def="vc-check-rmd"/>
  1355.                             </prod>
  1356.                         </prodgroup>
  1357.                     </scrap>
  1358.                 </p>
  1359.                 <p>
  1360. In a standalone document declaration, the value "<code>yes</code>" indicates
  1361. that there 
  1362. are no markup declarations external to the <termref def="dt-docent">document
  1363. entity</termref> (either in the DTD external subset, or in an
  1364. external parameter entity referenced from the internal subset)
  1365. which affect the information passed from the XML processor to
  1366. the application.  
  1367. The value "<code>no</code>" indicates that there are or may be such
  1368. external markup declarations.
  1369. Note that the standalone document declaration only 
  1370. denotes the presence of external <emph>declarations</emph>; the presence, in a
  1371. document, of 
  1372. references to external <emph>entities</emph>, when those entities are
  1373. internally declared, 
  1374. does not change its standalone status.</p>
  1375.                 <p>If there are no external markup declarations, the standalone document
  1376. declaration has no meaning. 
  1377. If there are external markup declarations but there is no standalone
  1378. document declaration, the value "<code>no</code>" is assumed.</p>
  1379.                 <p>Any XML document for which <code>standalone="no"</code> holds can 
  1380. be converted algorithmically to a standalone document, 
  1381. which may be desirable for some network delivery applications.</p>
  1382.                 <vcnote id="vc-check-rmd">
  1383.                     <head>Standalone Document Declaration</head>
  1384.                     <p>The standalone document declaration must have
  1385. the value "<code>no</code>" if any external markup declarations
  1386. contain declarations of:</p>
  1387.                     <ulist>
  1388.                         <item>
  1389.                             <p>attributes with <termref def="dt-default">default</termref> values, if
  1390. elements to which
  1391. these attributes apply appear in the document without
  1392. specifications of values for these attributes, or</p>
  1393.                         </item>
  1394.                         <item>
  1395.                             <p>entities (other than &magicents;), 
  1396. if <termref def="dt-entref">references</termref> to those
  1397. entities appear in the document, or</p>
  1398.                         </item>
  1399.                         <item>
  1400.                             <p>attributes with values subject to
  1401. <titleref href="AVNormalize">normalization</titleref>, where the
  1402. attribute appears in the document with a value which will
  1403. change as a result of normalization, or</p>
  1404.                         </item>
  1405.                         <item>
  1406.                             <p>element types with <termref def="dt-elemcontent">element content</termref>, 
  1407. if white space occurs
  1408. directly within any instance of those types.
  1409. </p>
  1410.                         </item>
  1411.                     </ulist>
  1412.                 </vcnote>
  1413.                 <p>An example XML declaration with a standalone document declaration:<eg><?xml version="&XML.version;" standalone='yes'?></eg>
  1414.                 </p>
  1415.             </div2>
  1416.             <div2 id="sec-white-space">
  1417.                 <head>White Space Handling</head>
  1418.                 <p>In editing XML documents, it is often convenient to use "white space"
  1419. (spaces, tabs, and blank lines, denoted by the nonterminal 
  1420. <nt def="NT-S">S</nt> in this specification) to
  1421. set apart the markup for greater readability.  Such white space is typically
  1422. not intended for inclusion in the delivered version of the document.
  1423. On the other hand, "significant" white space that should be preserved in the
  1424. delivered version is common, for example in poetry and
  1425. source code.</p>
  1426.                 <p>An <termref def="dt-xml-proc">XML processor</termref> 
  1427. must always pass all characters in a document that are not
  1428. markup through to the application.   A <termref def="dt-validating">
  1429. validating XML processor</termref> must also inform the application
  1430. which  of these characters constitute white space appearing
  1431. in <termref def="dt-elemcontent">element content</termref>.
  1432. </p>
  1433.                 <p>A special <termref def="dt-attr">attribute</termref> 
  1434. named <kw>xml:space</kw> may be attached to an element
  1435. to signal an intention that in that element,
  1436. white space should be preserved by applications.
  1437. In valid documents, this attribute, like any other, must be 
  1438. <termref def="dt-attdecl">declared</termref> if it is used.
  1439. When declared, it must be given as an 
  1440. <termref def="dt-enumerated">enumerated type</termref> whose only
  1441. possible values are "<code>default</code>" and "<code>preserve</code>".
  1442. For example:<eg>
  1443.                         <![CDATA[    <!ATTLIST poem   xml:space (default|preserve) 'preserve'>]]>
  1444.                     </eg>
  1445.                 </p>
  1446.                 <p>The value "<code>default</code>" signals that applications'
  1447. default white-space processing modes are acceptable for this element; the
  1448. value "<code>preserve</code>" indicates the intent that applications preserve
  1449. all the white space.
  1450. This declared intent is considered to apply to all elements within the content
  1451. of the element where it is specified, unless overriden with another instance
  1452. of the <kw>xml:space</kw> attribute.
  1453. </p>
  1454.                 <p>The <termref def="dt-root">root element</termref> of any document
  1455. is considered to have signaled no intentions as regards application space
  1456. handling, unless it provides a value for 
  1457. this attribute or the attribute is declared with a default value.
  1458. </p>
  1459.             </div2>
  1460.             <div2 id="sec-line-ends">
  1461.                 <head>End-of-Line Handling</head>
  1462.                 <p>XML <termref def="dt-parsedent">parsed entities</termref> are often stored in
  1463. computer files which, for editing convenience, are organized into lines.
  1464. These lines are typically separated by some combination of the characters
  1465. carriage-return (#xD) and line-feed (#xA).</p>
  1466.                 <p>To simplify the tasks of <termref def="dt-app">applications</termref>,
  1467. wherever an external parsed entity or the literal entity value
  1468. of an internal parsed entity contains either the literal 
  1469. two-character sequence "#xD#xA" or a standalone literal
  1470. #xD, an <termref def="dt-xml-proc">XML processor</termref> must 
  1471. pass to the application the single character #xA.
  1472. (This behavior can 
  1473. conveniently be produced by normalizing all 
  1474. line breaks to #xA on input, before parsing.)
  1475. </p>
  1476.             </div2>
  1477.             <div2 id="sec-lang-tag">
  1478.                 <head>Language Identification</head>
  1479.                 <p>In document processing, it is often useful to
  1480. identify the natural or formal language 
  1481. in which the content is 
  1482. written.
  1483. A special <termref def="dt-attr">attribute</termref> named
  1484. <kw>xml:lang</kw> may be inserted in
  1485. documents to specify the 
  1486. language used in the contents and attribute values 
  1487. of any element in an XML document.
  1488. In valid documents, this attribute, like any other, must be 
  1489. <termref def="dt-attdecl">declared</termref> if it is used.
  1490. The values of the attribute are language identifiers as defined
  1491. by <bibref ref="RFC1766"/>, "Tags for the Identification of Languages":
  1492. <scrap lang="ebnf">
  1493.                         <head>Language Identification</head>
  1494.                         <prod id="NT-LanguageID">
  1495.                             <lhs>LanguageID</lhs>
  1496.                             <rhs>
  1497.                                 <nt def="NT-Langcode">Langcode</nt> 
  1498. ('-' <nt def="NT-Subcode">Subcode</nt>)*</rhs>
  1499.                         </prod>
  1500.                         <prod id="NT-Langcode">
  1501.                             <lhs>Langcode</lhs>
  1502.                             <rhs>
  1503.                                 <nt def="NT-ISO639Code">ISO639Code</nt> | 
  1504. <nt def="NT-IanaCode">IanaCode</nt> | 
  1505. <nt def="NT-UserCode">UserCode</nt>
  1506.                             </rhs>
  1507.                         </prod>
  1508.                         <prod id="NT-ISO639Code">
  1509.                             <lhs>ISO639Code</lhs>
  1510.                             <rhs>([a-z] | [A-Z]) ([a-z] | [A-Z])</rhs>
  1511.                         </prod>
  1512.                         <prod id="NT-IanaCode">
  1513.                             <lhs>IanaCode</lhs>
  1514.                             <rhs>('i' | 'I') '-' ([a-z] | [A-Z])+</rhs>
  1515.                         </prod>
  1516.                         <prod id="NT-UserCode">
  1517.                             <lhs>UserCode</lhs>
  1518.                             <rhs>('x' | 'X') '-' ([a-z] | [A-Z])+</rhs>
  1519.                         </prod>
  1520.                         <prod id="NT-Subcode">
  1521.                             <lhs>Subcode</lhs>
  1522.                             <rhs>([a-z] | [A-Z])+</rhs>
  1523.                         </prod>
  1524.                     </scrap>
  1525. The <nt def="NT-Langcode">Langcode</nt> may be any of the following:
  1526. <ulist>
  1527.                         <item>
  1528.                             <p>a two-letter language code as defined by 
  1529. <bibref ref="ISO639"/>, "Codes
  1530. for the representation of names of languages"</p>
  1531.                         </item>
  1532.                         <item>
  1533.                             <p>a language identifier registered with the Internet
  1534. Assigned Numbers Authority <bibref ref="IANA"/>; these begin with the 
  1535. prefix "<code>i-</code>" (or "<code>I-</code>")</p>
  1536.                         </item>
  1537.                         <item>
  1538.                             <p>a language identifier assigned by the user, or agreed on
  1539. between parties in private use; these must begin with the
  1540. prefix "<code>x-</code>" or "<code>X-</code>" in order to ensure that they do not conflict 
  1541. with names later standardized or registered with IANA</p>
  1542.                         </item>
  1543.                     </ulist>
  1544.                 </p>
  1545.                 <p>There may be any number of <nt def="NT-Subcode">Subcode</nt> segments; if
  1546. the first 
  1547. subcode segment exists and the Subcode consists of two 
  1548. letters, then it must be a country code from 
  1549. <bibref ref="ISO3166"/>, "Codes 
  1550. for the representation of names of countries."
  1551. If the first 
  1552. subcode consists of more than two letters, it must be
  1553. a subcode for the language in question registered with IANA,
  1554. unless the <nt def="NT-Langcode">Langcode</nt> begins with the prefix 
  1555. "<code>x-</code>" or
  1556. "<code>X-</code>". </p>
  1557.                 <p>It is customary to give the language code in lower case, and
  1558. the country code (if any) in upper case.
  1559. Note that these values, unlike other names in XML documents,
  1560. are case insensitive.</p>
  1561.                 <p>For example:
  1562. <eg>
  1563.                         <![CDATA[<p xml:lang="en">The quick brown fox jumps over the lazy dog.</p>
  1564. <p xml:lang="en-GB">What colour is it?</p>
  1565. <p xml:lang="en-US">What color is it?</p>
  1566. <sp who="Faust" desc='leise' xml:lang="de">
  1567.   <l>Habe nun, ach! Philosophie,</l>
  1568.   <l>Juristerei, und Medizin</l>
  1569.   <l>und leider auch Theologie</l>
  1570.   <l>durchaus studiert mit hei▀em Bemⁿh'n.</l>
  1571.   </sp>]]>
  1572.                     </eg>
  1573.                 </p>
  1574.                 <!--<p>The xml:lang value is considered to apply both to the contents of an
  1575. element and 
  1576. (unless otherwise via attribute default values) to the
  1577. values of all of its attributes with free-text (CDATA) values.  -->
  1578.                 <p>The intent declared with <kw>xml:lang</kw> is considered to apply to
  1579. all attributes and content of the element where it is specified,
  1580. unless overridden with an instance of <kw>xml:lang</kw>
  1581. on another element within that content.</p>
  1582.                 <!--
  1583. If no
  1584. value is specified for xml:lang on an element, and no default value is
  1585. defined for it in the DTD, then the xml:lang attribute of any element
  1586. takes the same value it has in the parent element, if any.  The two
  1587. technical terms in the following example both have the same effective
  1588. value for xml:lang:
  1589.  
  1590.   <p xml:lang="en">Here the keywords are
  1591.   <term xml:lang="en">shift</term> and
  1592.   <term>reduce</term>. ...</p>
  1593.  
  1594. The application, not the XML processor, is responsible for this '
  1595. inheritance' of attribute values.
  1596. -->
  1597.                 <p>A simple declaration for <kw>xml:lang</kw> might take
  1598. the form
  1599. <eg>xml:lang  NMTOKEN  #IMPLIED</eg>
  1600. but specific default values may also be given, if appropriate.  In a
  1601. collection of French poems for English students, with glosses and
  1602. notes in English, the xml:lang attribute might be declared this way:
  1603. <eg>
  1604.                         <![CDATA[    <!ATTLIST poem   xml:lang NMTOKEN 'fr'>
  1605.     <!ATTLIST gloss  xml:lang NMTOKEN 'en'>
  1606.     <!ATTLIST note   xml:lang NMTOKEN 'en'>]]>
  1607.                     </eg>
  1608.                 </p>
  1609.             </div2>
  1610.         </div1>
  1611.         <!-- &Elements; -->
  1612.         <div1 id="sec-logical-struct">
  1613.             <head>Logical Structures</head>
  1614.             <p>
  1615.                 <termdef id="dt-element" term="Element">Each <termref def="dt-xml-doc">XML document</termref> contains one or more
  1616. <term>elements</term>, the boundaries of which are 
  1617. either delimited by <termref def="dt-stag">start-tags</termref> 
  1618. and <termref def="dt-etag">end-tags</termref>, or, for <termref def="dt-empty">empty</termref> elements, by an <termref def="dt-eetag">empty-element tag</termref>. Each element has a type,
  1619. identified by name, sometimes called its "generic
  1620. identifier" (GI), and may have a set of
  1621. attribute specifications.</termdef>  Each attribute specification 
  1622. has a <termref def="dt-attrname">name</termref> and a <termref def="dt-attrval">value</termref>.
  1623. </p>
  1624.             <scrap lang="ebnf">
  1625.                 <head>Element</head>
  1626.                 <prod id="NT-element">
  1627.                     <lhs>element</lhs>
  1628.                     <rhs>
  1629.                         <nt def="NT-EmptyElemTag">EmptyElemTag</nt>
  1630.                     </rhs>
  1631.                     <rhs>| <nt def="NT-STag">STag</nt>
  1632.                         <nt def="NT-content">content</nt>
  1633.                         <nt def="NT-ETag">ETag</nt>
  1634.                     </rhs>
  1635.                     <wfc def="GIMatch"/>
  1636.                     <vc def="elementvalid"/>
  1637.                 </prod>
  1638.             </scrap>
  1639.             <p>This specification does not constrain the semantics, use, or (beyond
  1640. syntax) names of the element types and attributes, except that names
  1641. beginning with a match to <code>(('X'|'x')('M'|'m')('L'|'l'))</code>
  1642. are reserved for standardization in this or future versions of this
  1643. specification.
  1644. </p>
  1645.             <wfcnote id="GIMatch">
  1646.                 <head>Element Type Match</head>
  1647.                 <p>
  1648. The <nt def="NT-Name">Name</nt> in an element's end-tag must match 
  1649. the element type in
  1650. the start-tag.
  1651. </p>
  1652.             </wfcnote>
  1653.             <vcnote id="elementvalid">
  1654.                 <head>Element Valid</head>
  1655.                 <p>An element is
  1656. valid if
  1657. there is a declaration matching 
  1658. <nt def="NT-elementdecl">elementdecl</nt> where the
  1659. <nt def="NT-Name">Name</nt> matches the element type, and
  1660. one of the following holds:</p>
  1661.                 <olist>
  1662.                     <item>
  1663.                         <p>The declaration matches <kw>EMPTY</kw> and the element has no 
  1664. <termref def="dt-content">content</termref>.</p>
  1665.                     </item>
  1666.                     <item>
  1667.                         <p>The declaration matches <nt def="NT-children">children</nt> and
  1668. the sequence of 
  1669. <termref def="dt-parentchild">child elements</termref>
  1670. belongs to the language generated by the regular expression in
  1671. the content model, with optional white space (characters 
  1672. matching the nonterminal <nt def="NT-S">S</nt>) between each pair
  1673. of child elements.</p>
  1674.                     </item>
  1675.                     <item>
  1676.                         <p>The declaration matches <nt def="NT-Mixed">Mixed</nt> and 
  1677. the content consists of <termref def="dt-chardata">character 
  1678. data</termref> and <termref def="dt-parentchild">child elements</termref>
  1679. whose types match names in the content model.</p>
  1680.                     </item>
  1681.                     <item>
  1682.                         <p>The declaration matches <kw>ANY</kw>, and the types
  1683. of any <termref def="dt-parentchild">child elements</termref> have
  1684. been declared.</p>
  1685.                     </item>
  1686.                 </olist>
  1687.             </vcnote>
  1688.             <div2 id="sec-starttags">
  1689.                 <head>Start-Tags, End-Tags, and Empty-Element Tags</head>
  1690.                 <p>
  1691.                     <termdef id="dt-stag" term="Start-Tag">The beginning of every
  1692. non-empty XML element is marked by a <term>start-tag</term>.
  1693. <scrap lang="ebnf">
  1694.                             <head>Start-tag</head>
  1695.                             <prodgroup pcw2="6" pcw4="15" pcw5="11.5">
  1696.                                 <prod id="NT-STag">
  1697.                                     <lhs>STag</lhs>
  1698.                                     <rhs>'<' <nt def="NT-Name">Name</nt> 
  1699. (<nt def="NT-S">S</nt>
  1700.                                         <nt def="NT-Attribute">Attribute</nt>)* 
  1701. <nt def="NT-S">S</nt>? '>'</rhs>
  1702.                                     <wfc def="uniqattspec"/>
  1703.                                 </prod>
  1704.                                 <prod id="NT-Attribute">
  1705.                                     <lhs>Attribute</lhs>
  1706.                                     <rhs>
  1707.                                         <nt def="NT-Name">Name</nt>
  1708.                                         <nt def="NT-Eq">Eq</nt>
  1709.                                         <nt def="NT-AttValue">AttValue</nt>
  1710.                                     </rhs>
  1711.                                     <vc def="ValueType"/>
  1712.                                     <wfc def="NoExternalRefs"/>
  1713.                                     <wfc def="CleanAttrVals"/>
  1714.                                 </prod>
  1715.                             </prodgroup>
  1716.                         </scrap>
  1717. The <nt def="NT-Name">Name</nt> in
  1718. the start- and end-tags gives the 
  1719. element's <term>type</term>.</termdef>
  1720.                     <termdef id="dt-attr" term="Attribute">
  1721. The <nt def="NT-Name">Name</nt>-<nt def="NT-AttValue">AttValue</nt> pairs are
  1722. referred to as 
  1723. the <term>attribute specifications</term> of the element</termdef>,
  1724. <termdef id="dt-attrname" term="Attribute Name">with the 
  1725. <nt def="NT-Name">Name</nt> in each pair
  1726. referred to as the <term>attribute name</term>
  1727.                     </termdef> and
  1728. <termdef id="dt-attrval" term="Attribute Value">the content of the
  1729. <nt def="NT-AttValue">AttValue</nt> (the text between the
  1730. <code>'</code> or <code>"</code> delimiters)
  1731. as the <term>attribute value</term>.</termdef>
  1732.                 </p>
  1733.                 <wfcnote id="uniqattspec">
  1734.                     <head>Unique Att Spec</head>
  1735.                     <p>
  1736. No attribute name may appear more than once in the same start-tag
  1737. or empty-element tag.
  1738. </p>
  1739.                 </wfcnote>
  1740.                 <vcnote id="ValueType">
  1741.                     <head>Attribute Value Type</head>
  1742.                     <p>
  1743. The attribute must have been declared; the value must be of the type 
  1744. declared for it.
  1745. (For attribute types, see <specref ref="attdecls"/>.)
  1746. </p>
  1747.                 </vcnote>
  1748.                 <wfcnote id="NoExternalRefs">
  1749.                     <head>No External Entity References</head>
  1750.                     <p>
  1751. Attribute values cannot contain direct or indirect entity references 
  1752. to external entities.
  1753. </p>
  1754.                 </wfcnote>
  1755.                 <wfcnote id="CleanAttrVals">
  1756.                     <head>No <code><</code> in Attribute Values</head>
  1757.                     <p>The <termref def="dt-repltext">replacement text</termref> of any entity
  1758. referred to directly or indirectly in an attribute
  1759. value (other than "<code>&lt;</code>") must not contain
  1760. a <code><</code>.
  1761. </p>
  1762.                 </wfcnote>
  1763.                 <p>An example of a start-tag:
  1764. <eg><termdef id="dt-dog" term="dog"></eg>
  1765.                 </p>
  1766.                 <p>
  1767.                     <termdef id="dt-etag" term="End Tag">The end of every element 
  1768. that begins with a start-tag must
  1769. be marked by an <term>end-tag</term>
  1770. containing a name that echoes the element's type as given in the
  1771. start-tag:
  1772. <scrap lang="ebnf">
  1773.                             <head>End-tag</head>
  1774.                             <prodgroup pcw2="6" pcw4="15" pcw5="11.5">
  1775.                                 <prod id="NT-ETag">
  1776.                                     <lhs>ETag</lhs>
  1777.                                     <rhs>'</' <nt def="NT-Name">Name</nt>
  1778.                                         <nt def="NT-S">S</nt>? '>'</rhs>
  1779.                                 </prod>
  1780.                             </prodgroup>
  1781.                         </scrap>
  1782.                     </termdef>
  1783.                 </p>
  1784.                 <p>An example of an end-tag:<eg></termdef></eg>
  1785.                 </p>
  1786.                 <p>
  1787.                     <termdef id="dt-content" term="Content">The 
  1788. <termref def="dt-text">text</termref> between the start-tag and
  1789. end-tag is called the element's
  1790. <term>content</term>:
  1791. <scrap lang="ebnf">
  1792.                             <head>Content of Elements</head>
  1793.                             <prodgroup pcw2="6" pcw4="15" pcw5="11.5">
  1794.                                 <prod id="NT-content">
  1795.                                     <lhs>content</lhs>
  1796.                                     <rhs>(<nt def="NT-element">element</nt> | <nt def="NT-CharData">CharData</nt> 
  1797. | <nt def="NT-Reference">Reference</nt> | <nt def="NT-CDSect">CDSect</nt> 
  1798. | <nt def="NT-PI">PI</nt> | <nt def="NT-Comment">Comment</nt>)*</rhs>
  1799.                                 </prod>
  1800.                             </prodgroup>
  1801.                         </scrap>
  1802.                     </termdef>
  1803.                 </p>
  1804.                 <p>
  1805.                     <termdef id="dt-empty" term="Empty">If an element is <term>empty</term>,
  1806. it must be represented either by a start-tag immediately followed
  1807. by an end-tag or by an empty-element tag.</termdef>
  1808.                     <termdef id="dt-eetag" term="empty-element tag">An 
  1809. <term>empty-element tag</term> takes a special form:
  1810. <scrap lang="ebnf">
  1811.                             <head>Tags for Empty Elements</head>
  1812.                             <prodgroup pcw2="6" pcw4="15" pcw5="11.5">
  1813.                                 <prod id="NT-EmptyElemTag">
  1814.                                     <lhs>EmptyElemTag</lhs>
  1815.                                     <rhs>'<' <nt def="NT-Name">Name</nt> (<nt def="NT-S">S</nt>
  1816.                                         <nt def="NT-Attribute">Attribute</nt>)* <nt def="NT-S">S</nt>? 
  1817. '/>'</rhs>
  1818.                                     <wfc def="uniqattspec"/>
  1819.                                 </prod>
  1820.                             </prodgroup>
  1821.                         </scrap>
  1822.                     </termdef>
  1823.                 </p>
  1824.                 <p>Empty-element tags may be used for any element which has no
  1825. content, whether or not it is declared using the keyword
  1826. <kw>EMPTY</kw>.
  1827. <termref def="dt-interop">For interoperability</termref>, the empty-element
  1828. tag must be used, and can only be used, for elements which are
  1829. <termref def="dt-eldecl">declared</termref>
  1830.                     <kw>EMPTY</kw>.</p>
  1831.                 <p>Examples of empty elements:
  1832. <eg><IMG align="left"
  1833.  src="http://www.w3.org/Icons/WWW/w3c_home" />
  1834. <br></br>
  1835. <br/></eg>
  1836.                 </p>
  1837.             </div2>
  1838.             <div2 id="elemdecls">
  1839.                 <head>Element Type Declarations</head>
  1840.                 <p>The <termref def="dt-element">element</termref> structure of an
  1841. <termref def="dt-xml-doc">XML document</termref> may, for 
  1842. <termref def="dt-valid">validation</termref> purposes, 
  1843. be constrained
  1844. using element type and attribute-list declarations.
  1845. An element type declaration constrains the element's
  1846. <termref def="dt-content">content</termref>.
  1847. </p>
  1848.                 <p>Element type declarations often constrain which element types can
  1849. appear as <termref def="dt-parentchild">children</termref> of the element.
  1850. At user option, an XML processor may issue a warning
  1851. when a declaration mentions an element type for which no declaration
  1852. is provided, but this is not an error.</p>
  1853.                 <p>
  1854.                     <termdef id="dt-eldecl" term="Element Type declaration">An <term>element
  1855. type declaration</term> takes the form:
  1856. <scrap lang="ebnf">
  1857.                             <head>Element Type Declaration</head>
  1858.                             <prodgroup pcw2="5.5" pcw4="18" pcw5="9">
  1859.                                 <prod id="NT-elementdecl">
  1860.                                     <lhs>elementdecl</lhs>
  1861.                                     <rhs>'<!ELEMENT' <nt def="NT-S">S</nt>
  1862.                                         <nt def="NT-Name">Name</nt>
  1863.                                         <nt def="NT-S">S</nt>
  1864.                                         <nt def="NT-contentspec">contentspec</nt>
  1865.                                         <nt def="NT-S">S</nt>? '>'</rhs>
  1866.                                     <vc def="EDUnique"/>
  1867.                                 </prod>
  1868.                                 <prod id="NT-contentspec">
  1869.                                     <lhs>contentspec</lhs>
  1870.                                     <rhs>'EMPTY' 
  1871. | 'ANY' 
  1872. | <nt def="NT-Mixed">Mixed</nt> 
  1873. | <nt def="NT-children">children</nt>
  1874.                                     </rhs>
  1875.                                 </prod>
  1876.                             </prodgroup>
  1877.                         </scrap>
  1878. where the <nt def="NT-Name">Name</nt> gives the element type 
  1879. being declared.</termdef>
  1880.                 </p>
  1881.                 <vcnote id="EDUnique">
  1882.                     <head>Unique Element Type Declaration</head>
  1883.                     <p>
  1884. No element type may be declared more than once.
  1885. </p>
  1886.                 </vcnote>
  1887.                 <p>Examples of element type declarations:
  1888. <eg><!ELEMENT br EMPTY>
  1889. <!ELEMENT p (#PCDATA|emph)* >
  1890. <!ELEMENT %name.para; %content.para; >
  1891. <!ELEMENT container ANY></eg>
  1892.                 </p>
  1893.                 <div3 id="sec-element-content">
  1894.                     <head>Element Content</head>
  1895.                     <p>
  1896.                         <termdef id="dt-elemcontent" term="Element content">An element <termref def="dt-stag">type</termref> has
  1897. <term>element content</term> when elements of that
  1898. type must contain only <termref def="dt-parentchild">child</termref> 
  1899. elements (no character data), optionally separated by 
  1900. white space (characters matching the nonterminal 
  1901. <nt def="NT-S">S</nt>).
  1902. </termdef>
  1903. In this case, the
  1904. constraint includes a content model, a simple grammar governing
  1905. the allowed types of the child
  1906. elements and the order in which they are allowed to appear.  
  1907. The grammar is built on
  1908. content particles (<nt def="NT-cp">cp</nt>s), which consist of names, 
  1909. choice lists of content particles, or
  1910. sequence lists of content particles:
  1911. <scrap lang="ebnf">
  1912.                             <head>Element-content Models</head>
  1913.                             <prodgroup pcw2="5.5" pcw4="16" pcw5="11">
  1914.                                 <prod id="NT-children">
  1915.                                     <lhs>children</lhs>
  1916.                                     <rhs>(<nt def="NT-choice">choice</nt> 
  1917. | <nt def="NT-seq">seq</nt>) 
  1918. ('?' | '*' | '+')?</rhs>
  1919.                                 </prod>
  1920.                                 <prod id="NT-cp">
  1921.                                     <lhs>cp</lhs>
  1922.                                     <rhs>(<nt def="NT-Name">Name</nt> 
  1923. | <nt def="NT-choice">choice</nt> 
  1924. | <nt def="NT-seq">seq</nt>) 
  1925. ('?' | '*' | '+')?</rhs>
  1926.                                 </prod>
  1927.                                 <prod id="NT-choice">
  1928.                                     <lhs>choice</lhs>
  1929.                                     <rhs>'(' <nt def="NT-S">S</nt>? cp 
  1930. ( <nt def="NT-S">S</nt>? '|' <nt def="NT-S">S</nt>? <nt def="NT-cp">cp</nt> )*
  1931. <nt def="NT-S">S</nt>? ')'</rhs>
  1932.                                     <vc def="vc-PEinGroup"/>
  1933.                                 </prod>
  1934.                                 <prod id="NT-seq">
  1935.                                     <lhs>seq</lhs>
  1936.                                     <rhs>'(' <nt def="NT-S">S</nt>? cp 
  1937. ( <nt def="NT-S">S</nt>? ',' <nt def="NT-S">S</nt>? <nt def="NT-cp">cp</nt> )*
  1938. <nt def="NT-S">S</nt>? ')'</rhs>
  1939.                                     <vc def="vc-PEinGroup"/>
  1940.                                 </prod>
  1941.                             </prodgroup>
  1942.                         </scrap>
  1943. where each <nt def="NT-Name">Name</nt> is the type of an element which may
  1944. appear as a <termref def="dt-parentchild">child</termref>.  
  1945. Any content
  1946. particle in a choice list may appear in the <termref def="dt-elemcontent">element content</termref> at the location where
  1947. the choice list appears in the grammar;
  1948. content particles occurring in a sequence list must each
  1949. appear in the <termref def="dt-elemcontent">element content</termref> in the
  1950. order given in the list.  
  1951. The optional character following a name or list governs
  1952. whether the element or the content particles in the list may occur one
  1953. or more (<code>+</code>), zero or more (<code>*</code>), or zero or 
  1954. one times (<code>?</code>).  
  1955. The absence of such an operator means that the element or content particle
  1956. must appear exactly once.
  1957. This syntax
  1958. and meaning are identical to those used in the productions in this
  1959. specification.</p>
  1960.                     <p>
  1961. The content of an element matches a content model if and only if it is
  1962. possible to trace out a path through the content model, obeying the
  1963. sequence, choice, and repetition operators and matching each element in
  1964. the content against an element type in the content model.  <termref def="dt-compat">For compatibility</termref>, it is an error
  1965. if an element in the document can
  1966. match more than one occurrence of an element type in the content model.
  1967. For more information, see <specref ref="determinism"/>.
  1968. <!-- appendix <specref ref="determinism"/>. -->
  1969.                         <!-- appendix on deterministic content models. -->
  1970.                     </p>
  1971.                     <vcnote id="vc-PEinGroup">
  1972.                         <head>Proper Group/PE Nesting</head>
  1973.                         <p>Parameter-entity 
  1974. <termref def="dt-repltext">replacement text</termref> must be properly nested
  1975. with parenthetized groups.
  1976. That is to say, if either of the opening or closing parentheses
  1977. in a <nt def="NT-choice">choice</nt>, <nt def="NT-seq">seq</nt>, or
  1978. <nt def="NT-Mixed">Mixed</nt> construct 
  1979. is contained in the replacement text for a 
  1980. <termref def="dt-PERef">parameter entity</termref>,
  1981. both must be contained in the same replacement text.</p>
  1982.                         <p>
  1983.                             <termref def="dt-interop">For interoperability</termref>, 
  1984. if a parameter-entity reference appears in a 
  1985. <nt def="NT-choice">choice</nt>, <nt def="NT-seq">seq</nt>, or
  1986. <nt def="NT-Mixed">Mixed</nt> construct, its replacement text
  1987. should not be empty, and 
  1988. neither the first nor last non-blank
  1989. character of the replacement text should be a connector 
  1990. (<code>|</code> or <code>,</code>).
  1991. </p>
  1992.                     </vcnote>
  1993.                     <p>Examples of element-content models:
  1994. <eg><!ELEMENT spec (front, body, back?)>
  1995. <!ELEMENT div1 (head, (p | list | note)*, div2*)>
  1996. <!ELEMENT dictionary-body (%div.mix; | %dict.mix;)*></eg>
  1997.                     </p>
  1998.                 </div3>
  1999.                 <div3 id="sec-mixed-content">
  2000.                     <head>Mixed Content</head>
  2001.                     <p>
  2002.                         <termdef id="dt-mixed" term="Mixed Content">An element 
  2003. <termref def="dt-stag">type</termref> has 
  2004. <term>mixed content</term> when elements of that type may contain
  2005. character data, optionally interspersed with
  2006. <termref def="dt-parentchild">child</termref> elements.</termdef>
  2007. In this case, the types of the child elements
  2008. may be constrained, but not their order or their number of occurrences:
  2009. <scrap lang="ebnf">
  2010.                             <head>Mixed-content Declaration</head>
  2011.                             <prodgroup pcw2="5.5" pcw4="16" pcw5="11">
  2012.                                 <prod id="NT-Mixed">
  2013.                                     <lhs>Mixed</lhs>
  2014.                                     <rhs>'(' <nt def="NT-S">S</nt>? 
  2015. '#PCDATA'
  2016. (<nt def="NT-S">S</nt>? 
  2017. '|' 
  2018. <nt def="NT-S">S</nt>? 
  2019. <nt def="NT-Name">Name</nt>)* 
  2020. <nt def="NT-S">S</nt>? 
  2021. ')*' </rhs>
  2022.                                     <rhs>| '(' <nt def="NT-S">S</nt>? '#PCDATA' <nt def="NT-S">S</nt>? ')'
  2023. </rhs>
  2024.                                     <vc def="vc-PEinGroup"/>
  2025.                                     <vc def="vc-MixedChildrenUnique"/>
  2026.                                 </prod>
  2027.                             </prodgroup>
  2028.                         </scrap>
  2029. where the <nt def="NT-Name">Name</nt>s give the types of elements
  2030. that may appear as children.
  2031. </p>
  2032.                     <vcnote id="vc-MixedChildrenUnique">
  2033.                         <head>No Duplicate Types</head>
  2034.                         <p>The same name must not appear more than once in a single mixed-content
  2035. declaration.
  2036. </p>
  2037.                     </vcnote>
  2038.                     <p>Examples of mixed content declarations:
  2039. <eg><!ELEMENT p (#PCDATA|a|ul|b|i|em)*>
  2040. <!ELEMENT p (#PCDATA | %font; | %phrase; | %special; | %form;)* >
  2041. <!ELEMENT b (#PCDATA)></eg>
  2042.                     </p>
  2043.                 </div3>
  2044.             </div2>
  2045.             <div2 id="attdecls">
  2046.                 <head>Attribute-List Declarations</head>
  2047.                 <p>
  2048.                     <termref def="dt-attr">Attributes</termref> are used to associate
  2049. name-value pairs with <termref def="dt-element">elements</termref>.
  2050. Attribute specifications may appear only within <termref def="dt-stag">start-tags</termref>
  2051. and <termref def="dt-eetag">empty-element tags</termref>; 
  2052. thus, the productions used to
  2053. recognize them appear in <specref ref="sec-starttags"/>.  
  2054. Attribute-list
  2055. declarations may be used:
  2056. <ulist>
  2057.                         <item>
  2058.                             <p>To define the set of attributes pertaining to a given
  2059. element type.</p>
  2060.                         </item>
  2061.                         <item>
  2062.                             <p>To establish type constraints for these
  2063. attributes.</p>
  2064.                         </item>
  2065.                         <item>
  2066.                             <p>To provide <termref def="dt-default">default values</termref>
  2067. for attributes.</p>
  2068.                         </item>
  2069.                     </ulist>
  2070.                 </p>
  2071.                 <p>
  2072.                     <termdef id="dt-attdecl" term="Attribute-List Declaration">
  2073.                         <term>Attribute-list declarations</term> specify the name, data type, and default
  2074. value (if any) of each attribute associated with a given element type:
  2075. <scrap lang="ebnf">
  2076.                             <head>Attribute-list Declaration</head>
  2077.                             <prod id="NT-AttlistDecl">
  2078.                                 <lhs>AttlistDecl</lhs>
  2079.                                 <rhs>'<!ATTLIST' <nt def="NT-S">S</nt>
  2080.                                     <nt def="NT-Name">Name</nt>
  2081.                                     <nt def="NT-AttDef">AttDef</nt>*
  2082. <nt def="NT-S">S</nt>? '>'</rhs>
  2083.                             </prod>
  2084.                             <prod id="NT-AttDef">
  2085.                                 <lhs>AttDef</lhs>
  2086.                                 <rhs>
  2087.                                     <nt def="NT-S">S</nt>
  2088.                                     <nt def="NT-Name">Name</nt>
  2089.                                     <nt def="NT-S">S</nt>
  2090.                                     <nt def="NT-AttType">AttType</nt>
  2091.                                     <nt def="NT-S">S</nt>
  2092.                                     <nt def="NT-DefaultDecl">DefaultDecl</nt>
  2093.                                 </rhs>
  2094.                             </prod>
  2095.                         </scrap>
  2096. The <nt def="NT-Name">Name</nt> in the
  2097. <nt def="NT-AttlistDecl">AttlistDecl</nt> rule is the type of an element.  At
  2098. user option, an XML processor may issue a warning if attributes are
  2099. declared for an element type not itself declared, but this is not an
  2100. error.  The <nt def="NT-Name">Name</nt> in the 
  2101. <nt def="NT-AttDef">AttDef</nt> rule is
  2102. the name of the attribute.</termdef>
  2103.                 </p>
  2104.                 <p>
  2105. When more than one <nt def="NT-AttlistDecl">AttlistDecl</nt> is provided for a
  2106. given element type, the contents of all those provided are merged.  When
  2107. more than one definition is provided for the same attribute of a
  2108. given element type, the first declaration is binding and later
  2109. declarations are ignored.  
  2110. <termref def="dt-interop">For interoperability,</termref> writers of DTDs
  2111. may choose to provide at most one attribute-list declaration
  2112. for a given element type, at most one attribute definition
  2113. for a given attribute name, and at least one attribute definition
  2114. in each attribute-list declaration.
  2115. For interoperability, an XML processor may at user option
  2116. issue a warning when more than one attribute-list declaration is
  2117. provided for a given element type, or more than one attribute definition
  2118. is provided 
  2119. for a given attribute, but this is not an error.
  2120. </p>
  2121.                 <div3 id="sec-attribute-types">
  2122.                     <head>Attribute Types</head>
  2123.                     <p>XML attribute types are of three kinds:  a string type, a
  2124. set of tokenized types, and enumerated types.  The string type may take
  2125. any literal string as a value; the tokenized types have varying lexical
  2126. and semantic constraints, as noted:
  2127. <scrap lang="ebnf">
  2128.                             <head>Attribute Types</head>
  2129.                             <prodgroup pcw4="14" pcw5="11.5">
  2130.                                 <prod id="NT-AttType">
  2131.                                     <lhs>AttType</lhs>
  2132.                                     <rhs>
  2133.                                         <nt def="NT-StringType">StringType</nt> 
  2134. | <nt def="NT-TokenizedType">TokenizedType</nt> 
  2135. | <nt def="NT-EnumeratedType">EnumeratedType</nt>
  2136.                                     </rhs>
  2137.                                 </prod>
  2138.                                 <prod id="NT-StringType">
  2139.                                     <lhs>StringType</lhs>
  2140.                                     <rhs>'CDATA'</rhs>
  2141.                                 </prod>
  2142.                                 <prod id="NT-TokenizedType">
  2143.                                     <lhs>TokenizedType</lhs>
  2144.                                     <rhs>'ID'</rhs>
  2145.                                     <vc def="id"/>
  2146.                                     <vc def="one-id-per-el"/>
  2147.                                     <vc def="id-default"/>
  2148.                                     <rhs>| 'IDREF'</rhs>
  2149.                                     <vc def="idref"/>
  2150.                                     <rhs>| 'IDREFS'</rhs>
  2151.                                     <vc def="idref"/>
  2152.                                     <rhs>| 'ENTITY'</rhs>
  2153.                                     <vc def="entname"/>
  2154.                                     <rhs>| 'ENTITIES'</rhs>
  2155.                                     <vc def="entname"/>
  2156.                                     <rhs>| 'NMTOKEN'</rhs>
  2157.                                     <vc def="nmtok"/>
  2158.                                     <rhs>| 'NMTOKENS'</rhs>
  2159.                                     <vc def="nmtok"/>
  2160.                                 </prod>
  2161.                             </prodgroup>
  2162.                         </scrap>
  2163.                     </p>
  2164.                     <vcnote id="id">
  2165.                         <head>ID</head>
  2166.                         <p>
  2167. Values of type <kw>ID</kw> must match the 
  2168. <nt def="NT-Name">Name</nt> production.  
  2169. A name must not appear more than once in
  2170. an XML document as a value of this type; i.e., ID values must uniquely
  2171. identify the elements which bear them.   
  2172. </p>
  2173.                     </vcnote>
  2174.                     <vcnote id="one-id-per-el">
  2175.                         <head>One ID per Element Type</head>
  2176.                         <p>No element type may have more than one ID attribute specified.</p>
  2177.                     </vcnote>
  2178.                     <vcnote id="id-default">
  2179.                         <head>ID Attribute Default</head>
  2180.                         <p>An ID attribute must have a declared default of <kw>#IMPLIED</kw> or
  2181. <kw>#REQUIRED</kw>.</p>
  2182.                     </vcnote>
  2183.                     <vcnote id="idref">
  2184.                         <head>IDREF</head>
  2185.                         <p>
  2186. Values of type <kw>IDREF</kw> must match
  2187. the <nt def="NT-Name">Name</nt> production, and
  2188. values of type <kw>IDREFS</kw> must match
  2189. <nt def="NT-Names">Names</nt>; 
  2190. each <nt def="NT-Name">Name</nt> must match the value of an ID attribute on 
  2191. some element in the XML document; i.e. <kw>IDREF</kw> values must 
  2192. match the value of some ID attribute. 
  2193. </p>
  2194.                     </vcnote>
  2195.                     <vcnote id="entname">
  2196.                         <head>Entity Name</head>
  2197.                         <p>
  2198. Values of type <kw>ENTITY</kw> 
  2199. must match the <nt def="NT-Name">Name</nt> production,
  2200. values of type <kw>ENTITIES</kw> must match
  2201. <nt def="NT-Names">Names</nt>;
  2202. each <nt def="NT-Name">Name</nt> must 
  2203. match the
  2204. name of an <termref def="dt-unparsed">unparsed entity</termref> declared in the
  2205. <termref def="dt-doctype">DTD</termref>.
  2206. </p>
  2207.                     </vcnote>
  2208.                     <vcnote id="nmtok">
  2209.                         <head>Name Token</head>
  2210.                         <p>
  2211. Values of type <kw>NMTOKEN</kw> must match the
  2212. <nt def="NT-Nmtoken">Nmtoken</nt> production;
  2213. values of type <kw>NMTOKENS</kw> must 
  2214. match <termref def="NT-Nmtokens">Nmtokens</termref>.
  2215. </p>
  2216.                     </vcnote>
  2217.                     <!-- why?
  2218. <p>The XML processor must normalize attribute values before
  2219. passing them to the application, as described in 
  2220. <specref ref="AVNormalize"/>.</p>-->
  2221.                     <p>
  2222.                         <termdef id="dt-enumerated" term="Enumerated Attribute
  2223. Values">
  2224.                             <term>Enumerated attributes</term> can take one 
  2225. of a list of values provided in the declaration</termdef>. There are two
  2226. kinds of enumerated types:
  2227. <scrap lang="ebnf">
  2228.                             <head>Enumerated Attribute Types</head>
  2229.                             <prod id="NT-EnumeratedType">
  2230.                                 <lhs>EnumeratedType</lhs>
  2231.                                 <rhs>
  2232.                                     <nt def="NT-NotationType">NotationType</nt> 
  2233. | <nt def="NT-Enumeration">Enumeration</nt>
  2234.                                 </rhs>
  2235.                             </prod>
  2236.                             <prod id="NT-NotationType">
  2237.                                 <lhs>NotationType</lhs>
  2238.                                 <rhs>'NOTATION' 
  2239. <nt def="NT-S">S</nt> 
  2240. '(' 
  2241. <nt def="NT-S">S</nt>?  
  2242. <nt def="NT-Name">Name</nt> 
  2243. (<nt def="NT-S">S</nt>? '|' <nt def="NT-S">S</nt>?  
  2244. <nt def="NT-Name">Name</nt>)*
  2245. <nt def="NT-S">S</nt>? ')'
  2246. </rhs>
  2247.                                 <vc def="notatn"/>
  2248.                             </prod>
  2249.                             <prod id="NT-Enumeration">
  2250.                                 <lhs>Enumeration</lhs>
  2251.                                 <rhs>'(' <nt def="NT-S">S</nt>?
  2252. <nt def="NT-Nmtoken">Nmtoken</nt> 
  2253. (<nt def="NT-S">S</nt>? '|' 
  2254. <nt def="NT-S">S</nt>?  
  2255. <nt def="NT-Nmtoken">Nmtoken</nt>)* 
  2256. <nt def="NT-S">S</nt>? 
  2257. ')'</rhs>
  2258.                                 <vc def="enum"/>
  2259.                             </prod>
  2260.                         </scrap>
  2261. A <kw>NOTATION</kw> attribute identifies a 
  2262. <termref def="dt-notation">notation</termref>, declared in the 
  2263. DTD with associated system and/or public identifiers, to
  2264. be used in interpreting the element to which the attribute
  2265. is attached.
  2266. </p>
  2267.                     <vcnote id="notatn">
  2268.                         <head>Notation Attributes</head>
  2269.                         <p>
  2270. Values of this type must match
  2271. one of the <titleref href="Notations">notation</titleref> names included in
  2272. the declaration; all notation names in the declaration must
  2273. be declared.
  2274. </p>
  2275.                     </vcnote>
  2276.                     <vcnote id="enum">
  2277.                         <head>Enumeration</head>
  2278.                         <p>
  2279. Values of this type
  2280. must match one of the <nt def="NT-Nmtoken">Nmtoken</nt> tokens in the
  2281. declaration. 
  2282. </p>
  2283.                     </vcnote>
  2284.                     <p>
  2285.                         <termref def="dt-interop">For interoperability,</termref> the same
  2286. <nt def="NT-Nmtoken">Nmtoken</nt> should not occur more than once in the
  2287. enumerated attribute types of a single element type.
  2288. </p>
  2289.                 </div3>
  2290.                 <div3 id="sec-attr-defaults">
  2291.                     <head>Attribute Defaults</head>
  2292.                     <p>An <termref def="dt-attdecl">attribute declaration</termref> provides
  2293. information on whether
  2294. the attribute's presence is required, and if not, how an XML processor should
  2295. react if a declared attribute is absent in a document.
  2296. <scrap lang="ebnf">
  2297.                             <head>Attribute Defaults</head>
  2298.                             <prodgroup pcw4="14" pcw5="11.5">
  2299.                                 <prod id="NT-DefaultDecl">
  2300.                                     <lhs>DefaultDecl</lhs>
  2301.                                     <rhs>'#REQUIRED' 
  2302. | '#IMPLIED' </rhs>
  2303.                                     <rhs>| (('#FIXED' S)? <nt def="NT-AttValue">AttValue</nt>)</rhs>
  2304.                                     <vc def="RequiredAttr"/>
  2305.                                     <vc def="defattrvalid"/>
  2306.                                     <wfc def="CleanAttrVals"/>
  2307.                                     <vc def="FixedAttr"/>
  2308.                                 </prod>
  2309.                             </prodgroup>
  2310.                         </scrap>
  2311.                     </p>
  2312.                     <p>In an attribute declaration, <kw>#REQUIRED</kw> means that the
  2313. attribute must always be provided, <kw>#IMPLIED</kw> that no default 
  2314. value is provided.
  2315. <!-- not any more!!
  2316. <kw>#IMPLIED</kw> means that if the attribute is omitted
  2317. from an element of this type,
  2318. the XML processor must inform the application
  2319. that no value was specified; no constraint is placed on the behavior
  2320. of the application. -->
  2321.                         <termdef id="dt-default" term="Attribute Default">If the 
  2322. declaration
  2323. is neither <kw>#REQUIRED</kw> nor <kw>#IMPLIED</kw>, then the
  2324. <nt def="NT-AttValue">AttValue</nt> value contains the declared
  2325. <term>default</term> value; the <kw>#FIXED</kw> keyword states that
  2326. the attribute must always have the default value.
  2327. If a default value
  2328. is declared, when an XML processor encounters an omitted attribute, it
  2329. is to behave as though the attribute were present with 
  2330. the declared default value.</termdef>
  2331.                     </p>
  2332.                     <vcnote id="RequiredAttr">
  2333.                         <head>Required Attribute</head>
  2334.                         <p>If the default declaration is the keyword <kw>#REQUIRED</kw>, then
  2335. the attribute must be specified for
  2336. all elements of the type in the attribute-list declaration.
  2337. </p>
  2338.                     </vcnote>
  2339.                     <vcnote id="defattrvalid">
  2340.                         <head>Attribute Default Legal</head>
  2341.                         <p>
  2342. The declared
  2343. default value must meet the lexical constraints of the declared attribute type.
  2344. </p>
  2345.                     </vcnote>
  2346.                     <vcnote id="FixedAttr">
  2347.                         <head>Fixed Attribute Default</head>
  2348.                         <p>If an attribute has a default value declared with the 
  2349. <kw>#FIXED</kw> keyword, instances of that attribute must
  2350. match the default value.
  2351. </p>
  2352.                     </vcnote>
  2353.                     <p>Examples of attribute-list declarations:
  2354. <eg><!ATTLIST termdef
  2355.           id      ID      #REQUIRED
  2356.           name    CDATA   #IMPLIED>
  2357. <!ATTLIST list
  2358.           type    (bullets|ordered|glossary)  "ordered">
  2359. <!ATTLIST form
  2360.           method  CDATA   #FIXED "POST"></eg>
  2361.                     </p>
  2362.                 </div3>
  2363.                 <div3 id="AVNormalize">
  2364.                     <head>Attribute-Value Normalization</head>
  2365.                     <p>Before the value of an attribute is passed to the application
  2366. or checked for validity, the
  2367. XML processor must normalize it as follows:
  2368. <ulist>
  2369.                             <item>
  2370.                                 <p>a character reference is processed by appending the referenced    
  2371. character to the attribute value</p>
  2372.                             </item>
  2373.                             <item>
  2374.                                 <p>an entity reference is processed by recursively processing the
  2375. replacement text of the entity</p>
  2376.                             </item>
  2377.                             <item>
  2378.                                 <p>a whitespace character (#x20, #xD, #xA, #x9) is processed by
  2379. appending #x20 to the normalized value, except that only a single #x20
  2380. is appended for a "#xD#xA" sequence that is part of an external
  2381. parsed entity or the literal entity value of an internal parsed
  2382. entity</p>
  2383.                             </item>
  2384.                             <item>
  2385.                                 <p>other characters are processed by appending them to the normalized
  2386. value</p>
  2387.                             </item>
  2388.                         </ulist>
  2389.                     </p>
  2390.                     <p>If the declared value is not CDATA, then the XML processor must
  2391. further process the normalized attribute value by discarding any
  2392. leading and trailing space (#x20) characters, and by replacing
  2393. sequences of space (#x20) characters by a single space (#x20)
  2394. character.</p>
  2395.                     <p>
  2396. All attributes for which no declaration has been read should be treated
  2397. by a non-validating parser as if declared
  2398. <kw>CDATA</kw>.
  2399. </p>
  2400.                 </div3>
  2401.             </div2>
  2402.             <div2 id="sec-condition-sect">
  2403.                 <head>Conditional Sections</head>
  2404.                 <p>
  2405.                     <termdef id="dt-cond-section" term="conditional section">
  2406.                         <term>Conditional sections</term> are portions of the
  2407. <termref def="dt-doctype">document type declaration external subset</termref>
  2408. which are 
  2409. included in, or excluded from, the logical structure of the DTD based on
  2410. the keyword which governs them.</termdef>
  2411.                     <scrap lang="ebnf">
  2412.                         <head>Conditional Section</head>
  2413.                         <prodgroup pcw2="9" pcw4="14.5">
  2414.                             <prod id="NT-conditionalSect">
  2415.                                 <lhs>conditionalSect</lhs>
  2416.                                 <rhs>
  2417.                                     <nt def="NT-includeSect">includeSect</nt>
  2418. | <nt def="NT-ignoreSect">ignoreSect</nt>
  2419.                                 </rhs>
  2420.                             </prod>
  2421.                             <prod id="NT-includeSect">
  2422.                                 <lhs>includeSect</lhs>
  2423.                                 <rhs>'<![' S? 'INCLUDE' S? '[' 
  2424.  
  2425. <nt def="NT-extSubsetDecl">extSubsetDecl</nt>
  2426. ']]>'
  2427. </rhs>
  2428.                             </prod>
  2429.                             <prod id="NT-ignoreSect">
  2430.                                 <lhs>ignoreSect</lhs>
  2431.                                 <rhs>'<![' S? 'IGNORE' S? '[' 
  2432. <nt def="NT-ignoreSectContents">ignoreSectContents</nt>*
  2433. ']]>'</rhs>
  2434.                             </prod>
  2435.                             <prod id="NT-ignoreSectContents">
  2436.                                 <lhs>ignoreSectContents</lhs>
  2437.                                 <rhs>
  2438.                                     <nt def="NT-Ignore">Ignore</nt>
  2439. ('<![' <nt def="NT-ignoreSectContents">ignoreSectContents</nt> ']]>' 
  2440. <nt def="NT-Ignore">Ignore</nt>)*</rhs>
  2441.                             </prod>
  2442.                             <prod id="NT-Ignore">
  2443.                                 <lhs>Ignore</lhs>
  2444.                                 <rhs>
  2445.                                     <nt def="NT-Char">Char</nt>* - 
  2446. (<nt def="NT-Char">Char</nt>* ('<![' | ']]>') 
  2447. <nt def="NT-Char">Char</nt>*)
  2448. </rhs>
  2449.                             </prod>
  2450.                         </prodgroup>
  2451.                     </scrap>
  2452.                 </p>
  2453.                 <p>Like the internal and external DTD subsets, a conditional section
  2454. may contain one or more complete declarations,
  2455. comments, processing instructions, 
  2456. or nested conditional sections, intermingled with white space.
  2457. </p>
  2458.                 <p>If the keyword of the
  2459. conditional section is <kw>INCLUDE</kw>, then the contents of the conditional
  2460. section are part of the DTD.
  2461. If the keyword of the conditional
  2462. section is <kw>IGNORE</kw>, then the contents of the conditional section are
  2463. not logically part of the DTD.
  2464. Note that for reliable parsing, the contents of even ignored
  2465. conditional sections must be read in order to
  2466. detect nested conditional sections and ensure that the end of the
  2467. outermost (ignored) conditional section is properly detected.
  2468. If a conditional section with a
  2469. keyword of <kw>INCLUDE</kw> occurs within a larger conditional
  2470. section with a keyword of <kw>IGNORE</kw>, both the outer and the
  2471. inner conditional sections are ignored.</p>
  2472.                 <p>If the keyword of the conditional section is a 
  2473. parameter-entity reference, the parameter entity must be replaced by its
  2474. content before the processor decides whether to
  2475. include or ignore the conditional section.</p>
  2476.                 <p>An example:
  2477. <eg><!ENTITY % draft 'INCLUDE' >
  2478. <!ENTITY % final 'IGNORE' >
  2479.  
  2480. <![%draft;[
  2481. <!ELEMENT book (comments*, title, body, supplements?)>
  2482. ]]>
  2483. <![%final;[
  2484. <!ELEMENT book (title, body, supplements?)>
  2485. ]]>
  2486. </eg>
  2487.                 </p>
  2488.             </div2>
  2489.             <!-- 
  2490. <div2 id='sec-pass-to-app'>
  2491. <head>XML Processor Treatment of Logical Structure</head>
  2492. <p>When an XML processor encounters a start-tag, it must make
  2493. at least the following information available to the application:
  2494. <ulist>
  2495. <item>
  2496. <p>the element type's generic identifier</p>
  2497. </item>
  2498. <item>
  2499. <p>the names of attributes known to apply to this element type
  2500. (validating processors must make available names of all attributes
  2501. declared for the element type; non-validating processors must
  2502. make available at least the names of the attributes for which
  2503. values are specified.
  2504. </p>
  2505. </item>
  2506. </ulist>
  2507. </p>
  2508. </div2>
  2509. -->
  2510.         </div1>
  2511.         <!-- &Entities; -->
  2512.         <div1 id="sec-physical-struct">
  2513.             <head>Physical Structures</head>
  2514.             <p>
  2515.                 <termdef id="dt-entity" term="Entity">An XML document may consist
  2516. of one or many storage units.   These are called
  2517. <term>entities</term>; they all have <term>content</term> and are all
  2518. (except for the document entity, see below, and 
  2519. the <termref def="dt-doctype">external DTD subset</termref>) 
  2520. identified by <term>name</term>.
  2521. </termdef>
  2522. Each XML document has one entity
  2523. called the <termref def="dt-docent">document entity</termref>, which serves
  2524. as the starting point for the <termref def="dt-xml-proc">XML
  2525. processor</termref> and may contain the whole document.</p>
  2526.             <p>Entities may be either parsed or unparsed.
  2527. <termdef id="dt-parsedent" term="Text Entity">A <term>parsed entity's</term>
  2528. contents are referred to as its 
  2529. <termref def="dt-repltext">replacement text</termref>;
  2530. this <termref def="dt-text">text</termref> is considered an
  2531. integral part of the document.</termdef>
  2532.             </p>
  2533.             <p>
  2534.                 <termdef id="dt-unparsed" term="Unparsed Entity">An 
  2535. <term>unparsed entity</term> 
  2536. is a resource whose contents may or may not be
  2537. <termref def="dt-text">text</termref>, and if text, may not be XML.
  2538. Each unparsed entity
  2539. has an associated <termref def="dt-notation">notation</termref>, identified by name.
  2540. Beyond a requirement
  2541. that an XML processor make the identifiers for the entity and 
  2542. notation available to the application,
  2543. XML places no constraints on the contents of unparsed entities.</termdef>
  2544.             </p>
  2545.             <p>
  2546. Parsed entities are invoked by name using entity references;
  2547. unparsed entities by name, given in the value of <kw>ENTITY</kw>
  2548. or <kw>ENTITIES</kw>
  2549. attributes.</p>
  2550.             <p>
  2551.                 <termdef id="gen-entity" term="general entity">
  2552.                     <term>General entities</term>
  2553. are entities for use within the document content.
  2554. In this specification, general entities are sometimes referred 
  2555. to with the unqualified term <emph>entity</emph> when this leads
  2556. to no ambiguity.</termdef>
  2557.                 <termdef id="dt-PE" term="Parameter entity">Parameter entities 
  2558. are parsed entities for use within the DTD.</termdef>
  2559. These two types of entities use different forms of reference and
  2560. are recognized in different contexts.
  2561. Furthermore, they occupy different namespaces; a parameter entity and
  2562. a general entity with the same name are two distinct entities.
  2563. </p>
  2564.             <div2 id="sec-references">
  2565.                 <head>Character and Entity References</head>
  2566.                 <p>
  2567.                     <termdef id="dt-charref" term="Character Reference">
  2568. A <term>character reference</term> refers to a specific character in the
  2569. ISO/IEC 10646 character set, for example one not directly accessible from
  2570. available input devices.
  2571. <scrap lang="ebnf">
  2572.                             <head>Character Reference</head>
  2573.                             <prod id="NT-CharRef">
  2574.                                 <lhs>CharRef</lhs>
  2575.                                 <rhs>'&#' [0-9]+ ';' </rhs>
  2576.                                 <rhs>| '&hcro;' [0-9a-fA-F]+ ';'</rhs>
  2577.                                 <wfc def="wf-Legalchar"/>
  2578.                             </prod>
  2579.                         </scrap>
  2580.                         <wfcnote id="wf-Legalchar">
  2581.                             <head>Legal Character</head>
  2582.                             <p>Characters referred to using character references must
  2583. match the production for
  2584. <termref def="NT-Char">Char</termref>.</p>
  2585.                         </wfcnote>
  2586. If the character reference begins with "<code>&#x</code>", the digits and
  2587. letters up to the terminating <code>;</code> provide a hexadecimal
  2588. representation of the character's code point in ISO/IEC 10646.
  2589. If it begins just with "<code>&#</code>", the digits up to the terminating
  2590. <code>;</code> provide a decimal representation of the character's 
  2591. code point.
  2592. </termdef>
  2593.                 </p>
  2594.                 <p>
  2595.                     <termdef id="dt-entref" term="Entity Reference">An <term>entity
  2596. reference</term> refers to the content of a named entity.</termdef>
  2597.                     <termdef id="dt-GERef" term="General Entity Reference">References to 
  2598. parsed general entities
  2599. use ampersand (<code>&</code>) and semicolon (<code>;</code>) as
  2600. delimiters.</termdef>
  2601.                     <termdef id="dt-PERef" term="Parameter-entity reference">
  2602.                         <term>Parameter-entity references</term> use percent-sign (<code>%</code>) and
  2603. semicolon 
  2604. (<code>;</code>) as delimiters.</termdef>
  2605.                 </p>
  2606.                 <scrap lang="ebnf">
  2607.                     <head>Entity Reference</head>
  2608.                     <prod id="NT-Reference">
  2609.                         <lhs>Reference</lhs>
  2610.                         <rhs>
  2611.                             <nt def="NT-EntityRef">EntityRef</nt> 
  2612. | <nt def="NT-CharRef">CharRef</nt>
  2613.                         </rhs>
  2614.                     </prod>
  2615.                     <prod id="NT-EntityRef">
  2616.                         <lhs>EntityRef</lhs>
  2617.                         <rhs>'&' <nt def="NT-Name">Name</nt> ';'</rhs>
  2618.                         <wfc def="wf-entdeclared"/>
  2619.                         <vc def="vc-entdeclared"/>
  2620.                         <wfc def="textent"/>
  2621.                         <wfc def="norecursion"/>
  2622.                     </prod>
  2623.                     <prod id="NT-PEReference">
  2624.                         <lhs>PEReference</lhs>
  2625.                         <rhs>'%' <nt def="NT-Name">Name</nt> ';'</rhs>
  2626.                         <vc def="vc-entdeclared"/>
  2627.                         <wfc def="norecursion"/>
  2628.                         <wfc def="indtd"/>
  2629.                     </prod>
  2630.                 </scrap>
  2631.                 <wfcnote id="wf-entdeclared">
  2632.                     <head>Entity Declared</head>
  2633.                     <p>In a document without any DTD, a document with only an internal
  2634. DTD subset which contains no parameter entity references, or a document with
  2635. "<code>standalone='yes'</code>", 
  2636. the <nt def="NT-Name">Name</nt> given in the entity reference must 
  2637. <termref def="dt-match">match</termref> that in an 
  2638. <titleref href="sec-entity-decl">entity declaration</titleref>, except that
  2639. well-formed documents need not declare 
  2640. any of the following entities: &magicents;.  
  2641. The declaration of a parameter entity must precede any reference to it.
  2642. Similarly, the declaration of a general entity must precede any
  2643. reference to it which appears in a default value in an attribute-list
  2644. declaration.</p>
  2645.                     <p>Note that if entities are declared in the external subset or in 
  2646. external parameter entities, a non-validating processor is 
  2647. <titleref href="include-if-valid">not obligated to</titleref> read
  2648. and process their declarations; for such documents, the rule that
  2649. an entity must be declared is a well-formedness constraint only
  2650. if <titleref href="sec-rmd">standalone='yes'</titleref>.</p>
  2651.                 </wfcnote>
  2652.                 <vcnote id="vc-entdeclared">
  2653.                     <head>Entity Declared</head>
  2654.                     <p>In a document with an external subset or external parameter
  2655. entities with "<code>standalone='no'</code>",
  2656. the <nt def="NT-Name">Name</nt> given in the entity reference must <termref def="dt-match">match</termref> that in an 
  2657. <titleref href="sec-entity-decl">entity declaration</titleref>.
  2658. For interoperability, valid documents should declare the entities 
  2659. &magicents;, in the form
  2660. specified in <specref ref="sec-predefined-ent"/>.
  2661. The declaration of a parameter entity must precede any reference to it.
  2662. Similarly, the declaration of a general entity must precede any
  2663. reference to it which appears in a default value in an attribute-list
  2664. declaration.</p>
  2665.                 </vcnote>
  2666.                 <!-- FINAL EDIT:  is this duplication too clumsy? -->
  2667.                 <wfcnote id="textent">
  2668.                     <head>Parsed Entity</head>
  2669.                     <p>
  2670. An entity reference must not contain the name of an <termref def="dt-unparsed">unparsed entity</termref>. Unparsed entities may be referred
  2671. to only in <termref def="dt-attrval">attribute values</termref> declared to
  2672. be of type <kw>ENTITY</kw> or <kw>ENTITIES</kw>.
  2673. </p>
  2674.                 </wfcnote>
  2675.                 <wfcnote id="norecursion">
  2676.                     <head>No Recursion</head>
  2677.                     <p>
  2678. A parsed entity must not contain a recursive reference to itself,
  2679. either directly or indirectly.
  2680. </p>
  2681.                 </wfcnote>
  2682.                 <wfcnote id="indtd">
  2683.                     <head>In DTD</head>
  2684.                     <p>
  2685. Parameter-entity references may only appear in the 
  2686. <termref def="dt-doctype">DTD</termref>.
  2687. </p>
  2688.                 </wfcnote>
  2689.                 <p>Examples of character and entity references:
  2690. <eg>Type <key>less-than</key> (&hcro;3C;) to save options.
  2691. This document was prepared on &docdate; and
  2692. is classified &security-level;.</eg>
  2693.                 </p>
  2694.                 <p>Example of a parameter-entity reference:
  2695. <eg>
  2696.                         <![CDATA[<!-- declare the parameter entity "ISOLat2"... -->
  2697. <!ENTITY % ISOLat2
  2698.          SYSTEM "http://www.xml.com/iso/isolat2-xml.entities" >
  2699. <!-- ... now reference it. -->
  2700. %ISOLat2;]]>
  2701.                     </eg>
  2702.                 </p>
  2703.             </div2>
  2704.             <div2 id="sec-entity-decl">
  2705.                 <head>Entity Declarations</head>
  2706.                 <p>
  2707.                     <termdef id="dt-entdecl" term="entity declaration">
  2708. Entities are declared thus:
  2709. <scrap lang="ebnf">
  2710.                             <head>Entity Declaration</head>
  2711.                             <prodgroup pcw2="5" pcw4="18.5">
  2712.                                 <prod id="NT-EntityDecl">
  2713.                                     <lhs>EntityDecl</lhs>
  2714.                                     <rhs>
  2715.                                         <nt def="NT-GEDecl">GEDecl</nt>
  2716.                                         <!--</rhs><com>General entities</com>
  2717. <rhs>--> | <nt def="NT-PEDecl">PEDecl</nt>
  2718.                                     </rhs>
  2719.                                     <!--<com>Parameter entities</com>-->
  2720.                                 </prod>
  2721.                                 <prod id="NT-GEDecl">
  2722.                                     <lhs>GEDecl</lhs>
  2723.                                     <rhs>'<!ENTITY' <nt def="NT-S">S</nt>
  2724.                                         <nt def="NT-Name">Name</nt>
  2725.                                         <nt def="NT-S">S</nt>
  2726.                                         <nt def="NT-EntityDef">EntityDef</nt>
  2727.                                         <nt def="NT-S">S</nt>? '>'</rhs>
  2728.                                 </prod>
  2729.                                 <prod id="NT-PEDecl">
  2730.                                     <lhs>PEDecl</lhs>
  2731.                                     <rhs>'<!ENTITY' <nt def="NT-S">S</nt> '%' <nt def="NT-S">S</nt>
  2732.                                         <nt def="NT-Name">Name</nt>
  2733.                                         <nt def="NT-S">S</nt>
  2734.                                         <nt def="NT-PEDef">PEDef</nt>
  2735.                                         <nt def="NT-S">S</nt>? '>'</rhs>
  2736.                                     <!--<com>Parameter entities</com>-->
  2737.                                 </prod>
  2738.                                 <prod id="NT-EntityDef">
  2739.                                     <lhs>EntityDef</lhs>
  2740.                                     <rhs>
  2741.                                         <nt def="NT-EntityValue">EntityValue</nt>
  2742.                                         <!--</rhs>
  2743. <rhs>-->| (<nt def="NT-ExternalID">ExternalID</nt>
  2744.                                         <nt def="NT-NDataDecl">NDataDecl</nt>?)</rhs>
  2745.                                     <!-- <nt def='NT-ExternalDef'>ExternalDef</nt></rhs> -->
  2746.                                 </prod>
  2747.                                 <!-- FINAL EDIT: what happened to WFs here? -->
  2748.                                 <prod id="NT-PEDef">
  2749.                                     <lhs>PEDef</lhs>
  2750.                                     <rhs>
  2751.                                         <nt def="NT-EntityValue">EntityValue</nt> 
  2752. | <nt def="NT-ExternalID">ExternalID</nt>
  2753.                                     </rhs>
  2754.                                 </prod>
  2755.                             </prodgroup>
  2756.                         </scrap>
  2757. The <nt def="NT-Name">Name</nt> identifies the entity in an
  2758. <termref def="dt-entref">entity reference</termref> or, in the case of an
  2759. unparsed entity, in the value of an <kw>ENTITY</kw> or <kw>ENTITIES</kw>
  2760. attribute.
  2761. If the same entity is declared more than once, the first declaration
  2762. encountered is binding; at user option, an XML processor may issue a
  2763. warning if entities are declared multiple times.</termdef>
  2764.                 </p>
  2765.                 <div3 id="sec-internal-ent">
  2766.                     <head>Internal Entities</head>
  2767.                     <p>
  2768.                         <termdef id="dt-internent" term="Internal Entity Replacement Text">If 
  2769. the entity definition is an 
  2770. <nt def="NT-EntityValue">EntityValue</nt>,  
  2771. the defined entity is called an <term>internal entity</term>.  
  2772. There is no separate physical
  2773. storage object, and the content of the entity is given in the
  2774. declaration. </termdef>
  2775. Note that some processing of entity and character references in the
  2776. <termref def="dt-litentval">literal entity value</termref> may be required to
  2777. produce the correct <termref def="dt-repltext">replacement 
  2778. text</termref>: see <specref ref="intern-replacement"/>.
  2779. </p>
  2780.                     <p>An internal entity is a <termref def="dt-parsedent">parsed
  2781. entity</termref>.</p>
  2782.                     <p>Example of an internal entity declaration:
  2783. <eg><!ENTITY Pub-Status "This is a pre-release of the
  2784.  specification."></eg>
  2785.                     </p>
  2786.                 </div3>
  2787.                 <div3 id="sec-external-ent">
  2788.                     <head>External Entities</head>
  2789.                     <p>
  2790.                         <termdef id="dt-extent" term="External Entity">If the entity is not
  2791. internal, it is an <term>external
  2792. entity</term>, declared as follows:
  2793. <scrap lang="ebnf">
  2794.                                 <head>External Entity Declaration</head>
  2795.                                 <!--
  2796. <prod id='NT-ExternalDef'><lhs>ExternalDef</lhs>
  2797. <rhs></prod> -->
  2798.                                 <prod id="NT-ExternalID">
  2799.                                     <lhs>ExternalID</lhs>
  2800.                                     <rhs>'SYSTEM' <nt def="NT-S">S</nt>
  2801.                                         <nt def="NT-SystemLiteral">SystemLiteral</nt>
  2802.                                     </rhs>
  2803.                                     <rhs>| 'PUBLIC' <nt def="NT-S">S</nt>
  2804.                                         <nt def="NT-PubidLiteral">PubidLiteral</nt>
  2805.                                         <nt def="NT-S">S</nt>
  2806.                                         <nt def="NT-SystemLiteral">SystemLiteral</nt>
  2807.                                     </rhs>
  2808.                                 </prod>
  2809.                                 <prod id="NT-NDataDecl">
  2810.                                     <lhs>NDataDecl</lhs>
  2811.                                     <rhs>
  2812.                                         <nt def="NT-S">S</nt> 'NDATA' <nt def="NT-S">S</nt>
  2813.                                         <nt def="NT-Name">Name</nt>
  2814.                                     </rhs>
  2815.                                     <vc def="not-declared"/>
  2816.                                 </prod>
  2817.                             </scrap>
  2818. If the <nt def="NT-NDataDecl">NDataDecl</nt> is present, this is a
  2819. general <termref def="dt-unparsed">unparsed
  2820. entity</termref>; otherwise it is a parsed entity.</termdef>
  2821.                     </p>
  2822.                     <vcnote id="not-declared">
  2823.                         <head>Notation Declared</head>
  2824.                         <p>
  2825. The <nt def="NT-Name">Name</nt> must match the declared name of a
  2826. <termref def="dt-notation">notation</termref>.
  2827. </p>
  2828.                     </vcnote>
  2829.                     <p>
  2830.                         <termdef id="dt-sysid" term="System Identifier">The
  2831. <nt def="NT-SystemLiteral">SystemLiteral</nt> 
  2832. is called the entity's <term>system identifier</term>. It is a URI,
  2833. which may be used to retrieve the entity.</termdef>
  2834. Note that the hash mark (<code>#</code>) and fragment identifier 
  2835. frequently used with URIs are not, formally, part of the URI itself; 
  2836. an XML processor may signal an error if a fragment identifier is 
  2837. given as part of a system identifier.
  2838. Unless otherwise provided by information outside the scope of this
  2839. specification (e.g. a special XML element type defined by a particular
  2840. DTD, or a processing instruction defined by a particular application
  2841. specification), relative URIs are relative to the location of the
  2842. resource within which the entity declaration occurs.
  2843. A URI might thus be relative to the 
  2844. <termref def="dt-docent">document entity</termref>, to the entity
  2845. containing the <termref def="dt-doctype">external DTD subset</termref>, 
  2846. or to some other <termref def="dt-extent">external parameter entity</termref>.
  2847. </p>
  2848.                     <p>An XML processor should handle a non-ASCII character in a URI by
  2849. representing the character in UTF-8 as one or more bytes, and then 
  2850. escaping these bytes with the URI escaping mechanism (i.e., by
  2851. converting each byte to %HH, where HH is the hexadecimal notation of the
  2852. byte value).</p>
  2853.                     <p>
  2854.                         <termdef id="dt-pubid" term="Public identifier">
  2855. In addition to a system identifier, an external identifier may
  2856. include a <term>public identifier</term>.</termdef>  
  2857. An XML processor attempting to retrieve the entity's content may use the public
  2858. identifier to try to generate an alternative URI.  If the processor
  2859. is unable to do so, it must use the URI specified in the system
  2860. literal.  Before a match is attempted, all strings
  2861. of white space in the public identifier must be normalized to single space characters (#x20),
  2862. and leading and trailing white space must be removed.</p>
  2863.                     <p>Examples of external entity declarations:
  2864. <eg><!ENTITY open-hatch
  2865.          SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
  2866. <!ENTITY open-hatch
  2867.          PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN"
  2868.          "http://www.textuality.com/boilerplate/OpenHatch.xml">
  2869. <!ENTITY hatch-pic
  2870.          SYSTEM "../grafix/OpenHatch.gif"
  2871.          NDATA gif ></eg>
  2872.                     </p>
  2873.                 </div3>
  2874.             </div2>
  2875.             <div2 id="TextEntities">
  2876.                 <head>Parsed Entities</head>
  2877.                 <div3 id="sec-TextDecl">
  2878.                     <head>The Text Declaration</head>
  2879.                     <p>External parsed entities may each begin with a <term>text
  2880. declaration</term>. 
  2881. <scrap lang="ebnf">
  2882.                             <head>Text Declaration</head>
  2883.                             <prodgroup pcw4="12.5" pcw5="13">
  2884.                                 <prod id="NT-TextDecl">
  2885.                                     <lhs>TextDecl</lhs>
  2886.                                     <rhs>&xmlpio; 
  2887. <nt def="NT-VersionInfo">VersionInfo</nt>?
  2888. <nt def="NT-EncodingDecl">EncodingDecl</nt>
  2889.                                         <nt def="NT-S">S</nt>? &pic;</rhs>
  2890.                                 </prod>
  2891.                             </prodgroup>
  2892.                         </scrap>
  2893.                     </p>
  2894.                     <p>The text declaration must be provided literally, not
  2895. by reference to a parsed entity.
  2896. No text declaration may appear at any position other than the beginning of
  2897. an external parsed entity.</p>
  2898.                 </div3>
  2899.                 <div3 id="wf-entities">
  2900.                     <head>Well-Formed Parsed Entities</head>
  2901.                     <p>The document entity is well-formed if it matches the production labeled
  2902. <nt def="NT-document">document</nt>.
  2903. An external general 
  2904. parsed entity is well-formed if it matches the production labeled
  2905. <nt def="NT-extParsedEnt">extParsedEnt</nt>.
  2906. An external parameter
  2907. entity is well-formed if it matches the production labeled
  2908. <nt def="NT-extPE">extPE</nt>.
  2909. <scrap lang="ebnf">
  2910.                             <head>Well-Formed External Parsed Entity</head>
  2911.                             <prod id="NT-extParsedEnt">
  2912.                                 <lhs>extParsedEnt</lhs>
  2913.                                 <rhs>
  2914.                                     <nt def="NT-TextDecl">TextDecl</nt>? 
  2915. <nt def="NT-content">content</nt>
  2916.                                 </rhs>
  2917.                             </prod>
  2918.                             <prod id="NT-extPE">
  2919.                                 <lhs>extPE</lhs>
  2920.                                 <rhs>
  2921.                                     <nt def="NT-TextDecl">TextDecl</nt>? 
  2922. <nt def="NT-extSubsetDecl">extSubsetDecl</nt>
  2923.                                 </rhs>
  2924.                             </prod>
  2925.                         </scrap>
  2926. An internal general parsed entity is well-formed if its replacement text 
  2927. matches the production labeled
  2928. <nt def="NT-content">content</nt>.
  2929. All internal parameter entities are well-formed by definition.
  2930. </p>
  2931.                     <p>A consequence of well-formedness in entities is that the logical 
  2932. and physical structures in an XML document are properly nested; no 
  2933. <termref def="dt-stag">start-tag</termref>,
  2934. <termref def="dt-etag">end-tag</termref>,
  2935. <termref def="dt-empty">empty-element tag</termref>,
  2936. <termref def="dt-element">element</termref>, 
  2937. <termref def="dt-comment">comment</termref>, 
  2938. <termref def="dt-pi">processing instruction</termref>, 
  2939. <termref def="dt-charref">character
  2940. reference</termref>, or
  2941. <termref def="dt-entref">entity reference</termref> 
  2942. can begin in one entity and end in another.</p>
  2943.                 </div3>
  2944.                 <div3 id="charencoding">
  2945.                     <head>Character Encoding in Entities</head>
  2946.                     <p>Each external parsed entity in an XML document may use a different
  2947. encoding for its characters. All XML processors must be able to read
  2948. entities in either UTF-8 or UTF-16. 
  2949.  
  2950. </p>
  2951.                     <p>Entities encoded in UTF-16 must
  2952. begin with the Byte Order Mark described by ISO/IEC 10646 Annex E and
  2953. Unicode Appendix B (the ZERO WIDTH NO-BREAK SPACE character, #xFEFF).
  2954. This is an encoding signature, not part of either the markup or the
  2955. character data of the XML document.
  2956. XML processors must be able to use this character to
  2957. differentiate between UTF-8 and UTF-16 encoded documents.</p>
  2958.                     <p>Although an XML processor is required to read only entities in
  2959. the UTF-8 and UTF-16 encodings, it is recognized that other encodings are
  2960. used around the world, and it may be desired for XML processors
  2961. to read entities that use them.
  2962. Parsed entities which are stored in an encoding other than
  2963. UTF-8 or UTF-16 must begin with a <titleref href="TextDecl">text
  2964. declaration</titleref> containing an encoding declaration:
  2965. <scrap lang="ebnf">
  2966.                             <head>Encoding Declaration</head>
  2967.                             <prod id="NT-EncodingDecl">
  2968.                                 <lhs>EncodingDecl</lhs>
  2969.                                 <rhs>
  2970.                                     <nt def="NT-S">S</nt>
  2971. 'encoding' <nt def="NT-Eq">Eq</nt> 
  2972. ('"' <nt def="NT-EncName">EncName</nt> '"' | 
  2973. "'" <nt def="NT-EncName">EncName</nt> "'" )
  2974. </rhs>
  2975.                             </prod>
  2976.                             <prod id="NT-EncName">
  2977.                                 <lhs>EncName</lhs>
  2978.                                 <rhs>[A-Za-z] ([A-Za-z0-9._] | '-')*</rhs>
  2979.                                 <com>Encoding name contains only Latin characters</com>
  2980.                             </prod>
  2981.                         </scrap>
  2982. In the <termref def="dt-docent">document entity</termref>, the encoding
  2983. declaration is part of the <termref def="dt-xmldecl">XML declaration</termref>.
  2984. The <nt def="NT-EncName">EncName</nt> is the name of the encoding used.
  2985. </p>
  2986.                     <!-- FINAL EDIT:  check name of IANA and charset names -->
  2987.                     <p>In an encoding declaration, the values
  2988. "<code>UTF-8</code>",
  2989. "<code>UTF-16</code>",
  2990. "<code>ISO-10646-UCS-2</code>", and
  2991. "<code>ISO-10646-UCS-4</code>" should be 
  2992. used for the various encodings and transformations of Unicode /
  2993. ISO/IEC 10646, the values
  2994. "<code>ISO-8859-1</code>",
  2995. "<code>ISO-8859-2</code>", ...
  2996. "<code>ISO-8859-9</code>" should be used for the parts of ISO 8859, and
  2997. the values
  2998. "<code>ISO-2022-JP</code>",
  2999. "<code>Shift_JIS</code>", and
  3000. "<code>EUC-JP</code>"
  3001. should be used for the various encoded forms of JIS X-0208-1997.  XML
  3002. processors may recognize other encodings; it is recommended that
  3003. character encodings registered (as <emph>charset</emph>s) 
  3004. with the Internet Assigned Numbers
  3005. Authority <bibref ref="IANA"/>, other than those just listed, should be
  3006. referred to
  3007. using their registered names.
  3008. Note that these registered names are defined to be 
  3009. case-insensitive, so processors wishing to match against them 
  3010. should do so in a case-insensitive
  3011. way.</p>
  3012.                     <p>In the absence of information provided by an external
  3013. transport protocol (e.g. HTTP or MIME), 
  3014. it is an <termref def="dt-error">error</termref> for an entity including
  3015. an encoding declaration to be presented to the XML processor 
  3016. in an encoding other than that named in the declaration, 
  3017. for an encoding declaration to occur other than at the beginning 
  3018. of an external entity, or for
  3019. an entity which begins with neither a Byte Order Mark nor an encoding
  3020. declaration to use an encoding other than UTF-8.
  3021. Note that since ASCII
  3022. is a subset of UTF-8, ordinary ASCII entities do not strictly need
  3023. an encoding declaration.</p>
  3024.                     <p>It is a <termref def="dt-fatal">fatal error</termref> when an XML processor
  3025. encounters an entity with an encoding that it is unable to process.</p>
  3026.                     <p>Examples of encoding declarations:
  3027. <eg><?xml encoding='UTF-8'?>
  3028. <?xml encoding='EUC-JP'?></eg>
  3029.                     </p>
  3030.                 </div3>
  3031.             </div2>
  3032.             <div2 id="entproc">
  3033.                 <head>XML Processor Treatment of Entities and References</head>
  3034.                 <p>The table below summarizes the contexts in which character references,
  3035. entity references, and invocations of unparsed entities might appear and the
  3036. required behavior of an <termref def="dt-xml-proc">XML processor</termref> in
  3037. each case.  
  3038. The labels in the leftmost column describe the recognition context:
  3039. <glist>
  3040.                         <gitem>
  3041.                             <label>Reference in Content</label>
  3042.                             <def>
  3043.                                 <p>as a reference
  3044. anywhere after the <termref def="dt-stag">start-tag</termref> and
  3045. before the <termref def="dt-etag">end-tag</termref> of an element; corresponds
  3046. to the nonterminal <nt def="NT-content">content</nt>.</p>
  3047.                             </def>
  3048.                         </gitem>
  3049.                         <gitem>
  3050.                             <label>Reference in Attribute Value</label>
  3051.                             <def>
  3052.                                 <p>as a reference within either the value of an attribute in a 
  3053. <termref def="dt-stag">start-tag</termref>, or a default
  3054. value in an <termref def="dt-attdecl">attribute declaration</termref>;
  3055. corresponds to the nonterminal
  3056. <nt def="NT-AttValue">AttValue</nt>.</p>
  3057.                             </def>
  3058.                         </gitem>
  3059.                         <gitem>
  3060.                             <label>Occurs as Attribute Value</label>
  3061.                             <def>
  3062.                                 <p>as a <nt def="NT-Name">Name</nt>, not a reference, appearing either as
  3063. the value of an 
  3064. attribute which has been declared as type <kw>ENTITY</kw>, or as one of
  3065. the space-separated tokens in the value of an attribute which has been
  3066. declared as type <kw>ENTITIES</kw>.</p>
  3067.                             </def>
  3068.                         </gitem>
  3069.                         <gitem>
  3070.                             <label>Reference in Entity Value</label>
  3071.                             <def>
  3072.                                 <p>as a reference
  3073. within a parameter or internal entity's 
  3074. <termref def="dt-litentval">literal entity value</termref> in
  3075. the entity's declaration; corresponds to the nonterminal 
  3076. <nt def="NT-EntityValue">EntityValue</nt>.</p>
  3077.                             </def>
  3078.                         </gitem>
  3079.                         <gitem>
  3080.                             <label>Reference in DTD</label>
  3081.                             <def>
  3082.                                 <p>as a reference within either the internal or external subsets of the 
  3083. <termref def="dt-doctype">DTD</termref>, but outside
  3084. of an <nt def="NT-EntityValue">EntityValue</nt> or
  3085. <nt def="NT-AttValue">AttValue</nt>.</p>
  3086.                             </def>
  3087.                         </gitem>
  3088.                     </glist>
  3089.                 </p>
  3090.                 <htable border="1" cellpadding="7" align="center">
  3091.                     <htbody>
  3092.                         <tr>
  3093.                             <td bgcolor="&cellback;" rowspan="2" colspan="1"/>
  3094.                             <td bgcolor="&cellback;" align="center" valign="bottom" colspan="4">Entity Type</td>
  3095.                             <td bgcolor="&cellback;" rowspan="2" align="center">Character</td>
  3096.                         </tr>
  3097.                         <tr align="center" valign="bottom">
  3098.                             <td bgcolor="&cellback;">Parameter</td>
  3099.                             <td bgcolor="&cellback;">Internal
  3100. General</td>
  3101.                             <td bgcolor="&cellback;">External Parsed
  3102. General</td>
  3103.                             <td bgcolor="&cellback;">Unparsed</td>
  3104.                         </tr>
  3105.                         <tr align="center" valign="middle">
  3106.                             <td bgcolor="&cellback;" align="right">Reference
  3107. in Content</td>
  3108.                             <td bgcolor="&cellback;">
  3109.                                 <titleref href="not-recognized">Not recognized</titleref>
  3110.                             </td>
  3111.                             <td bgcolor="&cellback;">
  3112.                                 <titleref href="included">Included</titleref>
  3113.                             </td>
  3114.                             <td bgcolor="&cellback;">
  3115.                                 <titleref href="include-if-valid">Included if validating</titleref>
  3116.                             </td>
  3117.                             <td bgcolor="&cellback;">
  3118.                                 <titleref href="forbidden">Forbidden</titleref>
  3119.                             </td>
  3120.                             <td bgcolor="&cellback;">
  3121.                                 <titleref href="included">Included</titleref>
  3122.                             </td>
  3123.                         </tr>
  3124.                         <tr align="center" valign="middle">
  3125.                             <td bgcolor="&cellback;" align="right">Reference
  3126. in Attribute Value</td>
  3127.                             <td bgcolor="&cellback;">
  3128.                                 <titleref href="not-recognized">Not recognized</titleref>
  3129.                             </td>
  3130.                             <td bgcolor="&cellback;">
  3131.                                 <titleref href="inliteral">Included in literal</titleref>
  3132.                             </td>
  3133.                             <td bgcolor="&cellback;">
  3134.                                 <titleref href="forbidden">Forbidden</titleref>
  3135.                             </td>
  3136.                             <td bgcolor="&cellback;">
  3137.                                 <titleref href="forbidden">Forbidden</titleref>
  3138.                             </td>
  3139.                             <td bgcolor="&cellback;">
  3140.                                 <titleref href="included">Included</titleref>
  3141.                             </td>
  3142.                         </tr>
  3143.                         <tr align="center" valign="middle">
  3144.                             <td bgcolor="&cellback;" align="right">Occurs as
  3145. Attribute Value</td>
  3146.                             <td bgcolor="&cellback;">
  3147.                                 <titleref href="not-recognized">Not recognized</titleref>
  3148.                             </td>
  3149.                             <td bgcolor="&cellback;">
  3150.                                 <titleref href="not-recognized">Forbidden</titleref>
  3151.                             </td>
  3152.                             <td bgcolor="&cellback;">
  3153.                                 <titleref href="not-recognized">Forbidden</titleref>
  3154.                             </td>
  3155.                             <td bgcolor="&cellback;">
  3156.                                 <titleref href="notify">Notify</titleref>
  3157.                             </td>
  3158.                             <td bgcolor="&cellback;">
  3159.                                 <titleref href="not recognized">Not recognized</titleref>
  3160.                             </td>
  3161.                         </tr>
  3162.                         <tr align="center" valign="middle">
  3163.                             <td bgcolor="&cellback;" align="right">Reference
  3164. in EntityValue</td>
  3165.                             <td bgcolor="&cellback;">
  3166.                                 <titleref href="inliteral">Included in literal</titleref>
  3167.                             </td>
  3168.                             <td bgcolor="&cellback;">
  3169.                                 <titleref href="bypass">Bypassed</titleref>
  3170.                             </td>
  3171.                             <td bgcolor="&cellback;">
  3172.                                 <titleref href="bypass">Bypassed</titleref>
  3173.                             </td>
  3174.                             <td bgcolor="&cellback;">
  3175.                                 <titleref href="forbidden">Forbidden</titleref>
  3176.                             </td>
  3177.                             <td bgcolor="&cellback;">
  3178.                                 <titleref href="included">Included</titleref>
  3179.                             </td>
  3180.                         </tr>
  3181.                         <tr align="center" valign="middle">
  3182.                             <td bgcolor="&cellback;" align="right">Reference
  3183. in DTD</td>
  3184.                             <td bgcolor="&cellback;">
  3185.                                 <titleref href="as-PE">Included as PE</titleref>
  3186.                             </td>
  3187.                             <td bgcolor="&cellback;">
  3188.                                 <titleref href="forbidden">Forbidden</titleref>
  3189.                             </td>
  3190.                             <td bgcolor="&cellback;">
  3191.                                 <titleref href="forbidden">Forbidden</titleref>
  3192.                             </td>
  3193.                             <td bgcolor="&cellback;">
  3194.                                 <titleref href="forbidden">Forbidden</titleref>
  3195.                             </td>
  3196.                             <td bgcolor="&cellback;">
  3197.                                 <titleref href="forbidden">Forbidden</titleref>
  3198.                             </td>
  3199.                         </tr>
  3200.                     </htbody>
  3201.                 </htable>
  3202.                 <div3 id="not-recognized">
  3203.                     <head>Not Recognized</head>
  3204.                     <p>Outside the DTD, the <code>%</code> character has no
  3205. special significance; thus, what would be parameter entity references in the
  3206. DTD are not recognized as markup in <nt def="NT-content">content</nt>.
  3207. Similarly, the names of unparsed entities are not recognized except
  3208. when they appear in the value of an appropriately declared attribute.
  3209. </p>
  3210.                 </div3>
  3211.                 <div3 id="included">
  3212.                     <head>Included</head>
  3213.                     <p>
  3214.                         <termdef id="dt-include" term="Include">An entity is 
  3215. <term>included</term> when its 
  3216. <termref def="dt-repltext">replacement text</termref> is retrieved 
  3217. and processed, in place of the reference itself,
  3218. as though it were part of the document at the location the
  3219. reference was recognized.
  3220. The replacement text may contain both 
  3221. <termref def="dt-chardata">character data</termref>
  3222. and (except for parameter entities) <termref def="dt-markup">markup</termref>,
  3223. which must be recognized in
  3224. the usual way, except that the replacement text of entities used to escape
  3225. markup delimiters (the entities &magicents;) is always treated as
  3226. data.  (The string "<code>AT&amp;T;</code>" expands to
  3227. "<code>AT&T;</code>" and the remaining ampersand is not recognized
  3228. as an entity-reference delimiter.) 
  3229. A character reference is <term>included</term> when the indicated
  3230. character is processed in place of the reference itself.
  3231. </termdef>
  3232.                     </p>
  3233.                 </div3>
  3234.                 <div3 id="include-if-valid">
  3235.                     <head>Included If Validating</head>
  3236.                     <p>When an XML processor recognizes a reference to a parsed entity, in order
  3237. to <termref def="dt-valid">validate</termref>
  3238. the document, the processor must 
  3239. <termref def="dt-include">include</termref> its
  3240. replacement text.
  3241. If the entity is external, and the processor is not
  3242. attempting to validate the XML document, the
  3243. processor <termref def="dt-may">may</termref>, but need not, 
  3244. include the entity's replacement text.
  3245. If a non-validating parser does not include the replacement text,
  3246. it must inform the application that it recognized, but did not
  3247. read, the entity.</p>
  3248.                     <p>This rule is based on the recognition that the automatic inclusion
  3249. provided by the SGML and XML entity mechanism, primarily designed
  3250. to support modularity in authoring, is not necessarily 
  3251. appropriate for other applications, in particular document browsing.
  3252. Browsers, for example, when encountering an external parsed entity reference,
  3253. might choose to provide a visual indication of the entity's
  3254. presence and retrieve it for display only on demand.
  3255. </p>
  3256.                 </div3>
  3257.                 <div3 id="forbidden">
  3258.                     <head>Forbidden</head>
  3259.                     <p>The following are forbidden, and constitute
  3260. <termref def="dt-fatal">fatal</termref> errors:
  3261. <ulist>
  3262.                             <item>
  3263.                                 <p>the appearance of a reference to an
  3264. <termref def="dt-unparsed">unparsed entity</termref>.
  3265. </p>
  3266.                             </item>
  3267.                             <item>
  3268.                                 <p>the appearance of any character or general-entity reference in the
  3269. DTD except within an <nt def="NT-EntityValue">EntityValue</nt> or 
  3270. <nt def="NT-AttValue">AttValue</nt>.</p>
  3271.                             </item>
  3272.                             <item>
  3273.                                 <p>a reference to an external entity in an attribute value.</p>
  3274.                             </item>
  3275.                         </ulist>
  3276.                     </p>
  3277.                 </div3>
  3278.                 <div3 id="inliteral">
  3279.                     <head>Included in Literal</head>
  3280.                     <p>When an <termref def="dt-entref">entity reference</termref> appears in an
  3281. attribute value, or a parameter entity reference appears in a literal entity
  3282. value, its <termref def="dt-repltext">replacement text</termref> is
  3283. processed in place of the reference itself as though it
  3284. were part of the document at the location the reference was recognized,
  3285. except that a single or double quote character in the replacement text
  3286. is always treated as a normal data character and will not terminate the
  3287. literal. 
  3288. For example, this is well-formed:
  3289. <eg>
  3290.                             <![CDATA[<!ENTITY % YN '"Yes"' >
  3291. <!ENTITY WhatHeSaid "He said &YN;" >]]>
  3292.                         </eg>
  3293. while this is not:
  3294. <eg><!ENTITY EndAttr "27'" >
  3295. <element attribute='a-&EndAttr;></eg>
  3296.                     </p>
  3297.                 </div3>
  3298.                 <div3 id="notify">
  3299.                     <head>Notify</head>
  3300.                     <p>When the name of an <termref def="dt-unparsed">unparsed
  3301. entity</termref> appears as a token in the
  3302. value of an attribute of declared type <kw>ENTITY</kw> or <kw>ENTITIES</kw>,
  3303. a validating processor must inform the
  3304. application of the <termref def="dt-sysid">system</termref> 
  3305. and <termref def="dt-pubid">public</termref> (if any)
  3306. identifiers for both the entity and its associated
  3307. <termref def="dt-notation">notation</termref>.</p>
  3308.                 </div3>
  3309.                 <div3 id="bypass">
  3310.                     <head>Bypassed</head>
  3311.                     <p>When a general entity reference appears in the
  3312. <nt def="NT-EntityValue">EntityValue</nt> in an entity declaration,
  3313. it is bypassed and left as is.</p>
  3314.                 </div3>
  3315.                 <div3 id="as-PE">
  3316.                     <head>Included as PE</head>
  3317.                     <p>Just as with external parsed entities, parameter entities
  3318. need only be <titleref href="include-if-valid">included if
  3319. validating</titleref>. 
  3320. When a parameter-entity reference is recognized in the DTD
  3321. and included, its 
  3322. <termref def="dt-repltext">replacement
  3323. text</termref> is enlarged by the attachment of one leading and one following
  3324. space (#x20) character; the intent is to constrain the replacement
  3325. text of parameter 
  3326. entities to contain an integral number of grammatical tokens in the DTD.
  3327. </p>
  3328.                 </div3>
  3329.             </div2>
  3330.             <div2 id="intern-replacement">
  3331.                 <head>Construction of Internal Entity Replacement Text</head>
  3332.                 <p>In discussing the treatment
  3333. of internal entities, it is  
  3334. useful to distinguish two forms of the entity's value.
  3335. <termdef id="dt-litentval" term="Literal Entity Value">The <term>literal
  3336. entity value</term> is the quoted string actually
  3337. present in the entity declaration, corresponding to the
  3338. non-terminal <nt def="NT-EntityValue">EntityValue</nt>.</termdef>
  3339.                     <termdef id="dt-repltext" term="Replacement Text">The <term>replacement
  3340. text</term> is the content of the entity, after
  3341. replacement of character references and parameter-entity
  3342. references.
  3343. </termdef>
  3344.                 </p>
  3345.                 <p>The literal entity value 
  3346. as given in an internal entity declaration
  3347. (<nt def="NT-EntityValue">EntityValue</nt>) may contain character,
  3348. parameter-entity, and general-entity references.
  3349. Such references must be contained entirely within the
  3350. literal entity value.
  3351. The actual replacement text that is 
  3352. <termref def="dt-include">included</termref> as described above
  3353. must contain the <emph>replacement text</emph> of any 
  3354. parameter entities referred to, and must contain the character
  3355. referred to, in place of any character references in the
  3356. literal entity value; however,
  3357. general-entity references must be left as-is, unexpanded.
  3358. For example, given the following declarations:
  3359.  
  3360. <eg>
  3361.                         <![CDATA[<!ENTITY % pub    "Éditions Gallimard" >
  3362. <!ENTITY   rights "All rights reserved" >
  3363. <!ENTITY   book   "La Peste: Albert Camus, 
  3364. © 1947 %pub;. &rights;" >]]>
  3365.                     </eg>
  3366. then the replacement text for the entity "<code>book</code>" is:
  3367. <eg>La Peste: Albert Camus, 
  3368. © 1947 Éditions Gallimard. &rights;</eg>
  3369. The general-entity reference "<code>&rights;</code>" would be expanded
  3370. should the reference "<code>&book;</code>" appear in the document's
  3371. content or an attribute value.</p>
  3372.                 <p>These simple rules may have complex interactions; for a detailed
  3373. discussion of a difficult example, see
  3374. <specref ref="sec-entexpand"/>.
  3375. </p>
  3376.             </div2>
  3377.             <div2 id="sec-predefined-ent">
  3378.                 <head>Predefined Entities</head>
  3379.                 <p>
  3380.                     <termdef id="dt-escape" term="escape">Entity and character
  3381. references can both be used to <term>escape</term> the left angle bracket,
  3382. ampersand, and other delimiters.   A set of general entities
  3383. (&magicents;) is specified for this purpose.
  3384. Numeric character references may also be used; they are
  3385. expanded immediately when recognized and must be treated as
  3386. character data, so the numeric character references
  3387. "<code>&#60;</code>" and "<code>&#38;</code>" may be used to 
  3388. escape <code><</code> and <code>&</code> when they occur
  3389. in character data.</termdef>
  3390.                 </p>
  3391.                 <p>All XML processors must recognize these entities whether they
  3392. are declared or not.  
  3393. <termref def="dt-interop">For interoperability</termref>,
  3394. valid XML documents should declare these
  3395. entities, like any others, before using them.
  3396. If the entities in question are declared, they must be declared
  3397. as internal entities whose replacement text is the single
  3398. character being escaped or a character reference to
  3399. that character, as shown below.
  3400. <eg>
  3401.                         <![CDATA[<!ENTITY lt     "&#60;"> 
  3402. <!ENTITY gt     ">"> 
  3403. <!ENTITY amp    "&#38;"> 
  3404. <!ENTITY apos   "'"> 
  3405. <!ENTITY quot   """> 
  3406. ]]>
  3407.                     </eg>
  3408. Note that the <code><</code> and <code>&</code> characters
  3409. in the declarations of "<code>lt</code>" and "<code>amp</code>"
  3410. are doubly escaped to meet the requirement that entity replacement
  3411. be well-formed.
  3412. </p>
  3413.             </div2>
  3414.             <div2 id="Notations">
  3415.                 <head>Notation Declarations</head>
  3416.                 <p>
  3417.                     <termdef id="dt-notation" term="Notation">
  3418.                         <term>Notations</term> identify by
  3419. name the format of <termref def="dt-extent">unparsed
  3420. entities</termref>, the
  3421. format of elements which bear a notation attribute, 
  3422. or the application to which  
  3423. a <termref def="dt-pi">processing instruction</termref> is
  3424. addressed.</termdef>
  3425.                 </p>
  3426.                 <p>
  3427.                     <termdef id="dt-notdecl" term="Notation Declaration">
  3428.                         <term>Notation declarations</term>
  3429. provide a name for the notation, for use in
  3430. entity and attribute-list declarations and in attribute specifications,
  3431. and an external identifier for the notation which may allow an XML
  3432. processor or its client application to locate a helper application
  3433. capable of processing data in the given notation.
  3434. <scrap lang="ebnf">
  3435.                             <head>Notation Declarations</head>
  3436.                             <prod id="NT-NotationDecl">
  3437.                                 <lhs>NotationDecl</lhs>
  3438.                                 <rhs>'<!NOTATION' <nt def="NT-S">S</nt>
  3439.                                     <nt def="NT-Name">Name</nt>
  3440.                                     <nt def="NT-S">S</nt> 
  3441. (<nt def="NT-ExternalID">ExternalID</nt> | 
  3442. <nt def="NT-PublicID">PublicID</nt>)
  3443. <nt def="NT-S">S</nt>? '>'</rhs>
  3444.                             </prod>
  3445.                             <prod id="NT-PublicID">
  3446.                                 <lhs>PublicID</lhs>
  3447.                                 <rhs>'PUBLIC' <nt def="NT-S">S</nt>
  3448.                                     <nt def="NT-PubidLiteral">PubidLiteral</nt>
  3449.                                 </rhs>
  3450.                             </prod>
  3451.                         </scrap>
  3452.                     </termdef>
  3453.                 </p>
  3454.                 <p>XML processors must provide applications with the name and external
  3455. identifier(s) of any notation declared and referred to in an attribute
  3456. value, attribute definition, or entity declaration.  They may
  3457. additionally resolve the external identifier into the
  3458. <termref def="dt-sysid">system identifier</termref>,
  3459. file name, or other information needed to allow the
  3460. application to call a processor for data in the notation described.  (It
  3461. is not an error, however, for XML documents to declare and refer to
  3462. notations for which notation-specific applications are not available on
  3463. the system where the XML processor or application is running.)</p>
  3464.             </div2>
  3465.             <div2 id="sec-doc-entity">
  3466.                 <head>Document Entity</head>
  3467.                 <p>
  3468.                     <termdef id="dt-docent" term="Document Entity">The <term>document
  3469. entity</term> serves as the root of the entity
  3470. tree and a starting-point for an <termref def="dt-xml-proc">XML
  3471. processor</termref>.</termdef>
  3472. This specification does
  3473. not specify how the document entity is to be located by an XML
  3474. processor; unlike other entities, the document entity has no name and might
  3475. well appear on a processor input stream 
  3476. without any identification at all.</p>
  3477.             </div2>
  3478.         </div1>
  3479.         <!-- &Conformance; -->
  3480.         <div1 id="sec-conformance">
  3481.             <head>Conformance</head>
  3482.             <div2 id="proc-types">
  3483.                 <head>Validating and Non-Validating Processors</head>
  3484.                 <p>Conforming <termref def="dt-xml-proc">XML processors</termref> fall into two
  3485. classes: validating and non-validating.</p>
  3486.                 <p>Validating and non-validating processors alike must report
  3487. violations of this specification's well-formedness constraints
  3488. in the content of the
  3489. <termref def="dt-docent">document entity</termref> and any 
  3490. other <termref def="dt-parsedent">parsed entities</termref> that 
  3491. they read.</p>
  3492.                 <p>
  3493.                     <termdef id="dt-validating" term="Validating Processor">
  3494.                         <term>Validating processors</term> must report
  3495. violations of the constraints expressed by the declarations in the
  3496. <termref def="dt-doctype">DTD</termref>, and
  3497. failures to fulfill the validity constraints given
  3498. in this specification.
  3499. </termdef>
  3500. To accomplish this, validating XML processors must read and process the entire
  3501. DTD and all external parsed entities referenced in the document.
  3502. </p>
  3503.                 <p>Non-validating processors are required to check only the 
  3504. <termref def="dt-docent">document entity</termref>, including
  3505. the entire internal DTD subset, for well-formedness.
  3506. <termdef id="dt-use-mdecl" term="Process Declarations">
  3507. While they are not required to check the document for validity,
  3508. they are required to 
  3509. <term>process</term> all the declarations they read in the
  3510. internal DTD subset and in any parameter entity that they
  3511. read, up to the first reference
  3512. to a parameter entity that they do <emph>not</emph> read; that is to 
  3513. say, they must
  3514. use the information in those declarations to
  3515. <titleref href="AVNormalize">normalize</titleref> attribute values,
  3516. <titleref href="included">include</titleref> the replacement text of 
  3517. internal entities, and supply 
  3518. <titleref href="sec-attr-defaults">default attribute values</titleref>.
  3519. </termdef>
  3520. They must not <termref def="dt-use-mdecl">process</termref>
  3521.                     <termref def="dt-entdecl">entity declarations</termref> or 
  3522. <termref def="dt-attdecl">attribute-list declarations</termref> 
  3523. encountered after a reference to a parameter entity that is not
  3524. read, since the entity may have contained overriding declarations.
  3525. </p>
  3526.             </div2>
  3527.             <div2 id="safe-behavior">
  3528.                 <head>Using XML Processors</head>
  3529.                 <p>The behavior of a validating XML processor is highly predictable; it
  3530. must read every piece of a document and report all well-formedness and
  3531. validity violations.
  3532. Less is required of a non-validating processor; it need not read any
  3533. part of the document other than the document entity.
  3534. This has two effects that may be important to users of XML processors:
  3535. <ulist>
  3536.                         <item>
  3537.                             <p>Certain well-formedness errors, specifically those that require
  3538. reading external entities, may not be detected by a non-validating processor.
  3539. Examples include the constraints entitled 
  3540. <titleref href="wf-entdeclared">Entity Declared</titleref>, 
  3541. <titleref href="wf-textent">Parsed Entity</titleref>, and
  3542. <titleref href="wf-norecursion">No Recursion</titleref>, as well
  3543. as some of the cases described as
  3544. <titleref href="forbidden">forbidden</titleref> in 
  3545. <specref ref="entproc"/>.</p>
  3546.                         </item>
  3547.                         <item>
  3548.                             <p>The information passed from the processor to the application may
  3549. vary, depending on whether the processor reads
  3550. parameter and external entities.
  3551. For example, a non-validating processor may not 
  3552. <titleref href="AVNormalize">normalize</titleref> attribute values,
  3553. <titleref href="included">include</titleref> the replacement text of 
  3554. internal entities, or supply 
  3555. <titleref href="sec-attr-defaults">default attribute values</titleref>,
  3556. where doing so depends on having read declarations in 
  3557. external or parameter entities.</p>
  3558.                         </item>
  3559.                     </ulist>
  3560.                 </p>
  3561.                 <p>For maximum reliability in interoperating between different XML
  3562. processors, applications which use non-validating processors should not 
  3563. rely on any behaviors not required of such processors.
  3564. Applications which require facilities such as the use of default
  3565. attributes or internal entities which are declared in external
  3566. entities should use validating XML processors.</p>
  3567.             </div2>
  3568.         </div1>
  3569.         <div1 id="sec-notation">
  3570.             <head>Notation</head>
  3571.             <p>The formal grammar of XML is given in this specification using a simple
  3572. Extended Backus-Naur Form (EBNF) notation.  Each rule in the grammar defines
  3573. one symbol, in the form
  3574. <eg>symbol ::= expression</eg>
  3575.             </p>
  3576.             <p>Symbols are written with an initial capital letter if they are
  3577. defined by a regular expression, or with an initial lower case letter 
  3578. otherwise.
  3579. Literal strings are quoted.
  3580.  
  3581. </p>
  3582.             <p>Within the expression on the right-hand side of a rule, the following
  3583. expressions are used to match strings of one or more characters:
  3584. <glist>
  3585.                     <gitem>
  3586.                         <label>
  3587.                             <code>#xN</code>
  3588.                         </label>
  3589.                         <def>
  3590.                             <p>where <code>N</code> is a hexadecimal integer, the
  3591. expression matches the character in ISO/IEC 10646 whose canonical
  3592. (UCS-4) 
  3593. code value, when interpreted as an unsigned binary number, has
  3594. the value indicated.  The number of leading zeros in the
  3595. <code>#xN</code> form is insignificant; the number of leading
  3596. zeros in the corresponding code value 
  3597. is governed by the character
  3598. encoding in use and is not significant for XML.</p>
  3599.                         </def>
  3600.                     </gitem>
  3601.                     <gitem>
  3602.                         <label>
  3603.                             <code>[a-zA-Z]</code>, <code>[#xN-#xN]</code>
  3604.                         </label>
  3605.                         <def>
  3606.                             <p>matches any <termref def="dt-character">character</termref> 
  3607. with a value in the range(s) indicated (inclusive).</p>
  3608.                         </def>
  3609.                     </gitem>
  3610.                     <gitem>
  3611.                         <label>
  3612.                             <code>[^a-z]</code>, <code>[^#xN-#xN]</code>
  3613.                         </label>
  3614.                         <def>
  3615.                             <p>matches any <termref def="dt-character">character</termref> 
  3616. with a value <emph>outside</emph> the
  3617. range indicated.</p>
  3618.                         </def>
  3619.                     </gitem>
  3620.                     <gitem>
  3621.                         <label>
  3622.                             <code>[^abc]</code>, <code>[^#xN#xN#xN]</code>
  3623.                         </label>
  3624.                         <def>
  3625.                             <p>matches any <termref def="dt-character">character</termref>
  3626. with a value not among the characters given.</p>
  3627.                         </def>
  3628.                     </gitem>
  3629.                     <gitem>
  3630.                         <label>
  3631.                             <code>"string"</code>
  3632.                         </label>
  3633.                         <def>
  3634.                             <p>matches a literal string <termref def="dt-match">matching</termref>
  3635. that given inside the double quotes.</p>
  3636.                         </def>
  3637.                     </gitem>
  3638.                     <gitem>
  3639.                         <label>
  3640.                             <code>'string'</code>
  3641.                         </label>
  3642.                         <def>
  3643.                             <p>matches a literal string <termref def="dt-match">matching</termref>
  3644. that given inside the single quotes.</p>
  3645.                         </def>
  3646.                     </gitem>
  3647.                 </glist>
  3648. These symbols may be combined to match more complex patterns as follows,
  3649. where <code>A</code> and <code>B</code> represent simple expressions:
  3650. <glist>
  3651.                     <gitem>
  3652.                         <label>(<code>expression</code>)</label>
  3653.                         <def>
  3654.                             <p>
  3655.                                 <code>expression</code> is treated as a unit 
  3656. and may be combined as described in this list.</p>
  3657.                         </def>
  3658.                     </gitem>
  3659.                     <gitem>
  3660.                         <label>
  3661.                             <code>A?</code>
  3662.                         </label>
  3663.                         <def>
  3664.                             <p>matches <code>A</code> or nothing; optional <code>A</code>.</p>
  3665.                         </def>
  3666.                     </gitem>
  3667.                     <gitem>
  3668.                         <label>
  3669.                             <code>A B</code>
  3670.                         </label>
  3671.                         <def>
  3672.                             <p>matches <code>A</code> followed by <code>B</code>.</p>
  3673.                         </def>
  3674.                     </gitem>
  3675.                     <gitem>
  3676.                         <label>
  3677.                             <code>A | B</code>
  3678.                         </label>
  3679.                         <def>
  3680.                             <p>matches <code>A</code> or <code>B</code> but not both.</p>
  3681.                         </def>
  3682.                     </gitem>
  3683.                     <gitem>
  3684.                         <label>
  3685.                             <code>A - B</code>
  3686.                         </label>
  3687.                         <def>
  3688.                             <p>matches any string that matches <code>A</code> but does not match
  3689. <code>B</code>.
  3690. </p>
  3691.                         </def>
  3692.                     </gitem>
  3693.                     <gitem>
  3694.                         <label>
  3695.                             <code>A+</code>
  3696.                         </label>
  3697.                         <def>
  3698.                             <p>matches one or more occurrences of <code>A</code>.</p>
  3699.                         </def>
  3700.                     </gitem>
  3701.                     <gitem>
  3702.                         <label>
  3703.                             <code>A*</code>
  3704.                         </label>
  3705.                         <def>
  3706.                             <p>matches zero or more occurrences of <code>A</code>.</p>
  3707.                         </def>
  3708.                     </gitem>
  3709.                 </glist>
  3710. Other notations used in the productions are:
  3711. <glist>
  3712.                     <gitem>
  3713.                         <label>
  3714.                             <code>/* ... */</code>
  3715.                         </label>
  3716.                         <def>
  3717.                             <p>comment.</p>
  3718.                         </def>
  3719.                     </gitem>
  3720.                     <gitem>
  3721.                         <label>
  3722.                             <code>[ wfc: ... ]</code>
  3723.                         </label>
  3724.                         <def>
  3725.                             <p>well-formedness constraint; this identifies by name a 
  3726. constraint on 
  3727. <termref def="dt-wellformed">well-formed</termref> documents
  3728. associated with a production.</p>
  3729.                         </def>
  3730.                     </gitem>
  3731.                     <gitem>
  3732.                         <label>
  3733.                             <code>[ vc: ... ]</code>
  3734.                         </label>
  3735.                         <def>
  3736.                             <p>validity constraint; this identifies by name a constraint on
  3737. <termref def="dt-valid">valid</termref> documents associated with
  3738. a production.</p>
  3739.                         </def>
  3740.                     </gitem>
  3741.                 </glist>
  3742.             </p>
  3743.         </div1>
  3744.     </body>
  3745.     <back>
  3746.         <!-- &SGML; -->
  3747.         <!-- &Biblio; -->
  3748.         <div1 id="sec-bibliography">
  3749.             <head>References</head>
  3750.             <div2 id="sec-existing-stds">
  3751.                 <head>Normative References</head>
  3752.                 <blist>
  3753.                     <bibl id="IANA" key="IANA">
  3754. (Internet Assigned Numbers Authority) <emph>Official Names for 
  3755. Character Sets</emph>,
  3756. ed. Keld Simonsen et al.
  3757. See <loc href="ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets">ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets</loc>.
  3758. </bibl>
  3759.                     <bibl id="RFC1766" key="IETF RFC 1766">
  3760. IETF (Internet Engineering Task Force).
  3761. <emph>RFC 1766:  Tags for the Identification of Languages</emph>,
  3762. ed. H. Alvestrand.
  3763. 1995.
  3764. </bibl>
  3765.                     <bibl id="ISO639" key="ISO 639">
  3766. (International Organization for Standardization).
  3767. <emph>ISO 639:1988 (E).
  3768. Code for the representation of names of languages.</emph>
  3769. [Geneva]:  International Organization for
  3770. Standardization, 1988.</bibl>
  3771.                     <bibl id="ISO3166" key="ISO 3166">
  3772. (International Organization for Standardization).
  3773. <emph>ISO 3166-1:1997 (E).
  3774. Codes for the representation of names of countries and their subdivisions 
  3775. — Part 1: Country codes</emph>
  3776. [Geneva]:  International Organization for
  3777. Standardization, 1997.</bibl>
  3778.                     <bibl id="ISO10646" key="ISO/IEC 10646">ISO
  3779. (International Organization for Standardization).
  3780. <emph>ISO/IEC 10646-1993 (E).  Information technology — Universal
  3781. Multiple-Octet Coded Character Set (UCS) — Part 1:
  3782. Architecture and Basic Multilingual Plane.</emph>
  3783. [Geneva]:  International Organization for
  3784. Standardization, 1993 (plus amendments AM 1 through AM 7).
  3785. </bibl>
  3786.                     <bibl id="Unicode" key="Unicode">The Unicode Consortium.
  3787. <emph>The Unicode Standard, Version 2.0.</emph>
  3788. Reading, Mass.:  Addison-Wesley Developers Press, 1996.</bibl>
  3789.                 </blist>
  3790.             </div2>
  3791.             <div2>
  3792.                 <head>Other References</head>
  3793.                 <blist>
  3794.                     <bibl id="Aho" key="Aho/Ullman">Aho, Alfred V., 
  3795. Ravi Sethi, and Jeffrey D. Ullman.
  3796. <emph>Compilers:  Principles, Techniques, and Tools</emph>.
  3797. Reading:  Addison-Wesley, 1986, rpt. corr. 1988.</bibl>
  3798.                     <bibl id="Berners-Lee" key="Berners-Lee et al.">
  3799. Berners-Lee, T., R. Fielding, and L. Masinter.
  3800. <emph>Uniform Resource Identifiers (URI):  Generic Syntax and
  3801. Semantics</emph>.
  3802. 1997.
  3803. (Work in progress; see updates to RFC1738.)</bibl>
  3804.                     <bibl id="ABK" key="Brⁿggemann-Klein">Brⁿggemann-Klein, Anne.
  3805. <emph>Regular Expressions into Finite Automata</emph>.
  3806. Extended abstract in I. Simon, Hrsg., LATIN 1992, 
  3807. S. 97-98. Springer-Verlag, Berlin 1992. 
  3808. Full Version in Theoretical Computer Science 120: 197-213, 1993.
  3809.  
  3810. </bibl>
  3811.                     <bibl id="ABKDW" key="Brⁿggemann-Klein and Wood">Brⁿggemann-Klein, Anne,
  3812. and Derick Wood.
  3813. <emph>Deterministic Regular Languages</emph>.
  3814. UniversitΣt Freiburg, Institut fⁿr Informatik,
  3815. Bericht 38, Oktober 1991.
  3816. </bibl>
  3817.                     <bibl id="Clark" key="Clark">James Clark.
  3818. Comparison of SGML and XML. See
  3819. <loc href="http://www.w3.org/TR/NOTE-sgml-xml-971215">http://www.w3.org/TR/NOTE-sgml-xml-971215</loc>.
  3820. </bibl>
  3821.                     <bibl id="RFC1738" key="IETF RFC1738">
  3822. IETF (Internet Engineering Task Force).
  3823. <emph>RFC 1738:  Uniform Resource Locators (URL)</emph>, 
  3824. ed. T. Berners-Lee, L. Masinter, M. McCahill.
  3825. 1994.
  3826. </bibl>
  3827.                     <bibl id="RFC1808" key="IETF RFC1808">
  3828. IETF (Internet Engineering Task Force).
  3829. <emph>RFC 1808:  Relative Uniform Resource Locators</emph>, 
  3830. ed. R. Fielding.
  3831. 1995.
  3832. </bibl>
  3833.                     <bibl id="RFC2141" key="IETF RFC2141">
  3834. IETF (Internet Engineering Task Force).
  3835. <emph>RFC 2141:  URN Syntax</emph>, 
  3836. ed. R. Moats.
  3837. 1997.
  3838. </bibl>
  3839.                     <bibl id="ISO8879" key="ISO 8879">ISO
  3840. (International Organization for Standardization).
  3841. <emph>ISO 8879:1986(E).  Information processing — Text and Office
  3842. Systems — Standard Generalized Markup Language (SGML).</emph>  First
  3843. edition — 1986-10-15.  [Geneva]:  International Organization for
  3844. Standardization, 1986.
  3845. </bibl>
  3846.                     <bibl id="ISO10744" key="ISO/IEC 10744">ISO
  3847. (International Organization for Standardization).
  3848. <emph>ISO/IEC 10744-1992 (E).  Information technology —
  3849. Hypermedia/Time-based Structuring Language (HyTime).
  3850. </emph>
  3851. [Geneva]:  International Organization for
  3852. Standardization, 1992.
  3853. <emph>Extended Facilities Annexe.</emph>
  3854. [Geneva]:  International Organization for
  3855. Standardization, 1996. 
  3856. </bibl>
  3857.                 </blist>
  3858.             </div2>
  3859.         </div1>
  3860.         <div1 id="CharClasses">
  3861.             <head>Character Classes</head>
  3862.             <p>Following the characteristics defined in the Unicode standard,
  3863. characters are classed as base characters (among others, these
  3864. contain the alphabetic characters of the Latin alphabet, without
  3865. diacritics), ideographic characters, and combining characters (among
  3866. others, this class contains most diacritics); these classes combine
  3867. to form the class of letters.  Digits and extenders are
  3868. also distinguished.
  3869. <scrap lang="ebnf" id="CHARACTERS">
  3870.                     <head>Characters</head>
  3871.                     <prodgroup pcw3="3" pcw4="15">
  3872.                         <prod id="NT-Letter">
  3873.                             <lhs>Letter</lhs>
  3874.                             <rhs>
  3875.                                 <nt def="NT-BaseChar">BaseChar</nt> 
  3876. | <nt def="NT-Ideographic">Ideographic</nt>
  3877.                             </rhs>
  3878.                         </prod>
  3879.                         <prod id="NT-BaseChar">
  3880.                             <lhs>BaseChar</lhs>
  3881.                             <rhs>[#x0041-#x005A]
  3882. | [#x0061-#x007A]
  3883. | [#x00C0-#x00D6]
  3884. | [#x00D8-#x00F6]
  3885. | [#x00F8-#x00FF]
  3886. | [#x0100-#x0131]
  3887. | [#x0134-#x013E]
  3888. | [#x0141-#x0148]
  3889. | [#x014A-#x017E]
  3890. | [#x0180-#x01C3]
  3891. | [#x01CD-#x01F0]
  3892. | [#x01F4-#x01F5]
  3893. | [#x01FA-#x0217]
  3894. | [#x0250-#x02A8]
  3895. | [#x02BB-#x02C1]
  3896. | #x0386
  3897. | [#x0388-#x038A]
  3898. | #x038C
  3899. | [#x038E-#x03A1]
  3900. | [#x03A3-#x03CE]
  3901. | [#x03D0-#x03D6]
  3902. | #x03DA
  3903. | #x03DC
  3904. | #x03DE
  3905. | #x03E0
  3906. | [#x03E2-#x03F3]
  3907. | [#x0401-#x040C]
  3908. | [#x040E-#x044F]
  3909. | [#x0451-#x045C]
  3910. | [#x045E-#x0481]
  3911. | [#x0490-#x04C4]
  3912. | [#x04C7-#x04C8]
  3913. | [#x04CB-#x04CC]
  3914. | [#x04D0-#x04EB]
  3915. | [#x04EE-#x04F5]
  3916. | [#x04F8-#x04F9]
  3917. | [#x0531-#x0556]
  3918. | #x0559
  3919. | [#x0561-#x0586]
  3920. | [#x05D0-#x05EA]
  3921. | [#x05F0-#x05F2]
  3922. | [#x0621-#x063A]
  3923. | [#x0641-#x064A]
  3924. | [#x0671-#x06B7]
  3925. | [#x06BA-#x06BE]
  3926. | [#x06C0-#x06CE]
  3927. | [#x06D0-#x06D3]
  3928. | #x06D5
  3929. | [#x06E5-#x06E6]
  3930. | [#x0905-#x0939]
  3931. | #x093D
  3932. | [#x0958-#x0961]
  3933. | [#x0985-#x098C]
  3934. | [#x098F-#x0990]
  3935. | [#x0993-#x09A8]
  3936. | [#x09AA-#x09B0]
  3937. | #x09B2
  3938. | [#x09B6-#x09B9]
  3939. | [#x09DC-#x09DD]
  3940. | [#x09DF-#x09E1]
  3941. | [#x09F0-#x09F1]
  3942. | [#x0A05-#x0A0A]
  3943. | [#x0A0F-#x0A10]
  3944. | [#x0A13-#x0A28]
  3945. | [#x0A2A-#x0A30]
  3946. | [#x0A32-#x0A33]
  3947. | [#x0A35-#x0A36]
  3948. | [#x0A38-#x0A39]
  3949. | [#x0A59-#x0A5C]
  3950. | #x0A5E
  3951. | [#x0A72-#x0A74]
  3952. | [#x0A85-#x0A8B]
  3953. | #x0A8D
  3954. | [#x0A8F-#x0A91]
  3955. | [#x0A93-#x0AA8]
  3956. | [#x0AAA-#x0AB0]
  3957. | [#x0AB2-#x0AB3]
  3958. | [#x0AB5-#x0AB9]
  3959. | #x0ABD
  3960. | #x0AE0
  3961. | [#x0B05-#x0B0C]
  3962. | [#x0B0F-#x0B10]
  3963. | [#x0B13-#x0B28]
  3964. | [#x0B2A-#x0B30]
  3965. | [#x0B32-#x0B33]
  3966. | [#x0B36-#x0B39]
  3967. | #x0B3D
  3968. | [#x0B5C-#x0B5D]
  3969. | [#x0B5F-#x0B61]
  3970. | [#x0B85-#x0B8A]
  3971. | [#x0B8E-#x0B90]
  3972. | [#x0B92-#x0B95]
  3973. | [#x0B99-#x0B9A]
  3974. | #x0B9C
  3975. | [#x0B9E-#x0B9F]
  3976. | [#x0BA3-#x0BA4]
  3977. | [#x0BA8-#x0BAA]
  3978. | [#x0BAE-#x0BB5]
  3979. | [#x0BB7-#x0BB9]
  3980. | [#x0C05-#x0C0C]
  3981. | [#x0C0E-#x0C10]
  3982. | [#x0C12-#x0C28]
  3983. | [#x0C2A-#x0C33]
  3984. | [#x0C35-#x0C39]
  3985. | [#x0C60-#x0C61]
  3986. | [#x0C85-#x0C8C]
  3987. | [#x0C8E-#x0C90]
  3988. | [#x0C92-#x0CA8]
  3989. | [#x0CAA-#x0CB3]
  3990. | [#x0CB5-#x0CB9]
  3991. | #x0CDE
  3992. | [#x0CE0-#x0CE1]
  3993. | [#x0D05-#x0D0C]
  3994. | [#x0D0E-#x0D10]
  3995. | [#x0D12-#x0D28]
  3996. | [#x0D2A-#x0D39]
  3997. | [#x0D60-#x0D61]
  3998. | [#x0E01-#x0E2E]
  3999. | #x0E30
  4000. | [#x0E32-#x0E33]
  4001. | [#x0E40-#x0E45]
  4002. | [#x0E81-#x0E82]
  4003. | #x0E84
  4004. | [#x0E87-#x0E88]
  4005. | #x0E8A
  4006. | #x0E8D
  4007. | [#x0E94-#x0E97]
  4008. | [#x0E99-#x0E9F]
  4009. | [#x0EA1-#x0EA3]
  4010. | #x0EA5
  4011. | #x0EA7
  4012. | [#x0EAA-#x0EAB]
  4013. | [#x0EAD-#x0EAE]
  4014. | #x0EB0
  4015. | [#x0EB2-#x0EB3]
  4016. | #x0EBD
  4017. | [#x0EC0-#x0EC4]
  4018. | [#x0F40-#x0F47]
  4019. | [#x0F49-#x0F69]
  4020. | [#x10A0-#x10C5]
  4021. | [#x10D0-#x10F6]
  4022. | #x1100
  4023. | [#x1102-#x1103]
  4024. | [#x1105-#x1107]
  4025. | #x1109
  4026. | [#x110B-#x110C]
  4027. | [#x110E-#x1112]
  4028. | #x113C
  4029. | #x113E
  4030. | #x1140
  4031. | #x114C
  4032. | #x114E
  4033. | #x1150
  4034. | [#x1154-#x1155]
  4035. | #x1159
  4036. | [#x115F-#x1161]
  4037. | #x1163
  4038. | #x1165
  4039. | #x1167
  4040. | #x1169
  4041. | [#x116D-#x116E]
  4042. | [#x1172-#x1173]
  4043. | #x1175
  4044. | #x119E
  4045. | #x11A8
  4046. | #x11AB
  4047. | [#x11AE-#x11AF]
  4048. | [#x11B7-#x11B8]
  4049. | #x11BA
  4050. | [#x11BC-#x11C2]
  4051. | #x11EB
  4052. | #x11F0
  4053. | #x11F9
  4054. | [#x1E00-#x1E9B]
  4055. | [#x1EA0-#x1EF9]
  4056. | [#x1F00-#x1F15]
  4057. | [#x1F18-#x1F1D]
  4058. | [#x1F20-#x1F45]
  4059. | [#x1F48-#x1F4D]
  4060. | [#x1F50-#x1F57]
  4061. | #x1F59
  4062. | #x1F5B
  4063. | #x1F5D
  4064. | [#x1F5F-#x1F7D]
  4065. | [#x1F80-#x1FB4]
  4066. | [#x1FB6-#x1FBC]
  4067. | #x1FBE
  4068. | [#x1FC2-#x1FC4]
  4069. | [#x1FC6-#x1FCC]
  4070. | [#x1FD0-#x1FD3]
  4071. | [#x1FD6-#x1FDB]
  4072. | [#x1FE0-#x1FEC]
  4073. | [#x1FF2-#x1FF4]
  4074. | [#x1FF6-#x1FFC]
  4075. | #x2126
  4076. | [#x212A-#x212B]
  4077. | #x212E
  4078. | [#x2180-#x2182]
  4079. | [#x3041-#x3094]
  4080. | [#x30A1-#x30FA]
  4081. | [#x3105-#x312C]
  4082. | [#xAC00-#xD7A3]
  4083. </rhs>
  4084.                         </prod>
  4085.                         <prod id="NT-Ideographic">
  4086.                             <lhs>Ideographic</lhs>
  4087.                             <rhs>[#x4E00-#x9FA5]
  4088. | #x3007
  4089. | [#x3021-#x3029]
  4090. </rhs>
  4091.                         </prod>
  4092.                         <prod id="NT-CombiningChar">
  4093.                             <lhs>CombiningChar</lhs>
  4094.                             <rhs>[#x0300-#x0345]
  4095. | [#x0360-#x0361]
  4096. | [#x0483-#x0486]
  4097. | [#x0591-#x05A1]
  4098. | [#x05A3-#x05B9]
  4099. | [#x05BB-#x05BD]
  4100. | #x05BF
  4101. | [#x05C1-#x05C2]
  4102. | #x05C4
  4103. | [#x064B-#x0652]
  4104. | #x0670
  4105. | [#x06D6-#x06DC]
  4106. | [#x06DD-#x06DF]
  4107. | [#x06E0-#x06E4]
  4108. | [#x06E7-#x06E8]
  4109. | [#x06EA-#x06ED]
  4110. | [#x0901-#x0903]
  4111. | #x093C
  4112. | [#x093E-#x094C]
  4113. | #x094D
  4114. | [#x0951-#x0954]
  4115. | [#x0962-#x0963]
  4116. | [#x0981-#x0983]
  4117. | #x09BC
  4118. | #x09BE
  4119. | #x09BF
  4120. | [#x09C0-#x09C4]
  4121. | [#x09C7-#x09C8]
  4122. | [#x09CB-#x09CD]
  4123. | #x09D7
  4124. | [#x09E2-#x09E3]
  4125. | #x0A02
  4126. | #x0A3C
  4127. | #x0A3E
  4128. | #x0A3F
  4129. | [#x0A40-#x0A42]
  4130. | [#x0A47-#x0A48]
  4131. | [#x0A4B-#x0A4D]
  4132. | [#x0A70-#x0A71]
  4133. | [#x0A81-#x0A83]
  4134. | #x0ABC
  4135. | [#x0ABE-#x0AC5]
  4136. | [#x0AC7-#x0AC9]
  4137. | [#x0ACB-#x0ACD]
  4138. | [#x0B01-#x0B03]
  4139. | #x0B3C
  4140. | [#x0B3E-#x0B43]
  4141. | [#x0B47-#x0B48]
  4142. | [#x0B4B-#x0B4D]
  4143. | [#x0B56-#x0B57]
  4144. | [#x0B82-#x0B83]
  4145. | [#x0BBE-#x0BC2]
  4146. | [#x0BC6-#x0BC8]
  4147. | [#x0BCA-#x0BCD]
  4148. | #x0BD7
  4149. | [#x0C01-#x0C03]
  4150. | [#x0C3E-#x0C44]
  4151. | [#x0C46-#x0C48]
  4152. | [#x0C4A-#x0C4D]
  4153. | [#x0C55-#x0C56]
  4154. | [#x0C82-#x0C83]
  4155. | [#x0CBE-#x0CC4]
  4156. | [#x0CC6-#x0CC8]
  4157. | [#x0CCA-#x0CCD]
  4158. | [#x0CD5-#x0CD6]
  4159. | [#x0D02-#x0D03]
  4160. | [#x0D3E-#x0D43]
  4161. | [#x0D46-#x0D48]
  4162. | [#x0D4A-#x0D4D]
  4163. | #x0D57
  4164. | #x0E31
  4165. | [#x0E34-#x0E3A]
  4166. | [#x0E47-#x0E4E]
  4167. | #x0EB1
  4168. | [#x0EB4-#x0EB9]
  4169. | [#x0EBB-#x0EBC]
  4170. | [#x0EC8-#x0ECD]
  4171. | [#x0F18-#x0F19]
  4172. | #x0F35
  4173. | #x0F37
  4174. | #x0F39
  4175. | #x0F3E
  4176. | #x0F3F
  4177. | [#x0F71-#x0F84]
  4178. | [#x0F86-#x0F8B]
  4179. | [#x0F90-#x0F95]
  4180. | #x0F97
  4181. | [#x0F99-#x0FAD]
  4182. | [#x0FB1-#x0FB7]
  4183. | #x0FB9
  4184. | [#x20D0-#x20DC]
  4185. | #x20E1
  4186. | [#x302A-#x302F]
  4187. | #x3099
  4188. | #x309A
  4189. </rhs>
  4190.                         </prod>
  4191.                         <prod id="NT-Digit">
  4192.                             <lhs>Digit</lhs>
  4193.                             <rhs>[#x0030-#x0039]
  4194. | [#x0660-#x0669]
  4195. | [#x06F0-#x06F9]
  4196. | [#x0966-#x096F]
  4197. | [#x09E6-#x09EF]
  4198. | [#x0A66-#x0A6F]
  4199. | [#x0AE6-#x0AEF]
  4200. | [#x0B66-#x0B6F]
  4201. | [#x0BE7-#x0BEF]
  4202. | [#x0C66-#x0C6F]
  4203. | [#x0CE6-#x0CEF]
  4204. | [#x0D66-#x0D6F]
  4205. | [#x0E50-#x0E59]
  4206. | [#x0ED0-#x0ED9]
  4207. | [#x0F20-#x0F29]
  4208. </rhs>
  4209.                         </prod>
  4210.                         <prod id="NT-Extender">
  4211.                             <lhs>Extender</lhs>
  4212.                             <rhs>#x00B7
  4213. | #x02D0
  4214. | #x02D1
  4215. | #x0387
  4216. | #x0640
  4217. | #x0E46
  4218. | #x0EC6
  4219. | #x3005
  4220. | [#x3031-#x3035]
  4221. | [#x309D-#x309E]
  4222. | [#x30FC-#x30FE]
  4223. </rhs>
  4224.                         </prod>
  4225.                     </prodgroup>
  4226.                 </scrap>
  4227.             </p>
  4228.             <p>The character classes defined here can be derived from the
  4229. Unicode character database as follows:
  4230. <ulist>
  4231.                     <item>
  4232.                         <p>Name start characters must have one of the categories Ll, Lu,
  4233. Lo, Lt, Nl.</p>
  4234.                     </item>
  4235.                     <item>
  4236.                         <p>Name characters other than Name-start characters 
  4237. must have one of the categories Mc, Me, Mn, Lm, or Nd.</p>
  4238.                     </item>
  4239.                     <item>
  4240.                         <p>Characters in the compatibility area (i.e. with character code
  4241. greater than #xF900 and less than #xFFFE) are not allowed in XML
  4242. names.</p>
  4243.                     </item>
  4244.                     <item>
  4245.                         <p>Characters which have a font or compatibility decomposition (i.e. those
  4246. with a "compatibility formatting tag" in field 5 of the database --
  4247. marked by field 5 beginning with a "<") are not allowed.</p>
  4248.                     </item>
  4249.                     <item>
  4250.                         <p>The following characters are treated as name-start characters
  4251. rather than name characters, because the property file classifies
  4252. them as Alphabetic:  [#x02BB-#x02C1], #x0559, #x06E5, #x06E6.</p>
  4253.                     </item>
  4254.                     <item>
  4255.                         <p>Characters #x20DD-#x20E0 are excluded (in accordance with 
  4256. Unicode, section 5.14).</p>
  4257.                     </item>
  4258.                     <item>
  4259.                         <p>Character #x00B7 is classified as an extender, because the
  4260. property list so identifies it.</p>
  4261.                     </item>
  4262.                     <item>
  4263.                         <p>Character #x0387 is added as a name character, because #x00B7
  4264. is its canonical equivalent.</p>
  4265.                     </item>
  4266.                     <item>
  4267.                         <p>Characters ':' and '_' are allowed as name-start characters.</p>
  4268.                     </item>
  4269.                     <item>
  4270.                         <p>Characters '-' and '.' are allowed as name characters.</p>
  4271.                     </item>
  4272.                 </ulist>
  4273.             </p>
  4274.         </div1>
  4275.         <inform-div1 id="sec-xml-and-sgml">
  4276.             <head>XML and SGML</head>
  4277.             <p>XML is designed to be a subset of SGML, in that every
  4278. <termref def="dt-valid">valid</termref> XML document should also be a
  4279. conformant SGML document.
  4280. For a detailed comparison of the additional restrictions that XML places on
  4281. documents beyond those of SGML, see <bibref ref="Clark"/>.
  4282. </p>
  4283.         </inform-div1>
  4284.         <inform-div1 id="sec-entexpand">
  4285.             <head>Expansion of Entity and Character References</head>
  4286.             <p>This appendix contains some examples illustrating the
  4287. sequence of entity- and character-reference recognition and
  4288. expansion, as specified in <specref ref="entproc"/>.</p>
  4289.             <p>
  4290. If the DTD contains the declaration 
  4291. <eg>
  4292.                     <![CDATA[<!ENTITY example "<p>An ampersand (&#38;) may be escaped
  4293. numerically (&#38;#38;) or with a general entity
  4294. (&amp;).</p>" >
  4295. ]]>
  4296.                 </eg>
  4297. then the XML processor will recognize the character references 
  4298. when it parses the entity declaration, and resolve them before 
  4299. storing the following string as the
  4300. value of the entity "<code>example</code>":
  4301. <eg>
  4302.                     <![CDATA[<p>An ampersand (&) may be escaped
  4303. numerically (&#38;) or with a general entity
  4304. (&amp;).</p>
  4305. ]]>
  4306.                 </eg>
  4307. A reference in the document to "<code>&example;</code>" 
  4308. will cause the text to be reparsed, at which time the 
  4309. start- and end-tags of the "<code>p</code>" element will be recognized 
  4310. and the three references will be recognized and expanded, 
  4311. resulting in a "<code>p</code>" element with the following content
  4312. (all data, no delimiters or markup):
  4313. <eg>
  4314.                     <![CDATA[An ampersand (&) may be escaped
  4315. numerically (&) or with a general entity
  4316. (&).
  4317. ]]>
  4318.                 </eg>
  4319.             </p>
  4320.             <p>A more complex example will illustrate the rules and their
  4321. effects fully.  In the following example, the line numbers are
  4322. solely for reference.
  4323. <eg>
  4324.                     <![CDATA[1 <?xml version='1.0'?>
  4325. 2 <!DOCTYPE test [
  4326. 3 <!ELEMENT test (#PCDATA) >
  4327. 4 <!ENTITY % xx '%zz;'>
  4328. 5 <!ENTITY % zz '<!ENTITY tricky "error-prone" >' >
  4329. 6 %xx;
  4330. 7 ]>
  4331. 8 <test>This sample shows a &tricky; method.</test>
  4332. ]]>
  4333.                 </eg>
  4334. This produces the following:
  4335. <ulist spacing="compact">
  4336.                     <item>
  4337.                         <p>in line 4, the reference to character 37 is expanded immediately,
  4338. and the parameter entity "<code>xx</code>" is stored in the symbol
  4339. table with the value "<code>%zz;</code>".  Since the replacement text
  4340. is not rescanned, the reference to parameter entity "<code>zz</code>"
  4341. is not recognized.  (And it would be an error if it were, since
  4342. "<code>zz</code>" is not yet declared.)</p>
  4343.                     </item>
  4344.                     <item>
  4345.                         <p>in line 5, the character reference "<code>&#60;</code>" is
  4346. expanded immediately and the parameter entity "<code>zz</code>" is
  4347. stored with the replacement text 
  4348. "<code><!ENTITY tricky "error-prone" ></code>",
  4349. which is a well-formed entity declaration.</p>
  4350.                     </item>
  4351.                     <item>
  4352.                         <p>in line 6, the reference to "<code>xx</code>" is recognized,
  4353. and the replacement text of "<code>xx</code>" (namely 
  4354. "<code>%zz;</code>") is parsed.  The reference to "<code>zz</code>"
  4355. is recognized in its turn, and its replacement text 
  4356. ("<code><!ENTITY tricky "error-prone" ></code>") is parsed.
  4357. The general entity "<code>tricky</code>" has now been
  4358. declared, with the replacement text "<code>error-prone</code>".</p>
  4359.                     </item>
  4360.                     <item>
  4361.                         <p>
  4362. in line 8, the reference to the general entity "<code>tricky</code>" is
  4363. recognized, and it is expanded, so the full content of the
  4364. "<code>test</code>" element is the self-describing (and ungrammatical) string
  4365. <emph>This sample shows a error-prone method.</emph>
  4366.                         </p>
  4367.                     </item>
  4368.                 </ulist>
  4369.             </p>
  4370.         </inform-div1>
  4371.         <inform-div1 id="determinism">
  4372.             <head>Deterministic Content Models</head>
  4373.             <p>
  4374.                 <termref def="dt-compat">For compatibility</termref>, it is
  4375. required
  4376. that content models in element type declarations be deterministic.  
  4377. </p>
  4378.             <!-- FINAL EDIT:  WebSGML allows ambiguity? -->
  4379.             <p>SGML
  4380. requires deterministic content models (it calls them
  4381. "unambiguous"); XML processors built using SGML systems may
  4382. flag non-deterministic content models as errors.</p>
  4383.             <p>For example, the content model <code>((b, c) | (b, d))</code> is
  4384. non-deterministic, because given an initial <code>b</code> the parser
  4385. cannot know which <code>b</code> in the model is being matched without
  4386. looking ahead to see which element follows the <code>b</code>.
  4387. In this case, the two references to
  4388. <code>b</code> can be collapsed 
  4389. into a single reference, making the model read
  4390. <code>(b, (c | d))</code>.  An initial <code>b</code> now clearly
  4391. matches only a single name in the content model.  The parser doesn't
  4392. need to look ahead to see what follows; either <code>c</code> or
  4393. <code>d</code> would be accepted.</p>
  4394.             <p>More formally:  a finite state automaton may be constructed from the
  4395. content model using the standard algorithms, e.g. algorithm 3.5 
  4396. in section 3.9
  4397. of Aho, Sethi, and Ullman <bibref ref="Aho"/>.
  4398. In many such algorithms, a follow set is constructed for each 
  4399. position in the regular expression (i.e., each leaf 
  4400. node in the 
  4401. syntax tree for the regular expression);
  4402. if any position has a follow set in which 
  4403. more than one following position is 
  4404. labeled with the same element type name, 
  4405. then the content model is in error
  4406. and may be reported as an error.
  4407. </p>
  4408.             <p>Algorithms exist which allow many but not all non-deterministic
  4409. content models to be reduced automatically to equivalent deterministic
  4410. models; see Brⁿggemann-Klein 1991 <bibref ref="ABK"/>.</p>
  4411.         </inform-div1>
  4412.         <inform-div1 id="sec-guessing">
  4413.             <head>Autodetection of Character Encodings</head>
  4414.             <p>The XML encoding declaration functions as an internal label on each
  4415. entity, indicating which character encoding is in use.  Before an XML
  4416. processor can read the internal label, however, it apparently has to
  4417. know what character encoding is in use—which is what the internal label
  4418. is trying to indicate.  In the general case, this is a hopeless
  4419. situation. It is not entirely hopeless in XML, however, because XML
  4420. limits the general case in two ways:  each implementation is assumed
  4421. to support only a  finite set of character encodings, and the XML
  4422. encoding declaration is restricted in position and content in order to
  4423. make it feasible to autodetect the character encoding in use in each
  4424. entity in normal cases.  Also, in many cases other sources of information
  4425. are available in addition to the XML data stream itself.  
  4426. Two cases may be distinguished, 
  4427. depending on whether the XML entity is presented to the
  4428. processor without, or with, any accompanying
  4429. (external) information.  We consider the first case first.
  4430. </p>
  4431.             <p>
  4432. Because each XML entity not in UTF-8 or UTF-16 format <emph>must</emph>
  4433. begin with an XML encoding declaration, in which the first  characters
  4434. must be '<code><?xml</code>', any conforming processor can detect,
  4435. after two to four octets of input, which of the following cases apply. 
  4436. In reading this list, it may help to know that in UCS-4, '<' is
  4437. "<code>#x0000003C</code>" and '?' is "<code>#x0000003F</code>", and the Byte
  4438. Order Mark required of UTF-16 data streams is "<code>#xFEFF</code>".</p>
  4439.             <p>
  4440.                 <ulist>
  4441.                     <item>
  4442.                         <p>
  4443.                             <code>00 00 00 3C</code>: UCS-4, big-endian machine (1234 order)</p>
  4444.                     </item>
  4445.                     <item>
  4446.                         <p>
  4447.                             <code>3C 00 00 00</code>: UCS-4, little-endian machine (4321 order)</p>
  4448.                     </item>
  4449.                     <item>
  4450.                         <p>
  4451.                             <code>00 00 3C 00</code>: UCS-4, unusual octet order (2143)</p>
  4452.                     </item>
  4453.                     <item>
  4454.                         <p>
  4455.                             <code>00 3C 00 00</code>: UCS-4, unusual octet order (3412)</p>
  4456.                     </item>
  4457.                     <item>
  4458.                         <p>
  4459.                             <code>FE FF</code>: UTF-16, big-endian</p>
  4460.                     </item>
  4461.                     <item>
  4462.                         <p>
  4463.                             <code>FF FE</code>: UTF-16, little-endian</p>
  4464.                     </item>
  4465.                     <item>
  4466.                         <p>
  4467.                             <code>00 3C 00 3F</code>: UTF-16, big-endian, no Byte Order Mark
  4468. (and thus, strictly speaking, in error)</p>
  4469.                     </item>
  4470.                     <item>
  4471.                         <p>
  4472.                             <code>3C 00 3F 00</code>: UTF-16, little-endian, no Byte Order Mark
  4473. (and thus, strictly speaking, in error)</p>
  4474.                     </item>
  4475.                     <item>
  4476.                         <p>
  4477.                             <code>3C 3F 78 6D</code>: UTF-8, ISO 646, ASCII, some part of ISO 8859, 
  4478. Shift-JIS, EUC, or any other 7-bit, 8-bit, or mixed-width encoding
  4479. which ensures that the characters of ASCII have their normal positions,
  4480. width,
  4481. and values; the actual encoding declaration must be read to 
  4482. detect which of these applies, but since all of these encodings
  4483. use the same bit patterns for the ASCII characters, the encoding 
  4484. declaration itself may be read reliably
  4485. </p>
  4486.                     </item>
  4487.                     <item>
  4488.                         <p>
  4489.                             <code>4C 6F A7 94</code>: EBCDIC (in some flavor; the full
  4490. encoding declaration must be read to tell which code page is in 
  4491. use)</p>
  4492.                     </item>
  4493.                     <item>
  4494.                         <p>other: UTF-8 without an encoding declaration, or else 
  4495. the data stream is corrupt, fragmentary, or enclosed in
  4496. a wrapper of some kind</p>
  4497.                     </item>
  4498.                 </ulist>
  4499.             </p>
  4500.             <p>
  4501. This level of autodetection is enough to read the XML encoding
  4502. declaration and parse the character-encoding identifier, which is
  4503. still necessary to distinguish the individual members of each family
  4504. of encodings (e.g. to tell  UTF-8 from 8859, and the parts of 8859
  4505. from each other, or to distinguish the specific EBCDIC code page in
  4506. use, and so on).
  4507. </p>
  4508.             <p>
  4509. Because the contents of the encoding declaration are restricted to
  4510. ASCII characters, a processor can reliably read the entire encoding
  4511. declaration as soon as it has detected which family of encodings is in
  4512. use.  Since in practice, all widely used character encodings fall into
  4513. one of the categories above, the XML encoding declaration allows
  4514. reasonably reliable in-band labeling of character encodings, even when
  4515. external sources of information at the operating-system or
  4516. transport-protocol level are unreliable.
  4517. </p>
  4518.             <p>
  4519. Once the processor has detected the character encoding in use, it can
  4520. act appropriately, whether by invoking a separate input routine for
  4521. each case, or by calling the proper conversion function on each
  4522. character of input. 
  4523. </p>
  4524.             <p>
  4525. Like any self-labeling system, the XML encoding declaration will not
  4526. work if any software changes the entity's character set or encoding
  4527. without updating the encoding declaration.  Implementors of
  4528. character-encoding routines should be careful to ensure the accuracy
  4529. of the internal and external information used to label the entity.
  4530. </p>
  4531.             <p>The second possible case occurs when the XML entity is accompanied
  4532. by encoding information, as in some file systems and some network
  4533. protocols.
  4534. When multiple sources of information are available,
  4535.  
  4536. their relative
  4537. priority and the preferred method of handling conflict should be
  4538. specified as part of the higher-level protocol used to deliver XML.
  4539. Rules for the relative priority of the internal label and the
  4540. MIME-type label in an external header, for example, should be part of the
  4541. RFC document defining the text/xml and application/xml MIME types. In
  4542. the interests of interoperability, however, the following rules
  4543. are recommended.
  4544. <ulist>
  4545.                     <item>
  4546.                         <p>If an XML entity is in a file, the Byte-Order Mark
  4547. and encoding-declaration PI are used (if present) to determine the
  4548. character encoding.  All other heuristics and sources of information
  4549. are solely for error recovery.
  4550. </p>
  4551.                     </item>
  4552.                     <item>
  4553.                         <p>If an XML entity is delivered with a
  4554. MIME type of text/xml, then the <code>charset</code> parameter
  4555. on the MIME type determines the
  4556. character encoding method; all other heuristics and sources of
  4557. information are solely for error recovery.
  4558. </p>
  4559.                     </item>
  4560.                     <item>
  4561.                         <p>If an XML entity is delivered 
  4562. with a
  4563. MIME type of application/xml, then the Byte-Order Mark and
  4564. encoding-declaration PI are used (if present) to determine the
  4565. character encoding.  All other heuristics and sources of
  4566. information are solely for error recovery.
  4567. </p>
  4568.                     </item>
  4569.                 </ulist>
  4570. These rules apply only in the absence of protocol-level documentation;
  4571. in particular, when the MIME types text/xml and application/xml are
  4572. defined, the recommendations of the relevant RFC will supersede
  4573. these rules.
  4574. </p>
  4575.         </inform-div1>
  4576.         <inform-div1 id="sec-xml-wg">
  4577.             <head>W3C XML Working Group</head>
  4578.             <p>This specification was prepared and approved for publication by the
  4579. W3C XML Working Group (WG).  WG approval of this specification does
  4580. not necessarily imply that all WG members voted for its approval.  
  4581. The current and former members of the XML WG are:</p>
  4582.             <orglist>
  4583.                 <member>
  4584.                     <name>Jon Bosak, Sun</name>
  4585.                     <role>Chair</role>
  4586.                 </member>
  4587.                 <member>
  4588.                     <name>James Clark</name>
  4589.                     <role>Technical Lead</role>
  4590.                 </member>
  4591.                 <member>
  4592.                     <name>Tim Bray, Textuality and Netscape</name>
  4593.                     <role>XML Co-editor</role>
  4594.                 </member>
  4595.                 <member>
  4596.                     <name>Jean Paoli, Microsoft</name>
  4597.                     <role>XML Co-editor</role>
  4598.                 </member>
  4599.                 <member>
  4600.                     <name>C. M. Sperberg-McQueen, U. of Ill.</name>
  4601.                     <role>XML
  4602. Co-editor</role>
  4603.                 </member>
  4604.                 <member>
  4605.                     <name>Dan Connolly, W3C</name>
  4606.                     <role>W3C Liaison</role>
  4607.                 </member>
  4608.                 <member>
  4609.                     <name>Paula Angerstein, Texcel</name>
  4610.                 </member>
  4611.                 <member>
  4612.                     <name>Steve DeRose, INSO</name>
  4613.                 </member>
  4614.                 <member>
  4615.                     <name>Dave Hollander, HP</name>
  4616.                 </member>
  4617.                 <member>
  4618.                     <name>Eliot Kimber, ISOGEN</name>
  4619.                 </member>
  4620.                 <member>
  4621.                     <name>Eve Maler, ArborText</name>
  4622.                 </member>
  4623.                 <member>
  4624.                     <name>Tom Magliery, NCSA</name>
  4625.                 </member>
  4626.                 <member>
  4627.                     <name>Murray Maloney, Muzmo and Grif</name>
  4628.                 </member>
  4629.                 <member>
  4630.                     <name>Makoto Murata, Fuji Xerox Information Systems</name>
  4631.                 </member>
  4632.                 <member>
  4633.                     <name>Joel Nava, Adobe</name>
  4634.                 </member>
  4635.                 <member>
  4636.                     <name>Conleth O'Connell, Vignette</name>
  4637.                 </member>
  4638.                 <member>
  4639.                     <name>Peter Sharpe, SoftQuad</name>
  4640.                 </member>
  4641.                 <member>
  4642.                     <name>John Tigue, DataChannel</name>
  4643.                 </member>
  4644.             </orglist>
  4645.         </inform-div1>
  4646.     </back>
  4647. </spec>
  4648. <!-- Keep this comment at the end of the file
  4649. Local variables:
  4650. mode: sgml
  4651. sgml-default-dtd-file:"~/sgml/spec.ced"
  4652. sgml-omittag:t
  4653. sgml-shorttag:t
  4654. End:
  4655. -->
  4656.