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