home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 Autumn / INTERNET109.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _04DB1FDBC7364C5DB9A127605122DD2F < prev    next >
Encoding:
Extensible Markup Language  |  2002-10-01  |  487.6 KB  |  8,876 lines

  1. <?xml version='1.0'?>
  2. <!-- Id: structures.xml,v 1.177 2001/05/01 03:14:11 ht Exp  -->
  3. <?xml-stylesheet type='text/xsl' href='xmlschema.xsl'?>
  4. <!DOCTYPE spec PUBLIC
  5.     "-//W3C//DTD Specification V2.2//EN"
  6.     "http://www.w3.org/XML/1998/06/xmlspec-v22.dtd" [
  7.    <!ENTITY SchemaWG "<loc
  8. href='http://www.w3.org/XML/Activity#schema-wg'>W3C XML Schema Working
  9. Group</loc>">
  10.    <!ENTITY XSP1 "<emph>XML Schema: Structures</emph>">
  11.    <!ENTITY XSP2 "<bibref ref='ref-xsp2'/>">
  12.    <!ENTITY doc.date "2 May 2001">
  13.    <!ENTITY w3c.doc.date "2-May-2001">
  14.    <!ENTITY XSP1.version "1.0">
  15.    <!ENTITY doc.audience "Public: Candidate Recommendation">
  16.    <!ENTITY doc.distribution "unrestricted">
  17.  
  18.    <!ENTITY eacute "é" > <!-- small e, acute accent -->
  19.    <!ENTITY rsquo "’"> <!-- right single quote -->
  20.    <!ENTITY constraint "identity-constraint">
  21.    <!ENTITY Constraint "Identity-constraint"> <!-- for replacement later? -->
  22.    <!ENTITY PSVI "post-schema-validation infoset">
  23.    <!ATTLIST spec xml:lang CDATA #IMPLIED>
  24.    <!ATTLIST eg text CDATA #IMPLIED> <!-- experimental pointer to out-of-line
  25.                                           example text -->
  26.    <!ELEMENT propdef ANY> <!-- best we can do without editing xml-spec -->
  27.    <!ATTLIST propdef id ID #REQUIRED
  28.                      name CDATA #REQUIRED>
  29.    <!ELEMENT propref EMPTY>
  30.    <!ATTLIST propref ref IDREF #REQUIRED
  31.                      role (psvi) #IMPLIED>
  32.    <!ELEMENT xpropref (#PCDATA)>
  33.    <!ATTLIST xpropref href CDATA #IMPLIED
  34.                       role (anon|psviAnon) #IMPLIED>
  35.    <!ELEMENT compdef (proplist)>
  36.    <!ATTLIST compdef name CDATA #REQUIRED
  37.                      ref IDREF #REQUIRED>
  38.    <!ELEMENT proplist (propdef*)>
  39.    <!ATTLIST proplist role (psvi) #IMPLIED
  40.                       item CDATA #IMPLIED>
  41.    <!ELEMENT reprdef (reprelt|reprcomp|p)*>
  42.    <!ELEMENT reprelt EMPTY>
  43.    <!ATTLIST reprelt eltname NMTOKENS #REQUIRED
  44.                      type NMTOKEN #IMPLIED
  45.                      local NMTOKEN #IMPLIED>
  46.    <!ELEMENT reprcomp (reprdep?,propmap*)>
  47.    <!ATTLIST reprcomp ref IDREF #REQUIRED
  48.                       abstract CDATA #REQUIRED>
  49.    <!ELEMENT propmap ANY> <!-- best we can do without editing xml-spec -->
  50.    <!ATTLIST propmap name IDREF #REQUIRED>
  51.    <!ELEMENT reprdep ANY> <!-- best we can do without editing xml-spec -->
  52.    <!ELEMENT eltref EMPTY>
  53.    <!ATTLIST eltref ref NMTOKEN #REQUIRED
  54.                     inside NMTOKEN #IMPLIED>
  55.    <!ELEMENT clauseref EMPTY>
  56.    <!ATTLIST clauseref ref IDREF #REQUIRED>
  57.    <!ELEMENT stale ANY>
  58.    <!ELEMENT restrictCases (restrict+)>
  59.    <!ELEMENT restrict (any|all|choice|elt|seq)*>
  60.    <!ATTLIST restrict case CDATA #REQUIRED>
  61.    <!ELEMENT any (#PCDATA)>
  62.    <!ATTLIST any ref NMTOKEN #IMPLIED>
  63.    <!ELEMENT all (#PCDATA)>
  64.    <!ATTLIST all ref NMTOKEN #IMPLIED>
  65.    <!ELEMENT elt (#PCDATA)>
  66.    <!ATTLIST elt ref NMTOKEN #IMPLIED>
  67.    <!ELEMENT choice (#PCDATA)>
  68.    <!ATTLIST choice ref NMTOKEN #IMPLIED>
  69.    <!ELEMENT seq (#PCDATA)>
  70.    <!ATTLIST seq ref NMTOKEN #IMPLIED>
  71.    <!ELEMENT schemaComp (head,pvlist+)>
  72.    <!ATTLIST schemaComp id ID #REQUIRED>
  73.    <!ELEMENT pvlist (pvpair+)>
  74.    <!ELEMENT pvpair ANY>
  75.    <!ATTLIST pvpair ref IDREF #REQUIRED>
  76.    <!ATTLIST graphic map IDREF #IMPLIED>
  77.    <!ELEMENT imagemap EMPTY>
  78.    <!ATTLIST imagemap source CDATA #REQUIRED
  79.                       id     ID    #REQUIRED>
  80.    <!ELEMENT local (#PCDATA)>
  81.    <!ELEMENT iiName (#PCDATA)>
  82.    <!ENTITY % local.emph.class '|local|iiName'>
  83.    <!ELEMENT pt (#PCDATA)>
  84.    <!ENTITY % local.term.class '|pt'><!-- ht: for pre-terminal -->
  85.    <!ENTITY % local.tech.class '|pt|propref|xpropref|eltref|clauseref'><!-- ht: for pre-terminal -->
  86.    <!-- the above used in content model of LHS -->
  87.    <!ENTITY % local.p.class "|stale">
  88.    <!ENTITY % local.termdef.class "|propdef">
  89.    <!ENTITY % local.ref.class "|propref|xpropref|eltref|clauseref">
  90.    <!ENTITY % local.illus.class "|compdef|reprdef|proplist|schemaComp|restrictCases|imagemap">
  91.    <!ENTITY i-attribute "<xpropref href='http://www.w3.org/TR/xml-infoset/#infoitem.element'>attribute</xpropref>">
  92.    <!ENTITY i-children "<xpropref href='http://www.w3.org/TR/xml-infoset/#infoitem.element'>children</xpropref>">
  93.    <!ENTITY i-attributes "<xpropref href='http://www.w3.org/TR/xml-infoset/#infoitem.element'>attributes</xpropref>">
  94.    <!ENTITY i-value "<termref def='key-nv'>normalized value</termref>">
  95.    <!ENTITY r-value "<termref def='key-iv'>initial value</termref>">
  96.    <!ENTITY v-value "<termref def='key-vv'>actual value</termref>">
  97.    <!ENTITY i-ccode "<xpropref
  98. href='http://www.w3.org/TR/xml-infoset/#infoitem.character'>character code</xpropref>">
  99.    <!ATTLIST spec schemaProper CDATA #FIXED "http://www.w3.org/2001/XMLSchema.xsd"
  100.            schemaDump CDATA #FIXED "http://www.w3.org/2001/05/XMLSchema.xsd,dmp"
  101.            schemaExample CDATA #FIXED "http://www.w3.org/2001/05/example.xsd,dmp"
  102.            datatypeDoc CDATA #FIXED "http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.xml"
  103.            docStatus CDATA #FIXED "REC">
  104.  ]>
  105. <spec xml:lang="en">
  106.   <header>
  107.     <title>XML Schema Part 1: Structures</title>
  108.     <version>&XSP1.version;</version>
  109.     <w3c-designation>REC-20010502</w3c-designation>
  110.     <w3c-doctype>W3C Recommendation</w3c-doctype>
  111.     <pubdate>
  112.       <day>2</day>
  113.       <month>May</month>
  114.       <year>2001</year><!-- Id: structures.xml,v 1.177 2001/05/01 03:14:11 ht Exp -->
  115.     </pubdate>
  116.     <notice role="publoc"><ednote><edtext>The following SHOULD be in the publoc, but
  117. the DTD doesn't currently allow it: the stylesheet fakes it.</edtext></ednote>
  118.      <p>(in <loc href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/structures.xml">XML</loc> (with its own <loc href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/xmlspec-19990429.dtd">DTD</loc>, <loc href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/xmlschema.xsl">XSL
  119. stylesheet</loc>) and <loc href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/structures.html">HTML</loc>), with separate provision of the <loc href="http://www.w3.org/2001/XMLSchema.xsd">schema</loc> and <loc href="http://www.w3.org/2001/XMLSchema.dtd">DTD</loc> for schemas described herein.</p>
  120. </notice>
  121.     <publoc> <loc href="http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/">http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/</loc> </publoc>
  122.    <latestloc><loc href="http://www.w3.org/TR/xmlschema-1/">http://www.w3.org/TR/xmlschema-1/</loc>
  123.  </latestloc>
  124.    <prevlocs>
  125.     <loc href="http://www.w3.org/TR/2001/PR-xmlschema-1-20010330/">http://www.w3.org/TR/2001/PR-xmlschema-1-20010330/</loc>
  126.    </prevlocs>
  127.     <authlist>
  128.       <author>
  129.         <name>Henry S. Thompson</name>
  130.         <affiliation>University of Edinburgh</affiliation>
  131.         <email href="mailto:ht@cogsci.ed.ac.uk">ht@cogsci.ed.ac.uk</email>
  132.       </author>
  133.      <author>
  134.       <name>David Beech</name>
  135.       <affiliation>Oracle Corporation</affiliation>
  136.       <email href="mailto:David.Beech@oracle.com">David.Beech@oracle.com</email>
  137.      </author>
  138.      <author>
  139.       <name>Murray Maloney</name>
  140.       <affiliation>for Commerce One</affiliation>
  141.       <email href="mailto:murray@muzmo.com">murray@muzmo.com</email>
  142.      </author>
  143.      <author>
  144.       <name>Noah Mendelsohn</name>
  145.       <affiliation>Lotus Development Corporation</affiliation>
  146.       <email href="mailto:Noah_Mendelsohn@lotus.com">Noah_Mendelsohn@lotus.com</email>
  147.      </author>
  148.     </authlist>
  149.     <status>
  150. <p><emph>This section describes the status of this document at the
  151. time of its publication. Other documents may supersede this
  152. document. The latest status of this document series is maintained at
  153. the W3C.</emph></p>
  154.  
  155. <p>This document has been reviewed by W3C Members and other interested
  156. parties and has been endorsed by the Director as a W3C
  157. Recommendation. It is a stable document and may be used as reference
  158. material or cited as a normative reference from another
  159. document. W3C's role in making the Recommendation is to draw attention
  160. to the specification and to promote its widespread deployment. This
  161. enhances the functionality and interoperability of the Web.</p>
  162.  
  163.      <p>This document has been produced by the <loc href="http://www.w3.org/XML/Schema">W3C XML Schema Working Group</loc>
  164. as part of the W3C <loc href="http://www.w3.org/XML/">XML
  165. Activity</loc>.  The goals of the XML Schema language are discussed in
  166. the <loc href="http://www.w3.org/TR/NOTE-xml-schema-req">XML Schema
  167. Requirements</loc> document.  The authors of this document are the XML
  168. Schema WG members. Different parts of this specification have
  169. different editors.</p>
  170. <p>
  171. This version of this document incorporates some editorial changes 
  172. from earlier versions.
  173. </p>
  174. <p>
  175. Please report errors in this document to <loc href="mailto:www-xml-schema-comments@w3.org">www-xml-schema-comments@w3.org</loc> (<loc href="http://lists.w3.org/Archives/Public/www-xml-schema-comments/">archive</loc>). The list of known errors in this specification is available at <loc href="http://www.w3.org/2001/05/xmlschema-errata">http://www.w3.org/2001/05/xmlschema-errata</loc>.
  176. </p>
  177. <p>The English version of this specification is the only normative
  178. version. Information about translations of this document is available
  179. at <loc href="http://www.w3.org/2001/05/xmlschema-translations">http://www.w3.org/2001/05/xmlschema-translations</loc>.</p>
  180.       <p>A list of current W3C Recommendations and other technical documents can be found at
  181.         <loc href="http://www.w3.org/TR/">http://www.w3.org/TR/</loc>.</p>
  182. </status>
  183.      <abstract>
  184.           <p><emph>XML Schema: Structures</emph> specifies the XML Schema definition language,
  185.           which offers facilities for describing the structure and constraining the contents
  186.             of XML 1.0 documents, including those which exploit the XML
  187. Namespace facility. The schema language, which is itself represented in XML
  188.             1.0 and uses namespaces, substantially reconstructs and considerably extends the capabilities found in XML 1.0 document type
  189.             definitions (DTDs).  This specification depends on <emph>XML Schema Part 2:
  190.             Datatypes</emph>.</p>
  191.     </abstract>
  192.     <pubstmt>
  193.       <p>Boston, Mountain View, Toronto, et al.: World-Wide Web Consortium, XML
  194.         Working Group, 1999.</p>
  195.     </pubstmt>
  196.     <sourcedesc>
  197.       <p>Created in electronic form using XML.</p>
  198.     </sourcedesc>
  199.     <langusage>
  200.       <language id="EN">English</language>
  201.       <language id="ebnf">Extended Backus-Naur Form (formal grammar)
  202.       </language>
  203.       <language>Extensible Markup Language (XML)</language> </langusage>
  204.     <revisiondesc>
  205.       <slist>
  206.        <sitem>1999-09-05: HST: Abandoned this method of logging
  207. changes:  see CVS change log at the end of the document</sitem>
  208.        <sitem>1999-09-02: HST: Marked non-status-quo sections as such.</sitem>
  209.        <sitem>1999-09-01: HST: incorporated Section 2 examples from 'Simple',
  210. modified to include some attributes.  Massaged explanatory text.</sitem>
  211.        <sitem>1999-08-22: HST: incorporated 'Simple' section 3 changes and started to smooth over
  212. the joints.</sitem>
  213.        <sitem>1999-07-18: DB: updated definition of "Schema" following WG and IG email discussion.
  214.          Changed "Schemata" to "Schemas" except where directly quoted from Requirements doc.
  215.          Clarified in 2.5 that elements and attributes have separate symbol spaces (public comment).
  216.          Fixed assorted typos.
  217.        </sitem>
  218.        <sitem>1999-06-23: HST: pushed & down to lowest level, fixed incoherent
  219. validity definition in 6.2.3.7 to agree with the note which follows.  Wrapped validation
  220. text from 3.4 in appropriately named div4's.</sitem>
  221.        <sitem>1999-06-20: HST: stripped out validation</sitem>
  222.         <sitem>1999-05-03: MCM: Updated schema and DTD. Package and test.
  223.         </sitem>
  224.         <sitem>1999-05-03 Integration of final editors' concerns for WD1.
  225.           Includes HT work on constraints.</sitem>
  226.         <sitem>1999-05-02 NRM General cleanup of first few chapters. Remove
  227.           chapter 4 redundancy (tuple discussion) with new validity rules. </sitem>
  228.         <sitem>1999-05-02: HST: still chipping away at validity. Redefined the
  229.           XSDL/XDTL entities.</sitem>
  230.         <sitem>19940502: MCM: mostly annotating the schema. Also moved info
  231.           about abstract grammar into Chapter 2. Chapter 3 now starts right into defining
  232.           a schema. Edited text entities to make them easier to manage.</sitem>
  233.         <sitem>19940501: HST: various</sitem>
  234.         <sitem>1999-04-30: NRM : revisions to chapter 4</sitem>
  235.         <sitem>1999-04-28: DB (pp HST) : promised edits for improved
  236.           consistency and definition of 'schema'; suggested modifications to
  237.           3.4.9/10 and 3.5 </sitem>
  238.         <sitem>1999-04-39: HST : integrated DB's edits, completely rewrote
  239.           6.1, replaced virtually all <B> with correct <...ref> </sitem>
  240.         <sitem>1999-04-28: DB (pp HST) : promised edits for improved
  241.           consistency and definition of 'schema'; suggested modifications to
  242.           3.4.9/10 and 3.5 </sitem>
  243.         <sitem>1999-04-23: HST : Got all productions sorted using
  244.           'nt' and correct IDs.</sitem>
  245.         <sitem>1999-04-21 : HST : Added lots of IDs and constraint heads:
  246.           Validates w/o error</sitem>
  247.         <sitem>1999-04-21 : HST : Converted with no content changes to speak of
  248.           from MCM-XSDL-19990416.html. This version has only ID/IDREF related errors
  249.           left.</sitem>
  250.       </slist>
  251.     </revisiondesc>
  252.   </header>
  253.   <body>
  254.     <div1 id="intro">
  255.       <head>Introduction</head>
  256.       <p>This document sets out the structural part (&XSP1;) of the XML Schema definition language.</p>
  257.       <p>Chapter 2 presents a <specref ref="concepts"/> for XML Schemas, including
  258.         an introduction to the nature of XML Schemas and an introduction
  259. to the XML Schema abstract data model, along with
  260.         other terminology used throughout this document. </p>
  261.       <p>Chapter 3, <specref ref="components"/>, specifies the precise
  262. semantics of each component of the abstract model, the representation of each 
  263. component in XML, with reference to a DTD and XML Schema
  264. for an XML Schema document type, along with a detailed mapping between the elements and
  265. attribute vocabulary of this representation and the components and properties
  266. of the abstract model.</p>
  267.       <p>Chapter 4 presents <specref ref="composition"/>, including the
  268. connection between documents and schemas, the import, inclusion and redefinition of declarations and definitions and
  269.         the foundations of schema-validity assessment.</p>
  270.       <p>Chapter 5 discusses <specref ref="conformance"/>, including the
  271. overall approach to schema-validity assessment of documents, and responsibilities of schema-aware
  272.         processors. </p>
  273.       <p>The normative appendices include a <specref ref="normative-schemaSchema"/> for the XML representation of schemas and
  274.         <specref ref="normative-references"/>.</p>
  275.      <p>The non-normative appendices include the <specref ref="nonnormative-schemaDTD"/> and a <specref ref="normative-glossary"/>.</p>
  276.      <p>This document is primarily intended as a language definition reference.
  277. As such, although it contains a few examples, it is <emph>not</emph> primarily designed
  278. to serve as a motivating introduction to the design and its features, or as a
  279. tutorial for new users.
  280. Rather it presents a careful and fully explicit definition of that design, suitable
  281. for guiding implementations.  For those in search of a step-by-step
  282. introduction to the design, the non-normative <bibref ref="bib-expo"/> is a much better
  283. starting point than this document.</p>
  284.     <div2 id="intro-purpose">
  285.       <head>Purpose</head>
  286.       <p>The purpose of &XSP1; is to define the nature of XML schemas
  287. and their component parts,
  288. provide an inventory of XML markup
  289.         constructs with which to represent schemas, and define the
  290. application of schemas to XML documents. </p>
  291.       <p>The purpose of an &XSP1; schema is to define and describe a class of
  292.         XML documents by using schema components to constrain and document the meaning,
  293.         usage and relationships of their constituent parts: datatypes, elements and
  294.         their content and attributes and their values. Schemas may also provide for the specification of additional
  295.         document information, such as normalization and defaulting of attribute
  296. and element values. Schemas have
  297. facilities for self-documentation. Thus, &XSP1; can be used to define, describe and catalogue XML
  298.         vocabularies for classes of XML documents. </p>
  299.  
  300.      <p>Any application that consumes well-formed XML can use the &XSP1;
  301.         formalism to express syntactic, structural and value constraints applicable to
  302.         its document instances. The &XSP1; formalism allows a useful level of
  303.         constraint checking to be described and implemented for a wide spectrum of XML
  304.         applications.  However, the language defined by this specification does not attempt to provide
  305.         <emph>all</emph> the facilities that might be needed by <emph>any</emph>
  306.         application. Some applications may require constraint capabilities not
  307.         expressible in this language, and so may need to perform their own additional
  308.         validations.</p>
  309.     </div2>
  310.     <div2 id="intro-relatedWork">
  311.       <head>Dependencies on Other Specifications</head>
  312.       <p>The definition of &XSP1; depends on the following specifications:
  313.       <bibref ref="ref-xmlinfo"/>,
  314.       <bibref ref="ref-xml-namespaces"/>,
  315.       <bibref ref="bib-xpath"/>, and
  316.       <bibref ref="ref-xsp2"/>.</p>
  317.      <p>See <specref ref="infoset"/> for a tabulation of the information items
  318. and properties specified in <bibref ref="ref-xmlinfo"/> which this
  319. specification requires as a precondition to schema-aware processing.</p>
  320.     </div2>
  321.     <div2 id="intro-terminology">
  322.         <head>Documentation Conventions and Terminology</head>
  323.         <p>The section introduces the highlighting and typography as used in
  324.           this document to present technical material.</p>
  325.         <p>Special terms are defined at their point of
  326. introduction in the text.  For example <termdef id="key-sampledef" term="term" role="local">a <term>term</term> is
  327.           something used with a special meaning</termdef>.  The definition is
  328. labeled as such and the term it defines is displayed in boldface.  The end of the definition is not specially marked
  329. in the displayed or printed text.  Uses of defined terms are links to
  330. their definitions, set off with middle dots, for instance <termref def="key-sampledef">term</termref>.</p>
  331.           <p>Non-normative examples are set off in boxes and accompanied by a brief
  332. explanation:</p>
  333.         <note role="example">
  334.           <eg xml:space="preserve"><schema targetNamespace="http://www.example.com/XMLSchema/1.0/mySchema"></eg>
  335.           <p>And an explanation of the example.</p>
  336.       </note>
  337.       <p>The definition of each kind of schema component consists of a list of
  338.       its properties and their contents, followed by descriptions of the
  339.       semantics of the properties:</p>
  340.         <compdef name="Example" ref="intro-terminology">
  341.    <proplist>
  342.   <propdef id="xmpl-prop" name="example property">
  343. Definition of the property.
  344.    </propdef>
  345.   </proplist>
  346.  </compdef>
  347.      <p>References to properties of schema components are links to
  348. the relevant definition as exemplified above, set off with curly braces, for instance <propref ref="xmpl-prop"/>.</p>
  349.       <p>The correspondence between an element information item which is part
  350. of the XML representation of a schema and one or more schema components is presented in a tableau
  351. which illustrates the element information item(s) involved.
  352. This is followed by a tabulation of the correspondence between properties of the component
  353. and properties of the information item.  Where context may determine which of
  354. several different components may arise, several tabulations, one per context,
  355. are given.  The property correspondences are normative,
  356. as are the illustrations of the XML representation element information items.
  357. </p>
  358.      <p>In the XML representation, bold-face
  359. attribute names (e.g. <term>count</term> below) indicate a required
  360. attribute information item, and the rest are
  361. optional.  Where an attribute information item has an enumerated type
  362. definition, the values are shown separated by vertical bars, as for
  363. <code>size</code> below; if there is a default value, it is shown
  364. following a colon.  Where an attribute information item has a built-in simple
  365. type definition defined in <bibref ref="ref-xsp2"/>, a hyperlink to its
  366. definition therein is given.</p>
  367.      <p>The allowed content of the information item is
  368. shown as a grammar fragment, using the Kleene operators <code>?</code>,
  369. <code>*</code> and <code>+</code>.  Each element name therein is a hyperlink to
  370. its own illustration.</p>
  371.      <note>
  372.       <p>The illustrations are derived automatically from the <specref ref="normative-schemaSchema"/>.  In the case of apparent conflict, the <specref ref="normative-schemaSchema"/> takes precedence, as it, together with the <termref def="gloss-src">Schema Representation Constraints</termref>, provide the normative statement of
  373. the form of XML representations.</p>
  374.      </note>
  375. <reprdef>
  376.  <reprelt eltname="example"/>
  377.  <reprcomp abstract="Example" ref="intro-terminology">
  378. <propmap name="xmpl-prop">Description of what the property corresponds to, e.g. the value of the <code>size</code>
  379. &i-attribute;
  380. </propmap>
  381. </reprcomp>
  382.  </reprdef>
  383.      <p>References to elements in the text are links to
  384. the relevant illustration as exemplified above, set off with angle brackets, for instance <eltref ref="example"/>.</p>
  385.      <p>References to properties of information items as defined in <bibref ref="ref-xmlinfo"/> are notated as links to the relevant section thereof, set off with square brackets, for example &i-children;.</p>
  386.      <p>Properties which this specification defines for information items are
  387. introduced as follows:</p>
  388.      <proplist item="example" role="psvi">
  389.       <propdef id="ex-foo" name="new property">The value the property gets.</propdef>
  390.      </proplist>
  391. <p>References to properties of information items defined in this specification
  392. are notated as links to their introduction as exemplified above, set off with square brackets, for example <propref role="psvi" ref="ex-foo"/>.</p>
  393.       <p>The following highlighting is used for non-normative commentary in
  394.         this document:</p>
  395.  
  396.  
  397.       <note>
  398.         <p>General comments directed to all readers. </p>
  399.       </note>
  400.      <p>Following <bibref ref="ref-xml"/>, within normative prose in this specification, the words
  401. <emph>may</emph> and <emph>must</emph> are defined as follows:</p>
  402.      <glist>
  403.       <gitem>
  404.        <label>may</label>
  405.        <def>
  406.         <p>Conforming documents and XML Schema-aware processors are permitted to but need not behave as described.</p>
  407.        </def>
  408.       </gitem>
  409.       <gitem>
  410.        <label>must</label>
  411.        <def>
  412.         <p>Conforming documents and XML Schema-aware processors are required to behave as described; otherwise they are in error.</p>
  413.        </def>
  414.       </gitem>
  415.      </glist>
  416.      <p>Note however that this specification provides a definition of error and of conformant processors'
  417. responsibilities with respect to errors (see <specref ref="conformance"/>) which is considerably
  418. more complex than that of <bibref ref="ref-xml"/>.</p>
  419.     </div2>
  420.   </div1>
  421.   <div1 id="concepts">
  422.     <head>Conceptual Framework</head>
  423. <p>This chapter gives an overview of &XSP1; at the level of its abstract data model.  <specref ref="components"/> provides details on this model, including
  424. a normative representation in XML for the components of the model.
  425. Readers interested primarily in learning to write schema documents may wish to
  426. first read <bibref ref="bib-expo"/> for a tutorial introduction, and only then consult the sub-sections of 
  427. <specref ref="components"/> named <emph>XML Representation of ...</emph> for
  428. the details.</p>
  429.    <div2>
  430.     <head>Overview of XML Schema</head>
  431.     <p>An XML Schema
  432. consists of components such as type definitions
  433. and element declarations.  These can be used to assess the validity of
  434. well-formed element and attribute information items (as defined
  435. in <bibref ref="ref-xmlinfo"/>), and furthermore
  436. may specify augmentations to those items and their descendants.  This augmentation makes explicit information which may have
  437. been implicit in the original document, such as normalized and/or default values for
  438. attributes and elements and
  439. the types of element and attribute information items.</p>
  440.     <p>Schema-validity assessment has two aspects:
  441. <olist><item id="c-lsv"><p>determining local schema-validity, that is
  442. whether an element or attribute information item satisfies the
  443. constraints embodied in the relevant
  444. components of an XML Schema;</p></item>
  445. <item><p>Synthesizing an overall validation outcome for the item,
  446. combining local schema-validity with the results of schema-validity
  447. assessments of its descendants, if any, and
  448. adding appropriate augmentations to the infoset to record this outcome.</p></item></olist></p>
  449.     <p>Throughout this specification, <termdef id="key-vn" term="valid">the
  450. word <term>valid</term> and its derivatives are used to refer to
  451. <clauseref ref="c-lsv"/> above, the determination of local
  452. schema-validity</termdef>.</p>
  453. <p>Throughout this specification, <termdef id="key-va" term="assessment"> the word <term>assessment</term> is used to refer
  454. to the overall process of
  455. local validation, schema-validity assessment and infoset augmentation</termdef>.</p>
  456.    </div2>
  457.    <div2 id="concepts-data-model">
  458.     <head>XML Schema Abstract Data Model</head>
  459.     <p>This specification builds on <bibref ref="ref-xml"/> and
  460. <bibref ref="ref-xml-namespaces"/>.  The concepts and definitions used
  461. herein regarding XML are framed at the abstract level of <xtermref href="http://www.w3.org/TR/xml-infoset/#infoitem">information
  462. items</xtermref> as defined in <bibref ref="ref-xmlinfo"/>.  By
  463. definition, this use of the infoset provides <emph>a priori</emph> guarantees of <xtermref href="http://www.w3.org/TR/REC-xml#sec-well-formed">well-formedness</xtermref>
  464. (as defined in <bibref ref="ref-xml"/>) and <xtermref href="http://www.w3.org/TR/REC-xml-names/#Conformance">namespace
  465. conformance</xtermref> (as defined in <bibref ref="ref-xml-namespaces"/>) for
  466. all candidates for <termref def="key-va">assessment</termref> and for all <termref def="key-schemaDoc">schema documents</termref>.</p>
  467.     <p>Just as <bibref ref="ref-xml"/> and
  468. <bibref ref="ref-xml-namespaces"/> can be described in terms of
  469. information items, XML Schemas can be described in terms of an
  470. abstract data model.  In defining XML Schemas in terms of an abstract
  471. data model, this specification rigorously specifies the information which
  472. must be available to a conforming XML Schema processor.  The abstract
  473. model for schemas is conceptual only, and does not mandate any
  474. particular implementation or representation of this information.  To
  475. facilitate interoperation and sharing of schema information, a
  476. normative XML interchange format for schemas is provided.</p>
  477. <p><termdef id="key-component" term="schema component"> <term>Schema component</term> is the generic term for the building blocks that comprise the abstract data model of the schema.
  478. </termdef>
  479. <termdef id="key-schema" term="XML Schema">
  480. An <term>XML Schema</term> is a
  481. set of <termref def="key-component">schema components</termref></termdef>.  There are 13 kinds of
  482. component in all, falling into three groups.  The primary components, which may
  483. (type definitions) or must (element and attribute declarations) have names
  484. are as follows:</p>
  485. <ulist>
  486. <item><p>Simple type definitions
  487. </p></item>
  488. <item><p>Complex type definitions</p></item>
  489. <item><p>Attribute declarations</p></item>
  490.  <item><p>Element declarations</p></item>
  491. </ulist><p>The secondary components, which must have names, are as follows:</p>
  492. <ulist>
  493. <item><p>Attribute group definitions</p></item>
  494. <item><p>&Constraint; definitions</p></item>
  495. <item><p>Model group definitions</p></item>
  496. <item><p>Notation declarations</p></item>
  497. </ulist>
  498. <p>Finally, the <quote>helper</quote> components provide small parts of
  499. other components; they are not independent of their context:</p>
  500. <ulist>
  501. <item><p>Annotations</p></item>
  502. <item><p>Model groups</p></item>
  503. <item><p>Particles</p></item>
  504. <item><p>Wildcards</p></item>
  505.  <item><p>Attribute Uses</p></item>
  506. </ulist>
  507.      <p>During <termref def="key-vn">validation</termref>, <termdef id="key-declaration" term="declaration"><term>declaration</term> components are associated by
  508. (qualified) name to information items being <termref def="key-vn">validated</termref></termdef>.</p>
  509. <p>On the other hand, <termdef id="key-definition" term="definition"><term>definition</term> components define
  510. internal schema components that can be used in other schema components</termdef>.
  511. </p>
  512. <p>
  513. <termdef id="key-compName" term="component name">Declarations and
  514. definitions may have and be identified by <term>name</term>s, which are NCNames as defined by <bibref ref="ref-xml-namespaces"/></termdef>.</p>
  515.  
  516.     <p>  <termdef id="key-targetNS" term="target namespace">Several kinds
  517. of component have a <term>target namespace</term>, which is either
  518. <termref def="key-null">absent</termref> or a namespace name, also as
  519. defined by <bibref ref="ref-xml-namespaces"/></termdef>.  The <termref def="key-targetNS">target
  520. namespace</termref> serves to identify the namespace within which the
  521. association between the component and its name exists.  In the case of
  522. declarations, this in turn determines the namespace name of, for example, the element
  523. information items it may <termref def="key-vn">validate</termref>.</p>
  524.     <note>
  525.      <p>At the abstract level, there is
  526. no requirement that the components of a schema share a
  527. <termref def="key-targetNS">target namespace</termref>.  Any schema for use in
  528. <termref def="key-va">assessment</termref> of documents containing names from more than one namespace
  529. will of necessity include components with different <termref def="key-targetNS">target namespaces</termref>.  This contrasts with
  530. the situation at the level of the XML representation of components, in which each schema document contributes
  531. definitions and declarations to a single target namespace.</p>
  532.     </note>
  533.     <p><termref def="key-vn">Validation</termref>, defined in detail in <specref ref="components"/>, is a
  534. relation between information items and schema components.  For example, an
  535. attribute information item may <termref def="key-vn">validate</termref> with respect to an attribute
  536. declaration, a list of element information items may <termref def="key-vn">validate</termref> with
  537. respect to a content model, and so on.  The following sections briefly
  538. introduce the kinds of components in the
  539. schema abstract data model, other major features of the abstract
  540. model, and how they contribute to <termref def="key-vn">validation</termref>.</p>
  541.      <div3 id="Type_Definition_Summary">
  542. <head>Type Definition Components</head>
  543. <p>The abstract model provides two kinds of type definition component: simple
  544. and complex.</p>
  545. <p><termdef id="key-typeDefn" term="type definition">This specification uses
  546. the phrase <term>type definition</term> in cases where no distinction
  547. need be made between simple and complex types</termdef>.</p>
  548. <p>Type definitions form a hierarchy with a single root.  The subsections below first describe characteristics of that
  549. hierarchy, then provide an introduction to simple and complex type definitions themselves.</p>
  550. <div4 id="Type_Derivation">
  551. <head>Type Definition Hierarchy</head>
  552. <p>
  553. <termdef id="key-typeDefinitionHierarchy" term="Type Definition
  554. Hierarchy">Except for a distinguished <termref def="key-urType">ur-type definition</termref>, every <termref def="key-typeDefn">type definition</termref> is, by construction, either a
  555. <termref def="key-typeRestriction">restriction</termref> or an <termref def="key-typeExtension">extension</termref> of some other type definition.  The graph of these relationships forms a tree known as the <term>Type Definition Hierarchy</term></termdef>.
  556. </p>
  557. <p><termdef id="key-typeRestriction" term="restriction">A type
  558. definition whose
  559. declarations or facets are in a one-to-one relation with those of another
  560. specified type
  561. definition, with each in turn restricting the possibilities of the one it
  562. corresponds to, is said to be a <term>restriction</term></termdef>.
  563. The specific restrictions might include narrowed ranges or reduced
  564. alternatives.
  565. Members of a type, A, whose definition is a <termref def="key-typeRestriction">restriction</termref> of the definition of another type, B, are always members of type B as well.</p>
  566. <p><termdef id="key-typeExtension" term="extension">A complex type definition
  567. which allows element or attribute content in addition to that allowed by
  568. another specified type
  569. definition is said to be an <term>extension</term></termdef>.</p>
  570. <p><termdef id="key-urType" term="ur-type definition">A distinguished <term>ur-type
  571. definition</term> is present in each <termref def="key-schema">XML Schema</termref>, serving as the root of the type
  572. definition hierarchy for that schema</termdef>.  The ur-type definition, whose
  573. name is <local>anyType</local>, has
  574. the unique characteristic that it can function as a complex or a
  575. simple type definition, according to context.
  576. Specifically, <termref def="key-typeRestriction">restrictions</termref> of the ur-type definition can
  577. themselves be either simple or complex type definitions.
  578. </p>
  579. <p><termdef id="key-baseTypeDefinition" term="base type definition">A type definition used as the
  580. basis for an <termref def="key-typeExtension">extension</termref> or
  581. <termref def="key-typeRestriction">restriction</termref> is known as
  582. the <term>base type definition</term> of that definition</termdef>.
  583. </p>
  584. </div4><div4 id="Simple_Type_Definition">
  585.  
  586.      <head>Simple Type Definition</head>
  587.      <p>A simple type definition is a set of constraints on strings and information about the values they encode, applicable to the &i-value; of an attribute
  588. information item or of an element information item with no element children.
  589. Informally, it applies to the values of attributes and the text-only content of elements.
  590. </p>
  591.      <p>Each simple type definition, whether built-in (that is, defined in &XSP2;) or
  592. user-defined, is a <termref def="key-typeRestriction">restriction</termref> of some particular
  593. simple <termref def="key-baseTypeDefinition">base type
  594. definition</termref>.  For the built-in primitive types, this is the simple
  595. version of the <termref def="key-urType">ur-type
  596. definition</termref>, whose name is <local>anySimpleType</local>. This
  597.  is in turn understood to be a restriction of the <termref def="key-urType">ur-type
  598. definition</termref>.  Simple types may
  599. also be defined whose members are lists of items
  600. themselves constrained by some other simple type definition, or whose
  601. membership is the union of the memberships of some other simple type
  602. definitions.  List and union simple type definitions are also understood as
  603. restrictions of the simple <termref def="key-urType">ur-type
  604. definition</termref>.</p>
  605.      <p>For detailed information on simple type definitions, see <specref ref="Simple_Type_Definitions"/> and &XSP2;.  The latter also defines an extensive inventory of
  606. pre-defined simple types.</p>
  607. </div4>
  608. <div4 id="Complex_Type_Definition">
  609. <head>Complex Type Definition</head>
  610. <p>A complex type definition is a set of attribute declarations and a content type, applicable to the &i-attributes; and
  611. &i-children; of an element information item respectively.  The content type may
  612. require the &i-children; to contain neither element nor character information
  613. items (that is, to be empty), to be a string which belongs to a particular simple
  614. type or to contain a sequence of element information items which conforms to a particular model group, with or without character information items as well.</p>
  615.      <p>Each complex type definition is either
  616.       <ulist>
  617.        <item>
  618.         <p>a restriction of a complex <termref def="key-baseTypeDefinition">base
  619. type definition</termref></p>
  620.        </item>
  621.       </ulist>
  622.       or
  623.       <ulist><item>
  624. <p>an <termref def="key-typeExtension">extension</termref> of a simple or complex <termref def="key-baseTypeDefinition">base
  625. type definition</termref></p>
  626. </item>
  627. </ulist>
  628.       or
  629.       <ulist>
  630.        <item>
  631. <p>a <termref def="key-typeRestriction">restriction</termref> of the
  632. <termref def="key-urType">ur-type definition</termref>.</p>
  633. </item>
  634.       </ulist>
  635. </p>
  636. <p> A
  637. complex type which extends another does so by having additional content model
  638. particles at the end of the other definition's content model,
  639. or by having additional attribute declarations, or both.
  640.   <note>
  641.    <p>This specification allows only appending, and not other kinds of
  642. extensions. This decision
  643. simplifies application processing required to cast instances from derived to
  644. base type.  Future versions may allow more kinds of extension, requiring more
  645. complex transformations to effect casting.</p>
  646.   </note></p>
  647.      <p>
  648. For detailed information on complex type definitions, see <specref ref="Complex_Type_Definitions"/>.</p>
  649. </div4>
  650. </div3>
  651.  
  652.      <div3 id="Declarations_Summary">
  653. <head>Declaration Components</head>
  654. <p>There are three kinds of declaration component: element, attribute, and
  655. notation.  Each is described in a section below. Also included is a discussion
  656. of element substitution groups, which is a feature provided in conjunction with
  657. element declarations.</p>
  658. <div4 id="Element_Declaration">
  659. <head>Element Declaration</head>
  660. <p>An element declaration is an association of a name with a type definition, either simple or
  661. complex, an (optional) default value and a (possibly empty) set of &constraint;
  662. definitions.  The association is either global or scoped to a containing complex type definition.  A
  663. top-level element declaration with name 'A' is broadly comparable to a pair of
  664. DTD declarations as follows, where the associated type definition
  665. fills in the ellipses:</p>
  666. <eg><!ELEMENT A . . .>
  667. <!ATTLIST A . . .>
  668. </eg>
  669. <p>Element declarations contribute to
  670. <termref def="key-vn">validation</termref> as part of model group <termref def="key-vn">validation</termref>, when their defaults and type components are checked against an element
  671. information item with a matching name and namespace, and by triggering
  672. &constraint; definition <termref def="key-vn">validation</termref>.</p>
  673.      <p>
  674. For detailed information on element declarations, see <specref ref="cElement_Declarations"/>.</p>
  675. </div4>
  676. <div4 id="Element_Equivalence_Class">
  677. <head>Element Substitution Group</head>
  678. <p>In XML 1.0, the name and content of an element must correspond exactly to the element type referenced in the corresponding content model.</p>
  679. <p><termdef id="key-equivalenceClass" term="element substitution group">Through
  680. the new mechanism of <term>element substitution groups</term>, XML Schemas provides a more powerful model supporting substitution of one named element for another</termdef>.
  681. Any top-level element declaration can serve as the defining element, or
  682. head, for an element substitution group.  Other top-level element declarations,
  683. regardless of target namespace, can be designated as members of the
  684. substitution group headed by this element.  In a suitably enabled content
  685. model, a reference to the head <termref def="key-vn">validates</termref> not just the head itself, but elements
  686. corresponding to any member of the substitution group as well.
  687. </p>
  688. <p>All such members must have type definitions which are either the same as the
  689. head's type definition or
  690. restrictions or extensions of it.
  691. Therefore, although the names of elements can vary widely as new
  692. namespaces and members of the substitution group are defined, the
  693. content of member elements is strictly limited according to the type
  694. definition of the substitution group head.</p>
  695. <p>Note that element substitution groups are not represented as separate components.  They are
  696. specified in the property values for element declarations (see <specref ref="cElement_Declarations"/>).</p>
  697. </div4>
  698. <div4 id="Attribute_Declaration">
  699. <head>Attribute Declaration</head>
  700. <p>An attribute declaration is an association between a name and a simple type definition, together
  701. with occurrence information and (optionally) a default value. The
  702. association is either global, or local to its containing complex type definition.  Attribute declarations contribute to
  703. <termref def="key-vn">validation</termref> as part of complex type definition <termref def="key-vn">validation</termref>, when their
  704. occurrence, defaults and type components are checked against an attribute
  705. information item with a matching name and namespace.</p>
  706.      <p>
  707. For detailed information on attribute declarations, see <specref ref="cAttribute_Declarations"/>.</p>
  708. </div4>
  709. <div4 id="Notation_Declaration">
  710. <head>Notation Declaration</head>
  711. <p>A notation declaration is an association between a name and an identifier for a
  712. notation.  For an attribute information item to be <termref def="key-vn">valid</termref> with respect to a
  713. <code>NOTATION</code> simple type definition, its value must have been declared
  714. with a notation declaration.</p>
  715.      <p>
  716. For detailed information on notation declarations, see <specref ref="cNotation_Declarations"/>.</p>
  717. </div4>
  718. </div3>
  719.  
  720.      <div3 id="Model_Group_Summary">
  721. <head>Model Group Components</head>
  722. <p>The model group, particle, and wildcard components contribute to
  723. the portion of a complex type definition that controls an element
  724. information item's content.</p>
  725. <div4 id="Model_Group">
  726. <head>Model Group</head>
  727. <p>A model group is a constraint in the form of a grammar fragment that applies to
  728. lists of element information items.  It consists of a list of particles, i.e.
  729. element declarations, wildcards and model groups.  There are three varieties of
  730. model group:</p>
  731. <ulist>
  732. <item><p>Sequence (the element information items
  733. match the particles in sequential order);</p></item>
  734. <item><p>Conjunction (the element information items match the
  735. particles, in any order);</p></item>
  736. <item><p>Disjunction (the element information items match
  737. one of the particles).</p></item>
  738. </ulist>
  739.      <p>
  740. For detailed information on model groups, see <specref ref="Model_Groups"/>.</p>
  741. </div4>
  742. <div4 id="Particle">
  743. <head>Particle</head>
  744. <p>A particle is a term in the grammar for element content, consisting of either an element
  745. declaration, a wildcard or a model group, together with
  746. occurrence constraints.  Particles contribute to
  747. <termref def="key-vn">validation</termref> as part of complex type definition <termref def="key-vn">validation</termref>, when they allow anywhere
  748. from zero to many element information items or sequences thereof, depending on
  749. their contents and occurrence
  750. constraints.</p>
  751.       <p><termdef id="key-contentModel" term="content model">A particle can
  752. be used in a complex type definition to constrain the <termref def="key-vn">validation</termref>
  753. of the &i-children; of an element information item; such a particle is called
  754. a <term>content model</term></termdef>.
  755. <note>
  756. <p>&XSP1; <termref def="key-contentModel">content models</termref> are similar to but more expressive than
  757. <bibref ref="ref-xml"/> content models; unlike <bibref ref="ref-xml"/>, &XSP1; applies <termref def="key-contentModel">content models</termref> to the <termref def="key-vn">validation</termref> of both mixed and element-only content. </p>
  758. </note></p>
  759.      <p>
  760. For detailed information on particles, see <specref ref="cParticles"/>.</p>
  761. </div4>
  762.       <div4 id="Attribute_Use">
  763.        <head>Attribute Use</head>
  764.        <p>An attribute use plays a role similar to that of a particle, but for
  765. attribute declarations:  an attribute declaration within a complex type definition
  766. is embedded within an attribute use, which specifies whether the declaration
  767. requires or merely allows its attribute, and whether it has a default or fixed value.</p>
  768.       </div4>
  769.       <div4 id="Wildcard">
  770. <head>Wildcard</head>
  771. <p>A wildcard is a special kind of particle which matches element and attribute information items dependent on their namespace name, independently
  772. of their local names.</p>
  773.      <p>
  774. For detailed information on wildcards, see <specref ref="Wildcards"/>.</p>
  775. </div4>
  776. </div3>
  777.  
  778.      <div3 id="&Constraint;_Definition">
  779. <head>&Constraint; Definition Components</head>
  780. <p>An &constraint; definition is an association between a name and one of
  781. several varieties of
  782. &constraint; related to uniqueness and reference.  All the
  783. varieties use <bibref ref="bib-xpath"/> expressions to pick out sets of
  784. information items relative to particular target element
  785. information items which are unique, or a key, or a <termref def="key-vn">valid</termref> reference, within
  786. a specified scope. An element information item is only <termref def="key-vn">valid</termref> with
  787. respect to an element declaration
  788. with &constraint; definitions if those definitions are all satisfied for all the descendants
  789. of that element information item which they pick out.</p>
  790.      <p>
  791. For detailed information on &constraint; definitions, see <specref ref="c&Constraint;_Definitions"/>.</p>
  792.     </div3>
  793. <div3 id="Group_Definitions">
  794. <head>Group Definition Components</head>
  795. <p>There are two kinds of convenience definitions provided to enable
  796. the re-use of pieces of complex type definitions: model group definitions
  797. and attribute group definitions.</p>
  798. <div4 id="Model_Group_Definition">
  799. <head>Model Group Definition</head>
  800. <p>A model group definition is an association between a name and a model group,
  801. enabling re-use of the same model group in several complex type
  802. definitions.</p>
  803.      <p>
  804. For detailed information on model group definitions, see <specref ref="cModel_Group_Definitions"/>.</p>
  805. </div4>
  806. <div4 id="Attribute_Group_Definition">
  807. <head>Attribute Group Definition</head>
  808. <p>An attribute group definition is an association between a name and a set of attribute declarations,
  809. enabling re-use of the same set in several complex type
  810. definitions.</p>
  811.      <p>
  812. For detailed information on attribute group definitions, see <specref ref="cAttribute_Group_Definitions"/>.</p>
  813. </div4>
  814. </div3>
  815.     <div3 id="Annotation">
  816.      <head>Annotation Components</head>
  817.      <p>An annotation is information for human and/or mechanical
  818. consumers. The interpretation of such information is
  819. not defined in this specification.</p>
  820.      <p>
  821. For detailed information on annotations, see <specref ref="cAnnotations"/>.</p>
  822.  
  823.      </div3>
  824.    </div2>
  825.     <div2 id="concepts-schemaConstraints">
  826.       <head>Constraints and Validation Rules</head>
  827.       <p>The <bibref ref="ref-xml"/> specification describes two kinds of
  828.         constraints on XML documents: <emph>well-formedness</emph> and
  829.         <emph>validity</emph> constraints. Informally, the well-formedness constraints
  830.         are those imposed by the definition of XML itself (such as the rules for the
  831.         use of the < and > characters and the rules for proper nesting of
  832.         elements), while validity constraints are the further constraints on document
  833.         structure provided by a particular DTD. </p>
  834.       <p>The preceding section focused on <termref def="key-vn">validation</termref>, that is
  835. the constraints on information items which schema components supply.  In fact
  836. however this specification provides four different kinds of normative statements about schema
  837.         components, their representations in XML and their contribution to the
  838. <termref def="key-vn">validation</termref> of information items:</p>
  839.       <glist>
  840.         <gitem>
  841.           <label>Schema Component Constraint</label>
  842.           <def>
  843.             <p><termdef id="gloss-cos" term="Schema Component Constraint">Constraints on the schema components themselves, i.e.
  844. conditions components must satisfy to be components at all.  Located in the
  845. sixth sub-section of the per-component sections of <specref ref="components"/>
  846. and tabulated in <specref ref="outcome-cos"/></termdef>.</p>
  847.           </def>
  848.         </gitem>
  849.        <gitem>
  850.         <label>Schema Representation Constraint</label>
  851.         <def>
  852.          <p><termdef id="gloss-src" term="Schema Representation Constraint">Constraints on the
  853. representation of schema components in XML beyond those which are expressed
  854. in <specref ref="normative-schemaSchema"/>.  Located in the
  855. third sub-section of the per-component sections of <specref ref="components"/>
  856. and tabulated in <specref ref="outcome-src"/></termdef>.</p>
  857.         </def>
  858.        </gitem>
  859.         <gitem>
  860.           <label>Validation Rules</label>
  861.           <def>
  862.             <p><termdef id="gloss-cvc" term="Validation
  863. Rules">Contributions to <termref def="key-vn">validation</termref> associated
  864. with schema components.  Located in the
  865. fourth sub-section of the per-component sections of <specref ref="components"/>
  866. and tabulated in <specref ref="validation_failures"/></termdef>.</p>
  867.           </def>
  868.         </gitem>
  869.        <gitem>
  870.           <label>Schema Information Set
  871.             Contribution</label>
  872.           <def>
  873.             <p><termdef id="gloss-sic" term="Schema Information Set Contribution">Augmentations to &PSVI;s
  874. expressed by schema components, which follow
  875.               as a consequence of <termref def="key-vn">validation</termref> and/or <termref def="key-va">assessment</termref>.
  876. Located in the
  877. fifth sub-section of the per-component sections of <specref ref="components"/>
  878. and tabulated in <specref ref="PSVI_contributions"/></termdef>.</p>
  879.           </def>
  880.         </gitem>
  881.       </glist>
  882.         <p>The last of these, schema information set
  883.           contributions, are not as new as they might at first seem.  XML 1.0
  884.           validation augments the XML 1.0 information set in similar ways,
  885. for example by
  886.           providing values for attributes not present in instances, and by implicitly
  887.           exploiting type information for normalization or access.
  888. (As an example of the latter case, consider the
  889.           effect of <code>NMTOKENS</code> on attribute white space, and the semantics of
  890.           <code>ID</code> and <code>IDREF</code>.) By including schema
  891. information set contributions, this specification makes explicit some features
  892. that XML 1.0 left implicit.</p>
  893.  
  894.     </div2>
  895. <div2 id="concepts-conformance">
  896. <head>Conformance</head>
  897. <p>This specification describes three levels of conformance for schema aware processors.  The first is
  898. required of all processors.  Support for the other two will depend on the application environments
  899. for which the processor is intended.</p>
  900. <p><termdef id="key-minimallyConforming" term="minimally conforming"><term>Minimally conforming</term> processors must completely and
  901. correctly implement the <termref def="gloss-cos">Schema Component
  902. Constraints</termref>, <termref def="gloss-cvc">Validation Rules</termref>,
  903. and <termref def="gloss-sic">Schema Information
  904. Set Contributions</termref> contained in this specification</termdef>.</p>
  905. <p><termdef id="key-interchange" term="conformance to the XML Representation of Schemas"><termref def="key-minimallyConforming">Minimally conforming</termref> processors which accept
  906. schemas represented in the form of XML documents as described in <specref ref="layer2"/> are
  907. additionally said to provide <term>conformance to the XML Representation of Schemas</term>.
  908. </termdef>
  909. Such processors must, when processing schema documents, completely and
  910. correctly implement all <termref def="gloss-src">Schema Representation
  911. Constraints</termref> in this specification, and must adhere exactly to the
  912. specifications in <specref ref="components"/> for mapping the contents of
  913. such documents to <termref def="key-component">schema
  914. components</termref> for use in <termref def="key-vn">validation</termref> and <termref def="key-va">assessment</termref>.</p>
  915. <note>
  916. <p>By separating the conformance requirements relating to the concrete syntax of XML schema
  917. documents, this specification admits processors
  918. which use schemas stored in optimized binary
  919. representations, dynamically created schemas represented as programming language data structures, or implementations in which particular schemas are compiled into executable code
  920. such as C or Java.  Such processors can be said to be <termref def="key-minimallyConforming">minimally conforming</termref> but not necessarily in <termref def="key-interchange">conformance to the XML Representation of Schemas</termref>.</p>
  921. </note>
  922. <p><termdef id="key-fullyConforming" term="fully conforming"> <term>Fully conforming</term>
  923. processors are network-enabled processors which are not only both <termref def="key-minimallyConforming">minimally conforming</termref> and <termref def="key-interchange">in conformance to the XML Representation of Schemas</termref>, but which additionally must be capable of accessing
  924. schema documents from the World Wide Web according to <specref ref="web-representation"/> and <specref ref="schema-loc"/>.
  925. </termdef>.
  926. </p>
  927. <note><p>Although this specification provides just these three standard levels of conformance, it is
  928. anticipated that other conventions can be established in the future.  For example, the World Wide
  929. Web Consortium is considering conventions for packaging on the Web a variety of
  930. resources relating to individual documents and namespaces.  Should such
  931. developments lead to new conventions for representing schemas, or for accessing them on the Web,
  932. new levels of conformance can be established and named at that time.  There is no need to modify
  933. or republish this specification to define such additional levels of conformance.</p></note>
  934.  <p>See <specref ref="composition"/> for a more detailed explanation of the
  935. mechanisms supporting these levels of conformance.</p>
  936. </div2>
  937.     <div2 id="concepts-nameSymbolSpaces">
  938.       <head>Names and Symbol Spaces</head>
  939.       <p>As discussed in <specref ref="concepts-data-model"/>, most schema
  940.         components (may) have <termref def="key-compName">names</termref>.
  941. If all such names were assigned from the same <quote>pool</quote>, then
  942.         it would be impossible to have, for example, a simple type definition and an element
  943. declaration both with the name
  944. <quote>title</quote> in a given <termref def="key-targetNS">target namespace</termref>.</p>
  945.       <p>
  946.         Therefore <termdef id="key-symbolSpace" term="symbol space">this specification introduces the term
  947. <term>symbol space</term> to denote a
  948. collection of names, each of which is unique with respect to the others</termdef>.  A symbol space is similar to the non-normative concept of <xtermref href="http://www.w3.org/TR/REC-xml-names/#ns-breakdown">namespace partition</xtermref> introduced in <bibref ref="ref-xml-namespaces"/>.
  949. There is a single distinct symbol space within a given <termref def="key-targetNS">target
  950. namespace</termref> for each kind of definition and declaration component
  951. identified in <specref ref="concepts-data-model"/>, except that within a target namespace, simple
  952. type definitions and complex type definitions share a symbol space.
  953. Within a given symbol space, names are unique, but the same name may appear in more than one symbol space without conflict. For example, the same name can appear in both a type definition and an element declaration, without conflict or necessary relation between the two.
  954. </p>
  955.       <p>Locally scoped attribute and element
  956. declarations are special with regard to symbol spaces.
  957. Every complex type definition defines its own local attribute and element declaration symbol
  958.         spaces, where these symbol spaces are distinct from each other and from any of the other
  959. symbol spaces.  So, for example, two complex type definitions having
  960. the same target namespace can contain
  961. a local attribute declaration for the unqualified name <quote>priority</quote>, or contain a local element declaration
  962. for the name <quote>address</quote>, without conflict or necessary relation between
  963. the two.</p>
  964.     </div2>
  965. <div2 id="Instance_Document_Constructions"> <head>Schema-Related Markup in
  966. Documents Being Validated</head>
  967.   <p>The XML representation of schema components uses a vocabulary
  968. identified by the namespace name <code>http://www.w3.org/2001/XMLSchema</code>.  For brevity, the text and examples in this specification use the prefix
  969. <code>xs:</code> to stand for this namespace; in practice,
  970. any prefix can be used.</p>
  971.  <p>&XSP1; also defines several attributes for direct use in any XML documents.  These attributes are in a different namespace,
  972. which has the namespace name <code>http://www.w3.org/2001/XMLSchema-instance</code>.
  973. For brevity, the text and examples in this specification use the prefix
  974. <code>xsi:</code> to stand for this latter namespace; in practice,
  975. any prefix can be used.  All schema processors have appropriate attribute
  976. declarations for these attributes built in, see <specref ref="xsi.type"/>,
  977. <specref ref="xsi.nil"/>, <specref ref="xsi.schemaLocation"/> and <specref ref="xsi.noNamespaceSchemaLocation"/>.</p>
  978. <div3 id="xsi_type">
  979. <head>xsi:type</head>
  980. <p>The <specref ref="Simple_Type_Definition"/> or <specref ref="Complex_Type_Definition"/> used in <termref def="key-vn">validation</termref> of an element is usually
  981. determined by reference to the appropriate schema components.
  982. An element information item in an instance may, however,
  983. explicitly assert its type using the attribute <code>xsi:type</code>.
  984. The value of this attribute is a <termref def="gloss-QName">QName</termref>;  see <specref ref="src-qname"/> for
  985. the means by which the <termref def="gloss-QName">QName</termref> is
  986. associated with a type definition.
  987. </p>
  988. </div3>
  989. <div3 id="xsi_nil">
  990. <head>xsi:nil</head>
  991. <p>&XSP1; introduces a mechanism for signaling that an element should
  992. be accepted as <termref def="key-vn">valid</termref> when it has no
  993. content despite a content type which does not require or even necessarily allow empty content.  An
  994. element may be 
  995. <termref def="key-vn">valid</termref> without content if it has the attribute <code>xsi:nil</code> with
  996. the value <code>true</code>.  An element so labeled must be empty, but can
  997. carry attributes if permitted by the corresponding complex type.</p>
  998. </div3>
  999. <div3 id="xsi_schemaLocation">
  1000. <head>xsi:schemaLocation, xsi:noNamespaceSchemaLocation</head>
  1001. <p>The <code>xsi:schemaLocation</code> and <code>xsi:noNamespaceSchemaLocation</code> attributes can be used in a document to provide
  1002. hints as to the physical location of schema documents which may be used for <termref def="key-va">assessment</termref>.
  1003. See <specref ref="schema-loc"/> for details on the use of these attributes.</p>
  1004. </div3>
  1005. </div2>
  1006. <div2 id="web-representation">
  1007. <head>Representation of Schemas on the World Wide Web</head>
  1008. <p>On the World Wide Web, schemas are conventionally represented as XML
  1009. documents (preferably of MIME type
  1010. <code>application/xml</code> or <code>text/xml</code>, but see <clauseref ref="c-vxd"/> of <specref ref="src-include"/>), conforming to the specifications in <specref ref="layer2"/>. For more information on
  1011. the representation and use of schema documents on the World Wide Web see <specref ref="schema-repr"/> and
  1012. <specref ref="schema-loc"/>. </p>
  1013. </div2>
  1014.  </div1>
  1015.   <div1 id="components">
  1016.    <head>Schema Component Details</head>
  1017.    <div2 id="scIntro">
  1018.     <head>Introduction</head>
  1019.     <p>The following sections provide full details on the composition of all schema components, together
  1020. with their XML representations and their contributions to <termref def="key-va">assessment</termref>.  Each section is devoted to a single component, with separate subsections for
  1021.      <olist>
  1022.       <item>
  1023.        <p>properties:  their values and significance</p>
  1024.       </item>
  1025.       <item>
  1026.        <p>XML representation and the mapping to properties</p>
  1027.       </item>
  1028.       <item>
  1029.        <p>constraints on representation</p>
  1030.       </item>
  1031.       <item>
  1032.        <p>validation rules</p>
  1033.       </item>
  1034.       <item>
  1035.        <p>&PSVI; contributions</p>
  1036.       </item>
  1037.       <item>
  1038.        <p>constraints on the components themselves</p>
  1039.       </item>
  1040.      </olist>
  1041. The sub-sections immediately below introduce conventions and terminology used throughout the component sections.</p>
  1042.    <div3>
  1043.     <head>Components and Properties</head>
  1044.     <p>Components are defined in terms of their
  1045. properties, and each property in turn is defined by giving its range,
  1046. that is the values it may have.  This can be understood as
  1047. defining a schema as a labeled directed graph, where the root is a schema,
  1048. every other vertex is a schema
  1049. component or a literal (string, boolean, number) and every labeled edge is a
  1050. property.  The graph is <emph>not</emph> acyclic:  multiple copies of
  1051. components with the same name in the same <termref def="key-symbolSpace">symbol space</termref> may not exist, so in some cases re-entrant chains
  1052. of properties must exist.  Equality of components for the purposes of this
  1053. specification is always defined as equality of names (including target
  1054. namespaces) within symbol spaces.</p>
  1055.     <note>
  1056.     <p>A schema and its components as defined in this chapter are an idealization of the information a schema-aware
  1057. processor requires:  implementations are not constrained in how they provide
  1058. it.  In particular, no implications about literal embedding versus indirection
  1059. follow from the use below of language such as "properties . . . having . . .
  1060. components as values".</p>
  1061.    </note>
  1062.    <p><termdef id="key-null" term="absent">Throughout this specification, the
  1063. term <term>absent</term> is used as a distinguished property value denoting absence</termdef>.</p>
  1064.    <p>Any property not
  1065. identified as optional is required to be present; optional properties which are
  1066. not present are taken to have <termref def="key-null">absent</termref> as their value.  Any
  1067. property identified as a having a set, subset or list value may have an empty value unless this is explicitly
  1068. ruled out:  this is <emph>not</emph> the same as <termref def="key-null">absent</termref>.  Any property value identified as a superset or subset of some set may be equal to that set, unless a proper superset or subset is explicitly called for.
  1069. By 'string' in Part 1 of this specification is meant a
  1070. sequence of ISO 10646 characters identified as <xtermref href="http://www.w3.org/TR/REC-xml#charsets">legal XML characters</xtermref>
  1071. in <bibref ref="ref-xml"/>.</p></div3>
  1072.    <div3>
  1073.     <head>XML Representations of Components</head>
  1074.     <p>The principal purpose of &XSP1; is to define a set of
  1075.       schema components that constrain the contents of instances and augment the
  1076.       information sets thereof.  Although no external representation
  1077. of schemas is required for this purpose, such representations will
  1078. obviously be widely used. To provide for this in an appropriate and
  1079. interoperable way, this specification provides a normative XML representation for schemas which
  1080. makes provision for every kind of schema
  1081. component.  <termdef id="key-schemaDoc" term="schema document">A document in
  1082. this form (i.e. a <eltref ref="schema"/> element information item) is a <term>schema document</term></termdef>.  For the schema document as a whole, and
  1083. its constituents, the sections below define correspondences between element
  1084. information items (with declarations in
  1085. <specref ref="normative-schemaSchema"/> and <specref ref="nonnormative-schemaDTD"/>) and
  1086. schema components.  All the element information items in the XML representation
  1087. of a schema must be in the XML Schema namespace, that is their <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref> must be <code>http://www.w3.org/2001/XMLSchema</code>.  Although a common way of creating the XML Infosets which are or contain <termref def="key-schemaDoc">schema documents</termref> will be using an XML parser, this is not required:  any mechanism which constructs conformant infosets as defined in <bibref ref="ref-xmlinfo"/> is a possible starting point.</p>
  1088.     <p>Two aspects of the XML representations of components presented in the
  1089. following sections are constant across them all:
  1090.     <olist>
  1091.      <item>
  1092.       <p>All of them allow attributes qualified with namespace names other than
  1093. the XML Schema namespace itself: these appear as annotations in the
  1094. corresponding schema component;</p>
  1095.      </item>
  1096.      <item>
  1097.       <p>All of them allow an <eltref ref="annotation"/> as their first child, for human-readable documentation and/or machine-targeted information.</p>
  1098.      </item>
  1099.     </olist>
  1100.    </p>
  1101.    </div3>
  1102.     <div3>
  1103.     <head>The Mapping between XML Representations and Components</head>
  1104.     <p>For each kind of schema component there is a corresponding normative XML representation.
  1105. The sections below describe the correspondences between the properties of each kind of
  1106. schema component on the one hand and the properties of information items in
  1107. that XML representation on the other, together
  1108. with constraints on that representation above and beyond those implicit in the
  1109. <specref ref="normative-schemaSchema"/>.</p>
  1110.  <p>The language used is as if the correspondences were mappings from XML representation to
  1111. schema component, but the mapping in the other direction, and therefore the
  1112. correspondence in the abstract, can always be
  1113. constructed therefrom.</p>
  1114.      <p>In discussing the mapping from XML representations to schema
  1115. components below, the value of a component property is often determined by the
  1116. value of an attribute information item, one of the &i-attributes; of an element
  1117. information item.  Since schema documents are constrained by the
  1118. <specref ref="normative-schemaSchema"/>, there is always a simple type
  1119. definition associated with any such attribute information item.  <termdef id="key-vv" term="actual value">The
  1120. phrase <term>actual value</term> is used to refer to the member of the value space of the
  1121. simple type definition associated with an attribute information item which corresponds to
  1122. its &i-value;</termdef>.  This will often be a string, but may also be an
  1123. integer, a boolean, a URI reference, etc.  This term is also occasionally used with respect to element or attribute information items in a document being <termref def="key-va">validated</termref>.</p>
  1124.    <p>Many properties are identified below as having
  1125. other schema components or sets of components as values.  For the purposes of exposition, the definitions in
  1126. this section assume that (unless the property is explicitly identified as
  1127. optional) all such values are in fact present.  When schema
  1128. components are constructed from XML representations involving reference by name
  1129. to other components, this assumption may be violated if one or more references
  1130. cannot be resolved.  This specification addresses the matter of missing
  1131. components in a uniform manner, described in <specref ref="conformance-missing"/>:  no mention of
  1132. handling missing components will be found in the individual component
  1133. descriptions below.</p>
  1134.    <p>Forward reference to named definitions and declarations <emph>is</emph>
  1135. allowed, both within and between <termref def="key-schemaDoc">schema documents</termref>. 
  1136. By the time the component corresponding to an XML representation which
  1137. contains a forward reference is actually needed for <termref def="key-vn">validation</termref> an appropriately-named component may have become available to discharge the reference: see <specref ref="composition"/> for details.</p>
  1138.    </div3>
  1139.    <div3>
  1140.     <head>White Space Normalization during Validation</head>
  1141.     <p>Throughout this specification, <termdef id="key-iv" term="initial value">the
  1142. <term>initial value</term> of some
  1143. attribute information item is the value of the
  1144. <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">normalized
  1145. value</xpropref> property of that item.  Similarly, the <term>initial value</term> of an element information item is the string composed of, in order, the
  1146. &i-ccode; of each character information item in the &i-children; of that
  1147. element information item</termdef>.</p>
  1148.    <p>The above definition means that comments and processing instructions,
  1149. even in the midst of text, are ignored for all <termref def="key-vn">validation</termref> purposes.</p>
  1150.    <p><termdef id="key-nv" term="normalized value">The
  1151. <term>normalized value</term> of an element or
  1152. attribute information item is an &r-value; whose white space, if any, has been
  1153. normalized according to the value of the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#rf-whiteSpace">whiteSpace facet</xtermref> of the
  1154. simple type definition used in its <termref def="key-vn">validation</termref>:
  1155.  </termdef>
  1156.     <glist>
  1157.      <gitem>
  1158.       <label>preserve</label>
  1159.       <def>
  1160.        <p>No normalization is done, the value is the &i-value;</p>
  1161.       </def>
  1162.      </gitem>
  1163.      <gitem>
  1164.       <label>replace</label>
  1165.       <def>
  1166.        <p>All occurrences of <code>#x9</code> (tab), <code>#xA</code> (line feed) and
  1167. <code>#xD</code> (carriage return) are replaced with <code>#x20</code> (space).</p>
  1168.       </def>
  1169.      </gitem>
  1170.      <gitem>
  1171.       <label>collapse</label>
  1172.       <def>
  1173.        <p>Subsequent to the replacements specified above under <local>replace</local>,
  1174. contiguous sequences of <code>#x20</code>s are collapsed to a single
  1175. <code>#x20</code>, and initial and/or final <code>#x20</code>s are deleted.</p>
  1176.       </def>
  1177.      </gitem>
  1178.     </glist>
  1179.    </p>
  1180.    <p>There are three alternative validation rules which may supply the
  1181. necessary background for the above:  <specref ref="cvc-attribute"/> (<clauseref ref="c-sva"/>), <specref ref="cvc-type"/> (<clauseref ref="c-sv1"/>) or <specref ref="cvc-complex-type"/> (<clauseref ref="c-sv2"/>).</p>
  1182.    <p>These three levels of normalization correspond to the processing mandated
  1183. in XML 1.0 for element content, CDATA attribute content and tokenized
  1184. attributed content, respectively.  See <xspecref href="http://www.w3.org/TR/REC-xml#AVNormalize">Attribute Value Normalization</xspecref> in <bibref ref="ref-xml"/> for the precedent for <local>replace</local> and <local>collapse</local> for attributes.  Extending this processing to element content is necessary to ensure a consistent <termref def="key-vn">validation</termref> semantics for simple types, regardless of whether they are applied to attributes or elements.  Performing it twice in the case of attributes whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">normalized
  1185. value</xpropref> has already been subject to replacement or collapse on the basis of
  1186. information in a DTD is necessary to ensure consistent treatment of attributes
  1187. regardless of the extent to which DTD-based information has been made use of
  1188. during infoset construction.</p>
  1189.    <note>
  1190.     <p>Even when DTD-based information <emph>has</emph> been appealed to, and
  1191. <xspecref href="http://www.w3.org/TR/REC-xml#AVNormalize">Attribute Value
  1192. Normalization</xspecref> has taken place, the above definition of &i-value; may
  1193. mean <emph>further</emph> normalization takes place, as for instance when
  1194. character entity references in attribute values result in white space characters
  1195. other than spaces in their &r-value;s.</p>
  1196.    </note>
  1197.    </div3>
  1198.    </div2>
  1199.    <div2 id="cAttribute_Declarations">
  1200.     <head>Attribute Declarations</head>
  1201.     <p>Attribute declarations provide for:</p>
  1202.     <ulist>
  1203.      <item><p>Local <termref def="key-vn">validation</termref> of attribute information item values using a simple type definition;</p></item>
  1204.      <item><p>Specifying default or fixed values for attribute information items.</p></item>
  1205.     </ulist>
  1206.  <note role="example">
  1207. <eg xml:space="preserve"><![CDATA[<xs:attribute name="age" type="xs:positiveInteger" use="required"/>]]>
  1208. </eg>
  1209. <p>The XML representation of an attribute declaration.</p>
  1210. </note>
  1211.     <div3 id="Attribute_Declaration_details">
  1212.      <head>The Attribute Declaration Schema Component</head>
  1213.     <p>The attribute declaration schema component has the following
  1214. properties:</p>
  1215.     <compdef name="Attribute Declaration" ref="Attribute_Declaration">
  1216.      <proplist>
  1217.       <propdef id="a-name" name="name">An NCName as defined by
  1218. <bibref ref="ref-xml-namespaces"/>.</propdef>
  1219.       <propdef id="a-target_namespace" name="target namespace">Either <termref def="key-null">absent</termref> or
  1220. a namespace name, as defined in <bibref ref="ref-xml-namespaces"/>.</propdef>
  1221.       <propdef id="a-simple_type_definition" name="type definition">A
  1222. simple type definition.</propdef>
  1223.             <propdef id="a-scope" name="scope">Optional.  Either <pt>global</pt> or a complex type
  1224. definition.</propdef>
  1225.       <propdef id="a-value_constraint" name="value constraint">Optional.  A pair
  1226. consisting of a value and one of <pt>default</pt>, <pt>fixed</pt>.</propdef>
  1227.       <propdef id="a-annotation" name="annotation">Optional.  An annotation.</propdef>
  1228.      </proplist>
  1229.     </compdef>
  1230. <p>The <propref ref="a-name"/> property must match the local part of the names of attributes being <termref def="key-vn">validated</termref>.</p>
  1231. <p>The value of the attribute must conform to the supplied <propref ref="a-simple_type_definition"/>.</p>
  1232.     <p>A non-<termref def="key-null">absent</termref> value of the <propref ref="a-target_namespace"/> property provides for <termref def="key-vn">validation</termref> of
  1233. namespace-qualified attribute information items (which must be explicitly
  1234. prefixed in the character-level form of XML documents).  <termref def="key-null">Absent</termref> values of
  1235. <propref ref="a-target_namespace"/> <termref def="key-vn">validate</termref> unqualified (unprefixed) items.</p>
  1236.     <p>A <propref ref="a-scope"/> of <pt>global</pt> identifies attribute declarations
  1237. available for use in complex type definitions throughout the schema.  Locally scoped declarations are available for use only within the
  1238. complex type definition identified by the <propref ref="a-scope"/> property.  This property is <termref def="key-null">absent</termref> in the case of declarations within attribute group definitions:  their scope will be determined when they are used in the construction of complex type definitions.
  1239. </p>
  1240. <p><propref ref="a-value_constraint"/> reproduces the functions of XML 1.0 default and <code>#FIXED</code>
  1241. attribute values.  <pt>default</pt> specifies that the attribute is to appear unconditionally in
  1242. the &PSVI;, with the supplied value used
  1243. whenever the attribute is not actually present; <pt>fixed</pt> indicates that the attribute value if present must equal the supplied
  1244. constraint value, and if absent receives the supplied value as for
  1245. <pt>default</pt>.  Note that it is <emph>values</emph> that are supplied and/or
  1246. checked, not strings.</p>
  1247.     <p>See <specref ref="cAnnotations"/> for information on the role of the
  1248. <propref ref="a-annotation"/> property.</p>
  1249. <note><p>A more complete and formal presentation of the semantics of <propref ref="a-name"/>, <propref ref="a-target_namespace"/> and <propref ref="a-value_constraint"/> is provided in
  1250. conjunction with other aspects of complex type <termref def="key-vn">validation</termref> (see <specref ref="cvc-complex-type"/>.)</p></note>
  1251.     <p><bibref ref="ref-xmlinfo"/> distinguishes attributes with names such as <code>xmlns</code> or <code>xmlns:xsl</code> from
  1252. ordinary attributes, identifying them as <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace attributes</xpropref>.  Accordingly, it is unnecessary and in fact not possible for
  1253. schemas to contain attribute declarations corresponding to such
  1254. namespace declarations, see <specref ref="no-xmlns"/>.  No means is provided in
  1255. this specification to supply a
  1256. default value for a namespace declaration.</p> 
  1257. </div3>
  1258.     <div3 id="declare-attribute">
  1259. <head>XML Representation of Attribute Declaration Schema Components</head>
  1260. <p>The XML representation for an attribute declaration schema component is an
  1261. <eltref ref="attribute"/> element information item.  It specifies a simple type
  1262. definition for an attribute either by reference or explicitly, and may provide default information.  The correspondences between the
  1263. properties of the information item and
  1264. properties of the component are as follows:</p>
  1265. <reprdef>
  1266.  <reprelt eltname="attribute" type="attribute"/>
  1267.  <p>If the <eltref ref="attribute"/> element information item has <eltref ref="schema"/> as its parent, the corresponding schema component is as follows:</p>
  1268.   <reprcomp ref="Attribute_Declaration_details" abstract="Attribute Declaration">
  1269.    <propmap name="a-name">The &v-value; of the <code>name</code> &i-attribute;</propmap>
  1270.   <propmap name="a-target_namespace">The &v-value; of the
  1271. <code>targetNamespace</code> &i-attribute; of the parent <eltref ref="schema"/>
  1272. element information item, or <termref def="key-null">absent</termref> if there is none.</propmap>
  1273.  <propmap name="a-simple_type_definition">The simple type definition
  1274. corresponding to the <eltref ref="simpleType"/> element information item in the
  1275. &i-children;, if present, otherwise the simple type definition <termref def="src-resolve">resolved</termref> to by
  1276. the &v-value; of the <code>type</code> &i-attribute;, if present, otherwise the
  1277. <termref def="simple-ur-type-itself">simple ur-type definition</termref>.</propmap>
  1278.    <propmap name="a-scope"><pt>global</pt>.</propmap>
  1279.  <propmap name="a-value_constraint">If there is a <code>default</code> or a <code>fixed</code>
  1280. &i-attribute;, then a pair consisting of the &v-value; (with respect to the
  1281. <propref ref="a-simple_type_definition"/>) of that &i-attribute; and
  1282. either <pt>default</pt> or <pt>fixed</pt>, as appropriate, otherwise <termref def="key-null">absent</termref>.</propmap>
  1283.  <propmap name="a-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
  1284. &i-children;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  1285.  </reprcomp>
  1286.  <p>otherwise if the <eltref ref="attribute"/> element information item has
  1287. <eltref ref="complexType"/> or <eltref ref="attributeGroup"/> as an ancestor
  1288. and the <code>ref</code> &i-attribute; is absent, it corresponds to an
  1289. attribute use with properties as follows (unless <code>use='prohibited'</code>, in which case the item
  1290. corresponds to nothing at all):</p>
  1291.  <reprcomp ref="AU_details" abstract="Attribute Use">
  1292.   <propmap name="required"><pt>true</pt> if the <code>use</code>
  1293. &i-attribute; is present with &v-value; <code>required</code>, otherwise
  1294. <pt>false</pt>.</propmap>
  1295.   <propmap name="attribute">See the Attribute Declaration mapping
  1296. immediately below.</propmap>
  1297.   <propmap name="au-value_constraint">If there is a <code>default</code> or a <code>fixed</code>
  1298. &i-attribute;, then a pair consisting of the &v-value; (with respect to the
  1299. <propref ref="a-simple_type_definition"/> of the <propref ref="attribute"/>) of that &i-attribute; and
  1300. either <pt>default</pt> or <pt>fixed</pt>, as appropriate, otherwise <termref def="key-null">absent</termref>.</propmap>
  1301.  </reprcomp>
  1302.  <reprcomp ref="Attribute_Declaration_details" abstract="Attribute Declaration">
  1303.   <propmap name="a-name">The &v-value; of the <code>name</code> &i-attribute;</propmap>
  1304.   <propmap name="a-target_namespace">If <code>form</code> is present and its
  1305. &v-value; is <code>qualified</code>, or if <code>form</code> is absent and the
  1306. &v-value; of <code>attributeFormDefault</code> on the <eltref ref="schema"/>
  1307. ancestor is <code>qualified</code>, then the &v-value; of the
  1308. <code>targetNamespace</code> &i-attribute; of the parent <eltref ref="schema"/>
  1309. element information item, or <termref def="key-null">absent</termref> if there
  1310. is none, otherwise <termref def="key-null">absent</termref>.</propmap>
  1311.   <propmap name="a-simple_type_definition">The simple type definition
  1312. corresponding to the <eltref ref="simpleType"/> element information item in the
  1313. &i-children;, if present, otherwise the simple type definition <termref def="src-resolve">resolved</termref> to by
  1314. the &v-value; of the <code>type</code> &i-attribute;, if present, otherwise the
  1315. <termref def="simple-ur-type-itself">simple ur-type definition</termref>.</propmap>
  1316.   <propmap name="a-scope">If the <eltref ref="attribute"/> element information item
  1317. has <eltref ref="complexType"/> as an ancestor, the complex definition
  1318. corresponding to that item, otherwise (the <eltref ref="attribute"/> element
  1319. information item is within an <eltref ref="attributeGroup"/> definition), <termref def="key-null">absent</termref>.</propmap>
  1320.   <propmap name="a-value_constraint"><termref def="key-null">absent</termref>.</propmap>
  1321.  <propmap name="a-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
  1322. &i-children;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  1323.  </reprcomp>
  1324.  <p>otherwise (the <eltref ref="attribute"/> element information item has
  1325. <eltref ref="complexType"/> or <eltref ref="attributeGroup"/> as an ancestor and the
  1326. <code>ref</code> &i-attribute; is present), it corresponds to an
  1327. attribute use with properties as follows (unless <code>use='prohibited'</code>, in which case the item
  1328. corresponds to nothing at all):</p>
  1329.  <reprcomp ref="AU_details" abstract="Attribute Use">
  1330.   <propmap name="required"><pt>true</pt> if the <code>use</code>
  1331. &i-attribute; is present with &v-value; <code>required</code>, otherwise
  1332. <pt>false</pt>.</propmap>
  1333.   <propmap name="attribute">The (top-level) attribute declaration <termref def="src-resolve">resolved</termref> to by the
  1334. &v-value; of the <code>ref</code> &i-attribute;</propmap>
  1335.   <propmap name="au-value_constraint">If there is a <code>default</code> or a <code>fixed</code>
  1336. &i-attribute;, then a pair consisting of the &v-value; (with respect to the
  1337. <propref ref="a-simple_type_definition"/> of the <propref ref="attribute"/>) of that &i-attribute; and
  1338. either <pt>default</pt> or <pt>fixed</pt>, as appropriate, otherwise <termref def="key-null">absent</termref>.</propmap>
  1339.  </reprcomp>
  1340.  </reprdef>
  1341.  <p>Attribute declarations can appear at the top level of a schema document, or within complex
  1342. type definitions, either as complete (local) declarations, or by reference to top-level
  1343. declarations, or within attribute group definitions.  For complete declarations, top-level or local, the <code>type</code> attribute is used when the declaration can use a
  1344. built-in or pre-declared simple type definition.  Otherwise an
  1345. anonymous <eltref ref="simpleType"/> is provided inline.</p>
  1346.  <p>The default when no simple type definition is referenced or
  1347. provided is the simple <termref def="key-urType">ur-type definition</termref>, which imposes no constraints at all.</p>
  1348.  <p>Attribute information items <termref def="key-vn">validated</termref> by a top-level declaration must be qualified with the
  1349. <propref ref="a-target_namespace"/> of that declaration (if this is <termref def="key-null">absent</termref>, the item must be unqualified).  Control over whether attribute information items
  1350. <termref def="key-vn">validated</termref> by a local declaration must be similarly qualified or not
  1351. is provided by the <code>form</code> &i-attribute;, whose default is provided
  1352. by the <code>attributeFormDefault</code> &i-attribute; on the enclosing <eltref ref="schema"/>, via its determination of <propref ref="a-target_namespace"/>.</p>
  1353.  <p>The names for top-level attribute declarations are in their own
  1354. <termref def="key-symbolSpace">symbol space</termref>.  The names of locally-scoped
  1355. attribute declarations reside in symbol spaces local to the type definition which contains
  1356. them.</p>
  1357.     </div3>
  1358.     <div3>
  1359.      <head>Constraints on XML Representations of Attribute Declarations</head>
  1360.  <constraintnote id="src-attribute" type="src">
  1361.   <head>Attribute Declaration Representation OK</head>
  1362.   <p>In addition to the conditions imposed on <eltref ref="attribute"/> element
  1363. information items by the schema for schemas,
  1364.    <olist role="and">
  1365.     <item>
  1366.      <p><code>default</code> and <code>fixed</code> must not both be present.</p>
  1367.     </item>
  1368.     <item>
  1369.      <p>If <code>default</code> and <code>use</code> are both present,
  1370. <code>use</code> must have the &v-value; <code>optional</code>.</p>
  1371.     </item>
  1372.     <item>
  1373.      <p>If the item's parent is not <eltref ref="schema"/>, then
  1374.       <olist role="and">
  1375.        <item>
  1376.      <p>One of <code>ref</code> or <code>name</code> must be present, but not both.</p>
  1377.     </item>
  1378.        <item>
  1379.         <p>If <code>ref</code> is present, then all of <eltref ref="simpleType"/>,
  1380. <code>form</code> and <code>type</code> must be absent.</p>
  1381.        </item>
  1382.       </olist>
  1383.      </p>
  1384.     </item>
  1385.     <item>
  1386.      <p><code>type</code> and <eltref ref="simpleType"/>
  1387. must not both be present.</p>
  1388.     </item>
  1389.     <item>
  1390.      <p>The corresponding attribute
  1391. declaration must satisfy the conditions set out in
  1392. <specref ref="coss-attribute"/>.</p>
  1393.     </item>
  1394.    </olist>
  1395.   </p>
  1396.  </constraintnote>
  1397.     </div3>
  1398.     <div3>
  1399.      <head>Attribute Declaration Validation Rules</head>
  1400.    <constraintnote type="cvc" id="cvc-attribute">
  1401.      <head>Attribute Locally Valid</head>
  1402.      <p>For an attribute information item to be locally <termref def="key-vn">valid</termref> with respect to an
  1403. attribute declaration 
  1404.       <olist role="and">
  1405.        <item id="c-a1">
  1406.         <p>The declaration must not be <termref def="key-null">absent</termref> (see <specref ref="conformance-missing"/> for
  1407. how this can fail to be the case).</p>
  1408.        </item>
  1409.        <item id="c-a2">
  1410.         <p>Its <propref ref="a-simple_type_definition"/> must not be absent.</p>
  1411.        </item>
  1412.        <item id="c-sva">
  1413.         <p>The item's &i-value; must be locally <termref def="key-vn">valid</termref> with respect to that <propref ref="a-simple_type_definition"/> as per <specref ref="cvc-simple-type"/>.</p>
  1414.        </item>
  1415.        <item>
  1416.         <p>The item's &v-value; must match the value of the <propref ref="a-value_constraint"/>, if it is
  1417. present and <pt>fixed</pt>.</p>
  1418.        </item>
  1419.       </olist>
  1420.      </p>
  1421.     </constraintnote>
  1422.     <constraintnote id="cvc-assess-attr" type="cvc">
  1423.      <head>Schema-Validity Assessment (Attribute)</head>
  1424.      <p>The schema-validity assessment of an attribute information item depends
  1425. on its <termref def="key-vn">validation</termref> alone.</p>
  1426.   <p><termdef id="key-dd" term="context-determined declaration">During <termref def="key-vn">validation</termref>, associations
  1427. between element and attribute information items among the &i-children;
  1428. and &i-attributes; on the one hand, and element and attribute
  1429. declarations on the other, are established as a side-effect.  Such
  1430. declarations are called the <term>context-determined declarations</term></termdef>. 
  1431. See <clauseref ref="c-ctma"/> (in <specref ref="cvc-complex-type"/>) for
  1432. attribute declarations, <clauseref ref="c-cdde"/> (in <specref ref="cvc-particle"/>) for element
  1433. declarations.</p>
  1434.   <p>For an attribute information item's schema-validity to have been assessed
  1435.       <olist role="and">
  1436.        <item>
  1437.         <p>A non-<termref def="key-null">absent</termref> attribute declaration
  1438. must be known for it, namely
  1439.          <olist role="orval">
  1440.           <item>
  1441.            <p>A declaration which has been established as its <termref def="key-dd">context-determined declaration</termref>;</p>
  1442.           </item>
  1443.           <item id="c-adbyr">
  1444.            <p>A declaration resolved to by its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref> and <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref> as defined by <specref ref="cvc-resolve-instance"/>, provided its <termref def="key-dd">context-determined declaration</termref> is
  1445. not <pt>skip</pt>.</p>
  1446.           </item>
  1447.          </olist>
  1448.         </p>
  1449.        </item>
  1450.        <item>
  1451.         <p>Its <termref def="key-vn">validity</termref> with respect to that
  1452. declaration must have been evaluated as per <specref ref="cvc-attribute"/>.</p>
  1453.        </item>
  1454.        <item>
  1455.         <p>Both <clauseref ref="c-a1"/> and <clauseref ref="c-a2"/> of <specref ref="cvc-attribute"/> must be satisfied.</p>
  1456.        </item>
  1457.       </olist>
  1458.      </p>
  1459. <p><termdef id="key-svaa" term="strictly assessed" role="local">For attributes, there is no
  1460. difference between assessment and strict assessment, so if the above holds, the attribute information item has been <term>strictly assessed</term></termdef>.</p> 
  1461.     </constraintnote>
  1462.     </div3>
  1463.     <div3>
  1464.      <head>Attribute Declaration Information Set Contributions</head>
  1465.     <constraintnote id="sic-a-outcome" type="sic">
  1466.      <head>Assessment Outcome (Attribute)</head>
  1467.      <p>If the schema-validity of an attribute information item has been assessed
  1468. as per <specref ref="cvc-assess-attr"/>, then in the &PSVI; it has properties as follows:</p>
  1469.      <proplist role="psvi" item="attribute">
  1470.        <propdef name="validation context" id="a-validation_context">The nearest ancestor element information
  1471. item with a <propref role="psvi" ref="e-schema_information"/> property.</propdef>
  1472.        <propdef name="validity" id="a-validity">
  1473.         <olist role="Caseval">
  1474.        <item>
  1475.         <p role="if">it was <termref def="key-svaa">strictly assessed</termref></p>
  1476.         <p role="then">
  1477.          <olist role="caseval">
  1478.           <item>
  1479.            <p role="if">it was
  1480. <termref def="key-vn">valid</termref> as defined by <specref ref="cvc-attribute"/></p>
  1481.            <p role="then"><pt>valid</pt>;</p>
  1482.           </item>
  1483.           <item>
  1484.            <p role="otherwise"><pt>invalid</pt>.</p>
  1485.           </item>
  1486.          </olist> 
  1487.         </p>
  1488.        </item>
  1489.        <item>
  1490.         <p role="otherwise"><pt>notKnown</pt>.</p>
  1491.        </item>
  1492.       </olist>
  1493.        </propdef>
  1494.        <propdef name="validation attempted" id="a-validation_attempted">
  1495.        <olist role="Caseval">
  1496.        <item>
  1497.         <p role="if">it was <termref def="key-svaa">strictly assessed</termref></p>
  1498.         <p role="then"><pt>full</pt>;</p>
  1499.        </item>
  1500.        <item>
  1501.         <p role="otherwise"><pt>none</pt>.</p>
  1502.        </item>
  1503.       </olist></propdef>
  1504.        <propdef name="schema specified" id="a-schema_specified"><pt>infoset</pt>.  See <specref ref="sic-attrDefault"/> for the other possible value.</propdef>
  1505.       </proplist>
  1506.     </constraintnote>
  1507.     <constraintnote type="sic" id="sic-attr-error-code">
  1508.      <head>Validation Failure (Attribute)</head>
  1509.      <p>If the local <termref def="key-vn">validity</termref>, as defined by <specref ref="cvc-attribute"/>
  1510. above, of an attribute information item has been assessed,
  1511. in the &PSVI; the item has a
  1512. property:</p>
  1513.      <proplist role="psvi" item="attribute">
  1514.       <propdef id="a-schema_error_code" name="schema error code">
  1515.        <olist role="Caseval">
  1516.         <item>
  1517.          <p role="if">the item is not <termref def="key-vn">valid</termref></p>
  1518.          <p role="then">a list.  Applications wishing to provide
  1519. information as to the reason(s) for the <termref def="key-vn">validation</termref> failure are encouraged to record one or more
  1520. error codes (see <specref ref="outcomes"/>) herein.</p>
  1521.         </item>
  1522.         <item>
  1523.          <p role="otherwise"><termref def="key-null">absent</termref>.</p>
  1524.         </item>
  1525.        </olist>
  1526.       </propdef>
  1527.      </proplist>
  1528.     </constraintnote>
  1529.     <constraintnote type="sic" id="sic-attr-decl">
  1530.      <head>Attribute Declaration</head>
  1531.      <p>If an attribute information item is <termref def="key-vn">valid</termref> with respect to an attribute
  1532. declaration as per <specref ref="cvc-attribute"/> then in the &PSVI; the attribute
  1533. information item may, at processor option, have a property:</p>
  1534.      <proplist role="psvi" item="attribute">
  1535.       <propdef id="a-declaration" name="attribute declaration">
  1536.        An <termref def="key-iso">item isomorphic</termref> to the declaration component itself.
  1537.       </propdef>
  1538.      </proplist>
  1539.     </constraintnote>
  1540.     <constraintnote type="sic" id="sic-attrType">
  1541.      <head>Attribute Validated by Type</head>
  1542.      <p>If <clauseref ref="c-sva"/> of <specref ref="cvc-attribute"/> applies with
  1543. respect to an attribute information item, in the &PSVI; the attribute
  1544. information item has a property:</p>
  1545.      <proplist role="psvi" item="attribute">
  1546.       <propdef id="a-schema_normalized_value" name="schema normalized value">
  1547.        The &i-value; of the item as <termref def="key-vn">validated</termref>.
  1548.       </propdef>
  1549.      </proplist>
  1550.      <p>Furthermore, the item has one of the following alternative sets of properties:</p>
  1551.      <p>Either</p>
  1552.     <proplist role="psvi" item="attribute">
  1553.       <propdef id="a-type_definition" name="type definition">An <termref def="key-iso">item isomorphic</termref> to the relevant attribute declaration's
  1554. <propref ref="a-simple_type_definition"/> component.</propdef>
  1555.      <propdef name="member type definition" id="a-member_type_definition">If
  1556. and only if that type definition has <propref ref="variety"/> <pt>union</pt>, then an
  1557. <termref def="key-iso">item isomorphic</termref> to that member of its <propref ref="st-member_type_definitions"/> which actually <termref def="key-vn">validated</termref> the attribute item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">normalized value</xpropref>.</propdef>
  1558.      </proplist>     
  1559.       <p>or</p>
  1560.     <proplist role="psvi" item="attribute">
  1561.       <propdef id="a-type_definition_type" name="type definition
  1562. type">
  1563. <pt>simple</pt>.</propdef>
  1564.        <propdef id="a-type_definition_namespace" name="type definition namespace">The <propref ref="st-target_namespace"/> of the <termref def="key-typeDefn">type definition</termref>.</propdef>
  1565.         <propdef name="type definition anonymous" id="a-type_definition_anonymous"><pt>true</pt> if the <propref ref="st-name"/> of the <termref def="key-typeDefn">type definition</termref> is <termref def="key-null">absent</termref>, otherwise <pt>false</pt>.</propdef>
  1566.         <propdef name="type definition name" id="a-type_definition_name">The <propref ref="st-name"/> of the <termref def="key-typeDefn">type definition</termref>, if it is not <termref def="key-null">absent</termref>.  If it is
  1567. <termref def="key-null">absent</termref>, schema processors may, but need not,
  1568. provide a value unique to the definition.</propdef>
  1569.        </proplist>
  1570.         <p>If the <termref def="key-typeDefn">type definition</termref> has <propref ref="variety"/> <pt>union</pt>, then calling
  1571.          <termdef id="a-key-amt" term="actual member type definition" role="local"> that
  1572. member of the <propref ref="st-member_type_definitions"/> which actually
  1573. <termref def="key-vn">validated</termref> the attribute item's &i-value; the
  1574. <term>actual member type definition</term></termdef>, there are three additional properties:</p>
  1575.     <proplist role="psvi" item="attribute">
  1576.      <propdef name="member type definition namespace" id="a-member_type_definition_namespace">The <propref ref="st-target_namespace"/> of the <termref def="a-key-amt">actual
  1577. member type definition</termref>.</propdef>
  1578.      <propdef name="member type definition anonymous" id="a-member_type_definition_anonymous"><pt>true</pt> if the <propref ref="st-name"/> of the <termref def="a-key-amt">actual member type definition</termref> is <termref def="key-null">absent</termref>, otherwise <pt>false</pt>.</propdef>
  1579.      <propdef name="member type definition name" id="a-member_type_definition_name">The <propref ref="st-name"/> of the <termref def="a-key-amt">actual member type definition</termref>, if it is not <termref def="key-null">absent</termref>.  If it is
  1580. <termref def="key-null">absent</termref>, schema processors may, but need not,
  1581. provide a value unique to the definition.</propdef>
  1582.          </proplist>
  1583.      <p>The first (<termref def="key-iso">item isomorphic</termref>) alternative above is provided for applications such as query
  1584. processors which need access to the full range of details about an item's
  1585. <termref def="key-va">assessment</termref>, for example the type hierarchy; the second, for lighter-weight
  1586. processors for whom representing the significant parts of the type hierarchy as
  1587. information items might be a significant burden.</p>     
  1588.      <p>Also, if the declaration has a <propref ref="a-value_constraint"/>, the
  1589. item has a property:</p>
  1590.      <proplist role="psvi" item="attribute">
  1591.       <propdef id="a-schema_default" name="schema default">
  1592.        The <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of
  1593. the declaration's <propref ref="a-value_constraint"/> value.
  1594.       </propdef>
  1595.      </proplist>
  1596.      <p>If the attribute information item was not <termref def="key-svaa">strictly assessed</termref>, then instead of the values specified above,
  1597.       <olist>
  1598.        <item>
  1599.         <p>The item's <propref ref="a-schema_normalized_value" role="psvi"/>
  1600. property has
  1601. the &r-value; of the item as its value;</p>
  1602.        </item>
  1603.        <item>
  1604.         <p>The <propref ref="a-type_definition" role="psvi"/> and
  1605. <propref ref="a-member_type_definition" role="psvi"/> properties, or their
  1606. alternatives, are based on the <termref def="simple-ur-type-itself">simple ur-type definition</termref>.</p>
  1607.        </item>
  1608.       </olist>
  1609.      </p>   
  1610.     </constraintnote>
  1611.     </div3>
  1612.     <div3 id="coss-attribute">
  1613.      <head>Constraints on Attribute Declaration Schema Components</head>
  1614.   <p>All attribute declarations (see <specref ref="cAttribute_Declarations"/>) must satisfy the following constraints.</p>
  1615.   <constraintnote type="cos" id="a-props-correct">
  1616.    <head>Attribute Declaration Properties Correct</head>
  1617.    <olist role="And">
  1618.     <item>
  1619.      <p>The values of the properties of an attribute declaration must be as described in
  1620. the property tableau in
  1621. <specref ref="Attribute_Declaration_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  1622.     </item>
  1623.     <item>
  1624.      <p>if there is a <propref ref="a-value_constraint"/>, the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of its value must be
  1625. <termref def="key-vn">valid</termref> with respect to the <propref ref="a-simple_type_definition"/> as
  1626. defined in <specref ref="cvc-simple-type"/>.
  1627.      </p>
  1628.     </item>
  1629.     <item>
  1630.      <p>If the <propref ref="a-simple_type_definition"/> is or is derived from <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref> then there must not be a <propref ref="a-value_constraint"/>.</p>
  1631.     </item>
  1632.    </olist>
  1633.   </constraintnote>
  1634.   <constraintnote type="cos" id="no-xmlns">
  1635.    <head><code>xmlns</code> Not Allowed</head>
  1636.    <p>The <propref ref="a-name"/> of an attribute declaration must not match <code>xmlns</code>.</p>
  1637. <note>
  1638. <p>The <propref ref="a-name"/> of an attribute is an <termref def="gloss-NCName">NCName</termref>, which implicitly
  1639. prohibits attribute declarations of the form <code>xmlns:*</code>.</p>
  1640. </note>
  1641.   </constraintnote>
  1642.   <constraintnote type="cos" id="no-xsi">
  1643.    <head><code>xsi:</code> Not Allowed</head>
  1644.    <p>The <propref ref="a-target_namespace"/> of an attribute declaration,
  1645. whether local or top-level, must not match <code>http://www.w3.org/2001/XMLSchema-instance</code>
  1646. (unless it is one of the four built-in declarations given in the next section).</p>
  1647.    <note>
  1648. <p>This reinforces the special status of these attributes, so that they not
  1649. only <emph>need</emph> not be declared to be allowed in instances, but
  1650. <emph>must</emph> not be declared.  It also removes any temptation to experiment with supplying global or fixed values
  1651. for e.g. <code>xsi:type</code> or <code>xsi:nil</code>, which would be
  1652. seriously misleading, as they would have no effect.</p>
  1653. </note>
  1654.   </constraintnote>
  1655.     </div3>
  1656.     <div3>
  1657.      <head>Built-in Attribute Declarations</head>
  1658.      <p>There are four attribute declarations present in every
  1659. schema by definition:</p>
  1660.     <schemaComp id="xsi.type">
  1661.      <head>Attribute Declaration for the 'type' attribute</head>
  1662.      <pvlist>
  1663.       <pvpair ref="a-name"><code>type</code></pvpair>
  1664.       <pvpair ref="a-target_namespace"><code>http://www.w3.org/2001/XMLSchema-instance</code></pvpair>
  1665.       <pvpair ref="type_definition">The built-in <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#QName">QName</xtermref> simple
  1666. type definition</pvpair>
  1667.       <pvpair ref="a-scope"><pt>global</pt></pvpair>
  1668.       <pvpair ref="a-value_constraint"><termref def="key-null">absent</termref></pvpair>
  1669.       <pvpair ref="a-annotation"><termref def="key-null">absent</termref></pvpair>
  1670.      </pvlist>
  1671.     </schemaComp>
  1672.      <schemaComp id="xsi.nil">
  1673.      <head>Attribute Declaration for the 'nil' attribute</head>
  1674.       <pvlist>
  1675.       <pvpair ref="a-name"><code>nil</code></pvpair>
  1676.       <pvpair ref="a-target_namespace"><code>http://www.w3.org/2001/XMLSchema-instance</code></pvpair>
  1677.       <pvpair ref="type_definition">The built-in <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#boolean">boolean</xtermref> simple
  1678. type definition</pvpair>
  1679.       <pvpair ref="a-scope"><pt>global</pt></pvpair>
  1680.       <pvpair ref="a-value_constraint"><termref def="key-null">absent</termref></pvpair>
  1681.       <pvpair ref="a-annotation"><termref def="key-null">absent</termref></pvpair>
  1682.      </pvlist>
  1683.      </schemaComp>
  1684.      <schemaComp id="xsi.schemaLocation">
  1685.      <head>Attribute Declaration for the 'schemaLocation' attribute</head>
  1686.       <pvlist>
  1687.       <pvpair ref="a-name"><code>schemaLocation</code></pvpair>
  1688.       <pvpair ref="a-target_namespace"><code>http://www.w3.org/2001/XMLSchema-instance</code></pvpair>
  1689.       <pvpair ref="type_definition">An anonymous simple type definition, as follows:
  1690.        <pvlist>
  1691.         <pvpair ref="st-name"><termref def="key-null">absent</termref></pvpair>
  1692.         <pvpair ref="st-target_namespace"><code>http://www.w3.org/2001/XMLSchema-instance</code></pvpair>
  1693.         <pvpair ref="st-base_type_definition">The built in <termref def="simple-ur-type-itself">simple ur-type definition</termref></pvpair>
  1694.         <pvpair ref="facets"><termref def="key-null">absent</termref></pvpair>
  1695.         <pvpair ref="variety"><pt>list</pt></pvpair>
  1696.         <pvpair ref="st-item_type_definition">The built-in <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#anyURI">anyURI</xtermref> simple
  1697. type definition</pvpair>
  1698.         <pvpair ref="st-annotation"><termref def="key-null">absent</termref></pvpair>
  1699.        </pvlist>
  1700.       </pvpair>
  1701.       <pvpair ref="a-scope"><pt>global</pt></pvpair>
  1702.       <pvpair ref="a-value_constraint"><termref def="key-null">absent</termref></pvpair>
  1703.       <pvpair ref="a-annotation"><termref def="key-null">absent</termref></pvpair>
  1704.      </pvlist>
  1705.      </schemaComp>
  1706.      <schemaComp id="xsi.noNamespaceSchemaLocation">
  1707.      <head>Attribute Declaration for the 'noNamespaceSchemaLocation' attribute</head>
  1708.       <pvlist>
  1709.       <pvpair ref="a-name"><code>noNamespaceSchemaLocation</code></pvpair>
  1710.       <pvpair ref="a-target_namespace"><code>http://www.w3.org/2001/XMLSchema-instance</code></pvpair>
  1711.       <pvpair ref="type_definition">The built-in <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#anyURI">anyURI</xtermref> simple
  1712. type definition</pvpair>
  1713.       <pvpair ref="a-scope"><pt>global</pt></pvpair>
  1714.       <pvpair ref="a-value_constraint"><termref def="key-null">absent</termref></pvpair>
  1715.       <pvpair ref="a-annotation"><termref def="key-null">absent</termref></pvpair>
  1716.      </pvlist>
  1717.      </schemaComp>
  1718.     </div3>
  1719.    </div2>
  1720.    <div2 id="cElement_Declarations">
  1721.     <head>Element Declarations</head>
  1722.        <p>Element declarations provide for:</p>
  1723.     <ulist>
  1724.      <item><p>Local <termref def="key-vn">validation</termref> of element information item values using a type definition;</p></item>
  1725.      <item><p>Specifying default or fixed values for an element information items;</p></item>
  1726.      <item><p>Establishing uniquenesses and reference constraint relationships among the values of related elements and
  1727. attributes;</p>
  1728. </item>
  1729.      <item><p>Controlling the substitutability of elements through the
  1730. mechanism of <termref def="key-equivalenceClass">element substitution groups</termref>.</p>
  1731.      </item>
  1732.     </ulist>
  1733.     <note role="example">
  1734.      <eg xml:space="preserve"><xs:element name="PurchaseOrder" type="PurchaseOrderType"/>
  1735.  
  1736. <xs:element name="gift">
  1737.  <xs:complexType>
  1738.   <xs:sequence>
  1739.    <xs:element name="birthday" type="xs:date"/>
  1740.    <xs:element ref="PurchaseOrder"/>
  1741.   </xs:sequence>
  1742.  </xs:complexType>
  1743. </xs:element>
  1744. </eg>
  1745.      <p>XML representations of several different types of element declaration</p>
  1746.     </note>
  1747.     <div3 id="Element_Declaration_details">
  1748.      <head>The Element Declaration Schema Component</head>
  1749. <p>The element declaration schema component has the following
  1750. properties:</p>
  1751.  
  1752.     <compdef name="Element Declaration" ref="Element_Declaration">
  1753.      <proplist>
  1754.       <propdef id="e-name" name="name">An NCName as defined by
  1755. <bibref ref="ref-xml-namespaces"/>.</propdef>
  1756.       <propdef id="e-target_namespace" name="target namespace">Either <termref def="key-null">absent</termref> or
  1757. a namespace name, as defined in <bibref ref="ref-xml-namespaces"/>.</propdef>
  1758.       <propdef id="type_definition" name="type definition">Either a simple type
  1759. definition or a complex type definition.</propdef>
  1760.       <propdef id="e-scope" name="scope">Optional.  Either <pt>global</pt> or a complex type
  1761. definition.</propdef>
  1762.       <propdef id="e-value_constraint" name="value constraint">Optional.  A
  1763. pair consisting of a value and one of <pt>default</pt>, <pt>fixed</pt>.</propdef>
  1764.       <propdef id="nillable" name="nillable">A boolean.</propdef>
  1765.       <propdef id="&constraint;_definitions" name="&constraint; definitions">A set
  1766. of constraint definitions.</propdef>
  1767.       <propdef id="class_exemplar" name="substitution group affiliation">Optional.  A top-level
  1768. element definition.</propdef>
  1769.       <propdef id="e-final" name="substitution group exclusions">A subset of
  1770. {<pt>extension</pt>,
  1771. <pt>restriction</pt>}.</propdef>
  1772.       <propdef id="e-exact" name="disallowed substitutions">A subset of {<pt>substitution</pt>, <pt>extension</pt>,
  1773. <pt>restriction</pt>}.</propdef>
  1774.       <propdef id="e-abstract" name="abstract">A boolean.</propdef>
  1775.       <propdef id="e-annotation" name="annotation">Optional.  An annotation.</propdef>
  1776.      </proplist>
  1777.  
  1778.     </compdef>
  1779. <p>The <propref ref="e-name"/> property must match the local part of the names
  1780. of element information items being <termref def="key-vn">validated</termref>.</p>
  1781. <p>A <propref ref="e-scope"/> of <pt>global</pt> identifies element declarations available for use in content
  1782. models throughout the schema.  Locally scoped declarations are available for use only within the
  1783. complex type identified by the <propref ref="e-scope"/> property.  This property is <termref def="key-null">absent</termref> in the case of  declarations within named model groups:  their scope is determined when they are used in the construction of complex type definitions.</p>
  1784.     <p>A non-<termref def="key-null">absent</termref> value of the <propref ref="e-target_namespace"/> property provides for <termref def="key-vn">validation</termref> of
  1785. namespace-qualified element information items.  <termref def="key-null">Absent</termref> values of
  1786. <propref ref="e-target_namespace"/> <termref def="key-vn">validate</termref> unqualified items.</p>
  1787. <p>An element information item is <termref def="key-vn">valid</termref>
  1788. if it satisfies the <propref ref="type_definition"/>.  For such an
  1789. item, schema information set contributions appropriate to the <propref ref="type_definition"/> are added to the
  1790. corresponding element information item in the &PSVI;.
  1791. </p>
  1792. <p>If <propref ref="nillable"/> is <pt>true</pt>, then an element may
  1793. also be <termref def="key-vn">valid</termref> if it
  1794. carries the namespace qualified attribute with <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref> <code>nil</code> from namespace <code>http://www.w3.org/2001/XMLSchema-instance</code> and value <code>true</code> (see <specref ref="xsi_nil"/>) even if it has
  1795. no text or element content despite a <propref ref="content_type"/> which would
  1796. otherwise require content. Formal details of element <termref def="key-vn">validation</termref> are described in <specref ref="cvc-elt"/>.</p>
  1797. <p><propref ref="e-value_constraint"/> establishes a default or fixed value for an element.  If <pt>default</pt> is specified, and if the element
  1798. being <termref def="key-vn">validated</termref> is empty, then the
  1799. canonical form of the supplied
  1800. constraint value becomes the <propref role="psvi" ref="e-schema_normalized_value"/> of the <termref def="key-vn">validated</termref> element in the &PSVI;.  If <pt>fixed</pt> is specified, then the element's content
  1801. must either be empty, in which case <pt>fixed</pt> behaves as <pt>default</pt>,
  1802. or its value must match the supplied constraint value.</p>
  1803.      <note>
  1804.       <p>The provision of defaults for elements goes beyond what is possible in
  1805. XML 1.0 DTDs, and does not exactly correspond to defaults for attributes.  In
  1806. particular, an element with a non-empty <propref ref="e-value_constraint"/> whose simple
  1807. type definition includes the empty string in its lexical space will
  1808. nonetheless never receive that value, because the <propref ref="e-value_constraint"/> will override it.</p>
  1809.      </note>
  1810. <p><propref ref="&constraint;_definitions"/> express constraints establishing uniquenesses and reference relationships among the values of related elements and
  1811. attributes.  See <specref ref="c&Constraint;_Definitions"/>.</p>
  1812. <p>Element declarations are members of the substitution group, if any, identified
  1813. by <propref ref="class_exemplar"/>.  Membership is transitive but not symmetric;  an element
  1814. declaration is a member of any group of which its <propref ref="class_exemplar"/> is a member.</p>
  1815. <p>An empty <propref ref="e-final"/> allows a declaration to be nominated as
  1816. the <propref ref="class_exemplar"/> of other element declarations having the same <propref ref="type_definition"/> or
  1817. types derived therefrom.  The explicit
  1818. values of <propref ref="e-final"/> rule out element declarations having types which
  1819. are <pt>extension</pt>s or <pt>restriction</pt>s respectively of <propref ref="type_definition"/>.  If
  1820. both values are specified, then the declaration may not be nominated as the
  1821. <propref ref="class_exemplar"/> of any other declaration.</p>
  1822.  
  1823. <p>The supplied values for <propref ref="e-exact"/> determine
  1824. whether an element declaration appearing in a <termref def="key-contentModel">content model</termref> will be prevented from additionally
  1825. <termref def="key-vn">validating</termref> elements (a) with an <specref ref="xsi_type"/> that identifies an
  1826. <pt>extension</pt> or <pt>restriction</pt> of the type of the declared element, and/or (b) from <termref def="key-vn">validating</termref> elements which are in the
  1827. substitution group headed by the declared element.
  1828. If <propref ref="e-exact"/> is empty, then all derived types and substitution group members are allowed.</p>
  1829. <p>Element declarations for which <propref ref="e-abstract"/> is <pt>true</pt> can appear in
  1830. content models only when substitution is allowed;
  1831. such declarations may not themselves ever be used to <termref def="key-vn">validate</termref> element content.</p>
  1832.      <p>See <specref ref="cAnnotations"/> for information on the role of the
  1833. <propref ref="e-annotation"/> property.</p>
  1834.     </div3>
  1835.     <div3 id="declare-element">
  1836. <head>XML Representation of Element Declaration Schema Components</head>
  1837. <p>The XML representation for an element declaration schema component is an
  1838. <eltref ref="element"/> element information item.  It specifies a type
  1839. definition for an element either by reference or explicitly, and may provide
  1840. occurrence and default information.  The correspondences between the
  1841. properties of the information item and
  1842. properties of the component(s) it corresponds to are as follows:</p>
  1843. <reprdef>
  1844.  <reprelt eltname="element" type="element"/>
  1845.  <p>If the <eltref ref="element"/> element information item has <eltref ref="schema"/> as its parent, the corresponding schema component is as follows:</p>
  1846.  <reprcomp abstract="Element Declaration" ref="Element_Declaration_details">  
  1847. <propmap name="e-name">The &v-value; of the <code>name</code> &i-attribute;.</propmap>
  1848.   <propmap name="e-target_namespace">The &v-value; of the
  1849. <code>targetNamespace</code> &i-attribute; of the parent <eltref ref="schema"/>
  1850. element information item, or <termref def="key-null">absent</termref> if there is none.</propmap>
  1851.  <propmap name="e-scope"><pt>global</pt>.</propmap>
  1852.   <propmap name="type_definition">The type definition
  1853. corresponding to the <eltref ref="simpleType"/> or <eltref ref="complexType"/> element information item in the
  1854. &i-children;, if either is present, otherwise the type definition <termref def="src-resolve">resolved</termref> to by
  1855. the &v-value; of the <code>type</code> &i-attribute;, otherwise the <propref ref="type_definition"/> of the element declaration <termref def="src-resolve">resolved</termref> to by the &v-value; of the <code>substitutionGroup</code> &i-attribute;, if present, otherwise the
  1856. <termref def="ur-type-itself">ur-type definition</termref>.</propmap>
  1857.   <propmap name="nillable">The &v-value; of the <code>nillable</code>
  1858. &i-attribute;, if present, otherwise <pt>false</pt>.</propmap>
  1859.   <propmap name="e-value_constraint">If there is a <code>default</code> or a <code>fixed</code>
  1860. &i-attribute;, then a pair consisting of the &v-value; (with respect to the
  1861. <propref ref="type_definition"/>, if it is a simple type definition, or the
  1862. <propref ref="type_definition"/>'s <propref ref="content_type"/>, if that is a
  1863. simple type definition, or else with respect to the built-in <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#string">string</xtermref> simple type definition) of that &i-attribute; and
  1864. either <pt>default</pt> or <pt>fixed</pt>, as appropriate, otherwise <termref def="key-null">absent</termref>.</propmap>
  1865.   <propmap name="&constraint;_definitions">A set consisting of the
  1866. &constraint;-definitions corresponding to all the <eltref ref="key"/>, <eltref ref="unique"/> and <eltref ref="keyref"/> element information items in the
  1867. &i-children;, if any, otherwise the empty set.</propmap>
  1868.   <propmap name="class_exemplar">The element declaration <termref def="src-resolve">resolved</termref> to by the
  1869. &v-value; of the
  1870. <code>substitutionGroup</code> &i-attribute;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  1871.   <propmap name="e-exact">A set depending on the &v-value; of the
  1872. <code>block</code> &i-attribute;, if present, otherwise on the &v-value; of the
  1873. <code>blockDefault</code> &i-attribute; of the ancestor <eltref ref="schema"/> element
  1874. information item, if present, otherwise on the empty string.  Call this the <local>EBV</local> (for effective block value).  Then the value of this property is
  1875.  <olist role="caseval">
  1876.   <item>
  1877.    <p role="if">the <local>EBV</local> is the empty string</p>
  1878.    <p role="then">the empty set;</p>
  1879.   </item>
  1880.   <item>
  1881.    <p role="if">the <local>EBV</local> is <code>#all</code></p>
  1882.    <p role="then"><code>{</code><pt>extension</pt>, <pt>restriction</pt>, <pt>substitution</pt><code>}</code>;</p>
  1883.   </item>
  1884.   <item>
  1885.    <p role="otherwise">a set with members drawn from the set above, each being present or
  1886. absent depending on whether the &v-value; (which is a list) contains an
  1887. equivalently named item.
  1888.    <note>
  1889.        <p>Although the <code>blockDefault</code> &i-attribute; of <eltref ref="schema"/> may include values other than <pt>extension</pt>, <pt>restriction</pt> or <pt>substitution</pt>, those values are ignored in the determination of <propref ref="e-exact"/> for element declarations (they <emph>are</emph> used elsewhere).</p>
  1890.       </note>
  1891.    </p>
  1892.   </item>
  1893.  </olist>
  1894.   </propmap>
  1895.   <propmap name="e-final">As for <propref ref="e-exact"/> above, but using the
  1896. <code>final</code> and <code>finalDefault</code> &i-attributes; in place of the
  1897. <code>block</code> and <code>blockDefault</code>
  1898. &i-attributes; and with the
  1899. relevant set being <code>{</code><pt>extension</pt>, <pt>restriction</pt><code>}</code>.</propmap>
  1900.   <propmap name="e-abstract">The &v-value; of the <code>abstract</code>
  1901. &i-attribute;, if present, otherwise <pt>false</pt>.</propmap>
  1902.   <propmap name="e-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
  1903. &i-children;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  1904. </reprcomp>
  1905.  <p>otherwise if the <eltref ref="element"/> element information item has
  1906. <eltref ref="complexType"/> or <eltref ref="group"/> as an ancestor and the
  1907. <code>ref</code> &i-attribute; is absent, the corresponding schema components
  1908. are as follows (unless <code>minOccurs=maxOccurs=0</code>, in which case the item
  1909. corresponds to no component at all):</p>
  1910.  <reprcomp abstract="Particle" ref="Particle_details">
  1911.   <propmap name="p-min_occurs">The &v-value; of the <code>minOccurs</code>
  1912. &i-attribute;, if present, otherwise <code>1</code>.</propmap>
  1913.   <propmap name="p-max_occurs"><pt>unbounded</pt>, if the <code>maxOccurs</code>
  1914. &i-attribute; equals <pt>unbounded</pt>, otherwise the &v-value; of the <code>maxOccurs</code>
  1915. &i-attribute;, if present, otherwise <code>1</code>.</propmap>
  1916.   <propmap name="term">A (local) element declaration as given below.</propmap>
  1917.   
  1918. </reprcomp>
  1919.  <p> 
  1920. An element declaration as in the first case above, with the exception of its <propref ref="e-target_namespace"/> and <propref ref="e-scope"/> properties, which are as below:</p>
  1921.  <reprcomp abstract="Element Declaration" ref="Element_Declaration_details">
  1922.   <propmap name="e-target_namespace">If <code>form</code> is present and its
  1923. &v-value; is <code>qualified</code>, or if <code>form</code> is absent and the
  1924. &v-value; of <code>elementFormDefault</code> on the <eltref ref="schema"/>
  1925. ancestor is <code>qualified</code>, then the &v-value; of the
  1926. <code>targetNamespace</code> &i-attribute; of the parent <eltref ref="schema"/>
  1927. element information item, or <termref def="key-null">absent</termref> if there
  1928. is none, otherwise <termref def="key-null">absent</termref>.</propmap>
  1929.  <propmap name="e-scope">If the <eltref ref="element"/> element information item
  1930. has <eltref ref="complexType"/> as an ancestor, the complex definition
  1931. corresponding to that item, otherwise (the <eltref ref="element"/> element
  1932. information item is within a named <eltref ref="group"/> definition), <termref def="key-null">absent</termref>.</propmap>
  1933.  </reprcomp>
  1934.  <p>otherwise (the <eltref ref="element"/> element information item has
  1935. <eltref ref="complexType"/> or <eltref ref="group"/> as an ancestor and the
  1936. <code>ref</code> &i-attribute; is present), the corresponding schema component is as
  1937. follows (unless <code>minOccurs=maxOccurs=0</code>, in which case the item
  1938. corresponds to no component at all):</p>
  1939.  <reprcomp abstract="Particle" ref="Particle_details">
  1940.   <propmap name="p-min_occurs">The &v-value; of the <code>minOccurs</code>
  1941. &i-attribute;, if present, otherwise <code>1</code>.</propmap>
  1942.   <propmap name="p-max_occurs"><pt>unbounded</pt>, if the <code>maxOccurs</code>
  1943. &i-attribute; equals <pt>unbounded</pt>, otherwise the &v-value; of the <code>maxOccurs</code>
  1944. &i-attribute;, if present, otherwise <code>1</code>.</propmap>
  1945.   <propmap name="term">The (top-level) element declaration <termref def="src-resolve">resolved</termref> to by the
  1946. &v-value; of the <code>ref</code> &i-attribute;.</propmap>
  1947. </reprcomp>
  1948. </reprdef>
  1949.  
  1950.  
  1951. <p><eltref ref="element"/> corresponds to an element declaration, and allows
  1952. the type definition of that declaration to be specified either by reference or
  1953. by explicit inclusion.</p>
  1954.   <p><eltref ref="element"/>s within <eltref ref="schema"/> produce
  1955. <pt>global</pt> element declarations; <eltref ref="element"/>s within <eltref ref="group"/> or <eltref ref="complexType"/> produce either particles which contain <pt>global</pt> element declarations (if there's a <code>ref</code> attribute) or local declarations (otherwise).  For complete declarations, top-level or local, the <code>type</code> attribute is used when the declaration can use a
  1956. built-in or pre-declared type definition.  Otherwise an
  1957. anonymous <eltref ref="simpleType"/> or <eltref ref="complexType"/> is provided inline.</p>
  1958.  <p>Element information items <termref def="key-vn">validated</termref> by a top-level declaration must be qualified with the
  1959. <propref ref="e-target_namespace"/> of that declaration (if this is <termref def="key-null">absent</termref>, the item must be unqualified).  Control over whether element information items <termref def="key-vn">validated</termref> by a local declaration must be similarly qualified or not
  1960. is provided by the <code>form</code> &i-attribute;, whose default is provided
  1961. by the <code>elementFormDefault</code> &i-attribute; on the enclosing <eltref ref="schema"/>, via its determination of <propref ref="e-target_namespace"/>.</p>
  1962. <p>As noted above the names for top-level element declarations are in a separate
  1963. <termref def="key-symbolSpace">symbol space</termref> from the symbol spaces for
  1964. the names of type definitions, so there can (but need
  1965. not be) a simple or complex type definition with the same name as a
  1966. top-level element.  As with attribute names, the names of locally-scoped
  1967. element declarations with no <propref ref="e-target_namespace"/> reside in symbol spaces local to the type definition which contains
  1968. them.</p>
  1969.  
  1970.   <p>Note that the above allows for two levels of defaulting for unspecified
  1971. type definitions.  An <eltref ref="element"/> with no referenced or included type definition will
  1972. correspond to an element declaration which has the same type definition as the
  1973. head of its substitution group if it identifies one, otherwise the <termref def="key-urType">ur-type definition</termref>.  This has the important consequence that the minimum valid element declaration, that is, one with only a <code>name</code> attribute and no contents, is also the most general, validating any combination of text and element content and allowing any attributes.</p>
  1974.  
  1975.  <p>See below at <specref ref="declare-key"/> for <eltref ref="key"/>, <eltref ref="unique"/> and <eltref ref="keyref"/>.</p>
  1976.  
  1977.  
  1978. <note role="example">
  1979. <eg xml:space="preserve"><xs:element name="unconstrained"/>
  1980.  
  1981. <xs:element name="emptyElt">
  1982.  <xs:complexType>
  1983.   <xs:attribute ...>. . .</xs:attribute>
  1984.  </xs:complexType>
  1985. </xs:element>
  1986.  
  1987. <xs:element name="contextOne">
  1988.  <xs:complexType>
  1989.   <xs:sequence>
  1990.    <xs:element name="myLocalElement" type="myFirstType"/>
  1991.    <xs:element ref="globalElement"/>
  1992.   </xs:sequence>
  1993.  </xs:complexType>
  1994. </xs:element>
  1995.  
  1996. <xs:element name="contextTwo">
  1997.  <xs:complexType>
  1998.   <xs:sequence>
  1999.    <xs:element name="myLocalElement" type="mySecondType"/>
  2000.    <xs:element ref="globalElement"/>
  2001.   </xs:sequence>
  2002.  </xs:complexType>
  2003. </xs:element></eg>
  2004. <p>The first example above declares an element whose type, by default, is the
  2005. <termref def="key-urType">ur-type definition</termref>.  The second uses an embedded anonymous complex
  2006. type definition.</p>
  2007. <p>The last two examples illustrate the use of local element declarations.  Instances of <code>myLocalElement</code> within
  2008. <code>contextOne</code> will be constrained by <code>myFirstType</code>,
  2009. while those within <code>contextTwo</code> will be constrained by
  2010. <code>mySecondType</code>. </p>
  2011.  
  2012. </note>
  2013. <note>
  2014. <p>The possibility that differing attribute declarations and/or content models
  2015. would apply to elements with the same name in different contexts is an
  2016. extension beyond the expressive power of a DTD in XML 1.0.</p>
  2017. </note>
  2018.   <note role="example">
  2019.    <eg xml:space="preserve"><![CDATA[ <xs:complexType name="facet">
  2020.   <xs:complexContent>
  2021.    <xs:extension base="xs:annotated">
  2022.     <xs:attribute name="value" use="required"/>
  2023.    </xs:extension>
  2024.   </xs:complexContent>
  2025.  </xs:complexType>
  2026.  
  2027.  <xs:element name="facet" type="xs:facet" abstract="true"/>
  2028.  
  2029.  <xs:element name="encoding" substitutionGroup="xs:facet">
  2030.   <xs:complexType>
  2031.    <xs:complexContent>
  2032.     <xs:restriction base="xs:facet">
  2033.      <xs:sequence>
  2034.       <xs:element ref="annotation" minOccurs="0"/>
  2035.      </xs:sequence>
  2036.      <xs:attribute name="value" type="xs:encodings"/>
  2037.     </xs:restriction>
  2038.    </xs:complexContent>
  2039.   </xs:complexType>
  2040.  </xs:element>
  2041.  
  2042.  <xs:element name="period" substitutionGroup="xs:facet">
  2043.   <xs:complexType>
  2044.    <xs:complexContent>
  2045.     <xs:restriction base="xs:facet">
  2046.      <xs:sequence>
  2047.       <xs:element ref="annotation" minOccurs="0"/>
  2048.      </xs:sequence>
  2049.      <xs:attribute name="value" type="xs:duration"/>
  2050.     </xs:restriction>
  2051.    </xs:complexContent>
  2052.   </xs:complexType>
  2053.  </xs:element>
  2054.  
  2055.  <xs:complexType name="datatype">
  2056.   <xs:sequence>
  2057.    <xs:element ref="facet" minOccurs="0" maxOccurs="unbounded"/>
  2058.   </xs:sequence>
  2059.   <xs:attribute name="name" type="xs:NCName" use="optional"/>
  2060.   . . .
  2061.  </xs:complexType>
  2062. ]]></eg>
  2063.    <p>An example from a previous version of the schema for datatypes.  The
  2064. <code>facet</code> type is defined
  2065. and the <code>facet</code> element is declared to use it. The <code>facet</code> element is abstract -- it's
  2066. <emph>only</emph> defined to stand as the head for a substitution group.  Two further
  2067. elements are declared, each a member of the <code>facet</code> substitution group.  Finally a type is defined which refers to <code>facet</code>, thereby
  2068. allowing <emph>either</emph> <code>period</code> or <code>encoding</code> (or
  2069. any other member of the group).</p>
  2070.   </note>
  2071. </div3>
  2072.     <div3>
  2073.      <head>Constraints on XML Representations of Element Declarations</head>
  2074.  <constraintnote id="src-element" type="src">
  2075.   <head>Element Declaration Representation OK</head>
  2076.   <p>In addition to the conditions imposed on <eltref ref="element"/> element
  2077. information items by the schema for schemas:
  2078.    <olist role="and">
  2079.     <item>
  2080.      <p><code>default</code> and <code>fixed</code> must not both be present.</p>
  2081.     </item>
  2082.     <item>
  2083.      <p>If the item's parent is not <eltref ref="schema"/>, then
  2084.       <olist role="and">
  2085.        <item>
  2086.      <p>One of <code>ref</code> or <code>name</code> must be present, but not both.</p>
  2087.     </item>
  2088.        <item>
  2089.         <p>If <code>ref</code> is present, then all of <eltref ref="complexType"/>,
  2090. <eltref ref="simpleType"/>, <eltref ref="key"/>, <eltref ref="keyref"/>,
  2091. <eltref ref="unique"/>, <code>nillable</code>, <code>default</code>,
  2092. <code>fixed</code>, <code>form</code>, <code>block</code> and <code>type</code> must be absent,
  2093. i.e. only <code>minOccurs</code>, <code>maxOccurs</code>, <code>id</code> are
  2094. allowed in addition to <code>ref</code>, along with <eltref ref="annotation"/>.</p>
  2095.        </item>
  2096.       </olist>
  2097.      </p>
  2098.     </item>
  2099.     <item>
  2100.      <p><code>type</code> and either <eltref ref="simpleType"/> or <eltref ref="complexType"/> are mutually exclusive.</p>
  2101.     </item>
  2102.     <item>
  2103.      <p>The corresponding particle and/or element declarations must satisfy the conditions set
  2104. out in <specref ref="coss-element"/> and <specref ref="coss-particle"/>.</p>
  2105.     </item>
  2106.    </olist>
  2107.   </p>
  2108.  </constraintnote>
  2109.     </div3>
  2110.     <div3>
  2111.      <head>Element Declaration Validation Rules</head>
  2112.     <constraintnote type="cvc" id="cvc-elt">
  2113.      <head>Element Locally Valid (Element)</head>
  2114.      <p>For an element information item to be locally <termref def="key-vn">valid</termref> with respect to an
  2115. element declaration
  2116.       <olist role="and">
  2117.        <item id="c-ea">
  2118.         <p>The declaration must not be <termref def="key-null">absent</termref>.</p>
  2119.        </item>
  2120.        <item>
  2121.         <p>Its
  2122. <propref ref="e-abstract"/> must be <pt>false</pt>.</p>
  2123.        </item>
  2124.        <item>
  2125.         <olist role="Case">
  2126.        <item>
  2127.         <p role="if"><propref ref="nillable"/> is <pt>false</pt></p>
  2128.         <p role="then">there must be no attribute information item among the element
  2129. information item's &i-attributes; whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref> is identical to <code>http://www.w3.org/2001/XMLSchema-instance</code> and whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref> is <code>nil</code>.</p>
  2130.        </item>
  2131.        <item id="c-nl">
  2132.         <p role="if"><propref ref="nillable"/> is <pt>true</pt> and there is such an attribute
  2133. information item and its &v-value; is <code>true</code>
  2134.         </p>
  2135.         <p role="then">
  2136.         <olist role="and">
  2137.           <item>
  2138.            <p>The element information item must have no character or element information item
  2139. &i-children;.</p>
  2140.           </item>
  2141.           <item>
  2142.            <p>There must be no <pt>fixed</pt> <propref ref="e-value_constraint"/>.</p>
  2143.           </item>
  2144.          </olist></p>
  2145.        </item>
  2146.       </olist>
  2147.        </item>
  2148.        <item>
  2149.         <p>If there is an attribute information item among the element
  2150. information item's &i-attributes; whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref> is identical to <code>http://www.w3.org/2001/XMLSchema-instance</code> and whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref> is <code>type</code>, then
  2151.       <olist role="and">
  2152.        <item>
  2153.         <p>The &i-value; of that attribute information item must be
  2154. <termref def="key-vn">valid</termref> with respect to the built-in <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#QName">QName</xtermref> simple type, as defined by <specref ref="cvc-simple-type"/>;</p>
  2155.        </item>
  2156.        <item>
  2157.         <p>The <termref def="q-local">local name</termref> and <termref def="q-uri">namespace name</termref> (as defined in <specref ref="src-qname"/>), of the &v-value; of that attribute information item must resolve to a type definition, as defined in <specref ref="cvc-resolve-instance"/> -- <termdef id="key-ltd" term="local type definition" role="local">call this type definition the <term>local type definition</term></termdef>;</p></item>
  2158.        <item>
  2159.         <p>The <termref def="key-ltd">local type definition</termref> must be
  2160. validly derived from the <propref ref="type_definition"/> given the
  2161. union of the <propref ref="e-exact"/> and the <propref ref="type_definition"/>'s <propref ref="ct-exact"/>, as defined in <specref ref="cos-ct-derived-ok"/> (if it is a complex type definition), or given <propref ref="e-exact"/> as defined in <specref ref="cos-st-derived-ok"/> (if it is a simple type definition).</p>
  2162.        </item>
  2163.       </olist>
  2164.       <termdef id="key-atd" term="actual type definition" role="local">The phrase
  2165. <term>actual type definition</term> occurs below.  If the above three clauses are satisfied, this
  2166. should be understood as referring to the <termref def="key-ltd">local type
  2167. definition</termref>, otherwise to the <propref ref="type_definition"/></termdef>.
  2168.      </p>
  2169.        </item>
  2170.        <item>
  2171.         <olist role="Case">
  2172.          <item>
  2173.           <p role="if">the declaration has a <propref ref="e-value_constraint"/>, the item has neither element nor character &i-children; and <clauseref ref="c-nl"/> has not applied</p>
  2174.         <p role="then">
  2175.       <olist role="and">
  2176.        <item>
  2177.         <p>If the <termref def="key-atd">actual type definition</termref> is a <termref def="key-ltd">local type
  2178. definition</termref> then the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of the <propref ref="e-value_constraint"/> value must
  2179. be a valid default for the <termref def="key-atd">actual
  2180. type definition</termref> as defined in <specref ref="cos-valid-default"/>.
  2181.         </p>
  2182.        </item>
  2183.        <item>
  2184.        <p>The element information item with the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of the <propref ref="e-value_constraint"/> value used as its &i-value;
  2185. must be <termref def="key-vn">valid</termref> with respect to the <termref def="key-atd">actual type definition</termref> as defined by <specref ref="cvc-type"/>.</p>
  2186.        </item>
  2187.       </olist>
  2188.      </p>
  2189.          </item>
  2190.          <item>
  2191.           <p role="if">the declaration has no <propref ref="e-value_constraint"/> or the item has either element or character &i-children; or <clauseref ref="c-nl"/> has applied</p>
  2192.           <p role="then"><olist role="and">
  2193.            <item>
  2194.        <p>The element information item
  2195. must be <termref def="key-vn">valid</termref> with respect to the <termref def="key-atd">actual type definition</termref> as defined by <specref ref="cvc-type"/>.</p>
  2196.        </item>
  2197.                           <item>
  2198.         <p>If there is a <pt>fixed</pt> <propref ref="e-value_constraint"/> and
  2199. <clauseref ref="c-nl"/> has not applied,
  2200.          <olist role="and">
  2201.           <item>
  2202.            <p>The element information item must have no element information
  2203. item &i-children;.</p>
  2204.           </item>
  2205.           <item>
  2206.            <olist role="Case">
  2207.             <item>
  2208.              <p role="if">the <propref ref="content_type"/> of the <termref def="key-atd">actual type definition</termref> is <pt>mixed</pt></p>
  2209.              <p role="then">the <termref def="key-iv">initial value</termref>
  2210. of the item must match the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of the <propref ref="e-value_constraint"/> value.</p>
  2211.             </item>
  2212.             <item>
  2213.              <p role="if">the <propref ref="content_type"/> of the <termref def="key-atd">actual type definition</termref> is a simple type definition</p>
  2214.              <p role="then">the &v-value; of the item must match the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of the <propref ref="e-value_constraint"/> value.</p>
  2215.             </item>
  2216.            </olist>
  2217.           </item>
  2218.          </olist>
  2219.          </p>
  2220.        </item>
  2221.           </olist></p>
  2222.          </item>
  2223.         </olist>
  2224.        </item>
  2225.        
  2226.        <item>
  2227.         <p>The element information item must be <termref def="key-vn">valid</termref> with respect to
  2228. each of the <propref ref="&constraint;_definitions"/> as per <specref ref="cvc-&constraint;"/>.</p>
  2229.        </item>
  2230.        <item>
  2231.         <p>If the element information item is the <termref def="key-vr">validation root</termref>, it must be <termref def="key-vn">valid</termref> per <specref ref="cvc-id"/>.</p>
  2232.        </item>
  2233.       </olist>      
  2234.      </p>
  2235.     </constraintnote>
  2236.     <constraintnote type="cvc" id="cvc-type">
  2237.      <head>Element Locally Valid (Type)</head>
  2238.      <p>For an element information item to be locally <termref def="key-vn">valid</termref> with respect to a type definition
  2239.       <olist role="and">
  2240.        <item id="c-ct">
  2241.         <p>The type definition must not be <termref def="key-null">absent</termref>;</p>
  2242.        </item>
  2243.        <item>
  2244.         <p>Its
  2245. <propref ref="ct-abstract"/> must be <pt>false</pt>.</p>
  2246.        </item>
  2247.        <item>
  2248.         <olist role="Case">
  2249.          <item>
  2250.         <p role="if">the type definition is a simple type
  2251. definition</p>
  2252.         <p role="then">
  2253.          <olist role="and">
  2254.           <item><p>The element information item's &i-attributes; must be empty,
  2255. excepting those whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref> is identical to <code>http://www.w3.org/2001/XMLSchema-instance</code> and whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref> is one of <code>type</code>, <code>nil</code>, <code>schemaLocation</code> or <code>noNamespaceSchemaLocation</code>.</p>
  2256.           </item>
  2257.           <item>
  2258.            <p>The element information item must have no element information item &i-children;.</p>
  2259.           </item>
  2260.           <item id="c-sv1">
  2261.            <p>If <clauseref ref="c-nl"/> of <specref ref="cvc-elt"/> did not apply, then the &i-value; must be <termref def="key-vn">valid</termref> with respect to the type definition as defined by <specref ref="cvc-simple-type"/>.</p>
  2262.           </item>
  2263.          </olist>
  2264.         </p>
  2265.        </item>
  2266.          <item>
  2267.           <p role="if">the type definition is a complex type definition</p>
  2268.           <p role="then">the element information item must be <termref def="key-vn">valid</termref> with respect to the type definition as per <specref ref="cvc-complex-type"/>;</p>
  2269.          </item>
  2270.         </olist>
  2271.        </item>
  2272.       </olist>
  2273.      </p>
  2274.     </constraintnote>
  2275.      <constraintnote type="cvc" id="cvc-id">
  2276.   <head>Validation Root Valid (ID/IDREF)</head>
  2277.       <p>For an element information item which is the <termref def="key-vr">validation root</termref> to be <termref def="key-vn">valid</termref>
  2278.        <olist role="and">
  2279.         <item>
  2280.          <p>There must be no <local>ID/IDREF binding</local> in the item's
  2281. <propref ref="e-ii_table" role="psvi"/> whose <propref role="psvi" ref="iib-binding"/> is the
  2282. empty set.</p>
  2283.         </item>
  2284.         <item id="c-uba">
  2285.          <p>There must be no <local>ID/IDREF binding</local> in the item's <propref ref="e-ii_table" role="psvi"/> whose <propref role="psvi" ref="iib-binding"/> has more
  2286. than one member.</p>
  2287.         </item>
  2288.        </olist>
  2289.       </p>
  2290.       <p>See <specref ref="sic-id"/> for the definition of <local>ID/IDREF binding</local>.</p>
  2291.       <note>
  2292.        <p>The first clause above applies when there is a reference to an
  2293. undefined ID.  The second applies when there is a multiply-defined ID.  They
  2294. are separated out to ensure that distinct error codes (see <specref ref="outcomes"/>) are associated with these two cases.</p>
  2295.       </note>
  2296.       <note>
  2297.        <p>Although this rule applies at the <termref def="key-vr">validation
  2298. root</termref>, in practice processors, particularly streaming processors, may
  2299. wish to detect and signal the <clauseref ref="c-uba"/> case as it arises.</p>
  2300.       </note>
  2301.       <note>
  2302.        <p>This reconstruction of <bibref ref="ref-xml"/>'s <code>ID/IDREF</code>
  2303. functionality is imperfect in that if the <termref def="key-vr">validation
  2304. root</termref> is not the document element of an XML document, the results will
  2305. not necessarily be the same as those a validating parser would give were the
  2306. document to have a DTD with equivalent declarations.</p>
  2307.       </note>
  2308.  </constraintnote>
  2309.     <constraintnote id="cvc-assess-elt" type="cvc">
  2310.      <head>Schema-Validity Assessment (Element)</head>
  2311.      <p>The schema-validity assessment of an element information item depends
  2312. on its <termref def="key-vn">validation</termref> and the <termref def="key-va">assessment</termref> of its element information item
  2313. children and associated attribute information items, if any.</p>
  2314.   <p>So for an element information item's schema-validity to be assessed      
  2315.       <olist role="and">
  2316.        <item id="c-xd">
  2317.         <p><olist role="Or">
  2318.        <item id="c-ed">        
  2319.       <olist role="And">
  2320.        <item>
  2321.         <p>A non-<termref def="key-null">absent</termref> element declaration
  2322. must be known for it, because</p>
  2323.         <olist role="ortest">
  2324.          <item>
  2325.           <p>A declaration was stipulated by the processor (see <specref ref="validation_outcome"/>).</p>
  2326.          </item>
  2327.          <item>
  2328.           <p>A declaration has been established as its <termref def="key-dd">context-determined declaration</termref>.</p>
  2329.          </item>
  2330.          <item>
  2331.           <olist role="And">
  2332.            <item>
  2333.             <p>Its <termref def="key-dd">context-determined declaration</termref> is
  2334. not <pt>skip</pt>.</p>
  2335.            </item>
  2336.            <item>
  2337.             <p>Its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">local name</xpropref> and <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref> resolve to an element declaration as defined by <specref ref="cvc-resolve-instance"/>.</p>
  2338.            </item>
  2339.           </olist>          
  2340.          </item>
  2341.         </olist>        
  2342.        </item>
  2343.        <item>
  2344.         <p>Its <termref def="key-vn">validity</termref> with respect to that
  2345. declaration must have been evaluated as per <specref ref="cvc-elt"/>.</p>
  2346.        </item>
  2347.        <item>
  2348.         <p>If that evaluation involved the evaluation of <specref ref="cvc-type"/>, <clauseref ref="c-ct"/> thereof must be satisfied.</p>
  2349.        </item>
  2350.       </olist>        
  2351.        </item>
  2352.             <item id="c-td">
  2353.         <olist role="And">
  2354.        <item>
  2355. <p>A non-<termref def="key-null">absent</termref> type definition is known for
  2356. it because 
  2357.  <olist role="ortest">
  2358.   <item>
  2359.    <p>A type definition was stipulated by the processor
  2360. (see <specref ref="validation_outcome"/>).</p>
  2361.   </item>
  2362.   <item>
  2363.    <olist role="And">
  2364.     <item>
  2365.      <p>There is an attribute information item among the element
  2366. information item's &i-attributes; whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref> is identical to <code>http://www.w3.org/2001/XMLSchema-instance</code> and whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref> is <code>type</code>.</p>
  2367.     </item>
  2368.     <item>
  2369.         <p>The &i-value; of that attribute information item is
  2370. <termref def="key-vn">valid</termref> with respect to the built-in <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#QName">QName</xtermref> simple type, as defined by <specref ref="cvc-simple-type"/>.</p>
  2371.        </item>
  2372.        <item>
  2373.         <p>The <termref def="q-local">local name</termref> and <termref def="q-uri">namespace name</termref> (as defined in <specref ref="src-qname"/>), of the &v-value; of that attribute information item resolve to a type definition, as defined in <specref ref="cvc-resolve-instance"/> -- <termdef id="key-ltd1" term="item type definition" role="local">call this type definition the <term>local type definition</term></termdef>.</p></item>
  2374.     <item>
  2375.         <p>If there is also a processor-stipulated type definition, the <termref def="key-ltd1">local type definition</termref> must be
  2376. validly derived from that type definition given its <propref ref="ct-exact"/>,
  2377. as defined in <specref ref="cos-ct-derived-ok"/> (if it is a complex type
  2378. definition), or given the empty set, as defined in <specref ref="cos-st-derived-ok"/> (if it is a simple type definition).</p>
  2379.        </item>
  2380.    </olist>
  2381.   </item>
  2382.  </olist>
  2383. </p>
  2384. </item>
  2385.        
  2386.        
  2387.          <item>
  2388.         <p>The element information item's <termref def="key-vn">validity</termref> with respect to the <termref def="key-ltd1">local type definition</termref> (if present and validly derived)
  2389. or the processor-stipulated type definition (if no <termref def="key-ltd1">local
  2390. type definition</termref> is present) has been evaluated as per <specref ref="cvc-type"/>.</p>
  2391.        </item>
  2392.       </olist>        
  2393.        </item>
  2394.       </olist>
  2395.         </p>
  2396.        </item>
  2397.        <item>
  2398.         <p>The schema-validity of all the element information items among its
  2399. &i-children; has been assessed as per <specref ref="cvc-assess-elt"/>, and the
  2400. schema-validity of all the attribute information items among its
  2401. &i-attributes; has been assessed as per <specref ref="cvc-assess-attr"/>.</p>
  2402.        </item>
  2403.       </olist>
  2404.      </p>
  2405.         <p><termdef id="key-sva" term="strictly assessed" role="local">If either case of
  2406. <clauseref ref="c-xd"/> above holds, the element information item has been <term>strictly assessed</term></termdef>.</p>
  2407.      <p>If the item cannot be <termref def="key-sva">strictly
  2408. assessed</termref>, because neither <clauseref ref="c-ed"/> nor <clauseref ref="c-td"/> above are satisfied,
  2409. <termdef id="key-lva" term="laxly assessed">an element information item's
  2410. schema validity may be <term>laxly assessed</term> if its <termref def="key-dd">context-determined declaration</termref> is not <pt>skip</pt> by <termref def="key-vn">validating</termref> with respect to the <termref def="ur-type-itself">ur-type definition</termref> as per <specref ref="cvc-type"/></termdef>.</p>     
  2411.      <note>
  2412.       <p>In general if <clauseref ref="c-ed"/> above holds 
  2413. <clauseref ref="c-td"/> does not, and vice versa.  When an
  2414. <code>xsi:type</code> &i-attribute; is involved, however, <clauseref ref="c-td"/> takes precedence,
  2415. as is made clear in <specref ref="cvc-elt"/>.</p>
  2416.      </note>
  2417.     </constraintnote>
  2418.     <note><p>The <propref ref="e-name"/> and <propref ref="e-target_namespace"/> properties are not
  2419. mentioned above because they are checked during particle <termref def="key-vn">validation</termref>, as per
  2420. <specref ref="cvc-particle"/>.</p></note>
  2421.     </div3>
  2422.     <div3>
  2423.      <head>Element Declaration Information Set Contributions</head>
  2424.     <constraintnote id="sic-e-outcome" type="sic">
  2425.      <head>Assessment Outcome (Element)</head>
  2426.      <p>If the schema-validity of an element information item has been assessed
  2427. as per <specref ref="cvc-assess-elt"/>, then in the &PSVI; it has properties as follows:</p>
  2428.      <proplist role="psvi" item="element">
  2429.        <propdef name="validation context" id="e-validation_context">The nearest ancestor element information
  2430. item with a <propref role="psvi" ref="e-schema_information"/> property (or this element item itself if it has such a property).</propdef>
  2431.        <propdef name="validity" id="e-validity">
  2432.         <olist role="Caseval">
  2433.        <item>
  2434.         <p role="if">it was <termref def="key-sva">strictly
  2435. assessed</termref></p>
  2436.         <p role="then">
  2437.         <olist role="caseval">
  2438.          <item>
  2439.           <p role="if">
  2440.           <olist role="andtest">
  2441.            <item>
  2442.             <olist role="Ortest">
  2443.              <item>
  2444.               <p><clauseref ref="c-ed"/> of <specref ref="cvc-assess-elt"/>
  2445. applied and the item was
  2446. <termref def="key-vn">valid</termref> as defined by <specref ref="cvc-elt"/>;</p>
  2447.              </item>
  2448.              <item>
  2449.               <p><clauseref ref="c-td"/> of <specref ref="cvc-assess-elt"/>
  2450. applied and the item was
  2451. <termref def="key-vn">valid</termref> as defined by <specref ref="cvc-type"/>.</p>
  2452.              </item>
  2453.             </olist>            
  2454.            </item>
  2455.             <item>
  2456.              <p>Neither its &i-children; nor its
  2457. &i-attributes; contains an information item (element or attribute respectively) whose  <xpropref role="psviAnon">validity</xpropref> is <pt>invalid</pt>.</p>
  2458.             </item>
  2459.            <item>
  2460.             <p>Neither its &i-children; nor its
  2461. &i-attributes; contains an information item (element or attribute respectively) with a <termref def="key-dd">context-determined declaration</termref> of
  2462. <pt>mustFind</pt> whose  <xpropref role="psviAnon">validity</xpropref> is <pt>unknown</pt>.</p>
  2463.            </item>
  2464.           </olist>
  2465.           </p>
  2466.           <p role="then"><pt>valid</pt>;</p>
  2467.          </item>
  2468.          <item>
  2469.           <p role="otherwise"><pt>invalid.</pt>.</p>
  2470.          </item>
  2471.         </olist>
  2472.         </p>
  2473.        </item>
  2474.        <item>
  2475.         <p role="otherwise"><pt>notKnown</pt>.</p>
  2476.        </item>
  2477.       </olist>
  2478.         </propdef>
  2479.        <propdef name="validation attempted" id="e-validation_attempted">
  2480.        <olist role="Caseval">
  2481.        <item>
  2482.         <p role="if">it was <termref def="key-sva">strictly assessed</termref> and neither its &i-children; nor its
  2483. &i-attributes; contains an information item (element or attribute
  2484. respectively) whose  <xpropref role="psviAnon">validation attempted</xpropref> is not
  2485. <pt>full</pt></p>
  2486.         <p role="then"><pt>full</pt>;</p>
  2487.        </item>
  2488.         <item>
  2489.          <p role="if">it was not <termref def="key-sva">strictly assessed</termref> and neither its &i-children; nor its
  2490. &i-attributes; contains an information item (element or attribute
  2491. respectively) whose  <xpropref role="psviAnon">validation attempted</xpropref> is not
  2492. <pt>none</pt></p>
  2493.          <p role="then"><pt>none</pt>;</p>
  2494.         </item>
  2495.         <item>
  2496.         <p role="otherwise"><pt>partial</pt>.</p>
  2497.        </item>
  2498.       </olist></propdef></proplist>
  2499.     </constraintnote>
  2500.     <constraintnote type="sic" id="sic-elt-error-code">
  2501.      <head>Validation Failure (Element)</head>
  2502.      <p>If the local <termref def="key-vn">validity</termref>, as defined by
  2503. <specref ref="cvc-elt"/> above and/or <specref ref="cvc-type"/>
  2504. below, of an element information item has been assessed,
  2505. in the &PSVI; the item has a
  2506. property:</p>
  2507.      <proplist role="psvi" item="element">
  2508.       <propdef id="e-schema_error_code" name="schema error code">
  2509.        <olist role="Caseval">
  2510.         <item>
  2511.          <p role="if">the item is not <termref def="key-vn">valid</termref></p>
  2512.          <p role="then">a list.  Applications wishing to provide
  2513. information as to the reason(s) for the <termref def="key-vn">validation</termref> failure are encouraged to record one or more
  2514. error codes (see <specref ref="outcomes"/>) herein.</p>
  2515.         </item>
  2516.         <item>
  2517.          <p role="otherwise"><termref def="key-null">absent</termref>.</p>
  2518.         </item>
  2519.        </olist>
  2520.       </propdef>
  2521.      </proplist>
  2522.     </constraintnote>
  2523.     <constraintnote type="sic" id="sic-elt-decl">
  2524.      <head>Element Declaration</head>
  2525.      <p>If an element information item is <termref def="key-vn">valid</termref> with respect to an element
  2526. declaration as per <specref ref="cvc-elt"/> then in the &PSVI;
  2527. the element
  2528. information item must, at processor option, have either:</p>
  2529.      <proplist role="psvi" item="element">
  2530.       <propdef id="e-declaration" name="element declaration">
  2531.        an <termref def="key-iso">item isomorphic</termref> to the declaration component itself
  2532.       </propdef>
  2533.      </proplist>
  2534.        <p>or</p>
  2535.  
  2536.      <proplist role="psvi" item="element">
  2537.       <propdef id="e-nil" name="nil"><pt>true</pt> if <clauseref ref="c-nl"/> of <specref ref="cvc-elt"/> above is satisfied,
  2538. otherwise <pt>false</pt>
  2539.       </propdef>
  2540.      </proplist>
  2541.     </constraintnote>
  2542.     <constraintnote type="sic" id="sic-eltType">
  2543.      <head>Element Validated by Type</head>
  2544.      <p>If an element information item is <termref def="key-vn">valid</termref> with respect to a <termref def="key-typeDefn">type definition</termref>
  2545. as per <specref ref="cvc-type"/>, in the &PSVI; the item has a property:</p>
  2546.      <proplist role="psvi" item="element">
  2547.       <propdef id="e-schema_normalized_value" name="schema normalized
  2548. value">
  2549.       <olist role="Caseval">
  2550.          <item><p role="if"><clauseref ref="c-nl"/> of <specref ref="cvc-elt"/> and <specref ref="sic-eltDefault"/> above have
  2551. <emph>not</emph> applied and either the <termref def="key-typeDefn">type definition</termref> is a simple type definition or its <propref ref="content_type"/> is a simple type definition</p>
  2552. <p role="then">
  2553. the &i-value; of the item as <termref def="key-vn">validated</termref>.</p>
  2554. </item>
  2555. <item><p role="otherwise"><termref def="key-null">absent</termref>.</p>
  2556. </item>
  2557. </olist>
  2558. </propdef>
  2559.      </proplist>
  2560.      <p>Furthermore, the item has one of the following alternative sets of properties:</p>
  2561.      <p>Either</p>
  2562.     <proplist role="psvi" item="element">
  2563.       <propdef id="e-type_definition" name="type definition">An
  2564. <termref def="key-iso">item isomorphic</termref> to the <termref def="key-typeDefn">type definition</termref> component itself.</propdef>
  2565.      <propdef name="member type definition" id="e-member_type_definition">If
  2566. and only if that type definition is a
  2567. simple type definition with <propref ref="variety"/> <pt>union</pt>, or
  2568. a complex type definition whose <propref ref="content_type"/> is a simple thype
  2569. definition with <propref ref="variety"/> <pt>union</pt>, then an
  2570. <termref def="key-iso">item isomorphic</termref> to that member of the
  2571. union's <propref ref="st-member_type_definitions"/> which actually <termref def="key-vn">validated</termref> the element item's &i-value;.</propdef>
  2572.      </proplist>
  2573.       <p>or</p>
  2574.     <proplist role="psvi" item="element">
  2575.       <propdef id="e-type_definition_type" name="type definition
  2576. type">
  2577. <pt>simple</pt> or <pt>complex</pt>, depending on the <termref def="key-typeDefn">type definition</termref>.</propdef>
  2578.        <propdef id="e-type_definition_namespace" name="type definition
  2579. namespace">The <xpropref role="anon">target namespace</xpropref> of the <termref def="key-typeDefn">type definition</termref>.</propdef>
  2580.         <propdef name="type definition anonymous" id="e-type_definition_anonymous"><pt>true</pt> if the <xpropref role="anon">name</xpropref> of the <termref def="key-typeDefn">type definition</termref> is <termref def="key-null">absent</termref>, otherwise <pt>false</pt>.</propdef>
  2581.         <propdef name="type definition name" id="e-type_definition_name">The <xpropref role="anon">name</xpropref> of the <termref def="key-typeDefn">type definition</termref>, if it is not <termref def="key-null">absent</termref>.  If it is
  2582. <termref def="key-null">absent</termref>, schema processors may, but need not,
  2583. provide a value unique to the definition.</propdef>
  2584.        </proplist>
  2585.         <p>If the <termref def="key-typeDefn">type definition</termref> is a
  2586. simple type definition or its <propref ref="content_type"/> is a
  2587. simple type definition, and that type
  2588. definition has <propref ref="variety"/> <pt>union</pt>, then calling
  2589.          <termdef id="key-amt" term="actual member type definition" role="local"> that
  2590. member of the <propref ref="st-member_type_definitions"/> which actually
  2591. <termref def="key-vn">validated</termref> the element item's &i-value; the
  2592. <term>actual member type definition</term></termdef>, there are three additional properties:</p>
  2593.     <proplist role="psvi" item="element">
  2594.      <propdef name="member type definition namespace" id="e-member_type_definition_namespace">The <propref ref="st-target_namespace"/> of the <termref def="key-amt">actual
  2595. member type definition</termref>.</propdef>
  2596.      <propdef name="member type definition anonymous" id="e-member_type_definition_anonymous"><pt>true</pt> if the <propref ref="st-name"/> of the <termref def="key-amt">actual member type definition</termref> is <termref def="key-null">absent</termref>, otherwise <pt>false</pt>.</propdef>
  2597.      <propdef name="member type definition name" id="e-member_type_definition_name">The <propref ref="st-name"/> of the <termref def="key-amt">actual member type definition</termref>, if it is not <termref def="key-null">absent</termref>.  If it is
  2598. <termref def="key-null">absent</termref>, schema processors may, but need not,
  2599. provide a value unique to the definition.</propdef>
  2600.          </proplist>
  2601.      <p>The first (<termref def="key-iso">item isomorphic</termref>) alternative above is provided for applications such as query
  2602. processors which need access to the full range of details about an item's
  2603. <termref def="key-va">assessment</termref>, for example the type hierarchy; the second, for lighter-weight
  2604. processors for whom representing the significant parts of the type hierarchy as
  2605. information items might be a significant burden.</p>
  2606.      <p>Also, if the declaration has a <propref ref="e-value_constraint"/>, the item has a property:</p>
  2607.      <proplist role="psvi" item="element">
  2608.       <propdef id="e-schema_default" name="schema default">
  2609.        The <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of
  2610. the declaration's <propref ref="e-value_constraint"/> value.</propdef>
  2611.      </proplist>
  2612.      <p>Note that if an element is <termref def="key-lva">laxly assessed</termref>, then the <propref ref="e-type_definition" role="psvi"/> and
  2613. <propref ref="e-member_type_definition" role="psvi"/> properties, or their
  2614. alternatives, are based on the <termref def="ur-type-itself">ur-type definition</termref>.</p>
  2615.     </constraintnote>
  2616.     <constraintnote type="sic" id="sic-eltDefault">
  2617.      <head>Element Default Value</head>
  2618. <p>If the local <termref def="key-vn">validity</termref>, as defined by <specref ref="cvc-elt"/>
  2619. above, of an element information item has been assessed,
  2620. in the &PSVI; the item has a
  2621. property:</p>
  2622. <proplist role="psvi" item="element">
  2623. <propdef id="e-schema_specified" name="schema specified">
  2624. <olist role="Caseval"><item>
  2625. <p role="if">the item is <termref def="key-vn">valid</termref> with respect to an element
  2626. declaration as per <specref ref="cvc-elt"/> and the <propref ref="e-value_constraint"/> is present, but <clauseref ref="c-nl"/>
  2627. of <specref ref="cvc-elt"/> above is not satisfied and the item has no element or character information item &i-children;</p>
  2628. <p role="then">
  2629. <pt>schema</pt>.  Furthermore, the
  2630. &PSVI; has the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of the <propref ref="e-value_constraint"/> value as the
  2631. item's <propref role="psvi" ref="e-schema_normalized_value"/>
  2632. property.</p></item>
  2633. <item>
  2634. <p role="otherwise"><pt>infoset</pt>.</p></item></olist></propdef></proplist>
  2635.     </constraintnote>
  2636.     </div3>
  2637.     <div3 id="coss-element">
  2638.      <head>Constraints on Element Declaration Schema Components</head>
  2639.   <p>All element declarations (see <specref ref="cElement_Declarations"/>) must satisfy the following constraint.</p>
  2640.   <constraintnote type="cos" id="e-props-correct">
  2641.    <head>Element Declaration Properties Correct</head>
  2642.    <olist role="And">
  2643.     <item>
  2644.      <p>The values of the properties of an element declaration must be as described in
  2645. the property tableau in
  2646. <specref ref="Element_Declaration_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  2647.     </item>
  2648.     <item>
  2649.      <p>If there is a <propref ref="e-value_constraint"/>, the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of its value must be
  2650. <termref def="key-vn">valid</termref> with respect to the <propref ref="type_definition"/> as defined in <specref ref="cos-valid-default"/>.</p>
  2651.     </item>
  2652.     <item>
  2653.      <p>If there is an <propref ref="class_exemplar"/>, the <propref ref="type_definition"/> of the element declaration must
  2654. be validly derived from the <propref ref="type_definition"/> of the <propref ref="class_exemplar"/>, given the value of the <propref ref="e-final"/> of the <propref ref="class_exemplar"/>, as defined in <specref ref="cos-ct-derived-ok"/> (if the <propref ref="type_definition"/> is complex) or as defined in <specref ref="cos-st-derived-ok"/> (if the <propref ref="type_definition"/> is simple).
  2655.      </p>
  2656.     </item>
  2657.     <item>
  2658.      <p>If the <propref ref="type_definition"/> or <propref ref="type_definition"/>'s <propref ref="content_type"/> is or is derived from <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref> then there must not be a <propref ref="e-value_constraint"/>.</p>
  2659.      <note>
  2660.       <p>The use of <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref> as a type
  2661. definition for elements goes beyond XML 1.0, and should be avoided if backwards
  2662. compatibility is desired.</p>
  2663.      </note>
  2664.     </item>
  2665.    </olist>
  2666.   </constraintnote>
  2667.   <p>The following constraints define relations appealed to elsewhere in this specification.</p>
  2668.   <constraintnote id="cos-valid-default" type="cos">
  2669.    <head>Element Default Valid (Immediate)</head>
  2670.    <p>For a string to be a valid default with respect to a type definition
  2671.     <olist role="case">
  2672.      <item>
  2673.       <p role="if">the type definition is a simple type definition</p>
  2674.       <p role="then">the string must be
  2675. <termref def="key-vn">valid</termref> with respect to that definition as defined by <specref ref="cvc-simple-type"/>.</p>
  2676.      </item>
  2677.      <item>
  2678.       <p role="if">the type definition is a complex type definition</p>
  2679.       <p role="then">
  2680.        <olist role="and">
  2681.         <item>
  2682.          <p>its <propref ref="content_type"/> must be a simple type definition
  2683. or <pt>mixed</pt>.</p>
  2684.         </item>
  2685.         <item>
  2686.          <olist role="Case">
  2687.           <item>
  2688.       <p role="if">the <propref ref="content_type"/> is a simple type definition</p>
  2689.       <p role="then">the string must be
  2690. <termref def="key-vn">valid</termref> with respect to that simple type definition as defined by <specref ref="cvc-simple-type"/>.</p>
  2691.      </item>
  2692.      <item>
  2693.       <p role="if">the  <propref ref="content_type"/> is <pt>mixed</pt></p>
  2694.       <p role="then">the <propref ref="content_type"/>'s particle must be <termref def="cd-emptiable">emptiable</termref> as defined by <specref ref="cos-group-emptiable"/>.</p>
  2695.      </item>
  2696.          </olist>
  2697.         </item>
  2698.        </olist>
  2699.       </p>
  2700.      </item>
  2701.     </olist>
  2702.    </p>
  2703.   </constraintnote>
  2704.   <constraintnote id="cos-equiv-derived-ok-rec" type="cos">
  2705.    <head>Substitution Group OK (Transitive)</head>
  2706.    <p>For an element declaration (call it <local>D</local>) together with a blocking constraint (a subset of
  2707. {<pt>substitution</pt>, <pt>extension</pt>, <pt>restriction</pt>}, the value of
  2708. a <propref ref="e-exact"/>) to be validly substitutable for another element declaration (call it <local>C</local>)
  2709.     <olist role="and">
  2710.      <item>
  2711.       <p>The blocking constraint does not contain <pt>substitution</pt>.</p>
  2712.      </item>
  2713.      <item>
  2714.       <p>There is a chain of <propref ref="class_exemplar"/>s from <local>D</local> to
  2715. <local>C</local>, that is, either <local>D</local>'s <propref ref="class_exemplar"/> is
  2716. <local>C</local>, or <local>D</local>'s <propref ref="class_exemplar"/>'s <propref ref="class_exemplar"/> is <local>C</local>, or . . .</p>
  2717.      </item>
  2718.      <item>
  2719.       <p>The set of all <propref ref="derivation_method"/>s
  2720. involved in the derivation of <local>D</local>'s <propref ref="type_definition"/> from
  2721. <local>C</local>'s <propref ref="type_definition"/> does not intersect with the union
  2722. of the blocking constraint, <local>C</local>'s <propref ref="ct-exact"/> (if <local>C</local>
  2723. is complex, otherwise the empty set) and the
  2724. <propref ref="ct-exact"/> (respectively the empty set) of any intermediate <propref ref="type_definition"/>s
  2725. in the derivation of <local>D</local>'s <propref ref="type_definition"/> from
  2726. <local>C</local>'s <propref ref="type_definition"/>.</p>
  2727.      </item>
  2728.     </olist>
  2729.    </p>
  2730.   </constraintnote>
  2731.   <constraintnote id="cos-equiv-class" type="cos">
  2732.    <head>Substitution Group</head>
  2733.    <p><termdef id="key-eq" term="substitution group" role="local">Every element declaration
  2734. in the <propref ref="element_declarations"/> of a schema defines a
  2735. <term>substitution group</term>, a subset of those <propref ref="element_declarations"/>, as follows:</termdef>
  2736.     <olist>
  2737.      <item>
  2738.       <p>The element declaration itself is in the group;</p>
  2739.      </item>
  2740.      <item>
  2741.       <p>The group is closed with respect to <propref ref="class_exemplar"/>, that
  2742. is, if any element declaration in the <propref ref="element_declarations"/> 
  2743. has a <propref ref="class_exemplar"/> in the group, then it is also in the group itself.</p>
  2744.      </item>
  2745.     </olist>
  2746.    </p>
  2747.   </constraintnote>
  2748.     </div3>
  2749.    </div2>
  2750.    <div2 id="Complex_Type_Definitions">
  2751.     <head>Complex Type Definitions</head>
  2752. <p>Complex Type Definitions provide for:</p>
  2753. <ulist>
  2754.      <item><p>Constraining element information items by providing <specref ref="Attribute_Declaration"/>s governing the appearance and content of
  2755. &i-attributes;</p></item>
  2756.      <item><p>Constraining element information item &i-children; to be empty,
  2757. or to conform to a specified element-only or mixed content model, or else
  2758. constraining the character information item &i-children; to conform to a
  2759. specified simple type definition.</p></item>
  2760.      <item><p>Using the mechanisms of <specref ref="Type_Derivation"/> to derive a complex type from another simple or complex type.</p></item>
  2761.      <item>
  2762. <p>Specifying <termref def="gloss-sic">&PSVI; contributions</termref> for elements. </p>
  2763. </item>
  2764.      <item><p>Limiting the ability to derive additional types from a given complex type.</p></item>
  2765.      <item><p>Controlling the permission to substitute, in an instance, elements of a derived
  2766. type for elements declared in a content model to be of a given complex type.</p></item>
  2767. </ulist>
  2768. <note role="example">
  2769.  <eg xml:space="preserve"><![CDATA[<xs:complexType name="PurchaseOrderType">
  2770.   <xs:sequence>
  2771.    <xs:element name="shipTo" type="USAddress"/>
  2772.    <xs:element name="billTo" type="USAddress"/>
  2773.    <xs:element ref="comment" minOccurs="0"/>
  2774.    <xs:element name="items"  type="Items"/>
  2775.   </xs:sequence>
  2776.   <xs:attribute name="orderDate" type="xs:date"/>
  2777.  </xs:complexType>
  2778. ]]></eg>
  2779.  <p>The XML representation of a complex type definition.</p>
  2780. </note>
  2781. <div3 id="Complex_Type_Definition_details">
  2782.  <head>The Complex Type Definition Schema Component</head>
  2783.  <p>A complex type definition schema component has the following
  2784. properties:</p>
  2785.  
  2786.   <compdef name="Complex Type Definition" ref="Complex_Type_Definition">
  2787.    <proplist>
  2788.   <propdef id="ct-name" name="name">
  2789.     Optional.  An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
  2790.    </propdef>
  2791.   <propdef id="ct-target_namespace" name="target namespace">
  2792.     Either <termref def="key-null">absent</termref> or a namespace name, as defined in <bibref ref="ref-xml-namespaces"/>.
  2793.    </propdef>
  2794.   <propdef id="ct-base_type_definition" name="base type definition">
  2795.     Either a simple type definition or a complex type definition.
  2796.    </propdef>
  2797.   <propdef id="derivation_method" name="derivation method">
  2798.     Either <pt>extension</pt> or <pt>restriction</pt>.
  2799.    </propdef>
  2800.    <propdef id="ct-final" name="final">
  2801.     A subset of {<pt>extension</pt>, <pt>restriction</pt>}.
  2802.    </propdef>
  2803.    <propdef id="ct-abstract" name="abstract">
  2804.     A boolean
  2805.    </propdef>   
  2806.     <propdef id="ct-attribute_declarations" name="attribute uses">
  2807.     A set of attribute uses.
  2808.    </propdef>
  2809.   <propdef id="ct-attribute_wildcard" name="attribute wildcard">
  2810.     Optional.  A wildcard.
  2811.    </propdef>
  2812.    <propdef id="content_type" name="content type">One of <pt>empty</pt>, a simple type definition or a pair
  2813. consisting of a <termref def="key-contentModel">content model</termref> (I.e. a <specref ref="Particle"/>) and one of <pt>mixed</pt>, <pt>element-only</pt>.
  2814.    </propdef>
  2815.   <propdef id="ct-exact" name="prohibited substitutions">
  2816.     A subset of {<pt>extension</pt>, <pt>restriction</pt>}.
  2817.    </propdef>
  2818.     <propdef id="ct-annotations" name="annotations">A set of annotations.</propdef>
  2819. </proplist>
  2820.  
  2821.   </compdef>
  2822. <p>Complex types definitions are identified by their <propref ref="ct-name"/> and <propref ref="ct-target_namespace"/>.  Except
  2823. for anonymous complex type definitions (those with no <propref ref="ct-name"/>), since
  2824. type definitions (i.e. both simple and complex type definitions taken together) must be uniquely identified within an <termref def="key-schema">XML
  2825. Schema</termref>, no complex type definition can have the same name as another
  2826. simple or complex type definition.  Complex type <propref ref="ct-name"/>s and <propref ref="ct-target_namespace"/>s
  2827. are provided for reference from
  2828. instances (see <specref ref="xsi_type"/>), and for use in the XML
  2829. representation of schema components
  2830. (specifically in <eltref ref="element"/>).  See <specref ref="composition-schemaImport"/> for the use of component
  2831. identifiers when importing one schema into another.</p>
  2832. <note>
  2833. <p>The <propref ref="ct-name"/> of a complex type is not <emph>ipso
  2834. facto</emph> the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">(local) name</xpropref> of the
  2835.   element information items <termref def="key-vn">validated</termref> by that definition. The connection between a
  2836.   name and a type definition is described in <specref ref="cElement_Declarations"/>. </p>
  2837. </note>
  2838.    <p>As described in <specref ref="Type_Derivation"/>, each complex type is derived from a
  2839. <propref ref="ct-base_type_definition"/> which is itself either a <specref ref="Simple_Type_Definition"/> or a <specref ref="Complex_Type_Definition"/>.  <propref ref="derivation_method"/> specifies the means of derivation as either <pt>extension</pt> or <pt>restriction</pt> (see <specref ref="Type_Derivation"/>).</p>
  2840.  
  2841. <p>A complex type with an empty specification for <propref ref="ct-final"/> can be used as a
  2842. <propref ref="ct-base_type_definition"/> for other types derived by either of
  2843. extension or restriction; the explicit values <pt>extension</pt>, and <pt>restriction</pt> prevent further
  2844. derivations by extension and restriction respectively.  If all values are specified, then <termdef id="key-ct-final" term="final">the complex type is said to be
  2845. <term>final</term>, because no
  2846. further derivations are possible</termdef>.  Finality is <emph>not</emph>
  2847. inherited, that is, a type definition derived by restriction from a type
  2848. definition which is final for extension is not itself, in the absence of any
  2849. explicit <code>final</code> attribute of its own, final for anything.</p>
  2850.  
  2851. <p>Complex types for which <propref ref="ct-abstract"/> is <pt>true</pt> must
  2852. not be used as the
  2853. <propref ref="type_definition"/> for the <termref def="key-vn">validation</termref> of element information items.  It follows that they must not be referenced from an
  2854. <specref ref="xsi_type"/> attribute in an instance document.  Abstract complex types can be
  2855. used as <propref ref="ct-base_type_definition"/>s, or even as the <propref ref="type_definition"/>s of element declarations, provided in every case a concrete derived type definition is used for <termref def="key-vn">validation</termref>, either via <specref ref="xsi_type"/> or the operation of a substitution group.</p>
  2856.  
  2857. <p><propref ref="ct-attribute_declarations"/> are a set of attribute uses.  See <specref ref="cvc-complex-type"/>
  2858. and <specref ref="cvc-attribute"/> for details of attribute <termref def="key-vn">validation</termref>.</p>
  2859. <p><propref ref="ct-attribute_wildcard"/>s provide a more flexible specification for <termref def="key-vn">validation</termref> of
  2860. attributes not explicitly included in <propref ref="ct-attribute_declarations"/>.
  2861. Informally, the specific values
  2862. of <propref ref="ct-attribute_wildcard"/> are interpreted as follows:
  2863. <ulist><item>
  2864. <p><pt>any</pt>: &i-attributes; can include attributes with any qualified or unqualified name.</p>
  2865. </item>
  2866. <item>
  2867. <p>a set whose
  2868. members are either namespace names or <termref def="key-null">absent</termref>: &i-attributes; can
  2869. include any attribute(s) from the specified namespace(s).  If <termref def="key-null">absent</termref> is included in the set, then any unqualified attributes are (also) allowed.</p>
  2870. </item>
  2871. <item>
  2872. <p><pt>'not'</pt> and a namespace name: &i-attributes; cannot include attributes from the specified namespace.</p>
  2873. </item>
  2874. <item>
  2875. <p><pt>'not'</pt> and <termref def="key-null">absent</termref>: &i-attributes; cannot include
  2876. unqualified attributes.</p>
  2877. </item></ulist>
  2878. See <specref ref="cvc-complex-type"/> and <specref ref="cvc-wildcard-namespace"/> for formal
  2879. details of attribute wildcard <termref def="key-vn">validation</termref>. </p>
  2880. <p><propref ref="content_type"/> determines the <termref def="key-vn">validation</termref> of &i-children; of element information items.  Informally:
  2881. <ulist>
  2882. <item>
  2883. <p>A <propref ref="content_type"/> with the distinguished value <pt>empty</pt> <termref def="key-vn">validates</termref> elements
  2884. with no character or element information item &i-children;.</p>
  2885. </item>
  2886. <item>
  2887. <p>A <propref ref="content_type"/> which is a <specref ref="Simple_Type_Definition"/> <termref def="key-vn">validates</termref>
  2888. elements with character-only &i-children;.</p>
  2889. </item>
  2890. <item>
  2891. <p>An <pt>element-only</pt> <propref ref="content_type"/> <termref def="key-vn">validates</termref> elements with &i-children; that
  2892. conform to the supplied <termref def="key-contentModel">content model</termref>.</p>
  2893. </item>
  2894. <item>
  2895. <p>A <pt>mixed</pt> <propref ref="content_type"/> <termref def="key-vn">validates</termref> elements whose element &i-children; (i.e. specifically ignoring other &i-children; such as character information items)
  2896. conform to the supplied <termref def="key-contentModel">content model</termref>.</p>
  2897. </item></ulist>
  2898. </p>
  2899. <p><propref ref="ct-exact"/> determine
  2900. whether an element declaration appearing in a <termref def="key-contentModel">
  2901. content model</termref> is prevented from additionally
  2902. <termref def="key-vn">validating</termref> element items with an <specref ref="xsi_type"/> attribute that
  2903. identifies a complex type definition derived by <pt>extension</pt> or
  2904. <pt>restriction</pt> from this definition, or element items in
  2905. a substitution group whose type definition is similarly derived:
  2906. If <propref ref="ct-exact"/> is empty,
  2907. then all such substitutions are allowed, otherwise, the derivation method(s) it
  2908. names are disallowed.
  2909. </p>
  2910.  <p>See <specref ref="cAnnotations"/> for information on the role of the
  2911. <propref ref="ct-annotations"/> property.</p>
  2912. </div3>
  2913.     <div3 id="declare-type">
  2914. <head>XML Representation of Complex Type Definitions</head>
  2915. <p>The XML representation for a complex type definition schema component is a
  2916. <eltref ref="complexType"/> element information item.</p>
  2917.  <p>The XML representation for complex type definitions with
  2918. a simple type definition <propref ref="content_type"/> is significantly different
  2919. from that of those with other <propref ref="content_type"/>s, and this
  2920. is reflected in the presentation below, which displays first the elements
  2921. involved in the first case, then those for the second.  The property mapping is shown once for each case.</p>
  2922. <reprdef>
  2923.  <reprelt eltname="complexType" type="complexType"/>
  2924.  <p>Whichever alternative for the content of <eltref ref="complexType"/> is
  2925. chosen, the following property mappings apply:</p>
  2926.  <reprcomp abstract="Complex Type Definition" ref="Complex_Type_Definition_details">
  2927.   <propmap name="ct-name">The &v-value; of the <code>name</code> &i-attribute; if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  2928.   <propmap name="ct-target_namespace">The &v-value; of the
  2929. <code>targetNamespace</code> &i-attribute; of the <eltref ref="schema"/> ancestor
  2930. element information item if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  2931. <propmap name="ct-abstract">The &v-value; of the <code>abstract</code>
  2932. &i-attribute;, if present, otherwise <pt>false</pt>.</propmap>
  2933. <propmap name="ct-exact">A set corresponding to the &v-value; of the
  2934. <code>block</code> &i-attribute;, if present, otherwise on the &v-value; of the
  2935. <code>blockDefault</code> &i-attribute; of the ancestor <eltref ref="schema"/> element
  2936. information item, if present, otherwise on the empty string.  Call this the <local>EBV</local> (for effective block value).  Then the value of this property is
  2937.  <olist role="caseval">
  2938.   <item>
  2939.    <p role="if">the <local>EBV</local> is the empty string</p>
  2940.    <p role="then">the empty set;</p>
  2941.   </item>
  2942.   <item>
  2943.    <p role="if">the <local>EBV</local> is <code>#all</code></p>
  2944.    <p role="then"><code>{</code><pt>extension</pt>, <pt>restriction</pt><code>}</code>;</p>
  2945.   </item>
  2946.   <item>
  2947.    <p role="otherwise">a set with members drawn from the set above, each being present or
  2948. absent depending on whether the &v-value; (which is a list) contains an
  2949. equivalently named item.
  2950.    <note>
  2951.        <p>Although the <code>blockDefault</code> &i-attribute; of <eltref ref="schema"/> may include values other than <pt>restriction</pt> or<pt>extension</pt>, those values are ignored in the determination of <propref ref="ct-exact"/> for complex type definitions (they <emph>are</emph> used elsewhere).</p>
  2952.       </note>
  2953.    </p>
  2954.   </item>
  2955.  </olist>
  2956. </propmap>
  2957. <propmap name="ct-final">As for <propref ref="ct-exact"/> above, but using the
  2958. <code>final</code> and <code>finalDefault</code> &i-attributes; in place of the
  2959. <code>block</code> and <code>blockDefault</code>
  2960. &i-attributes;.</propmap>
  2961.   <propmap name="ct-annotations">The annotations corresponding to the <eltref ref="annotation"/> element information item in the
  2962. &i-children;, if present, in the <eltref ref="simpleContent"/> and
  2963. <eltref ref="complexContent"/> &i-children;, if present, and in their <eltref ref="restriction" inside="simpleContent"/> and <eltref ref="extension" inside="simpleContent"/> &i-children;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  2964. </reprcomp>
  2965. <p>When the <eltref ref="simpleContent"/> alternative is chosen, the following
  2966. elements are relevant, and the remaining property mappings are as below.  Note that either
  2967. <eltref ref="restriction" inside="simpleContent"/> or <eltref ref="extension" inside="simpleContent"/> must be chosen as the
  2968. content of <eltref ref="simpleContent"/>.</p>
  2969.  <reprelt eltname="simpleContent"/>
  2970.  <reprelt eltname="restriction" type="simpleRestrictionType" local="simpleContent"/>
  2971.  <reprelt eltname="extension" type="simpleExtensionType" local="simpleContent"/> 
  2972.  <reprelt eltname="attributeGroup" type="attributeGroupRef" local="simpleContent"/>
  2973.  <reprelt eltname="anyAttribute"/>
  2974.  <reprcomp abstract="Complex Type Definition with simple content" ref="Complex_Type_Definition_details">
  2975. <propmap name="ct-base_type_definition">The type definition <termref def="src-resolve">resolved</termref> to by the
  2976. &v-value; of the <code>base</code> &i-attribute;</propmap>
  2977.   <propmap name="derivation_method">If the <eltref ref="restriction" inside="simpleContent"/> alternative
  2978. is chosen, then <pt>restriction</pt>, otherwise (the <eltref ref="extension" inside="simpleContent"/> alternative
  2979. is chosen) <pt>extension</pt>.</propmap>
  2980. <propmap name="ct-attribute_declarations">A union of sets of attribute uses as follows 
  2981.  <olist>
  2982.   <item id="c-add1">
  2983.    <p>The set of attribute uses corresponding to the <eltref ref="attribute"/> &i-children;, if any.</p>
  2984.   </item>
  2985.   <item id="c-add2">
  2986.    <p>The <propref ref="ag-attribute_declarations"/> of the
  2987. attribute groups <termref def="src-resolve">resolved</termref> to by the &v-value;s of the <code>ref</code>
  2988. &i-attribute; of the <eltref ref="attributeGroup" inside="simpleContent"/> &i-children;, if any.</p>
  2989.   </item>
  2990.   <item>
  2991.    <p>if the type definition <termref def="src-resolve">resolved</termref> to by the
  2992. &v-value; of the <code>base</code> &i-attribute; is a complex type definition, the
  2993. <propref ref="ct-attribute_declarations"/> of that type definition, unless
  2994. the <eltref ref="restriction" inside="simpleContent"/> alternative is chosen, in which case some members of
  2995. that type definition's <propref ref="ct-attribute_declarations"/> may not be
  2996. included, namely those whose
  2997. <propref ref="attribute"/>'s
  2998. <propref ref="a-name"/> and <propref ref="a-target_namespace"/> are the same as
  2999. <olist role="orval">
  3000.  <item>
  3001.   <p>the <propref ref="a-name"/> and <propref ref="a-target_namespace"/> of the <propref ref="attribute"/> of an attribute use in the set per <clauseref ref="c-add1"/> or <clauseref ref="c-add2"/> above;</p>
  3002.  </item>
  3003.  <item>
  3004.   <p>what would have been the <propref ref="a-name"/> and <propref ref="a-target_namespace"/> of the <propref ref="attribute"/> of an attribute use in the set per <clauseref ref="c-add1"/> above but for the &v-value; of the <code>use</code> &i-attribute; of the relevant <eltref ref="attribute"/> among the
  3005. &i-children; of <eltref ref="restriction" inside="simpleContent"/> being <pt>prohibited</pt>.</p>
  3006.  </item>
  3007. </olist></p>
  3008.   </item>
  3009.  </olist>
  3010. </propmap>
  3011. <propmap name="ct-attribute_wildcard"><termdef id="key-law" term="local wildcard" role="local">Let the <term>local wildcard</term> be defined as</termdef>
  3012.  <olist role="caseval">
  3013.      <item>
  3014.       <p role="if">there is an <eltref ref="anyAttribute"/> present</p>
  3015.       <p role="then">a wildcard based
  3016. on the &v-value;s of the <code>namespace</code> and
  3017. <code>processContents</code> &i-attributes; and the <eltref ref="annotation"/> &i-children;, exactly as for the wildcard
  3018. corresponding to an <eltref ref="any"/> element as set out in <specref ref="declare-openness"/>;</p>
  3019.      </item>
  3020.      <item>
  3021.       <p role="otherwise"><termref def="key-null">absent</termref>.</p>
  3022.      </item>
  3023.     </olist>
  3024. <termdef id="key-eaw" term="complete wildcard" role="local">Let the <term>complete wildcard</term> be defined as</termdef>
  3025.  <olist role="caseval">
  3026.   <item>
  3027.    <p role="if">there are no <eltref ref="attributeGroup" inside="simpleContent"/> &i-children; corresponding
  3028. to attribute groups with non-<termref def="key-null">absent</termref> <propref ref="ag-attribute_wildcard"/>s</p>
  3029.    <p role="then">the <termref def="key-law">local wildcard</termref>.</p>
  3030.   </item>
  3031.   <item>
  3032.    <p role="if">there are one or more <eltref ref="attributeGroup" inside="simpleContent"/> &i-children; corresponding
  3033. to attribute groups with non-<termref def="key-null">absent</termref> <propref ref="ag-attribute_wildcard"/>s</p>
  3034.    <p role="then">
  3035.     <olist role="caseval">
  3036.      <item id="c-awi1">
  3037.       <p role="if">there is an <eltref ref="anyAttribute"/> present</p>
  3038.       <p role="then">a wildcard whose <propref ref="process_contents"/> and
  3039. <propref ref="w-annotation"/> are those of the <termref def="key-law">local
  3040. wildcard</termref>, and whose <propref ref="namespace_constraint"/> is the intensional intersection of the <propref ref="namespace_constraint"/> of the <termref def="key-law">local wildcard</termref>
  3041. and of the <propref ref="namespace_constraint"/>s of all the non-<termref def="key-null">absent</termref> <propref ref="ag-attribute_wildcard"/>s of the attribute groups corresponding to the <eltref ref="attributeGroup" inside="simpleContent"/> &i-children;, as defined in <specref ref="cos-aw-intersect"/>.</p>
  3042.      </item>
  3043.      <item id="c-awi2">
  3044.    <p role="if">there is no <eltref ref="anyAttribute"/> present</p>
  3045.       <p role="then">a wildcard whose properties are as follows:
  3046.        <glist>
  3047.         <gitem>
  3048.          <label><propref ref="process_contents"/></label>
  3049.          <def>
  3050.           <p>The <propref ref="process_contents"/> of the first non-<termref def="key-null">absent</termref> <propref ref="ag-attribute_wildcard"/> of an attribute group among the
  3051. attribute groups corresponding to the <eltref ref="attributeGroup" inside="simpleContent"/> &i-children;.</p>
  3052.          </def>
  3053.         </gitem>
  3054.         <gitem>
  3055.          <label><propref ref="namespace_constraint"/></label>
  3056.          <def>
  3057.           <p>The intensional intersection of the <propref ref="namespace_constraint"/>s of all the non-<termref def="key-null">absent</termref> <propref ref="ag-attribute_wildcard"/>s of the attribute groups corresponding to the <eltref ref="attributeGroup" inside="simpleContent"/> &i-children;, as defined in <specref ref="cos-aw-intersect"/>.</p>
  3058.          </def>
  3059.         </gitem>
  3060.         <gitem>
  3061.          <label><propref ref="w-annotation"/></label>
  3062.          <def><p><termref def="key-null">absent</termref>.</p>
  3063.          </def>
  3064.         </gitem>
  3065.        </glist>
  3066.       </p>
  3067.   </item>
  3068.     </olist>
  3069.    </p>
  3070.   </item>  
  3071.  </olist>
  3072. The value is then determined by
  3073.  <olist role="caseval">
  3074. <item>
  3075.       <p role="if">the <eltref ref="restriction" inside="simpleContent"/> alternative is chosen</p>
  3076.       <p role="then">the <termref def="key-eaw">complete wildcard</termref>;</p>
  3077.      </item>
  3078.   <item>
  3079.    <p role="if">the <eltref ref="extension" inside="simpleContent"/> alternative is chosen</p>
  3080.    <p role="then">
  3081.     <termdef id="key-baw" term="base wildcard" role="local">let the <term>base
  3082. wildcard</term> be defined as</termdef>
  3083.     <olist role="caseval">
  3084.      <item>
  3085.       <p role="if">the type definition <termref def="src-resolve">resolved</termref> to by the
  3086. &v-value; of the <code>base</code> &i-attribute; is a complex type definition
  3087. with an <propref ref="ct-attribute_wildcard"/></p>
  3088.       <p role="then">that <propref ref="ct-attribute_wildcard"/>.</p>
  3089.      </item>
  3090.      <item>
  3091.       <p role="otherwise"><termref def="key-null">absent</termref>.</p>
  3092.      </item>
  3093.     </olist>  The value is then determined by
  3094.     <olist role="caseval">
  3095.      <item>
  3096.       <p role="if">the <termref def="key-baw">base wildcard</termref> is non-<termref def="key-null">absent</termref></p>
  3097.       <p role="then">
  3098.        <olist role="caseval">
  3099.         <item>
  3100.          <p role="if">the <termref def="key-eaw">complete wildcard</termref> is <termref def="key-null">absent</termref></p>
  3101.          <p role="then">the <termref def="key-baw">base wildcard</termref>.</p>
  3102.         </item>
  3103.         <item id="c-awu">
  3104.          <p role="otherwise">a wildcard whose <propref ref="process_contents"/> and
  3105. <propref ref="w-annotation"/> are those of the <termref def="key-eaw">complete
  3106. wildcard</termref>, and whose <propref ref="namespace_constraint"/> is the intensional union of the <propref ref="namespace_constraint"/> of the <termref def="key-eaw">effective wildcard</termref>
  3107. and of the <termref def="key-baw">base wildcard</termref>, as defined in <specref ref="cos-aw-union"/>.</p>
  3108.         </item>
  3109.        </olist>
  3110.       </p>
  3111.      </item>
  3112.     </olist>
  3113.    </p>
  3114.   </item>
  3115.  </olist>
  3116. </propmap>
  3117. <propmap name="content_type">
  3118.  <olist>
  3119.   <item><p>if the type definition <termref def="src-resolve">resolved</termref> to by the
  3120. &v-value; of the <code>base</code> &i-attribute; is a complex type definition
  3121. (whose own <propref ref="content_type"/> must be a
  3122. simple type definition, see below) and the <eltref ref="restriction" inside="simpleContent"/> alternative is chosen, then starting from either
  3123.          <olist>
  3124.           <item>
  3125.            <p>the simple type definition corresponding to the <eltref ref="simpleType"/> among
  3126. the &i-children; of <eltref ref="restriction" inside="simpleContent"/> if there
  3127. is one;</p>
  3128.           </item>
  3129.           <item>
  3130.            <p>otherwise (<eltref ref="restriction" inside="simpleContent"/> has no <eltref ref="simpleType"/> among its
  3131. &i-children;), the simple type definition which is the <propref ref="content_type"/> of the type definition <termref def="src-resolve">resolved</termref> to by the
  3132. &v-value; of the <code>base</code> &i-attribute;</p>
  3133.           </item>
  3134.          </olist>
  3135. a simple type definition which restricts that simple type definition with a
  3136. set of facet components corresponding to the appropriate element information
  3137. items among the <eltref ref="restriction" inside="simpleContent"/>'s
  3138. &i-children; (i.e. those which specify facets, if any), as
  3139. defined in <specref ref="st-restrict-facets"/>;</p></item>
  3140.   <item><p>otherwise if the type definition <termref def="src-resolve">resolved</termref> to by the
  3141. &v-value; of the <code>base</code> &i-attribute; is a complex type definition
  3142. (whose own <propref ref="content_type"/> must be a
  3143. simple type definition, see below) and the <eltref ref="extension" inside="simpleContent"/> alternative is chosen, then
  3144. the <propref ref="content_type"/> of that complex type definition;</p></item>
  3145.   <item>
  3146.    <p>otherwise (the type definition <termref def="src-resolve">resolved</termref> to by the
  3147. &v-value; of the <code>base</code> &i-attribute; is a simple type definition and
  3148. the <eltref ref="extension" inside="simpleContent"/> alternative is chosen), then
  3149. that simple type definition.</p>
  3150.   </item>
  3151.  </olist>
  3152. </propmap>
  3153. </reprcomp>
  3154. <p>When the <eltref ref="complexContent"/> alternative is chosen, the following
  3155. elements are relevant (as are the <eltref ref="attributeGroup" inside="simpleContent"/> and <eltref ref="anyAttribute"/> elements, not repeated here), and the additional property mappings are as below.  Note that either
  3156. <eltref ref="restriction" inside="complexContent"/> or <eltref ref="extension" inside="complexContent"/> must be chosen as the
  3157. content of <eltref ref="complexContent"/>, but their content models are
  3158. different in this case from the case above when they occur as children of
  3159. <eltref ref="simpleContent"/>.</p>
  3160.  <p>The property mappings below are <emph>also</emph> used in the case where
  3161. the third alternative (neither <eltref ref="simpleContent"/> nor <eltref ref="complexContent"/>) is chosen.  This case is understood as shorthand for complex content restricting the <termref def="key-urType">ur-type definition</termref>, and the details of the mappings should be modified as necessary.</p>
  3162.  <reprelt eltname="complexContent"/>
  3163.  <reprelt eltname="restriction" type="complexRestrictionType" local="complexContent"/>
  3164.  <reprelt eltname="extension" type="extensionType" local="complexContent"/>
  3165.  <reprcomp abstract="Complex Type Definition with complex content" ref="Complex_Type_Definition_details">
  3166. <propmap name="ct-base_type_definition">The type definition <termref def="src-resolve">resolved</termref> to by the
  3167. &v-value; of the <code>base</code> &i-attribute;</propmap>
  3168.   <propmap name="derivation_method">If the <eltref ref="restriction" inside="complexContent"/> alternative
  3169. is chosen, then <pt>restriction</pt>, otherwise (the <eltref ref="extension" inside="complexContent"/> alternative
  3170. is chosen) <pt>extension</pt>.</propmap>
  3171. <propmap name="ct-attribute_declarations">A union of sets of attribute uses as follows: 
  3172.  <olist>
  3173.   <item id="c-ad1">
  3174.    <p>The set of attribute uses corresponding to the <eltref ref="attribute"/> &i-children;, if any.</p>
  3175.   </item>
  3176.   <item id="c-ad2">
  3177.    <p>The <propref ref="ag-attribute_declarations"/> of the
  3178. attribute groups <termref def="src-resolve">resolved</termref> to by the &v-value;s of the <code>ref</code>
  3179. &i-attribute; of the <eltref ref="attributeGroup" inside="simpleContent"/> &i-children;, if any.</p>
  3180.   </item>
  3181.   <item>
  3182.    <p>The
  3183. <propref ref="ct-attribute_declarations"/> of the type definition <termref def="src-resolve">resolved</termref> to by the
  3184. &v-value; of the <code>base</code> &i-attribute;, unless
  3185. the <eltref ref="restriction" inside="complexContent"/> alternative
  3186. is chosen, in which case some members of
  3187. that type definition's <propref ref="ct-attribute_declarations"/> may not be
  3188. included, namely those whose
  3189. <propref ref="attribute"/>'s
  3190. <propref ref="a-name"/> and <propref ref="a-target_namespace"/> are the same as
  3191. <olist role="orval">
  3192.  <item>
  3193.   <p>The <propref ref="a-name"/> and <propref ref="a-target_namespace"/> of the <propref ref="attribute"/> of an attribute use in the set per <clauseref ref="c-ad1"/> or <clauseref ref="c-ad2"/> above;</p>
  3194.  </item>
  3195.  <item>
  3196.   <p>what would have been the <propref ref="a-name"/> and <propref ref="a-target_namespace"/> of the <propref ref="attribute"/> of an attribute use in the set per <clauseref ref="c-ad1"/> above but for the &v-value; of the <code>use</code> &i-attribute; of the relevant <eltref ref="attribute"/> among the
  3197. &i-children; of <eltref ref="restriction" inside="complexContent"/> being <pt>prohibited</pt>.</p>
  3198.  </item>
  3199. </olist></p>
  3200.   </item>
  3201.  </olist>
  3202. </propmap>
  3203. <propmap name="ct-attribute_wildcard">As above for the <eltref ref="simpleContent"/> alternative.</propmap>
  3204. <propmap name="content_type">
  3205.  <olist role="Caseval">
  3206.   <item><p role="if">the <eltref ref="restriction" inside="complexContent"/> alternative is chosen</p>
  3207.   <p role="then"><olist role="caseval">
  3208.   <item id="c-cme"><p role="if"> 
  3209. <olist role="ortest">
  3210.  <item>
  3211.   <p>There is no <eltref ref="group"/>, <eltref ref="all"/>, <eltref ref="choice"/> or <eltref ref="sequence"/> among the &i-children;;</p>
  3212.  </item>
  3213.  <item>
  3214.            <p>There is an <eltref ref="all"/> or <eltref ref="sequence"/> among
  3215. the &i-children; with no &i-children; of its own excluding <eltref ref="annotation"/>;</p>
  3216.           </item>
  3217.  <item>
  3218.            <p>There is a <eltref ref="choice"/> among
  3219. the &i-children; with no &i-children; of its own excluding <eltref ref="annotation"/> whose <code>minOccurs</code> &i-attribute; has the &v-value; <code>0</code>;</p>
  3220.           </item>
  3221. </olist>
  3222. </p>
  3223.    <p role="then"><pt>empty</pt>;</p>
  3224.   </item>
  3225.   <item>
  3226.    <p role="otherwise">a pair consisting of 
  3227.     <olist>
  3228.      <item id="c-mve">
  3229.       <olist role="caseval">
  3230.        <item>
  3231.         <p role="if">the <code>mixed</code> &i-attribute; is present on <eltref ref="complexContent"/></p>
  3232.         <p role="then"><pt>mixed</pt> if its &v-value; is <code>true</code>, otherwise <pt>elementOnly</pt>;</p>
  3233.        </item>
  3234.        <item>
  3235.         <p role="if">the <code>mixed</code> &i-attribute; is present on
  3236. <eltref ref="complexType"/> and its &v-value; is <code>true</code></p>
  3237.         <p role="then"><pt>mixed</pt>;</p>
  3238.        </item>
  3239.        <item>
  3240.         <p role="otherwise"><pt>elementOnly</pt>.</p>
  3241.        </item>
  3242.       </olist>
  3243.      </item>
  3244.      <item>
  3245.       <p>The particle corresponding to
  3246. the <eltref ref="all"/>, <eltref ref="choice"/>, <eltref ref="group"/> or
  3247. <eltref ref="sequence"/> among the &i-children;.</p>
  3248.      </item>
  3249.     </olist>
  3250.    </p>
  3251.   </item>
  3252.    </olist></p>
  3253.   </item>
  3254.   <item><p role="if">the <eltref ref="extension" inside="complexContent"/> alternative is chosen</p>
  3255.    <p role="then"><termdef id="key-exg" term="explicit content" role="local">let the <term>explicit
  3256. content</term> be <pt>empty</pt> if any of the sub-clauses of <clauseref ref="c-cme"/> above
  3257. applies, otherwise the particle corresponding to
  3258. the <eltref ref="all"/>, <eltref ref="choice"/>, <eltref ref="group"/> or
  3259. <eltref ref="sequence"/> among the &i-children;</termdef>, and then take
  3260.     <olist role="caseval">
  3261.         <item>
  3262.          <p role="if">the <termref def="key-exg">explicit
  3263. content</termref> is <pt>empty</pt></p>
  3264.          <p role="then">the
  3265. <propref ref="content_type"/> of the type definition <termref def="src-resolve">resolved</termref> to
  3266. by the &v-value; of the <code>base</code> &i-attribute;</p>
  3267.         </item>
  3268.      <item>
  3269.          <p role="if">the type definition <termref def="src-resolve">resolved</termref> to
  3270. by the &v-value; of the <code>base</code> &i-attribute; has a <propref ref="content_type"/> of <pt>empty</pt></p>
  3271.       <p role="then">a pair of <pt>mixed</pt> or <pt>elementOnly</pt> (determined as per <clauseref ref="c-mve"/> above) and the <termref def="key-exg">explicit content</termref> itself;</p>
  3272.         </item>
  3273.      <item>
  3274.          <p role="otherwise">a pair of <pt>mixed</pt> or <pt>elementOnly</pt> (determined as per
  3275. <clauseref ref="c-mve"/> above) and a particle whose properties are as follows:
  3276.        <glist>
  3277.         <gitem>
  3278.          <label><propref ref="p-min_occurs"/></label>
  3279.          <def>
  3280.           <p><code>1</code></p>
  3281.          </def>
  3282.         </gitem>
  3283.         <gitem>
  3284.          <label><propref ref="p-max_occurs"/></label>
  3285.          <def>
  3286.           <p><code>1</code></p>
  3287.          </def>
  3288.         </gitem>
  3289.         <gitem>
  3290.          <label><propref ref="term"/></label>
  3291.          <def>
  3292.           <p>A model group whose <propref ref="compositor"/> is
  3293. <pt>sequence</pt> and whose <propref ref="particles"/> are the particle of
  3294. the <propref ref="content_type"/> of the type definition <termref def="src-resolve">resolved</termref> to
  3295. by the &v-value; of the <code>base</code> &i-attribute; followed by the
  3296. <termref def="key-exg">explicit content</termref>.</p>
  3297.          </def>
  3298.         </gitem>
  3299.        </glist></p>
  3300.         </item>
  3301.        </olist>
  3302.    </p>
  3303. </item>
  3304.  </olist>
  3305. </propmap>
  3306. </reprcomp>
  3307. </reprdef>
  3308.  <note>
  3309.   <p>Aside from the simple coherence requirements enforced above, constraining
  3310. type definitions identified as restrictions to actually <emph>be</emph>
  3311. restrictions, that is, to <termref def="key-vn">validate</termref> a
  3312. subset of the items which are
  3313. <termref def="key-vn">validated</termref> by their base type definition, is enforced in <specref ref="coss-ct"/>.</p>
  3314.  </note>
  3315.      <note>
  3316.       <p>The <emph>only</emph> substantive function of the value <pt>prohibited</pt> for the
  3317. <code>use</code> attribute of an <eltref ref="attribute"/> is in establishing
  3318. the correspondence between a complex type defined by restriction and its XML
  3319. representation.  It serves to prevent
  3320. inheritance of an identically named attribute use from the <propref ref="ct-base_type_definition"/>.  Such an <eltref ref="attribute"/> does not correspond to any component, and hence there is no interaction with either explicit or inherited wildcards in the operation of <specref ref="formal-complex-type"/> or <specref ref="coss-ct"/>.</p>
  3321.      </note>
  3322. <p>Careful consideration of the above concrete syntax reveals that
  3323. a type definition need consist of no more than a name, i.e. that
  3324.  <code><complexType name="anyThing"/></code> is allowed.</p>
  3325.  <note role="example">
  3326.     <eg xml:space="preserve"><![CDATA[<xs:complexType name="length1">
  3327.  <xs:simpleContent>
  3328.   <xs:extension base="xs:nonNegativeInteger">
  3329.    <xs:attribute name="unit" type="xs:NMTOKEN"/>
  3330.   </xs:extension>
  3331.  </xs:simpleContent>
  3332. </xs:complexType>
  3333.  
  3334. <xs:element name="width" type="length1"/>
  3335.  
  3336.   <width unit="cm">25</width>
  3337.  
  3338. <xs:complexType name="length2">
  3339.  <xs:complexContent>
  3340.   <xs:restriction base="xs:anyType">
  3341.    <xs:sequence>
  3342.     <xs:element name="size" type="xs:nonPositiveInteger"/>
  3343.     <xs:element name="unit" type="xs:NMTOKEN"/>
  3344.    </xs:sequence>
  3345.   </xs:restriction>
  3346.  </xs:complexContent>
  3347. </xs:complexType>
  3348.  
  3349. <xs:element name="depth" type="length2"/>
  3350.  
  3351.   <depth>
  3352.    <size>25</size><unit>cm</unit>
  3353.   </depth>
  3354.  
  3355. <xs:complexType name="length3">
  3356.  <xs:sequence>
  3357.   <xs:element name="size" type="xs:non-positive-integer"/>
  3358.   <xs:element name="unit" type="xs:NMTOKEN"/>
  3359.  </xs:sequence>
  3360. </xs:complexType>
  3361. ]]>
  3362. </eg>
  3363.   <p>
  3364.     Three approaches to defining a type for length:  one with
  3365. character data content constrained by reference to
  3366.     a built-in datatype, and one attribute, the other two using two
  3367. elements.  <code>length3</code> is the abbreviated alternative to
  3368. <code>length2</code>:  they correspond to identical type definition components.
  3369. </p>
  3370. </note>
  3371.  
  3372. <note role="example">
  3373.    <eg xml:space="preserve"><![CDATA[<xs:complexType name="personName">
  3374.  <xs:sequence>
  3375.   <xs:element name="title" minOccurs="0"/>
  3376.   <xs:element name="forename" minOccurs="0" maxOccurs="unbounded"/>
  3377.   <xs:element name="surname"/>
  3378.  </xs:sequence>
  3379. </xs:complexType>
  3380.  
  3381. <xs:complexType name="extendedName">
  3382.  <xs:complexContent>
  3383.   <xs:extension base="personName">
  3384.    <xs:sequence>
  3385.     <xs:element name="generation" minOccurs="0"/>
  3386.    </xs:sequence>
  3387.   </xs:extension>
  3388.  </xs:complexContent>
  3389. </xs:complexType>
  3390.  
  3391. <xs:element name="addressee" type="extendedName"/>
  3392.  
  3393.   <addressee>
  3394.    <forename>Albert</forename>
  3395.    <forename>Arnold</forename>
  3396.    <surname>Gore</surname>
  3397.    <generation>Jr</generation>
  3398.   </addressee>]]></eg>
  3399.    <p>A type definition for personal names, and a definition derived by
  3400. extension which adds a single element; an element declaration referencing the
  3401. derived definition, and a <termref def="key-vn">valid</termref> instance thereof.</p>
  3402.   </note> 
  3403. <note role="example">
  3404.    <eg xml:space="preserve"><![CDATA[<xs:complexType name="simpleName">
  3405.  <xs:complexContent>
  3406.   <xs:restriction base="personName">
  3407.    <xs:sequence>
  3408.     <xs:element name="forename" minOccurs="1" maxOccurs="1"/>
  3409.     <xs:element name="surname"/>
  3410.    </xs:sequence>
  3411.   </xs:restriction>
  3412.  </xs:complexContent>
  3413. </xs:complexType>
  3414.  
  3415. <xs:element name="who" type="simpleName"/>
  3416.  
  3417.    <who>
  3418.     <forename>Bill</forename>
  3419.     <surname>Clinton</surname>
  3420.    </who>]]></eg>
  3421.    <p>A simplified type definition
  3422. derived from the base type from the previous example by restriction, eliminating one optional daughter and
  3423. fixing another to occur exactly once; an element declared by reference to it,
  3424. and a <termref def="key-vn">valid</termref> instance thereof.</p>
  3425.   </note>
  3426.  <note role="example">
  3427.   <eg xml:space="preserve"><![CDATA[<xs:complexType name="paraType" mixed="true">
  3428.  <xs:choice minOccurs="0" maxOccurs="unbounded">
  3429.   <xs:element ref="emph"/>
  3430.   <xs:element ref="strong"/>
  3431.  </xs:choice>
  3432.  <xs:attribute name="version" type="xs:number"/>
  3433. </xs:complexType>]]></eg>
  3434.   <p>A further illustration of the abbreviated form, with the
  3435. <code>mixed</code> attribute appearing on <code>complexType</code> itself.</p>
  3436.  </note>
  3437. </div3>
  3438.     <div3>
  3439.       <head>Constraints on XML Representations of Complex Type Definitions</head>
  3440.       <constraintnote id="src-ct" type="src">
  3441.   <head>Complex Type Definition Representation OK</head>
  3442.   <p>In addition to the conditions imposed on <eltref ref="complexType"/> element
  3443. information items by the schema for schemas, 
  3444.    <olist role="and">
  3445.     <item>
  3446.      <p>If the <eltref ref="complexContent"/> alternative is chosen, the type definition <termref def="src-resolve">resolved</termref> to
  3447. by the &v-value; of the <code>base</code> &i-attribute; must be a complex type definition;</p>
  3448.     </item>
  3449.     <item>
  3450.      <p>If the <eltref ref="simpleContent"/> alternative is chosen, the type definition <termref def="src-resolve">resolved</termref> to
  3451. by the &v-value; of the <code>base</code> &i-attribute; must be either a complex type
  3452. definition whose <propref ref="content_type"/> is a simple type definition or, only if the
  3453. <eltref ref="extension" inside="simpleContent"/> alternative is also chosen, a simple type definition;</p>
  3454.     </item>
  3455.     <item>
  3456.      <p>The corresponding complex type definition component must satisfy the conditions set
  3457. out in <specref ref="coss-ct"/>;</p>
  3458.     </item>
  3459.     <item>
  3460.      <p>If <clauseref ref="c-awi1"/> or <clauseref ref="c-awi2"/> in the correspondence specification above for <propref ref="ct-attribute_wildcard"/> is satisfied, the intensional intersection must be expressible, as defined in <specref ref="cos-aw-intersect"/>.</p>
  3461.     </item>
  3462.    </olist>
  3463.   </p>
  3464.  </constraintnote>
  3465.      </div3>
  3466.     <div3 id="formal-complex-type">
  3467.     <head>Complex Type Definition Validation Rules</head>
  3468.     <constraintnote type="cvc" id="cvc-complex-type">
  3469.      <head>Element Locally Valid (Complex Type)</head>
  3470.      <p>For an element information item to be locally <termref def="key-vn">valid</termref> with respect to a complex type definition
  3471.       <olist role="and">
  3472.        <item>
  3473.         <p><propref ref="ct-abstract"/> is <pt>false</pt>.</p>
  3474.        </item>
  3475.        <item>
  3476.         <p>If <clauseref ref="c-nl"/> of <specref ref="cvc-elt"/> did not
  3477. apply, then <olist role="case">
  3478.          <item>
  3479.         <p role="if">the <propref ref="content_type"/> is <pt>empty</pt></p>
  3480.           <p role="then">the element
  3481. information item has no character or element information item &i-children;.</p>
  3482.        </item>
  3483.        <item id="c-sv2">
  3484.         <p role="if">the <propref ref="content_type"/> is a simple
  3485. type definition</p>
  3486.         <p role="then">the element information item has no element
  3487. information item &i-children;, and the &i-value; of the element information item is <termref def="key-vn">valid</termref> with respect to that simple type definition as defined by <specref ref="cvc-simple-type"/>.</p>
  3488.        </item>
  3489.        <item>
  3490.         <p role="if">the <propref ref="content_type"/> is <pt>element-only</pt></p>
  3491.         <p role="then">the
  3492. element information item has no character information item &i-children; other
  3493. than those whose &i-ccode; is defined as a <xtermref href="http://www.w3.org/TR/REC-xml#NT-S">white space</xtermref>
  3494. in <bibref ref="ref-xml"/>.</p>
  3495.        </item>
  3496.        <item>
  3497.         <p role="if">the <propref ref="content_type"/> is <pt>element-only</pt> or
  3498. <pt>mixed</pt></p>
  3499.         <p role="then">the sequence of the element information item's element
  3500. information item &i-children;, if any, taken in order, is <termref def="key-vn">valid</termref> with
  3501. respect to the <propref ref="content_type"/>'s particle, as defined in <specref ref="cvc-particle"/>.</p>
  3502.        </item>
  3503.         </olist></p>
  3504.        </item>
  3505.        <item id="c-aam">
  3506.         <p>For each attribute information item in the element information
  3507. item's &i-attributes; excepting those whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref> is identical to <code>http://www.w3.org/2001/XMLSchema-instance</code> and whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref> is one of <code>type</code>, <code>nil</code>, <code>schemaLocation</code> or <code>noNamespaceSchemaLocation</code>,
  3508.          <olist role="case">
  3509.           <item id="c-ctma">
  3510.            <p role="if">there is among the <propref ref="ct-attribute_declarations"/> an
  3511. attribute use with an <propref ref="attribute"/> whose
  3512. <propref ref="a-name"/> matches the attribute information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref> and whose <propref ref="a-target_namespace"/> is identical to the attribute information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref> (where an <termref def="key-null">absent</termref> <propref ref="a-target_namespace"/> is taken to be identical to a <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref> with no value)</p>           
  3513.            <p role="then">the attribute information must be <termref def="key-vn">valid</termref> with respect to that attribute use as per <specref ref="cvc-au"/>.  In this case the <propref ref="attribute"/> of that attribute use is the <termref def="key-dd">context-determined declaration</termref> for the attribute information item with respect to <specref ref="cvc-assess-attr"/> and <specref ref="sic-a-outcome"/>.</p>
  3514.           </item>
  3515.           <item id="c-avaw">
  3516.            <p role="otherwise">
  3517.             <olist role="and">
  3518.              <item>
  3519.               <p>There must be an <propref ref="ct-attribute_wildcard"/>.</p>
  3520.              </item>
  3521.              <item>
  3522.               <p>The
  3523. attribute information item must be <termref def="key-vn">valid</termref> with respect to it as defined in <specref ref="cvc-wildcard"/>.</p>
  3524.              </item>
  3525.             </olist>
  3526.            </p>
  3527.           </item>
  3528.          </olist>
  3529.         </p>
  3530.        </item>
  3531.        <item>
  3532.         <p>The <propref ref="attribute"/> of each attribute use in the <propref ref="ct-attribute_declarations"/> whose
  3533. <propref ref="required"/> is <pt>true</pt> matches one of the attribute information items in the element information item's &i-attributes; as per <clauseref ref="c-ctma"/> above.</p>
  3534.        </item>
  3535.        <item>
  3536.               <p>Let <termdef id="key-ida" term="wild IDs" role="local">the <term>wild
  3537. IDs</term> be the set of all
  3538. attribute information item to which <clauseref ref="c-avaw"/> applied and whose <termref def="key-vn">validation</termref> resulted in
  3539. a <termref def="key-dd">context-determined declaration</termref> of
  3540. <pt>mustFind</pt> or no <termref def="key-dd">context-determined
  3541. declaration</termref> at all, and whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref> and <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref> resolve (as defined by <specref ref="cvc-resolve-instance"/>) to an attribute declaration whose <propref ref="a-simple_type_definition"/> is or is derived from <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref></termdef>. Then
  3542.                <olist role="and">
  3543.                 <item>
  3544.                  <p>There must be no more than one item in <termref def="key-ida">wild IDs</termref>.</p>
  3545.                 </item>
  3546.                 <item>
  3547.                  <p>If <termref def="key-ida">wild IDs</termref> is non-empty, there must not be any attribute uses among the <propref ref="ct-attribute_declarations"/> whose <propref ref="attribute"/>'s <propref ref="a-simple_type_definition"/> is or is derived from <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref>.</p>
  3548.                 </item>
  3549.                </olist>
  3550.                <note>
  3551.                 <p>This clause serves to ensure that even via attribute
  3552. wildcards no element has more than one attribute of type ID, and that even when
  3553. an element legitimately lacks a declared attribute of type ID, a
  3554. wildcard-validated attribute must not supply it.  That is, if an element has a
  3555. type whose attribute declarations include one of type ID, it either has that
  3556. attribute or no attribute of type ID.</p>
  3557.                </note>
  3558.               </p>
  3559.              </item>
  3560.       </olist>
  3561.      </p>
  3562.      <note>
  3563.       <p>When an <propref ref="ct-attribute_wildcard"/> is present, this does
  3564. <emph>not</emph> introduce any ambiguity with respect to how attribute
  3565. information items for
  3566. which an attribute use is present amongst the <propref ref="ct-attribute_declarations"/> whose name and target namespace match are <termref def="key-va">assessed</termref>.  In such cases the attribute use <emph>always</emph> takes precedence, and the <termref def="key-va">assessment</termref> of such items stands or falls entirely on the basis of the attribute use and its <propref ref="attribute"/>.  This follows from the details of <clauseref ref="c-aam"/>.</p>
  3567.      </note>
  3568.     </constraintnote>
  3569.     </div3>
  3570.      <div3>
  3571.      <head>Complex Type Definition Information Set Contributions</head>
  3572.      <constraintnote type="sic" id="sic-attrDefault">
  3573.      <head>Attribute Default Value</head>
  3574.      <p>For each attribute use in the <propref ref="ct-attribute_declarations"/> whose
  3575. <propref ref="required"/> is <pt>false</pt> and whose <propref ref="au-value_constraint"/> is not <termref def="key-null">absent</termref> but whose <propref ref="attribute"/> does not match one of the attribute information items in the element information item's &i-attributes; as per <clauseref ref="c-ctma"/> of <specref ref="cvc-complex-type"/> above, the &PSVI; has an attribute information item whose properties are as below added to the
  3576. &i-attributes; of the element information item.</p>
  3577.       <glist>
  3578.        <gitem>
  3579.         <label><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref></label>
  3580.         <def>
  3581. <p>The <propref ref="attribute"/>'s <propref ref="a-name"/>.</p>
  3582.         </def>
  3583.        </gitem>
  3584.        <gitem>
  3585.         <label><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref></label>
  3586.         <def>
  3587. <p>The <propref ref="attribute"/>'s <propref ref="a-target_namespace"/>.</p>
  3588.         </def>
  3589.        </gitem>
  3590.        <gitem>
  3591.         <label><propref ref="a-schema_normalized_value" role="psvi"/></label>
  3592.         <def>
  3593.          <p>The <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of the <propref ref="au-value_constraint"/> value.</p>
  3594.         </def>
  3595.        </gitem>
  3596.        <gitem>
  3597.         <label><propref ref="a-schema_default" role="psvi"/></label>
  3598.         <def>
  3599.          <p>The <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of the <propref ref="au-value_constraint"/> value.</p>
  3600.         </def>
  3601.        </gitem>
  3602.        <gitem>
  3603.         <label><propref ref="a-validation_context" role="psvi"/></label>
  3604.         <def><p>The nearest ancestor element information item with a
  3605. <propref role="psvi" ref="e-schema_information"/> property.</p></def>
  3606.        </gitem>
  3607.        <gitem>
  3608.         <label><propref ref="a-validity" role="psvi"/></label>
  3609.         <def>
  3610.          <p><pt>valid</pt>.</p>
  3611.         </def>
  3612.        </gitem>
  3613.        <gitem>
  3614.         <label><propref ref="a-validation_attempted" role="psvi"/></label>
  3615.         <def><p><pt>full</pt>.</p></def>
  3616.        </gitem>
  3617.        <gitem>
  3618.         <label><propref ref="a-schema_specified" role="psvi"/></label>
  3619.         <def><p><pt>schema</pt>.</p></def>
  3620.        </gitem>
  3621.       </glist>
  3622.       <p>The added items should also either have <propref role="psvi" ref="a-type_definition"/> (and <propref role="psvi" ref="a-member_type_definition"/> if appropriate) properties, or their lighter-weight alternatives, as specified in <specref ref="sic-attrType"/>.</p>
  3623.     </constraintnote>
  3624. </div3>
  3625.  <div3 id="coss-ct">
  3626.   <head>Constraints on Complex Type Definition Schema Components</head>
  3627.   <p>All complex type definitions (see <specref ref="Complex_Type_Definitions"/>) must satisfy the following constraints.</p>
  3628.   <constraintnote type="cos" id="ct-props-correct">
  3629.    <head>Complex Type Definition Properties Correct</head>
  3630.    <olist role="And">
  3631.     <item>
  3632.      <p>The values of the properties of a complex type definition must be as described in
  3633. the property tableau in
  3634. <specref ref="Complex_Type_Definition_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  3635.     </item>
  3636.     <item>
  3637.      <p>If the <propref ref="ct-base_type_definition"/> is a simple type
  3638. definition, the <propref ref="derivation_method"/> must be <pt>extension</pt>.</p>
  3639.     </item>
  3640.     <item><p>Circular definitions are disallowed, except for the <termref def="ur-type-itself">ur-type definition</termref>.  That is, it must be possible to reach the <termref def="ur-type-itself">ur-type definition</termref> by repeatedly following the <propref ref="ct-base_type_definition"/>.</p></item>
  3641.     <item>
  3642.      <p>Two distinct attribute declarations in the <propref ref="ct-attribute_declarations"/> must not have identical <propref ref="a-name"/>s and <propref ref="a-target_namespace"/>s.</p>
  3643.     </item>
  3644.     <item>
  3645.      <p>Two distinct attribute declarations in the <propref ref="ct-attribute_declarations"/>
  3646. must not have <propref ref="a-simple_type_definition"/>s which are or are derived from <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref>.</p>
  3647.     </item>
  3648.    </olist>
  3649.   </constraintnote>
  3650.   <constraintnote type="cos" id="cos-ct-extends">
  3651.      <head>Derivation Valid (Extension)</head>
  3652.      <p>If the <propref ref="derivation_method"/> is <pt>extension</pt>, 
  3653.       <olist role="case">
  3654.        <item>
  3655.         <p role="if">the <propref ref="ct-base_type_definition"/> is a complex type
  3656. definition</p>
  3657.         <p role="then">
  3658.          <olist role="and">
  3659.           <item>
  3660.            <p>The <propref ref="ct-final"/> of the <propref ref="ct-base_type_definition"/> must not contain <pt>extension</pt>.</p>
  3661.           </item>
  3662.           <item id="c-cte">
  3663.            <p>Its <propref ref="ct-attribute_declarations"/> must be a subset
  3664. of the <propref ref="ct-attribute_declarations"/> of the complex type
  3665. definition itself, that is, for every attribute use in the
  3666. <propref ref="ct-attribute_declarations"/> of the
  3667. <propref ref="ct-base_type_definition"/>, there must be an attribute use in the <propref ref="ct-attribute_declarations"/> of the complex
  3668. type definition itself whose <propref ref="attribute"/> has the same <propref ref="a-name"/>,
  3669. <propref ref="a-target_namespace"/> and
  3670. <propref ref="a-simple_type_definition"/> as its attribute declaration.</p>
  3671.           </item>
  3672.           <item>
  3673.            <p>If it has an <propref ref="ct-attribute_wildcard"/>, the complex
  3674. type definition must also have one, and the base type definition's <propref ref="ct-attribute_wildcard"/>'s <propref ref="namespace_constraint"/> must be a subset of the complex type definition's <propref ref="ct-attribute_wildcard"/>'s <propref ref="namespace_constraint"/>, as defined by <specref ref="cos-ns-subset"/>.</p>
  3675.           </item>
  3676.           <item>
  3677.            <p>
  3678.             <olist role="Or">
  3679.              <item>
  3680.               <p>The <propref ref="content_type"/> of
  3681. the <propref ref="ct-base_type_definition"/> and the
  3682. <propref ref="content_type"/> of the complex type definition itself must be the
  3683. same simple type definition.</p>
  3684.              </item>
  3685.              <item>
  3686.               <olist role="And">
  3687.                <item>
  3688.                 <p>The
  3689. <propref ref="content_type"/> of the complex type definition itself must
  3690. specify a particle.</p>
  3691.                </item>
  3692.                <item>
  3693.                 <olist role="Or">
  3694.                  <item>
  3695.                   <p>The
  3696. <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/>
  3697. must be <pt>empty</pt>.</p>
  3698.                  </item>
  3699.                  <item>
  3700.                   <p>
  3701.                    <olist role="And">
  3702.                     <item>
  3703.                      <p>Both
  3704. <propref ref="content_type"/>s must be <pt>mixed</pt> or both must be
  3705. <pt>element-only</pt>.</p>
  3706.                     </item>
  3707.                     <item>
  3708.                      <p>The particle of the complex type
  3709. definition must be a <termref def="cd-model-extension">valid
  3710. extension</termref> of the <propref ref="ct-base_type_definition"/>'s particle,
  3711. as defined in <specref ref="cos-particle-extend"/>.</p>
  3712.                     </item>
  3713.                    </olist>
  3714.                   </p>
  3715.                   </item>
  3716.                 </olist>
  3717.                </item>
  3718.               </olist>
  3719.              </item>
  3720.             </olist>
  3721.            </p>
  3722.            </item>
  3723.           <item>
  3724.            <p>It must in principle be possible to derive the complex type
  3725. definition in two steps, the first an extension and the
  3726. second a restriction (possibly vacuous), from that type definition among its
  3727. ancestors whose <propref ref="ct-base_type_definition"/> is the <termref def="ur-type-itself">ur-type definition</termref>.</p>
  3728.            <note>
  3729.             <p>This requirement ensures that nothing removed by a restriction
  3730. is subsequently added back by an extension.  It is trivial to check if the
  3731. extension in question is the only extension in its derivation, or if there are
  3732. no restrictions bar the first from the <termref def="ur-type-itself">ur-type definition</termref>.</p>
  3733.             <p>Constructing the intermediate type definition to check this
  3734. constraint is straightforward:  simply re-order the derivation to put all the
  3735. extension steps first, then collapse them into a single extension.  If the
  3736. resulting definition can be the basis for a valid restriction to the desired
  3737. definition, the constraint is satisfied.</p>
  3738.            </note>
  3739.           </item>
  3740.           </olist>
  3741.         </p>
  3742.        </item>
  3743.        <item>
  3744.         <p role="if">the <propref ref="ct-base_type_definition"/> is a simple type
  3745. definition</p>
  3746.         <p role="then">
  3747.          <olist role="and">
  3748.          <item>
  3749.           <p>The <propref ref="content_type"/> must be the same simple type
  3750. definition.</p>
  3751.          </item>
  3752.          <item>
  3753.            <p>The <propref ref="st-final"/> of the <propref ref="ct-base_type_definition"/> must not contain <pt>extension</pt>.</p>
  3754.           </item>
  3755.         </olist>
  3756.         </p>        
  3757.        </item>
  3758.       </olist>
  3759.       <termdef id="cd-ct-extension" term="valid extension">If this
  3760. constraint <specref ref="cos-ct-extends"/> holds of a complex type definition, it is a <term>valid
  3761. extension</term> of its <propref ref="ct-base_type_definition"/></termdef>.
  3762.      </p>
  3763.     </constraintnote>
  3764.     <constraintnote type="cos" id="derivation-ok-restriction">
  3765.     <head>Derivation Valid (Restriction, Complex)</head>
  3766.     <p>If the <propref ref="derivation_method"/> is <pt>restriction</pt>
  3767.      <olist role="and">
  3768.       <item>
  3769.        <p>The <propref ref="ct-base_type_definition"/> must be a complex type
  3770. definition whose <propref ref="ct-final"/> does not contain <pt>restriction</pt>.</p>
  3771.       </item>
  3772.       <item id="c-rad">
  3773.        <p>For each attribute use (call this <local>R</local>) in the <propref ref="ct-attribute_declarations"/>
  3774.         <olist role="case">
  3775.          <item>
  3776.           <p role="if">there is an attribute use in the
  3777. <propref ref="ct-attribute_declarations"/> of the <propref ref="ct-base_type_definition"/> (call this <local>B</local>) whose <propref ref="attribute"/> has the same <propref ref="a-name"/> and <propref ref="a-target_namespace"/></p>
  3778.           <p role="then">
  3779.            <olist role="and">
  3780.             <item>
  3781.              <p><olist role="or">
  3782.              <item>
  3783.               <p><local>B</local>'s <propref ref="required"/> is <pt>false</pt>.</p>
  3784.              </item>
  3785.              <item>
  3786.               <p><local>R</local>'s <propref ref="required"/> is <pt>true</pt>.</p>
  3787.              </item>
  3788.             </olist></p>
  3789.             </item>
  3790.            <item>
  3791.             <p><local>R</local>'s <propref ref="attribute"/>'s <propref ref="a-simple_type_definition"/> must be validly derived from <local>B</local>'s <propref ref="a-simple_type_definition"/> given the
  3792. empty set as defined in
  3793. <specref ref="cos-st-derived-ok"/>.</p>
  3794.            </item>
  3795.            <item>
  3796.             <p><termdef id="key-evc" term="effective base value constraint" role="local">Let the
  3797. <term>effective value constraint</term> of an attribute use be
  3798. its <propref ref="au-value_constraint"/>, if present, otherwise
  3799. its <propref ref="attribute"/>'s <propref ref="a-value_constraint"/>
  3800. </termdef>.  Then <olist role="or">
  3801.              <item>
  3802.               <p><local>B</local>'s <termref def="key-evc">effective value
  3803. constraint</termref> is <termref def="key-null">absent</termref> or <pt>default</pt>.</p>
  3804.              </item>
  3805.              <item>
  3806.               <p><local>R</local>'s <termref def="key-evc">effective value
  3807. constraint</termref> is
  3808. <pt>fixed</pt> with the same string as <local>B</local>'s.</p>
  3809.              </item>
  3810.             </olist>
  3811.             </p>
  3812.            </item>
  3813.           </olist>
  3814.           </p>
  3815.          </item>
  3816.          <item>
  3817.           <p role="otherwise">the <propref ref="ct-base_type_definition"/> must
  3818. have an <propref ref="ct-attribute_wildcard"/> and the <propref ref="a-target_namespace"/> of the <local>R</local>'s <propref ref="attribute"/> must be <termref def="key-vn">valid</termref> with respect to that wildcard, as defined in <specref ref="cvc-wildcard-namespace"/>.</p>
  3819.          </item>
  3820.         </olist>
  3821.        </p>
  3822.       </item>
  3823.       <item id="c-rad2">
  3824.        <p>For each attribute use in the <propref ref="ct-attribute_declarations"/> of
  3825. the <propref ref="ct-base_type_definition"/> whose <propref ref="required"/> is
  3826. <pt>true</pt>, there must be an attribute use with an <propref ref="attribute"/> with the same <propref ref="a-name"/> and <propref ref="a-target_namespace"/> as its <propref ref="attribute"/> in the
  3827. <propref ref="ct-attribute_declarations"/> of the complex type definition
  3828. itself whose <propref ref="required"/> is
  3829. <pt>true</pt>.</p>
  3830.       </item>
  3831.       <item id="c-raw">
  3832.            <p>If there is an <propref ref="ct-attribute_wildcard"/>, 
  3833.             <olist role="and">
  3834.              <item>
  3835.               <p>The
  3836. <propref ref="ct-base_type_definition"/> must also have one.</p>
  3837.              </item>
  3838.              <item>
  3839.               <p>The complex
  3840. type definition's <propref ref="ct-attribute_wildcard"/>'s <propref ref="namespace_constraint"/> must be a subset of the <propref ref="ct-base_type_definition"/>'s <propref ref="ct-attribute_wildcard"/>'s <propref ref="namespace_constraint"/>, as defined by <specref ref="cos-ns-subset"/>.</p>
  3841.              </item>
  3842.             </olist>
  3843.            </p>
  3844.           </item>
  3845.       <item>
  3846.        <p>
  3847.         <olist role="Case">
  3848.          <item>
  3849.           <p role="if">the <propref ref="content_type"/> of the complex type definition
  3850. is a simple type definition</p>
  3851.           <p role="then">
  3852.            <olist role="or">
  3853.             <item>
  3854.              <p>The <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/> must be a simple type
  3855. definition of which the <propref ref="content_type"/> is a <termref def="cd-st-restriction">valid restriction</termref> as defined in
  3856. <specref ref="cos-st-restricts"/>.</p>
  3857.             </item>
  3858.             <item>
  3859.              <p>The <propref ref="ct-base_type_definition"/> must be <pt>mixed</pt>
  3860. and have a particle which is <termref def="cd-emptiable">emptiable</termref> as defined in <specref ref="cos-group-emptiable"/>.</p>
  3861.             </item>
  3862.            </olist>
  3863.           </p>
  3864.          </item>
  3865.          <item>
  3866.           <p role="if">the <propref ref="content_type"/> of the complex type itself
  3867. is <pt>empty</pt>
  3868.           </p>
  3869.           <p role="then">
  3870.            <olist role="or">
  3871.             <item>
  3872.              <p>The <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/> must also be <pt>empty</pt>.</p>
  3873.             </item>
  3874.             <item>
  3875.              <p>The <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/> must be <pt>elementOnly</pt> or <pt>mixed</pt> and have a particle which is <termref def="cd-emptiable">emptiable</termref> as defined in <specref ref="cos-group-emptiable"/>.</p>
  3876.             </item>
  3877.            </olist>
  3878.           </p>
  3879.          </item>
  3880.          <item>
  3881.           <p role="if">the <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/> is <pt>mixed</pt> or the <propref ref="content_type"/> of the complex type definition itself is <pt>element-only</pt></p>
  3882.           <p role="then">the particle of the complex type definition itself
  3883. must be a <termref def="cd-model-restriction">valid restriction</termref> of the particle of the <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/> as defined in <specref ref="cos-particle-restrict"/>.</p>
  3884.          </item>
  3885.         </olist>
  3886.         </p>
  3887.       </item>
  3888.      </olist>
  3889.      <termdef id="cd-ct-restriction" term="valid restriction">If this
  3890. constraint <specref ref="derivation-ok-restriction"/> holds of a complex type definition, it is a <term>valid
  3891. restriction</term> of its <propref ref="ct-base_type_definition"/></termdef>.
  3892.   </p>
  3893.   </constraintnote>
  3894.   <note>
  3895.    <p>To restrict a complex type definition with a simple base type definition
  3896. to <pt>empty</pt>, use a simple type definition with a <pt>fixed</pt> value of
  3897. the empty string: this preserves the type information.</p>
  3898.   </note>
  3899.     <p>The following constraint defines a relation appealed to elsewhere in this specification.</p>
  3900.   <constraintnote id="cos-ct-derived-ok" type="cos">
  3901.    <head>Type Derivation OK (Complex)</head>
  3902.    <p>For a complex type definition (call it <local>D</local>, for derived) to be validly
  3903. derived from a type definition (call this <local>B</local>, for base) given
  3904. a subset of {<pt>extension</pt>, <pt>restriction</pt>}
  3905.     <olist role="and">
  3906.      <item>
  3907.       <p>If <local>B</local> and <local>D</local> are not the same type definition, then
  3908. the <propref ref="derivation_method"/> of <local>D</local> must not be in the subset.</p>
  3909.      </item>
  3910.      <item>      
  3911.       <p>
  3912.        <olist role="Or">
  3913.         <item>
  3914.       <p><local>B</local> and <local>D</local> must be the same type definition.</p>
  3915.      </item>
  3916.         <item>
  3917.          <p><local>B</local> must be <local>D</local>'s <propref ref="ct-base_type_definition"/>.</p>
  3918.         </item>
  3919.         <item>
  3920.          <p>
  3921.           <olist role="And">
  3922.            <item>
  3923.             <p><local>D</local>'s <propref ref="ct-base_type_definition"/> must not be the
  3924. <termref def="ur-type-itself">ur-type definition</termref>.</p>
  3925.            </item>
  3926.            <item>
  3927.             <p>
  3928.              <olist role="Case">
  3929.               <item>
  3930.                <p role="if"><local>D</local>'s <propref ref="ct-base_type_definition"/> is complex</p>
  3931.                <p role="then">it must be validly derived
  3932. from <local>B</local> given the subset as defined by this constraint.</p>
  3933.               </item>
  3934.               <item>
  3935.                <p role="if"><local>D</local>'s <propref ref="ct-base_type_definition"/> is simple</p>
  3936.                <p role="then">it must be validly derived
  3937. from <local>B</local> given the subset as defined in <specref ref="cos-st-derived-ok"/>.</p>
  3938.               </item>
  3939.              </olist>
  3940.             </p>
  3941.            </item>
  3942.           </olist>
  3943.          </p>
  3944.         </item>
  3945.        </olist>
  3946.       </p>
  3947.      </item>
  3948.     </olist>
  3949.    </p>
  3950.   </constraintnote>
  3951.   <note>
  3952.    <p>This constraint is used to check that when someone uses a type in a
  3953. context where another type was expected (either via <code>xsi:type</code> or
  3954. substitution groups), that the type used is actually derived from the expected
  3955. type, and that that derivation does not involve a form of derivation which was
  3956. ruled out by the expected type.</p>
  3957.   </note>
  3958.  </div3>
  3959.     <div3>
  3960.      <head>Built-in Complex Type Definition</head>
  3961.     <p>There is a complex type definition nearly equivalent to the <termref def="key-urType">ur-type definition</termref> present in every
  3962. schema by definition.  It has the following properties:</p>
  3963.     <schemaComp id="ur-type-itself">
  3964.      <head>Complex Type Definition of the Ur-Type</head>
  3965.      <pvlist>
  3966.       <pvpair ref="ct-name">anyType</pvpair>
  3967.       <pvpair ref="ct-target_namespace">http://www.w3.org/2001/XMLSchema</pvpair>
  3968.       <pvpair ref="ct-base_type_definition">Itself</pvpair>
  3969.       <pvpair ref="derivation_method"><pt>restriction</pt></pvpair>
  3970.       <pvpair ref="content_type">A pair consisting of <pt>mixed</pt> and a
  3971. particle with the following properties: 
  3972.        <pvlist>
  3973.         <pvpair ref="p-min_occurs">1</pvpair>
  3974.         <pvpair ref="p-max_occurs">1</pvpair>
  3975.         <pvpair ref="term">a model group with
  3976. the following properties:
  3977.          <pvlist>
  3978.           <pvpair ref="compositor"><pt>sequence</pt></pvpair>
  3979.           <pvpair ref="particles">
  3980.            a list containing one particle with the following properties:
  3981.            <pvlist>
  3982.             <pvpair ref="p-min_occurs">0</pvpair>
  3983.             <pvpair ref="p-max_occurs"><pt>unbounded</pt></pvpair>
  3984.             <pvpair ref="term">a wildcard with an <pt>any</pt>
  3985. <propref ref="namespace_constraint"/></pvpair>
  3986.            </pvlist>
  3987.            </pvpair>
  3988.          </pvlist>
  3989.         </pvpair>
  3990.        </pvlist>
  3991.       </pvpair>
  3992.       <pvpair ref="ct-attribute_declarations">The empty set</pvpair>
  3993.         <pvpair ref="ct-attribute_wildcard">
  3994.         <propref ref="namespace_constraint"/> is <pt>any</pt></pvpair>
  3995.         <pvpair ref="ct-final">The empty set</pvpair>
  3996.         <pvpair ref="ct-exact">The empty set</pvpair>
  3997.         <pvpair ref="ct-abstract"><pt>false</pt></pvpair>
  3998.      </pvlist>
  3999.     </schemaComp>
  4000.     <p>The <code>mixed</code> content specification together with the
  4001. unconstrained wildcard content model and attribute specification produce the defining property for the
  4002. <termref def="key-urType">ur-type definition</termref>, namely that <emph>every</emph> complex type
  4003. definition is (eventually) a restriction
  4004. of the <termref def="key-urType">ur-type definition</termref>: its permissions and requirements are
  4005. the least restrictive possible.</p>
  4006.      <note><p>This specification does not provide an inventory of built-in complex
  4007. type definitions for use in user schemas.  A preliminary library of complex type
  4008. definitions is available which includes both mathematical (e.g.
  4009. <code>rational</code>) and utility (e.g. <code>array</code>) type definitions. 
  4010. In particular, there is a <code>text</code> type definition which is recommended for use
  4011. as the type definition in element declarations intended for general text
  4012. content, as it makes sensible provision for various aspects of
  4013. internationalization.  For more details, see the schema document for the type
  4014. library at its namespace name: <loc href="http://www.w3.org/2001/03/XMLSchema/TypeLibrary.xsd">http://www.w3.org/2001/03/XMLSchema/TypeLibrary.xsd</loc>.</p></note>
  4015.     </div3>
  4016.    </div2>
  4017.    <div2 id="cAttributeUse">
  4018.     <head>AttributeUses</head>
  4019.     <p>An attribute use is a utility component which controls the occurrence and
  4020. defaulting behavior of attribute declarations.  It plays the same role for
  4021. attribute declarations in complex types that particles play for element declarations.</p>
  4022.     <note role="example">
  4023.      <eg xml:space="preserve"><![CDATA[<xs:complexType>
  4024.  . . .
  4025.  <xs:attribute ref="xml:lang" use="required"/>
  4026.  <xs:attribute ref="xml:space" default="preserve"/>
  4027.  <xs:attribute name="version" type="xs:number" fixed="1.0"/>
  4028. </xs:complexType>]]>
  4029.      </eg>
  4030.      <p>XML representations which all involve attribute uses, illustrating some of
  4031. the possibilities for controlling occurrence.</p>
  4032.     </note>
  4033.     <div3 id="AU_details">
  4034.      <head>The Attribute Use Schema Component</head>
  4035. <p>The attribute use schema component has the following properties:</p>
  4036.  
  4037.   <compdef name="Attribute Use" ref="Attribute_Use">
  4038.    <proplist>
  4039.     <propdef id="required" name="required">A boolean.</propdef>
  4040.     <propdef id="attribute" name="attribute declaration">An attribute declaration.</propdef>
  4041.     <propdef id="au-value_constraint" name="value constraint">Optional.  A pair
  4042. consisting of a value and one of <pt>default</pt>, <pt>fixed</pt>.</propdef>   </proplist>
  4043.  
  4044.   </compdef>
  4045.      <p><propref ref="required"/> determines whether this use of an attribute
  4046. declaration requires an appropriate attribute information item to be present, or
  4047. merely allows it.</p>
  4048.      <p><propref ref="attribute"/> provides the attribute declaration itself,
  4049. which will in turn determine the simple type definition used.</p>
  4050.      <p><propref ref="au-value_constraint"/> allows for local specification of a
  4051. default or fixed value.  This must be consistent with that of the <propref ref="attribute"/>, in that if the <propref ref="attribute"/> specifies a fixed value, the only allowed <propref ref="au-value_constraint"/> is the same fixed value.</p>
  4052.     </div3>
  4053.     <div3>
  4054.      <head>XML Representation of Attribute Use Components</head>
  4055.      <p>Attribute uses correspond to all uses of <eltref ref="attribute"/> which
  4056. allow a <code>use</code> attribute.  These in turn correspond to
  4057. <emph>two</emph> components in each case, an attribute use and its <propref ref="attribute"/> (although note the latter is not new when the attribute use is a reference to a top-level attribute declaration).  The appropriate mapping is described in <specref ref="declare-attribute"/>.</p>
  4058.     </div3>
  4059.     <div3>
  4060.      <head>Constraints on XML Representations of Attribute Uses</head>
  4061.      <p>None as such.</p>
  4062.     </div3>
  4063.     <div3>
  4064.      <head>Attribute Use Validation Rules</head>
  4065. <constraintnote type="cvc" id="cvc-au">
  4066.  <head>Attribute Locally Valid (Use)</head>
  4067.  <p>For an attribute information item to be<termref def="key-vn">valid</termref> with respect to an attribute use its &i-value;  must match the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-canonical-representation">canonical lexical representation</xtermref> of the attribute use's <propref ref="au-value_constraint"/> value, if it is present and 
  4068.   <pt>fixed</pt>.</p>
  4069. </constraintnote>
  4070.     </div3>
  4071.     <div3>
  4072.      <head>Attribute Use Information Set Contributions</head>
  4073.      <p>None as such.</p>
  4074.     </div3>
  4075.     <div3 id="coss-attruse">
  4076.      <head>Constraints on Attribute Use Schema Components</head>
  4077.   <p>All attribute uses (see <specref ref="cAttributeUse"/>) must satisfy the following constraints.</p>
  4078.   <constraintnote type="cos" id="au-props-correct">
  4079.    <head>Attribute Use Correct</head>
  4080.    <olist role="And">
  4081.     <item>
  4082.    <p>The values of the properties of an attribute use must be as described in
  4083. the property tableau in
  4084. <specref ref="AU_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  4085.     </item>
  4086.     <item>
  4087.      <p>If the <propref ref="attribute"/> has a <pt>fixed</pt> <propref ref="a-value_constraint"/>, then if the attribute use itself has a <propref ref="au-value_constraint"/>, it must also be <pt>fixed</pt> and its value must match that of the <propref ref="attribute"/>'s <propref ref="a-value_constraint"/>.</p>
  4088.     </item>
  4089.    </olist>
  4090.   </constraintnote> 
  4091.     </div3>
  4092.    </div2>
  4093.    <div2 id="cAttribute_Group_Definitions">
  4094.     <head>Attribute Group Definitions</head>
  4095. <p>A schema can name a group of attribute declarations so that they may be incorporated as a
  4096. group into complex type definitions.</p>
  4097. <p>
  4098. Attribute group definitions do not participate in <termref def="key-vn">validation</termref> as such, but the
  4099. <propref ref="ct-attribute_declarations"/> and <propref ref="ct-attribute_wildcard"/> of one or
  4100. more complex type definitions may be constructed in whole or part by reference
  4101. to an attribute group.  Thus, attribute group definitions provide a
  4102. replacement for some uses of XML's
  4103. <xspecref href="http://www.w3.org/TR/REC-xml#dt-PE">parameter entity</xspecref> facility.
  4104. Attribute group definitions are provided primarily for reference from the XML
  4105. representation of schema components
  4106. (see <eltref ref="complexType"/> and <eltref ref="attributeGroup" inside="simpleContent"/>).
  4107. </p>
  4108.     <note role="example">
  4109. <eg xml:space="preserve"><xs:attributeGroup name="myAttrGroup">
  4110.     <xs:attribute . . ./>
  4111.     . . .
  4112. </xs:attributeGroup>
  4113.  
  4114. <xs:complexType name="myelement">
  4115.     . . .
  4116.     <xs:attributeGroup ref="myAttrGroup"/>
  4117. </xs:complexType>
  4118. </eg>
  4119. <p>XML representations for attribute group definitions. The effect is as if the attribute
  4120. declarations in the group were present in the type definition.</p>
  4121. </note>
  4122.     <div3 id="Attribute_Group_Definition_details">
  4123.      <head>The Attribute Group Definition Schema Component</head>
  4124.     <p>The attribute group definition schema component has the
  4125. following properties:</p>
  4126.  
  4127.   <compdef name="Attribute Group Definition" ref="Attribute_Group_Definition">
  4128.    <proplist>
  4129.   <propdef id="ag-name" name="name">
  4130.     An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
  4131.    </propdef>
  4132.   <propdef id="ag-target_namespace" name="target namespace">
  4133.     Either <termref def="key-null">absent</termref> or a namespace name, as defined in <bibref ref="ref-xml-namespaces"/>.
  4134.    </propdef>
  4135.   <propdef id="ag-attribute_declarations" name="attribute uses">
  4136.     A set of attribute uses.
  4137.    </propdef>
  4138.   <propdef id="ag-attribute_wildcard" name="attribute wildcard">
  4139.     Optional.  A wildcard.
  4140.    </propdef>
  4141.     <propdef id="ag-annotation" name="annotation">Optional.  An annotation.</propdef>
  4142. </proplist>
  4143.  
  4144.   </compdef>
  4145.  
  4146.   <p>Attribute groups are identified by their <propref ref="ag-name"/> and <propref ref="ag-target_namespace"/>; attribute group identities must be unique within an <termref def="key-schema">XML Schema</termref>.  See <specref ref="composition-schemaImport"/> for the use of component
  4147. identifiers when importing one schema into another.</p>
  4148. <p><propref ref="ag-attribute_declarations"/> is a set attribute uses, allowing
  4149. for local specification of occurrence and default or fixed values.</p>
  4150. <p><propref ref="ag-attribute_wildcard"/> provides for an attribute wildcard to be included in an
  4151. attribute group.
  4152. See above under <specref ref="Complex_Type_Definitions"/> for the
  4153. interpretation of
  4154. attribute wildcards during <termref def="key-vn">validation</termref>.</p>
  4155.      <p>See <specref ref="cAnnotations"/> for information on the role of the
  4156. <propref ref="ag-annotation"/> property.</p>
  4157.     </div3>
  4158.     <div3 id="declare-attributeGroup">
  4159. <head>XML Representation of Attribute Group Definition Schema Components</head>
  4160. <p>The XML representation for an attribute group definition schema component is an
  4161. <eltref ref="attributeGroup"/> element information item.  It provides for
  4162. naming a group of attribute declarations and an attribute wildcard for use by reference in the XML representation of
  4163. complex type definitions and other attribute group definitions.  The correspondences between the
  4164. properties of the information item and
  4165. properties of the component it corresponds to are as follows:</p>
  4166.  
  4167.  <reprdef>
  4168.  <reprelt eltname="attributeGroup" type="attributeGroup"/>
  4169.   <p>When an <eltref ref="attributeGroup"/> appears as a daughter of
  4170. <eltref ref="schema"/> or <eltref ref="redefine"/>, it corresponds to an attribute group definition as
  4171. below.  When it appears as a daughter of <eltref ref="complexType"/> or <eltref ref="attributeGroup"/>, it does not correspond to any component as such.</p>
  4172.  <reprcomp abstract="Attribute Group Definition" ref="Attribute_Group_Definition_details">
  4173.   <propmap name="ag-name">The &v-value; of the <code>name</code> &i-attribute;</propmap>
  4174.   <propmap name="ag-target_namespace">The &v-value; of the
  4175. <code>targetNamespace</code> &i-attribute; of the parent <code>schema</code>
  4176. element information item.</propmap>
  4177.   <propmap name="ag-attribute_declarations">The union of the set of attribute uses corresponding to the <eltref ref="attribute"/> &i-children;, if any, with the <propref ref="ag-attribute_declarations"/> of the
  4178. attribute groups <termref def="src-resolve">resolved</termref> to by the &v-value;s of the <code>ref</code>
  4179. &i-attribute; of the <eltref ref="attributeGroup" inside="simpleContent"/> &i-children;, if any.</propmap>
  4180. <propmap name="ag-attribute_wildcard">As for the <termref def="key-eaw">complete wildcard</termref> as described in <specref ref="declare-type"/>.</propmap>
  4181. <propmap name="ag-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
  4182. &i-children;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  4183. </reprcomp></reprdef>
  4184.  <p>The example above illustrates a pattern which
  4185. recurs in the XML representation of schemas:  The same element, in this case <code>attributeGroup</code>, serves both to
  4186. define and to incorporate by reference.  In the first case the
  4187. <code>name</code> attribute is required, in the second the <code>ref</code>
  4188. attribute is required, and the element must be empty.  These two are mutually exclusive, and also conditioned
  4189. by context:  the defining form, with a <code>name</code>, must occur at the top
  4190. level of a schema, whereas the referring form, with a <code>ref</code>, must
  4191. occur within a complex type definition or an attribute group definition.</p>
  4192.  </div3>
  4193.     <div3>
  4194.      <head>Constraints on XML Representations of Attribute Group Definitions</head>
  4195. <constraintnote id="src-attribute_group" type="src">
  4196.   <head>Attribute Group Definition Representation OK</head>
  4197.   <p>In addition to the conditions imposed on <eltref ref="attributeGroup"/> element
  4198. information items by the schema for schemas,
  4199.    <olist role="and">
  4200.     <item>
  4201.      <p>The corresponding attribute group definition, if any, must satisfy the conditions set
  4202. out in <specref ref="coss-attrGroup"/>.</p>
  4203.     </item>
  4204.     <item>
  4205.      <p>If <clauseref ref="c-awi1"/> or <clauseref ref="c-awi2"/> in the correspondence specification in <specref ref="declare-type"/> for <propref ref="ct-attribute_wildcard"/>, as referenced above, is satisfied, the intensional intersection must be expressible, as defined in <specref ref="cos-aw-intersect"/>.</p>
  4206.     </item>
  4207.      <item>
  4208.       <p>Circular group reference is disallowed outside <eltref ref="redefine"/>.  That is, unless this element information item's parent is <eltref ref="redefine"/>, then among the
  4209. &i-children;, if any, there must not be an <eltref ref="attributeGroup" inside="simpleContent"/> with <code>ref</code> &i-attribute; which resolves to the component corresponding to this <eltref ref="attributeGroup"/>.</p>
  4210.      </item>
  4211.    </olist>
  4212.   </p>
  4213.  </constraintnote>
  4214.     </div3>
  4215.     <div3>
  4216.      <head>Attribute Group Definition Validation Rules</head>
  4217.      <p>None as such.</p>
  4218.     </div3>
  4219.     <div3>
  4220.      <head>Attribute Group Definition Information Set
  4221. Contributions</head>
  4222.      <p>None as such.</p>
  4223.     </div3>
  4224.     <div3 id="coss-attrGroup">
  4225.      <head>Constraints on Attribute Group Definition Schema Components</head>
  4226. <p>All attribute group definitions (see <specref ref="cAttribute_Group_Definitions"/>) must satisfy the following constraint.</p>
  4227.   <constraintnote type="cos" id="ag-props-correct">
  4228.    <head>Attribute Group Definition Properties Correct</head>
  4229.    <olist role="And">
  4230.     <item>
  4231.      <p>The values of the properties of an attribute group definition must be as described in
  4232. the property tableau in
  4233. <specref ref="Attribute_Group_Definition_details"/>, modulo the impact of <specref ref="conformance-missing"/>;</p>
  4234.     </item>
  4235.     <item>
  4236.      <p>Two distinct members of the <propref ref="ag-attribute_declarations"/>
  4237. must not have <propref ref="attribute"/>s both of whose <propref ref="a-name"/>s
  4238. match and whose <propref ref="a-target_namespace"/>s are identical.</p>
  4239.     </item>
  4240.     <item>
  4241.      <p>Two distinct members of the <propref ref="ag-attribute_declarations"/>
  4242. must not have <propref ref="attribute"/>s both of whose <propref ref="a-simple_type_definition"/>s are or are derived from <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref>.</p>
  4243.     </item>
  4244.    </olist>
  4245.   </constraintnote>
  4246.     </div3>
  4247.    </div2>
  4248.    <div2 id="cModel_Group_Definitions">
  4249.     <head>Model Group Definitions</head>
  4250. <p>A model group definition associates a name and optional annotations with a <specref ref="Model_Group"/>.
  4251. By reference to the name, the entire model group can be incorporated by reference into a <propref ref="term"/>.</p>
  4252. <p>
  4253. Model group definitions are provided
  4254. primarily for reference from the <specref ref="declare-type"/> (see <eltref ref="complexType"/>
  4255. and <eltref ref="group"/>).  Thus, model group definitions provide a
  4256. replacement for some uses of XML's
  4257. <xspecref href="http://www.w3.org/TR/REC-xml#dt-PE">parameter entity</xspecref> facility.
  4258. </p>
  4259.     <note role="example">
  4260. <eg xml:space="preserve"><xs:group name="myModelGroup">
  4261.  <xs:sequence>
  4262.   <xs:element ref="someThing"/>
  4263.   . . .
  4264.  </xs:sequence>
  4265. </xs:group>
  4266.  
  4267. <xs:complexType name="trivial">
  4268.  <xs:group ref="myModelGroup"/>
  4269.  <xs:attribute .../>
  4270. </xs:complexType>
  4271.  
  4272. <xs:complexType name="moreSo">
  4273.  <xs:choice>
  4274.   <xs:element ref="anotherThing"/>
  4275.   <xs:group ref="myModelGroup"/>
  4276.  </xs:choice>
  4277.  <xs:attribute .../>
  4278. </xs:complexType></eg>
  4279. <p>A minimal model group is defined and used by reference, first as the whole
  4280. content model, then as one alternative in a choice. </p>
  4281. </note>
  4282.     <div3 id="Model_Group_Definition_details">
  4283.      <head>The Model Group Definition Schema Component</head>
  4284.     <p>The model group definition schema component has the following
  4285. properties:</p>
  4286.  
  4287.   <compdef name="Model Group Definition" ref="Model_Group_Definition">
  4288.  
  4289.    <proplist>
  4290.   <propdef id="mg-name" name="name">
  4291.     An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
  4292.    </propdef>
  4293.   <propdef id="mg-target_namespace" name="target namespace">
  4294.     Either <termref def="key-null">absent</termref> or a namespace name, as defined in <bibref ref="ref-xml-namespaces"/>.
  4295.    </propdef>
  4296.   <propdef id="model_group" name="model group">
  4297.     A model group.
  4298.    </propdef>
  4299.     <propdef id="mg-annotation" name="annotation">Optional.  An annotation.</propdef>
  4300. </proplist>
  4301.   </compdef>
  4302. <p>Model group definitions are identified by their <propref ref="mg-name"/> and <propref ref="mg-target_namespace"/>; model group identities must be unique within an <termref def="key-schema">XML Schema</termref>.  See <specref ref="composition-schemaImport"/> for the use of component
  4303. identifiers when importing one schema into another.</p>
  4304. <p>Model group definitions <emph>per se</emph> do not participate in <termref def="key-vn">validation</termref>, but the <propref ref="term"/> of
  4305. a particle may correspond in whole or in part
  4306. to a model group from a model group definition.</p>
  4307. <p><propref ref="model_group"/> is the <specref ref="Model_Group"/> for which the model group definition provides a name.</p>
  4308. <p>See <specref ref="cAnnotations"/> for information on the role of the
  4309. <propref ref="mg-annotation"/> property.</p>
  4310.     </div3>
  4311. <div3 id="declare-namedModelGroup">
  4312. <head>XML Representation of Model Group Definition Schema Components</head>
  4313.  <p>The XML representation for a model group definition schema component is a
  4314. <eltref ref="group"/> element information item.  It provides for
  4315. naming a model group for use by reference in the XML representation of
  4316. complex type definitions and model groups.  The correspondences between the
  4317. properties of the information item and
  4318. properties of the component it corresponds to are as follows:</p>
  4319. <reprdef>
  4320.  <reprelt eltname="group" type="namedGroup"/> 
  4321.  <p>If there is a <code>name</code> &i-attribute; (in which case the
  4322. item will have <eltref ref="schema"/> or <eltref ref="redefine"/> as parent), then the item corresponds to
  4323. a model group definition component with properties as follows:</p>
  4324.  <reprcomp abstract="Model Group Definition" ref="Model_Group_Definition_details">
  4325. <propmap name="mg-name">The &v-value; of the
  4326. <code>name</code> &i-attribute;</propmap>
  4327.  
  4328.   <propmap name="mg-target_namespace">The &v-value; of the
  4329. <code>targetNamespace</code> &i-attribute; of the parent <code>schema</code>
  4330. element information item.</propmap>
  4331. <propmap name="model_group">A model group which is the <propref ref="term"/> of a
  4332. particle corresponding to the <eltref ref="all"/>, <eltref ref="choice"/> or
  4333. <eltref ref="sequence"/> among the &i-children; (there must be one).</propmap>
  4334. <propmap name="mg-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
  4335. &i-children;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  4336. </reprcomp>
  4337.  <p>Otherwise, the item will have a <code>ref</code> &i-attribute;,
  4338. in which case it corresponds to a particle component with properties as follows (unless <code>minOccurs=maxOccurs=0</code>, in which case the item
  4339. corresponds to no component at all):</p>
  4340.  <reprcomp abstract="Particle" ref="Particle">
  4341.   <propmap name="p-min_occurs">The &v-value; of the <code>minOccurs</code>
  4342. &i-attribute;, if present, otherwise <code>1</code>.</propmap>
  4343.   <propmap name="p-max_occurs"><pt>unbounded</pt>, if the <code>maxOccurs</code>
  4344. &i-attribute; equals <pt>unbounded</pt>, otherwise the &v-value; of the <code>maxOccurs</code>
  4345. &i-attribute;, if present, otherwise <code>1</code>.</propmap>
  4346.   <propmap name="term">The <propref ref="model_group"/> of the
  4347. model group definition <termref def="src-resolve">resolved</termref> to by the &v-value; of the <code>ref</code> &i-attribute;</propmap>
  4348.   </reprcomp>
  4349. </reprdef>
  4350.  <p>The name of this section is slightly misleading, in that the second, un-named,
  4351. case above (with a
  4352. <code>ref</code> and no <code>name</code>) is not really a named model
  4353. group at all, but a reference to one.  Also note that in the first (named)
  4354. case above no reference is made to <code>minOccurs</code> or
  4355. <code>maxOccurs</code>: this is because the schema for schemas does not allow
  4356. them on the child of <eltref ref="group"/> when it is named.  This in turn is
  4357. because the <propref ref="p-min_occurs"/> and <propref ref="p-max_occurs"/> of
  4358. the particles which <emph>refer</emph> to the definition are what count.</p>
  4359.  <p>Given the constraints on its appearance in content models, an
  4360. <eltref ref="all"/> should only occur as the only item in the
  4361. &i-children; of a named model group definition or a content model: see <specref ref="coss-modelGroup"/>.</p>
  4362. </div3>
  4363.     <div3>
  4364.      <head>Constraints on XML Representations of Model Group Definitions</head>
  4365. <constraintnote id="src-model_group_defn" type="src">
  4366.   <head>Model Group Definition Representation OK</head>
  4367.   <p>In addition to the conditions imposed on <eltref ref="group"/> element
  4368. information items by the schema for schemas, the corresponding model group definition, if any, must satisfy the conditions set
  4369. out in <specref ref="coss-modelGroup"/>.
  4370.   </p>
  4371.  </constraintnote>
  4372.     </div3>
  4373.     <div3>
  4374.      <head>Model Group Definition Validation Rules</head>
  4375.      <p>None as such.</p>
  4376.     </div3>
  4377.     <div3>
  4378.      <head>Model Group Definition Information Set Contributions</head>
  4379.      <p>None as such.</p>
  4380.     </div3>
  4381.     <div3 id="coss-groupDef">
  4382.      <head>Constraints on Model Group Definition Schema Components</head>
  4383.   <p>All model group definitions (see <specref ref="cModel_Group_Definitions"/>) must satisfy the following constraint.</p>
  4384.   <constraintnote type="cos" id="mgd-props-correct">
  4385.    <head>Model Group Definition Properties Correct</head>
  4386.    <p>The values of the properties of a model group definition must be as described in
  4387. the property tableau in
  4388. <specref ref="Model_Group_Definition_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  4389.   </constraintnote>
  4390.  
  4391.     </div3>
  4392.    </div2>
  4393.    <div2 id="Model_Groups">
  4394.     <head>Model Groups</head>
  4395.     <p>When the &i-children; of element information items are not constrained
  4396. to be <pt>empty</pt> or by reference to a simple type definition
  4397. (<specref ref="Simple_Type_Definitions"/>), the sequence of element
  4398. information item &i-children; content may be specified in
  4399. more detail with a model group.  Because the <propref ref="term"/> property of a particle can be a
  4400. model group, and model groups contain particles, model groups can indirectly contain other model groups; the grammar for content models
  4401. is therefore recursive.</p>
  4402.     <note role="example">
  4403. <eg xml:space="preserve"><![CDATA[<xs:all>
  4404.  <xs:element ref="cats"/>
  4405.  <xs:element ref="dogs"/>
  4406. </xs:all>
  4407.  
  4408. <xs:sequence>
  4409.  <xs:choice>
  4410.   <xs:element ref="left"/>
  4411.   <xs:element ref="right"/>
  4412.  </xs:choice>
  4413.  <xs:element ref="landmark"/>
  4414. </xs:sequence>
  4415. ]]></eg>
  4416. <p>XML representations for the three kinds of model group, the third nested
  4417. inside the second.</p>
  4418. </note>
  4419.     <div3 id="Model_Group_details">
  4420.      <head>The Model Group Schema Component</head>
  4421.     <p>The model group schema component has the following
  4422. properties:</p>
  4423.  
  4424.   <compdef name="Model Group" ref="Model_Group">
  4425.    <proplist>
  4426.   <propdef id="compositor" name="compositor">
  4427.     One of <pt>all</pt>, <pt>choice</pt> or <pt>sequence</pt>.
  4428.    </propdef>
  4429.   <propdef id="particles" name="particles">
  4430.     A list of particles
  4431.    </propdef>
  4432.     <propdef id="amg-annotation" name="annotation">Optional.  An annotation.</propdef>
  4433. </proplist>
  4434.   </compdef>
  4435. <p>specifies a sequential (<pt>sequence</pt>),
  4436. disjunctive (<pt>choice</pt>) or conjunctive (<pt>all</pt>) interpretation of
  4437. the <propref ref="particles"/>.  This in turn 
  4438. determines whether the element
  4439. information item &i-children; <termref def="key-vn">validated</termref> by the model group must:
  4440. <ulist>
  4441. <item><p>(<pt>sequence</pt>) correspond, in order, to the specified <propref ref="particles"/>;</p>
  4442. </item>
  4443. <item><p>(<pt>choice</pt>) corresponded to exactly one of the specified <propref ref="particles"/>;</p>
  4444. </item>
  4445. <item><p>(<pt>all</pt>) contain all and only exactly zero or one of each
  4446. element specified in <propref ref="particles"/>.  The elements can occur in any
  4447. order.  In this case, to reduce implementation complexity, <propref ref="particles"/> is restricted to contain local and top-level element
  4448. declarations only, with <propref ref="p-min_occurs"/><code>=0</code> or
  4449. <code>1</code>, <propref ref="p-max_occurs"/><code>=1</code>.</p>
  4450. </item>
  4451. </ulist></p>
  4452.     <p>When two or more particles contained directly or indirectly in the
  4453. <propref ref="particles"/> of a model group have identically named
  4454. element declarations as their 
  4455. <propref ref="term"/>, the type definitions of those declarations must be the
  4456. same.  By 'indirectly' is meant particles within the <propref ref="particles"/>
  4457. of a group which is itself the <propref ref="term"/> of a directly contained
  4458. particle, and so on recursively.</p>
  4459. <p>See <specref ref="cAnnotations"/> for information on the role of the
  4460. <propref ref="amg-annotation"/> property.</p>
  4461.     </div3>
  4462. <div3 id="declare-contentModel">
  4463. <head>XML Representation of Model Group Schema Components</head>
  4464. <p>The XML representation for a model group schema component is
  4465. either an
  4466. <eltref ref="all"/>, a <eltref ref="choice"/> or a <eltref ref="sequence"/>
  4467. element information item.    The correspondences between the
  4468. properties of those information items and
  4469. properties of the component they correspond to are as follows:</p>
  4470. <reprdef>
  4471.  <reprelt eltname="all"/>
  4472.  <reprelt eltname="choice"/>
  4473.  <reprelt eltname="sequence"/>  
  4474.  <p>Each of the above items corresponds to a particle containing a model
  4475. group, with properties as follows (unless <code>minOccurs=maxOccurs=0</code>, in which case the item
  4476. corresponds to no component at all):</p>
  4477.  <reprcomp abstract="Particle" ref="Particle_details">
  4478. <propmap name="p-min_occurs">The &v-value; of the <code>minOccurs</code>
  4479. &i-attribute;, if present, otherwise <code>1</code>.</propmap>
  4480.   <propmap name="p-max_occurs"><pt>unbounded</pt>, if the <code>maxOccurs</code>
  4481. &i-attribute; equals <pt>unbounded</pt>, otherwise the &v-value; of the <code>maxOccurs</code>
  4482. &i-attribute;, if present, otherwise <code>1</code>.</propmap>
  4483. <propmap name="term">A model group as given below:</propmap>
  4484. </reprcomp><reprcomp abstract="Model Group" ref="Model_Group_details">
  4485. <propmap name="compositor">One of <pt>all</pt>, <pt>choice</pt>,
  4486. <pt>sequence</pt> depending on the element information item.</propmap>
  4487. <propmap name="particles">A sequence of particles
  4488. corresponding to all the <eltref ref="all"/>, <eltref ref="choice"/>,
  4489. <eltref ref="sequence"/>, <eltref ref="any"/>,
  4490. <eltref ref="group"/> or <eltref ref="element"/> items among the &i-children;,
  4491. in order.</propmap>
  4492. <propmap name="amg-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
  4493. &i-children;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  4494. </reprcomp>
  4495. </reprdef>
  4496. </div3>
  4497.     <div3>
  4498.      <head>Constraints on XML Representations of Model Groups</head>
  4499.   <constraintnote type="src" id="src-model_group">
  4500.    <head>Model Group Representation OK</head>
  4501.    <p>In addition to the conditions imposed on <eltref ref="all"/>, <eltref ref="choice"/> and <eltref ref="sequence"/> element
  4502. information items by the schema for schemas, the corresponding particle and model group must satisfy the conditions set
  4503. out in <specref ref="coss-modelGroup"/> and <specref ref="coss-particle"/>.   
  4504.    </p>
  4505.   </constraintnote>
  4506.     </div3>
  4507.     <div3>
  4508.      <head>Model Group Validation Rules</head>
  4509. <constraintnote type="cvc" id="cvc-model-group">
  4510.  <head>Element Sequence Valid</head>
  4511.  <p><termdef id="key-partition" term="partition">Define a
  4512. <term>partition</term> of a sequence as a sequence of sub-sequences, some or
  4513. all of which may be empty, such that concatenating all the sub-sequences yields
  4514. the original sequence</termdef>.</p>
  4515.  <p>For a sequence (possibly empty) of element information items to be
  4516. locally <termref def="key-vn">valid</termref> with respect to
  4517. a model group
  4518.   <olist role="case">
  4519.    <item>
  4520.     <p role="if">the <propref ref="compositor"/> is <pt>sequence</pt></p>
  4521.     <p role="then">there must be a
  4522. <termref def="key-partition">partition</termref> of the sequence into <code>n</code> sub-sequences where <code>n</code> is the length of <propref ref="particles"/> such that each of the sub-sequences in order is <termref def="key-vn">valid</termref>
  4523. with respect to the corresponding particle in the <propref ref="particles"/> as defined in <specref ref="cvc-particle"/>.</p>
  4524.    </item>
  4525.    <item>
  4526.     <p role="if">the <propref ref="compositor"/> is <pt>choice</pt></p>
  4527.     <p role="then">there must be a
  4528. particle among the <propref ref="particles"/> such that the sequence is
  4529. <termref def="key-vn">valid</termref> with respect to that particle as defined in <specref ref="cvc-particle"/>.</p>
  4530.    </item>
  4531.    <item>
  4532.     <p role="if">the <propref ref="compositor"/> is <pt>all</pt></p>
  4533.     <p role="then">there must be a
  4534. <termref def="key-partition">partition</termref> of the sequence into <code>n</code> sub-sequences where <code>n</code> is the length of <propref ref="particles"/> such that there is a one-to-one mapping between the sub-sequences and the <propref ref="particles"/> where each sub-sequence is <termref def="key-vn">valid</termref> with respect to the corresponding particle as defined in <specref ref="cvc-particle"/>.</p>
  4535.    </item>
  4536.   </olist>
  4537.  </p>
  4538.  <p>Nothing in the above should be understood as ruling out groups whose
  4539. <propref ref="particles"/> is empty:  although no sequence can be <termref def="key-vn">valid</termref>
  4540. with respect to such a group whose <propref ref="compositor"/> is
  4541. <pt>choice</pt>, the empty sequence <emph>is</emph> <termref def="key-vn">valid</termref> with respect
  4542. to empty groups whose <propref ref="compositor"/> is <pt>sequence</pt> or <pt>all</pt>.</p>
  4543. </constraintnote>
  4544.     <note>
  4545.      <p>The above definition is implicitly non-deterministic, and should not be
  4546. taken as a recipé for implementations.  Note in particular that when 
  4547. <propref ref="compositor"/> is <pt>all</pt>, particles is restricted to a list
  4548. of local and top-level element declarations (see <specref ref="coss-modelGroup"/>).   A much simpler implementation is possible than would arise from a literal interpretation of the definition above; informally, the content is <termref def="key-vn">valid</termref> when each declared element occurs exactly once (or at most once, if <propref ref="p-min_occurs"/> is <code>0</code>), and each is <termref def="key-vn">valid</termref> with respect to its corresponding declaration.  The elements can occur in arbitrary order.</p>
  4549.     </note>
  4550.     </div3>
  4551.     <div3>
  4552.      <head>Model Group Information Set Contributions</head>
  4553.      <p>None as such.</p>
  4554.     </div3>
  4555.     <div3 id="coss-modelGroup">
  4556.      <head>Constraints on Model Group Schema Components</head>
  4557.   <p>All model groups (see <specref ref="Model_Groups"/>) must satisfy the following constraints.</p>
  4558.   <constraintnote type="cos" id="mg-props-correct">
  4559.    <head>Model Group Correct</head>
  4560.    <olist role="And">
  4561.     <item><p>The values of the properties of a model group must be as described in
  4562. the property tableau in
  4563. <specref ref="Model_Group_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p></item>
  4564.     <item><p>Circular groups are disallowed.  That is, within the <propref ref="particles"/> of a group there must not be at any
  4565. depth a particle whose <propref ref="term"/> is the
  4566. group itself.</p></item>
  4567.    </olist>   
  4568.   </constraintnote>
  4569.   <constraintnote type="cos" id="cos-all-limited">
  4570.    <head>All Group Limited</head>
  4571.    <p>When a model group has <propref ref="compositor"/> <pt>all</pt>
  4572.     <olist role="and">
  4573.      <item><olist role="or">
  4574.      <item>
  4575.       <p>It appears as the model group of a model group definition.</p>
  4576.      </item>
  4577.      <item>
  4578.       <p>It appears in a particle with <propref ref="p-min_occurs"/>=<propref ref="p-max_occurs"/><code>=1</code>, and that particle
  4579. must be part of a pair which constitutes the <propref ref="content_type"/> of a
  4580. complex type definition.</p>
  4581.      </item>
  4582.     </olist>
  4583.      </item>
  4584.      <item>
  4585. <p>The <propref ref="p-max_occurs"/> of all the particles in the
  4586. <propref ref="particles"/> of the group must be <code>0</code> or <code>1</code>.</p>
  4587. </item>
  4588.     </olist> 
  4589.    </p>
  4590.   </constraintnote>
  4591.   <constraintnote type="cos" id="cos-element-consistent">
  4592.    <head>Element Declarations Consistent</head>
  4593.    <p>If the <propref ref="particles"/> contains, either directly, indirectly
  4594. (that is, within the <propref ref="particles"/> of a contained model group,
  4595. recursively) or <termref def="key-impl-cont">implicitly</termref> two or more
  4596. element declaration particles with the same <propref ref="e-name"/> and
  4597. <propref ref="e-target_namespace"/>, then all their type definitions must be
  4598. the same top-level definition, that is,
  4599.     <olist role="and">
  4600.      <item>
  4601.       <p>all their
  4602. <propref ref="type_definition"/>s must have a non-<termref def="key-null">absent</termref> name.</p>
  4603.      </item>
  4604.      <item>
  4605.       <p>all their
  4606. <propref ref="type_definition"/>s must have the same name.</p>
  4607.      </item>
  4608.      <item>
  4609.       <p>all their
  4610. <propref ref="type_definition"/>s must have the same target namespace.</p>
  4611.      </item>
  4612.     </olist>
  4613.     </p>
  4614.   <p><termdef id="key-impl-cont" term="implicitly contains">A list
  4615. of particles <term>implicitly contains</term> an element declaration if a
  4616. member of the list contains that
  4617. element declaration in its <termref def="key-eq">substitution group</termref></termdef>.</p>
  4618.   </constraintnote>
  4619.   <constraintnote type="cos" id="cos-nonambig">
  4620. <head>Unique Particle Attribution</head>
  4621. <p>A content model must be formed such that
  4622. during <termref def="key-vn">validation</termref> of an element information item sequence, the particle
  4623. contained directly, indirectly or <termref def="key-impl-cont">implicitly</termref> therein with which to attempt to <termref def="key-vn">validate</termref> each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence.</p>   
  4624.    <note>
  4625.     <p>This constraint reconstructs for XML Schema the equivalent constraints of
  4626. <bibref ref="ref-xml"/> and SGML.  Given the presence of element substitution groups and wildcards, the concise expression of this constraint is difficult,
  4627. see <specref ref="non-ambig"/> for further discussion.</p>
  4628.    </note>
  4629. </constraintnote>
  4630.   <note>
  4631.     <p>Because locally-scoped element declarations may or may not have a
  4632. <propref ref="e-target_namespace"/>, the scope of declarations is
  4633. <emph>not</emph> relevant to enforcing either of the two preceding constraints.</p>
  4634.    </note>
  4635.   <p>The following constraints define relations appealed to elsewhere in this specification.</p>
  4636.   <constraintnote type="cos" id="cos-seq-range">
  4637.    <head>Effective Total Range (<pt>all</pt> and <pt>sequence</pt>)</head>
  4638.    <p>The effective total range of a particle whose <propref ref="term"/> is a group whose <propref ref="compositor"/> is
  4639. <pt>all</pt> or <pt>sequence</pt> is a pair of minimum and maximum, as follows: </p>
  4640.    <glist>
  4641.     <gitem>
  4642.      <label>minimum</label>
  4643.      <def>
  4644.       <p>The product of the particle's <propref ref="p-min_occurs"/> and the
  4645. sum of the <propref ref="p-min_occurs"/> of every wildcard or element
  4646. declaration particle in the group's <propref ref="particles"/> and the minimum
  4647. part of the effective total range of each of the group particles in the group's <propref ref="particles"/> (or <code>0</code> if there are no <propref ref="particles"/>).</p>
  4648.      </def>
  4649.     </gitem>
  4650.     <gitem>
  4651.      <label>maximum</label>
  4652.      <def>
  4653.       <p><pt>unbounded</pt> if the <propref ref="p-max_occurs"/> of any wildcard or element
  4654. declaration particle in the group's <propref ref="particles"/> or the maximum
  4655. part of the effective total range of any of the group particles in the group's
  4656. <propref ref="particles"/> is <pt>unbounded</pt>, or if any of those is non-zero
  4657. and the <propref ref="p-max_occurs"/> of the particle itself is <pt>unbounded</pt>,
  4658. otherwise the product of the particle's <propref ref="p-max_occurs"/> and the
  4659. sum of the <propref ref="p-max_occurs"/> of every wildcard or element
  4660. declaration particle in the group's <propref ref="particles"/> and the maximum
  4661. part of the effective total range of each of the group particles in the group's <propref ref="particles"/> (or <code>0</code> if there are no <propref ref="particles"/>).</p>
  4662.      </def>
  4663.     </gitem>
  4664.    </glist>
  4665.   </constraintnote>
  4666.   <constraintnote type="cos" id="cos-choice-range">
  4667.    <head>Effective Total Range (<pt>choice</pt>)</head>
  4668.    <p>The effective total range of a particle whose <propref ref="term"/> is a group whose <propref ref="compositor"/> is
  4669. <pt>choice</pt> is a pair of minimum and maximum, as follows:</p>
  4670.    <glist>
  4671.     <gitem>
  4672.      <label>minimum</label>
  4673.      <def>
  4674.       <p>The product of the particle's <propref ref="p-min_occurs"/> and the
  4675. minimum of the <propref ref="p-min_occurs"/> of every wildcard or element
  4676. declaration particle in the group's <propref ref="particles"/> and the minimum
  4677. part of the effective total range of each of the group particles in the group's <propref ref="particles"/> (or <code>0</code> if there are no <propref ref="particles"/>).</p>
  4678.      </def>
  4679.     </gitem>
  4680.     <gitem>
  4681.      <label>maximum</label>
  4682.      <def>
  4683.       <p><pt>unbounded</pt> if the <propref ref="p-max_occurs"/> of any wildcard or element
  4684. declaration particle in the group's <propref ref="particles"/> or the maximum
  4685. part of the effective total range of any of the group particles in the group's
  4686. <propref ref="particles"/> is <pt>unbounded</pt>, or if any of those is non-zero
  4687. and the <propref ref="p-max_occurs"/> of the particle itself is <pt>unbounded</pt>,
  4688. otherwise the product of the particle's <propref ref="p-max_occurs"/> and the
  4689. maximum of the <propref ref="p-max_occurs"/> of every wildcard or element
  4690. declaration particle in the group's <propref ref="particles"/> and the maximum
  4691. part of the effective total range of each of the group particles in the group's <propref ref="particles"/> (or <code>0</code> if there are no <propref ref="particles"/>).</p>
  4692.      </def>
  4693.     </gitem>
  4694.    </glist>
  4695.   </constraintnote>
  4696.     </div3>
  4697.    </div2>
  4698.    <div2 id="cParticles">
  4699.     <head>Particles</head>
  4700.     <p>As described in <specref ref="Model_Groups"/>, particles contribute to the definition
  4701. of content models.</p>
  4702.     <note role="example">
  4703.      <eg xml:space="preserve"><![CDATA[<xs:element ref="egg" minOccurs="12" maxOccurs="12"/>
  4704.  
  4705. <xs:group ref="omelette" minOccurs="0"/>
  4706.  
  4707. <xs:any maxOccurs="unbounded"/>]]>
  4708.      </eg>
  4709.      <p>XML representations which all involve particles, illustrating some of
  4710. the possibilities for controlling occurrence.</p>
  4711.     </note>
  4712.     <div3 id="Particle_details">
  4713.      <head>The Particle Schema Component</head>
  4714. <p>The particle schema component has the following properties:</p>
  4715.  
  4716.   <compdef name="Particle" ref="Particle">
  4717.    <proplist>
  4718.     <propdef id="p-min_occurs" name="min occurs">A non-negative
  4719. integer.</propdef>
  4720.     <propdef id="p-max_occurs" name="max occurs">Either a non-negative integer
  4721. or <pt>unbounded</pt>.</propdef>
  4722.     <propdef id="term" name="term">One of a model group, a wildcard, or an  element declaration.</propdef>
  4723.    </proplist>
  4724.  
  4725.   </compdef>
  4726. <p>In general, multiple element
  4727. information item &i-children;, possibly with intervening character &i-children; if the content type
  4728. is <pt>mixed</pt>, can be <termref def="key-vn">validated</termref> with
  4729. respect to a single particle.  When the <propref ref="term"/> is an element
  4730. declaration or wildcard, <propref ref="p-min_occurs"/> determines the minimum number of such element &i-children; that can occur.  The number of such children must be greater than or equal to <propref ref="p-min_occurs"/>.  If <propref ref="p-min_occurs"/> is <pt>0</pt>, then occurrence of such children is optional.</p>
  4731. <p>Again, when the <propref ref="term"/> is an element
  4732. declaration or wildcard, the number of such element &i-children; must be less than or equal to any numeric specification of
  4733. <propref ref="p-max_occurs"/>; if <propref ref="p-max_occurs"/> is <pt>unbounded</pt>, then there is no
  4734. upper bound on the number of such children.</p>
  4735.      <p>When the <propref ref="term"/> is a model group, the permitted
  4736. occurrence range is determined by a combination of <propref ref="p-min_occurs"/> and <propref ref="p-max_occurs"/> and the occurrence ranges of the <propref ref="term"/>'s <propref ref="particles"/>.</p>
  4737.     </div3>
  4738.     <div3>
  4739.      <head>XML Representation of Particle Components</head>
  4740.      <p>Particles correspond to all three elements (<eltref ref="element" inside="complexType"/> not immediately within <eltref ref="schema"/>, <eltref ref="group" inside="complexType"/> not immediately within <eltref ref="schema"/> and <eltref ref="any"/>) which allow <code>minOccurs</code> and <code>maxOccurs</code> attributes.  These in turn correspond to
  4741. <emph>two</emph> components in each case, a particle and its <propref ref="term"/>.  The appropriate mapping is described in <specref ref="declare-element"/>, <specref ref="declare-contentModel"/> and <specref ref="declare-openness"/> respectively.</p>
  4742.     </div3>
  4743.     <div3>
  4744.      <head>Constraints on XML Representations of Particles</head>
  4745.      <p>None as such.</p>
  4746.     </div3>
  4747.     <div3>
  4748.      <head>Particle Validation Rules</head>
  4749. <constraintnote type="cvc" id="cvc-particle">
  4750.  <head>Element Sequence Locally Valid (Particle)</head>
  4751.  <p>For a sequence (possibly empty) of element information items to be
  4752. locally <termref def="key-vn">valid</termref>
  4753. with respect to a particle
  4754.  <olist role="case">
  4755.      <item id="c-pw">
  4756.       <p role="if">the <propref ref="term"/> is a wildcard</p>
  4757.       <p role="then">
  4758.        <olist role="and">
  4759.         <item>
  4760.     <p>The length of the sequence must be greater than or equal to the <propref ref="p-min_occurs"/>.</p>
  4761.    </item>
  4762.    <item>
  4763.     <p>If <propref ref="p-max_occurs"/> is a number, the length of the sequence must be less than or equal to the <propref ref="p-max_occurs"/>.</p>
  4764.    </item>
  4765.         <item>
  4766.          <p>Each element
  4767. information item in the sequence must be <termref def="key-vn">valid</termref> with respect to the wildcard as defined by <specref ref="cvc-wildcard"/>.</p>
  4768.         </item>
  4769.        </olist>
  4770.       </p>
  4771.      </item>
  4772.      <item id="c-cdde">
  4773.       <p role="if">the <propref ref="term"/> is an element declaration</p>
  4774.       <p role="then">
  4775.        <olist role="and">
  4776.         <item>
  4777.     <p>The length of the sequence must be greater than or equal to the <propref ref="p-min_occurs"/>.</p>
  4778.    </item>
  4779.    <item>
  4780.     <p>If <propref ref="p-max_occurs"/> is a number, the length of the sequence must be less than or equal to the <propref ref="p-max_occurs"/>.</p>
  4781.    </item>
  4782.         <item>
  4783.          <p>For each element
  4784. information item in the sequence
  4785.         <olist role="or">
  4786.          <item>
  4787.           <p>The element declaration is local (i.e. its
  4788. <propref ref="e-scope"/> must not be <pt>global</pt>), its <propref ref="e-abstract"/> is <pt>false</pt>, the element information
  4789. item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref> is identical to the element declaration's <propref ref="e-target_namespace"/> (where an <termref def="key-null">absent</termref> <propref ref="e-target_namespace"/> is taken to be identical to a <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref> with no value) and the element information
  4790. item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">local
  4791. name</xpropref> matches the element declaration's <propref ref="e-name"/>.</p>
  4792.           <p>In this case the element declaration is the <termref def="key-dd">context-determined declaration</termref> for the element information item with respect to <specref ref="cvc-assess-elt"/> and <specref ref="sic-e-outcome"/>.</p>
  4793.          </item>
  4794.          <item>
  4795.           <p>The element declaration is top-level (i.e. its
  4796. <propref ref="e-scope"/> is <pt>global</pt>), <propref ref="e-abstract"/> is <pt>false</pt>, the element information
  4797. item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref> is identical to the element declaration's <propref ref="e-target_namespace"/> (where an <termref def="key-null">absent</termref> <propref ref="e-target_namespace"/> is taken to be identical to a <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref> with no value) and the element information
  4798. item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">local
  4799. name</xpropref> matches the element declaration's <propref ref="e-name"/>.</p>
  4800.           <p>In this case the element declaration is the <termref def="key-dd">context-determined declaration</termref> for the element information item with respect to <specref ref="cvc-assess-elt"/> and <specref ref="sic-e-outcome"/>.</p>
  4801.          </item>
  4802.          <item id="c-psg">
  4803.           <p>The element declaration is top-level (i.e. its
  4804. <propref ref="e-scope"/> is <pt>global</pt>), its <propref ref="e-exact"/> does not contain <pt>substitution</pt>,
  4805. the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">local
  4806. </xpropref> and <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref> of the element information item resolve to an element declaration, as
  4807. defined in <specref ref="cvc-resolve-instance"/> -- <termdef id="key-eqd" term="head declaration" role="local">call this declaration the <term>substituting declaration</term></termdef> and the <termref def="key-eqd">substituting declaration</termref> together with the particle's element declaration's <propref ref="e-exact"/> is validly substitutable for the particle's element declaration as defined in <specref ref="cos-equiv-derived-ok-rec"/>.</p>
  4808.           <p>In this case the <termref def="key-eqd">substituting declaration</termref> is the <termref def="key-dd">context-determined declaration</termref> for the element information item with respect to <specref ref="cvc-assess-elt"/> and <specref ref="sic-e-outcome"/>.</p>
  4809.          </item>
  4810.         </olist></p>
  4811.         </item>
  4812.        </olist>
  4813.        </p>
  4814.      </item>
  4815.      <item>
  4816.     <p role="if">the <propref ref="term"/> is a model group</p>
  4817.     <p role="then">
  4818.      <olist role="and">
  4819.       <item><p>There is a <termref def="key-partition">partition</termref> of the sequence into <code>n</code> sub-sequences such that <code>n</code> is greater than or equal to <propref ref="p-min_occurs"/>.</p></item>
  4820.       <item><p>If <propref ref="p-max_occurs"/> is a number, <code>n</code>
  4821. must be less than or equal to <propref ref="p-max_occurs"/>.</p></item>
  4822.       <item><p>Each sub-sequence in the <termref def="key-partition">partition</termref> is <termref def="key-vn">valid</termref> with respect to that model group as defined in <specref ref="cvc-model-group"/>.</p></item>
  4823.      </olist>
  4824.     </p>
  4825.    </item>
  4826.     </olist>
  4827.  </p>
  4828.  <note>
  4829.   <p>Clauses <clauseref ref="c-pw"/> and <clauseref ref="c-psg"/> do not
  4830. interact: an element information item validatable by a declaration with a substitution group head in a
  4831. different namespace is <emph>not</emph> validatable by a wildcard which accepts
  4832. the head's namespace but not its own.</p>
  4833.  </note>
  4834. </constraintnote>
  4835.     </div3>
  4836.     <div3>
  4837.      <head>Particle Information Set Contributions</head>
  4838.      <p>None as such.</p>
  4839.     </div3>
  4840.     <div3 id="coss-particle">
  4841.      <head>Constraints on Particle Schema Components</head>
  4842.   <p>All particles (see <specref ref="cParticles"/>) must satisfy the following constraints.</p>
  4843.   <constraintnote type="cos" id="p-props-correct">
  4844.    <head>Particle Correct</head>
  4845.    <olist role="And">
  4846.     <item>
  4847.    <p>The values of the properties of a particle must be as described in
  4848. the property tableau in
  4849. <specref ref="Particle_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  4850.     </item>
  4851.     <item>
  4852.      <p>If <propref ref="p-max_occurs"/> is not <pt>unbounded</pt>, that is, it has a
  4853. numeric value, then
  4854.     <olist role="and">
  4855.      <item>
  4856.      <p><propref ref="p-min_occurs"/> must not be greater than <propref ref="p-max_occurs"/>.</p>
  4857.     </item>
  4858.     <item>
  4859.      <p><propref ref="p-max_occurs"/> must be greater than or equal to 1.</p>
  4860.     </item>
  4861.     </olist>
  4862.    </p>
  4863.     </item>
  4864.    </olist>
  4865.   </constraintnote>
  4866.   <p>The following constraints define relations appealed to elsewhere in this specification.</p>
  4867.   <constraintnote type="cos" id="cos-particle-extend">
  4868.    <head>Particle Valid (Extension)</head>
  4869.    <p><termdef id="cd-model-extension" term="valid extension" role="local">For a particle
  4870. (call it <local>E</local>, for extension) to be a <term>valid extension</term> of
  4871. another particle (call it <local>B</local>, for base)</termdef>
  4872.     <olist role="or">
  4873.      <item>
  4874.       <p>They are the same particle.</p>
  4875.      </item>
  4876.      <item>
  4877.       <p><local>E</local>'s <propref ref="p-min_occurs"/>=<propref ref="p-max_occurs"/><code>=1</code> and its <propref ref="term"/> is a <pt>sequence</pt> group whose <propref ref="particles"/>' first member is a particle all of whose properties, recursively, are identical to those of <local>B</local>, with the exception of <xpropref role="anon">annotation</xpropref> properties.</p>
  4878.      </item>
  4879.     </olist>
  4880.    </p>
  4881.   </constraintnote>
  4882.    <p>The approach to defining a type by restricting another type definition
  4883. set out here is designed to ensure that types defined in this way are
  4884. guaranteed to be a subset of the type they restrict.  This is accomplished by
  4885. requiring a clear mapping between the components of the base type definition and the
  4886. restricting type definition.  Permissible mappings are set out below via a set
  4887. of recursive definitions, bottoming out in the obvious cases, e.g. where an
  4888. (restricted) element declaration corresponds to another (base) element
  4889. declaration with the same name and type but the same or wider range of occurrence.</p>
  4890.    <note role="pf">
  4891.     <p>The structural correspondence approach to guaranteeing the subset
  4892. relation set out here is necessarily verbose, but has the advantage of being
  4893. checkable in a straightforward way.  The working group solicits feedback on how
  4894. difficult this is in practice, and on whether other approaches are found to be viable.</p>
  4895.    </note>
  4896.   <constraintnote type="cos" id="cos-particle-restrict">
  4897.    <head>Particle Valid (Restriction)</head>
  4898.    <p><termdef id="cd-model-restriction" term="valid restriction" role="local">For a particle (call it <local>R</local>, for restriction) to be a <term>valid restriction</term> of
  4899. another particle (call it <local>B</local>, for base)</termdef>
  4900.     <olist role="or">
  4901.      <item>
  4902.       <p>They are the same particle.</p>
  4903.      </item>
  4904.      <item>
  4905.       <p>depending on the kind of particle, per the table below, with the
  4906. qualifications that 
  4907.        <olist role="and">
  4908.         <item>
  4909.          <p>Any top-level element declaration particle (in <local>R</local> or
  4910. <local>B</local>) which is the
  4911. <propref ref="class_exemplar"/> of one or more other element declarations is
  4912. treated as if it were a <pt>choice</pt> group whose <propref ref="p-min_occurs"/> and <propref ref="p-max_occurs"/> are those of the particle, and whose <propref ref="particles"/> consists of
  4913. one particle with <propref ref="p-min_occurs"/> and <propref ref="p-max_occurs"/> of <code>1</code> for the top-level element declaration and for each of the declarations in its <termref def="key-eq">substitution group</termref>.</p>
  4914.         </item>
  4915.         <item>
  4916.          <p>Any pointless occurrences of <eltref ref="sequence"/>, <eltref ref="choice"/> or <eltref ref="all"/> are ignored, where pointlessness is understood as follows:
  4917.           <glist>
  4918.            <gitem>
  4919.             <label><eltref ref="sequence"/></label>
  4920.             <def>
  4921.               <olist role="Or">
  4922.               <item>
  4923.                <p><propref ref="particles"/> is empty.</p>
  4924.               </item>
  4925.                <item>
  4926.                 <olist role="And">
  4927.                  <item><p>The particle within which this <eltref ref="sequence"/>
  4928. appears has <propref ref="p-max_occurs"/> and <propref ref="p-min_occurs"/> of
  4929. <code>1</code>.</p></item>
  4930.                  <item>
  4931.                   <olist role="Or"> 
  4932.                   <item>
  4933.                    <p>The <eltref ref="sequence"/>'s <propref ref="particles"/>
  4934. has only one member.</p>
  4935.                   </item>
  4936.                    <item>
  4937.                    <p>The particle within which this <eltref ref="sequence"/>
  4938. appears is itself among the <propref ref="particles"/> of a <eltref ref="sequence"/>.</p>
  4939.                   </item>
  4940.                  </olist>
  4941.                  </item>
  4942.                 </olist>
  4943.                </item>
  4944.              </olist>             
  4945.             </def>
  4946.            </gitem>
  4947.            <gitem>
  4948.             <label><eltref ref="all"/></label>
  4949.             <def>
  4950.               <olist role="Or">
  4951.               <item>
  4952.                <p><propref ref="particles"/> is empty.</p>
  4953.               </item>
  4954.                <item>
  4955.                 <p><propref ref="particles"/> has only one member.</p>
  4956.                </item>
  4957.              </olist>             
  4958.             </def>
  4959.            </gitem>
  4960.            <gitem>
  4961.             <label><eltref ref="choice"/></label>
  4962.             <def>
  4963.               <olist role="Or">
  4964.               <item>
  4965.                <p><propref ref="particles"/> is empty and the
  4966. particle within which this <eltref ref="choice"/> appears has <propref ref="p-min_occurs"/> of <code>0</code>.</p>
  4967.               </item>
  4968.                <item>
  4969.                 <olist role="And">
  4970.                  <item><p>The particle within which this <eltref ref="choice"/>
  4971. appears has <propref ref="p-max_occurs"/> and <propref ref="p-min_occurs"/> of
  4972. <code>1</code>.</p></item>
  4973.                  <item>
  4974.                  <olist role="Or"> 
  4975.                   <item>
  4976.                    <p>The <eltref ref="choice"/>'s <propref ref="particles"/>
  4977. has only one member.</p>
  4978.                   </item>
  4979.                   <item>
  4980.                    <p>The particle within which this <eltref ref="choice"/>
  4981. appears is itself among the <propref ref="particles"/> of a <eltref ref="choice"/>.</p>
  4982.                   </item>
  4983.                  </olist>
  4984.                 </item>
  4985.                 </olist>
  4986.                </item>
  4987.              </olist>             
  4988.             </def>
  4989.            </gitem>
  4990.           </glist>
  4991.          </p>
  4992.         </item>
  4993.        </olist>
  4994.        </p>
  4995.       <restrictCases>
  4996.         <restrict case="elt">
  4997.          <elt ref="NameAndTypeOK">NameAnd- TypeOK</elt>
  4998.          <any>NSCompat</any>
  4999.          <all ref="RecurseAsIfGroup">Recurse- AsIfGroup</all>
  5000.          <choice ref="RecurseAsIfGroup">Recurse- AsIfGroup</choice>
  5001.          <seq ref="RecurseAsIfGroup">RecurseAs- IfGroup</seq>
  5002.         </restrict>
  5003.         <restrict case="any">
  5004.          <any>NSSubset</any>
  5005.          <elt>Forbidden</elt>
  5006.          <all>Forbidden</all>
  5007.          <choice>Forbidden</choice>
  5008.          <seq>Forbidden</seq>
  5009.         </restrict>
  5010.         <restrict case="all">
  5011.          <any ref="NSRecurseCheckCardinality">NSRecurse- CheckCardinality</any>
  5012.          <all>Recurse</all>
  5013.          <elt>Forbidden</elt>
  5014.          <choice>Forbidden</choice>
  5015.          <seq>Forbidden</seq>
  5016.         </restrict>
  5017.         <restrict case="choice">
  5018.          <any ref="NSRecurseCheckCardinality">NSRecurse- CheckCardinality</any>
  5019.          <choice>RecurseLax</choice>
  5020.          <all>Forbidden</all>
  5021.          <elt>Forbidden</elt>
  5022.          <seq>Forbidden</seq>
  5023.         </restrict>
  5024.         <restrict case="seq- uence">
  5025.          <any ref="NSRecurseCheckCardinality">NSRecurse- CheckCardinality</any>
  5026.          <all ref="RecurseUnordered">Recurse- Unordered</all>
  5027.          <choice>MapAndSum</choice>
  5028.          <seq>Recurse</seq>
  5029.          <elt>Forbidden</elt>
  5030.         </restrict>
  5031.        </restrictCases>
  5032.      </item>
  5033.     </olist>
  5034.    </p>
  5035.   </constraintnote>
  5036.   <constraintnote id="range-ok" type="cos">
  5037.    <head>Occurrence Range OK</head>
  5038.    <p>For a particle's occurrence range to be a valid restriction of another's
  5039. occurrence range
  5040.     <olist role="and">
  5041.      <item>
  5042.       <p>Its <propref ref="p-min_occurs"/> is greater than or equal to the
  5043. other's <propref ref="p-min_occurs"/>.</p>
  5044.      </item>
  5045.      <item>
  5046.       
  5047.        <olist role="or">
  5048.         <item>
  5049.          <p>The other's <propref ref="p-max_occurs"/> is <pt>unbounded</pt>.</p>
  5050.         </item>
  5051.         <item>
  5052.          <p>Both <propref ref="p-max_occurs"/> are numbers, and the particle's is less than or equal to the
  5053. other's.</p>
  5054.         </item>
  5055.        </olist>      
  5056.      </item>
  5057.     </olist>
  5058.    </p>
  5059.   </constraintnote>
  5060.   <constraintnote type="cos" id="rcase-NameAndTypeOK">
  5061.    <head>Particle Restriction OK (Elt:Elt -- NameAndTypeOK)</head>
  5062.    <p>For an element declaration particle to be a <termref def="cd-model-restriction">valid restriction</termref> of another element declaration particle
  5063.     <olist role="and">
  5064.      <item>
  5065.       <p>The declarations' <propref ref="e-name"/>s and <propref ref="e-target_namespace"/>s are the same.</p>
  5066.      </item>
  5067.      <item>
  5068.       <p>Either <local>B</local>'s <propref ref="nillable"/> is <pt>true</pt> or <local>R</local>'s <propref ref="nillable"/> is <pt>false</pt>.</p>
  5069.      </item>
  5070.      <item>
  5071.       <p><local>R</local>'s occurrence range is a valid
  5072. restriction of <local>B</local>'s occurrence range as defined by <specref ref="range-ok"/>.</p>
  5073.      </item>
  5074.      <item>
  5075.       <p>either <local>B</local>'s declaration's <propref ref="e-value_constraint"/> is
  5076. absent, or is
  5077. not <pt>fixed</pt>, or <local>R</local>'s declaration's <propref ref="e-value_constraint"/> is
  5078. <pt>fixed</pt> with the same value.</p>
  5079.      </item>
  5080.      <item>
  5081.       <p><local>R</local>'s declaration's <propref ref="&constraint;_definitions"/> is
  5082. a subset of <local>B</local>'s declaration's <propref ref="&constraint;_definitions"/>,
  5083. if any.</p></item>
  5084.      <item>
  5085.       <p><local>R</local>'s declaration's <propref ref="e-exact"/> is
  5086. a superset of <local>B</local>'s declaration's <propref ref="e-exact"/>.</p>
  5087.      </item>
  5088.      <item>
  5089.       <p><local>R</local>'s <propref ref="type_definition"/> is validly derived given
  5090. {<pt>extension</pt>, <pt>list</pt>, <pt>union</pt>} from <local>B</local>'s <propref ref="type_definition"/> as defined by
  5091. <specref ref="cos-ct-derived-ok"/> or <specref ref="cos-st-derived-ok"/>, as appropriate.</p>
  5092.      </item>
  5093.     </olist>
  5094.    </p>
  5095.    <note>
  5096.     <p>The above constraint on <propref ref="type_definition"/> means that in
  5097. deriving a type by restriction, any contained type definitions must themselves be
  5098. explicitly derived by restriction from the corresponding type definitions in the
  5099. base definition.</p>
  5100.    </note>
  5101.   </constraintnote>
  5102.   <constraintnote type="cos" id="rcase-NSCompat">
  5103.    <head>Particle Derivation OK (Elt:Any -- NSCompat)</head>
  5104.    <p>For an element declaration particle to be a <termref def="cd-model-restriction">valid restriction</termref> of a wildcard particle
  5105.     <olist role="and">
  5106.      <item>
  5107.       <p>The element declaration's <propref ref="e-target_namespace"/> is
  5108. <termref def="key-vn">valid</termref> with respect to the wildcard's <propref ref="namespace_constraint"/> as
  5109. defined by <specref ref="cvc-wildcard-namespace"/>.</p>
  5110.      </item>
  5111.      <item>
  5112.       <p><local>R</local>'s occurrence range is a valid
  5113. restriction of <local>B</local>'s occurrence range as defined by <specref ref="range-ok"/>.</p>
  5114.      </item>
  5115.     </olist>
  5116.    </p>
  5117.   </constraintnote>
  5118.   <constraintnote type="cos" id="rcase-RecurseAsIfGroup">
  5119.    <head>Particle Derivation OK (Elt:All/Choice/Sequence -- RecurseAsIfGroup)</head>
  5120.    <p>For an element declaration particle to be a <termref def="cd-model-restriction">valid restriction</termref> of a group particle (<pt>all</pt>, <pt>choice</pt> or <pt>sequence</pt>)
  5121. a group particle of the variety corresponding to <local>B</local>'s, with
  5122. <propref ref="p-min_occurs"/> and <propref ref="p-max_occurs"/> of <code>1</code> and with <propref ref="particles"/> consisting of a single particle
  5123. the same as the element declaration must be a <termref def="cd-model-restriction">valid restriction</termref> of the group as defined by <specref ref="rcase-Recurse"/>, <specref ref="rcase-RecurseLax"/> or <specref ref="rcase-Recurse"/>, depending on whether the group is <pt>all</pt>, <pt>choice</pt> or <pt>sequence</pt>.</p>
  5124.   </constraintnote>
  5125.   <constraintnote type="cos" id="rcase-NSSubset">
  5126.    <head>Particle Derivation OK (Any:Any -- NSSubset)</head>
  5127.    <p>For a wildcard particle to be a <termref def="cd-model-restriction">valid restriction</termref> of another wildcard particle
  5128.     <olist role="and">
  5129.      <item>
  5130.       <p><local>R</local>'s occurrence range must be a valid
  5131. restriction of <local>B</local>'s occurrence range as defined by <specref ref="range-ok"/>.</p>
  5132.      </item>
  5133.      <item>
  5134.       <p><local>R</local>'s <propref ref="namespace_constraint"/> must be an intensional
  5135. subset of <local>B</local>'s <propref ref="namespace_constraint"/> as defined by <specref ref="cos-ns-subset"/>.</p>
  5136.      </item>
  5137.     </olist>
  5138.    </p>
  5139.   </constraintnote>
  5140.   <constraintnote type="cos" id="rcase-NSRecurseCheckCardinality">
  5141.    <head>Particle Derivation OK (All/Choice/Sequence:Any -- NSRecurseCheckCardinality)</head>
  5142.    <p>For a group particle to be a <termref def="cd-model-restriction">valid restriction</termref> of a wildcard particle
  5143.     <olist role="and">
  5144.      <item>
  5145.       <p>Every member of the <propref ref="particles"/> of the group is a
  5146. <termref def="cd-model-restriction">valid restriction</termref> of the wildcard
  5147. as defined by <specref ref="cos-particle-restrict"/>.</p>
  5148.      </item>
  5149.      <item>
  5150.       <p>The effective total range of the group, as defined by <specref ref="cos-seq-range"/> (if
  5151. the group is <pt>all</pt> or <pt>sequence</pt>) or 
  5152. <specref ref="cos-choice-range"/> (if it is <pt>choice</pt>) is a valid
  5153. restriction of <local>B</local>'s occurrence range as defined by <specref ref="range-ok"/>.</p>
  5154.      </item>
  5155.     </olist>
  5156.    </p>
  5157.   </constraintnote>
  5158.   <constraintnote type="cos" id="rcase-Recurse">
  5159.    <head>Particle Derivation OK (All:All,Sequence:Sequence -- Recurse)</head>
  5160.    <p>For an <pt>all</pt> or <pt>sequence</pt> group particle to be a <termref def="cd-model-restriction">valid restriction</termref> of another group particle with the same <propref ref="compositor"/> 
  5161.     <olist role="and">
  5162.      <item>
  5163.       <p><local>R</local>'s occurrence range is a valid
  5164. restriction of <local>B</local>'s occurrence range as defined by <specref ref="range-ok"/>.</p>
  5165.      </item>
  5166.      <item>
  5167.       <p>There is a complete <termref def="key-op">order-preserving</termref> functional mapping from the particles in the
  5168. <propref ref="particles"/> of <local>R</local> to the particles in the <propref ref="particles"/> of <local>B</local> such that
  5169.        <olist role="and">
  5170.         <item>
  5171.          <p>Each particle in the <propref ref="particles"/> of <local>R</local> is a
  5172. <termref def="cd-model-restriction">valid restriction</termref> of the
  5173. particle in the <propref ref="particles"/> of <local>B</local> it maps to as defined
  5174. by <specref ref="cos-particle-restrict"/>.</p>
  5175.         </item>
  5176.         <item>
  5177.          <p>All particles in the <propref ref="particles"/> of <local>B</local> which
  5178. are not mapped to by any particle in the <propref ref="particles"/> of <local>R</local>
  5179. are <termref def="cd-emptiable">emptiable</termref> as defined by <specref ref="cos-group-emptiable"/>.</p>
  5180.         </item>
  5181.        </olist></p>
  5182.      </item>
  5183.     </olist>
  5184.    </p>
  5185.    <note>
  5186.     <p>Although the <termref def="key-vn">validation</termref> semantics of an <pt>all</pt> group does not
  5187. depend on the order of its particles, derived <pt>all</pt> groups are required to
  5188. match the order of their base in order to simplify checking that the derivation is OK.</p>
  5189.    </note>
  5190.    <p><termdef id="key-op" term="order-preserving" role="local">A complete functional mapping is
  5191. <term>order-preserving</term> if each particle <local>r</local> in the domain <local>R</local> maps to a
  5192. particle <local>b</local> in the range <local>B</local> which follows (not necessarily
  5193. immediately) the particle in the range
  5194. <local>B</local> mapped to by the predecessor of <local>r</local>, if any, where
  5195. <quote>predecessor</quote> and <quote>follows</quote> are defined with respect
  5196. to the order of the lists which constitute <local>R</local> and <local>B</local></termdef>.</p>
  5197.   </constraintnote>
  5198.   <constraintnote type="cos" id="rcase-RecurseLax">
  5199.    <head>Particle Derivation OK (Choice:Choice -- RecurseLax)</head>
  5200.    <p>For a <pt>choice</pt> group particle to be a <termref def="cd-model-restriction">valid restriction</termref> of another <pt>choice</pt> group particle 
  5201.     <olist role="and">
  5202.      <item>
  5203.       <p><local>R</local>'s occurrence range is a valid
  5204. restriction of <local>B</local>'s occurrence range as defined by <specref ref="range-ok"/>;</p>
  5205.      </item>
  5206.      <item>
  5207.       <p>There is a complete <termref def="key-op">order-preserving</termref> functional mapping from the particles in the
  5208. <propref ref="particles"/> of <local>R</local> to the particles in the <propref ref="particles"/> of <local>B</local> such that each particle in the <propref ref="particles"/> of <local>R</local> is a
  5209. <termref def="cd-model-restriction">valid restriction</termref> of the
  5210. particle in the <propref ref="particles"/> of <local>B</local> it maps to as defined
  5211. by <specref ref="cos-particle-restrict"/>.</p>
  5212.      </item>
  5213.     </olist>
  5214.     </p>
  5215.    <note>
  5216.     <p>Although the <termref def="key-vn">validation</termref> semantics of a <pt>choice</pt> group does not
  5217. depend on the order of its particles, derived <pt>choice</pt> groups are
  5218. required to
  5219. match the order of their base in order to simplify checking that the derivation is OK.</p>
  5220.    </note>
  5221.   </constraintnote>
  5222.   <constraintnote type="cos" id="rcase-RecurseUnordered">
  5223.    <head>Particle Derivation OK (Sequence:All -- RecurseUnordered)</head>
  5224.    <p>For a <pt>sequence</pt> group particle to be a <termref def="cd-model-restriction">valid restriction</termref> of an <pt>all</pt> group particle
  5225.     <olist role="and">
  5226.      <item>
  5227.       <p><local>R</local>'s occurrence range is a valid
  5228. restriction of <local>B</local>'s occurrence range as defined by <specref ref="range-ok"/>.</p>
  5229.      </item>
  5230.      <item>
  5231.       <p>There is a complete functional mapping from the particles in the
  5232. <propref ref="particles"/> of <local>R</local> to the particles in the <propref ref="particles"/> of <local>B</local> such that
  5233.        <olist role="and">
  5234.         <item>
  5235.          <p>No particle in the <propref ref="particles"/> of <local>B</local> is mapped
  5236. to by more than one of the particles in the
  5237. <propref ref="particles"/> of <local>R</local>;</p>
  5238.         </item>
  5239.         <item>
  5240.          <p>Each particle in the <propref ref="particles"/> of <local>R</local> is a
  5241. <termref def="cd-model-restriction">valid restriction</termref> of the
  5242. particle in the <propref ref="particles"/> of <local>B</local> it maps to as defined
  5243. by <specref ref="cos-particle-restrict"/>;</p>
  5244.         </item>
  5245.         <item>
  5246.          <p>All particles in the <propref ref="particles"/> of <local>B</local> which
  5247. are not mapped to by any particle in the <propref ref="particles"/> of <local>R</local>
  5248. are <termref def="cd-emptiable">emptiable</termref> as defined by <specref ref="cos-group-emptiable"/>.</p>
  5249.         </item>
  5250.        </olist>
  5251.       </p>
  5252.      </item>
  5253.     </olist>
  5254.    </p>
  5255.    <note>
  5256.     <p>Although this clause allows reordering, because of the limits on the
  5257. contents of <pt>all</pt> groups the checking process can still be deterministic.</p>
  5258.    </note>
  5259.   </constraintnote>
  5260.   <constraintnote type="cos" id="rcase-MapAndSum">
  5261.    <head>Particle Derivation OK (Sequence:Choice -- MapAndSum)</head>
  5262.    <p>For a <pt>sequence</pt> group particle to be a <termref def="cd-model-restriction">valid restriction</termref> of a <pt>choice</pt> group particle
  5263.     <olist role="and">
  5264.      <item>
  5265.       <p>There is a complete functional mapping from the particles in the
  5266. <propref ref="particles"/> of <local>R</local> to the particles in the <propref ref="particles"/> of <local>B</local> such that each particle in the <propref ref="particles"/> of <local>R</local> is a
  5267. <termref def="cd-model-restriction">valid restriction</termref> of the
  5268. particle in the <propref ref="particles"/> of <local>B</local> it maps to as defined
  5269. by <specref ref="cos-particle-restrict"/>.</p>
  5270.      </item>
  5271.      <item>
  5272.       <p>The pair consisting of the product of the <propref ref="p-min_occurs"/> of <local>R</local> and the length of its <propref ref="particles"/> and <pt>unbounded</pt> if <propref ref="p-max_occurs"/> is <pt>unbounded</pt> otherwise the product of the <propref ref="p-max_occurs"/> of <local>R</local> and the length of its <propref ref="particles"/> is a valid
  5273. restriction of <local>B</local>'s occurrence range as defined by <specref ref="range-ok"/>.</p>
  5274.       <note>
  5275.        <p>This clause is in principle more restrictive than absolutely
  5276. necessary, but in practice will cover all the likely cases, and is much easier
  5277. to specify than the fully general version.</p>
  5278.       </note>
  5279.      </item>
  5280.     </olist>
  5281.    </p>
  5282.    <note>
  5283.     <p>This case allows the <quote>unfolding</quote> of iterated disjunctions
  5284. into sequences.  It may be particularly useful when the disjunction is an
  5285. implicit one arising from the use of substitution groups.</p>
  5286.    </note>
  5287.   </constraintnote>
  5288.  <constraintnote id="cos-group-emptiable" type="cos">
  5289.   <head>Particle Emptiable</head>
  5290.   <p><termdef id="cd-emptiable" term="emptiable" role="local">For a particle to be
  5291. <term>emptiable</term></termdef>
  5292.    <olist role="or">
  5293.     <item>
  5294.      <p>Its <propref ref="p-min_occurs"/> is <code>0</code>.</p>
  5295.     </item>
  5296.     <item>
  5297.      <p>Its <propref ref="term"/> is a group and the minimum part of the
  5298. effective total range of that group, as defined by <specref ref="cos-seq-range"/> (if
  5299. the group is <pt>all</pt> or <pt>sequence</pt>) or 
  5300. <specref ref="cos-choice-range"/> (if it is <pt>choice</pt>), is <code>0</code>.</p>
  5301.     </item>
  5302.    </olist>
  5303.   </p>
  5304.  </constraintnote> 
  5305.     </div3>
  5306.    </div2>
  5307.    <div2 id="Wildcards">
  5308.     <head>Wildcards</head>
  5309.     <p>In order to exploit the full potential for extensibility offered by XML
  5310. plus namespaces, more provision is needed than DTDs allow for targeted flexibility in content
  5311. models and attribute declarations.  A wildcard provides for <termref def="key-vn">validation</termref> of
  5312. attribute and element information items dependent on their namespace
  5313. name, but independently of their local name.</p>
  5314. <note role="example"><eg xml:space="preserve"><![CDATA[<xs:any processContents="skip"/>
  5315.  
  5316. <xs:any namespace="##other" processContents="lax"/>
  5317.  
  5318. <xs:any namespace="http://www.w3.org/1999/XSL/Transform"/>
  5319.  
  5320. <xs:any namespace="##targetNamespace"/>
  5321.  
  5322. <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/>]]></eg>
  5323.     <p>XML representations of the four basic types of wildcard, plus one attribute wildcard.</p>
  5324. </note>
  5325.     <div3 id="Wildcard_details">
  5326.      <head>The Wildcard Schema Component</head>
  5327.    <p>The wildcard schema component has the following properties:</p>
  5328.      <compdef name="Wildcard" ref="Wildcard">
  5329.    <proplist>
  5330.   <propdef id="namespace_constraint" name="namespace constraint">
  5331.     One of <pt>any</pt>; a pair of <pt>not</pt> and a namespace name
  5332. or <termref def="key-null">absent</termref>; or a set whose
  5333. members are either namespace names or <termref def="key-null">absent</termref>.
  5334.    </propdef>
  5335.     <propdef name="process contents" id="process_contents">One of <pt>skip</pt>, <pt>lax</pt> or <pt>strict</pt>.</propdef>
  5336.     <propdef id="w-annotation" name="annotation">Optional.  An annotation.</propdef>
  5337. </proplist>
  5338.  </compdef>
  5339. <p><propref ref="namespace_constraint"/> provides for <termref def="key-vn">validation</termref> of attribute and element items that:
  5340. <olist>
  5341. <item>
  5342. <p>(<pt>any</pt>) have any namespace or are not namespace qualified;</p>
  5343. </item>
  5344. <item>
  5345. <p>(<pt>not</pt> and a namespace name) have any namespace other than the specified namespace name, or
  5346. are not namespace qualified;</p>
  5347. </item>
  5348. <item>
  5349. <p>(<pt>not</pt> and <termref def="key-null">absent</termref>) are namespace qualified;</p>
  5350. </item>
  5351. <item>
  5352. <p>(a set whose
  5353. members are either namespace names or <termref def="key-null">absent</termref>) have any of the
  5354. specified namespaces and/or, if <termref def="key-null">absent</termref> is included in the set, are unqualified.</p>
  5355. </item>
  5356. </olist></p>
  5357.     <p><propref ref="process_contents"/> controls the impact on <termref def="key-va">assessment</termref>
  5358. of the information items allowed by wildcards, as follows:
  5359.      <glist>
  5360.       <gitem>
  5361.        <label>strict</label>
  5362.        <def>
  5363.         <p>There must be a top-level declaration for the item available, or the item
  5364. must have an <code>xsi:type</code>, and the item
  5365. must be <termref def="key-vn">valid</termref> as appropriate.</p>
  5366.        </def>
  5367.       </gitem>
  5368.       <gitem>
  5369.        <label>skip</label>
  5370.        <def>
  5371.         <p>No constraints at all:  the item must simply be well-formed XML.</p>
  5372.        </def>
  5373.       </gitem>
  5374.       <gitem>
  5375.        <label>lax</label>
  5376.        <def>
  5377.         <p>If the item, or any items among its &i-children; if it's an element
  5378. information item, has a uniquely
  5379. determined declaration available, it must be <termref def="key-vn">valid</termref> with respect to
  5380. that definition, that is, <termref def="key-vn">validate</termref> where you can, don't worry when you can't.</p>
  5381.        </def>
  5382.       </gitem>
  5383.      </glist>
  5384.     </p>
  5385.      <p>See <specref ref="cAnnotations"/> for information on the role of the
  5386. <propref ref="w-annotation"/> property.</p>
  5387.     </div3>
  5388.      <div3 id="declare-openness">
  5389.     <head>XML Representation of Wildcard Schema Components</head>
  5390.     <p>The XML representation for a wildcard schema component is an
  5391. <eltref ref="any"/> or <eltref ref="anyAttribute"/> element information item.    The correspondences between the
  5392. properties of an <eltref ref="any"/> information item and
  5393. properties of the components it corresponds to are as follows (see <eltref ref="complexType"/> and <eltref ref="attributeGroup"/> for the correspondences for <eltref ref="anyAttribute"/>):</p>
  5394.     <reprdef>
  5395.  <reprelt eltname="any"/>
  5396.      <p>A particle containing a wildcard, with properties as follows (unless <code>minOccurs=maxOccurs=0</code>, in which case the item
  5397. corresponds to no component at all):</p>
  5398.      <reprcomp abstract="Particle" ref="Particle_details">
  5399. <propmap name="p-min_occurs">The &v-value; of the <code>minOccurs</code>
  5400. &i-attribute;, if present, otherwise <code>1</code>.</propmap>
  5401.   <propmap name="p-max_occurs"><pt>unbounded</pt>, if the <code>maxOccurs</code>
  5402. &i-attribute; equals <pt>unbounded</pt>, otherwise the &v-value; of the <code>maxOccurs</code>
  5403. &i-attribute;, if present, otherwise <code>1</code>.</propmap>
  5404. <propmap name="term">A wildcard as given below:</propmap>
  5405. </reprcomp>
  5406.  <reprcomp abstract="Wildcard" ref="Wildcard_details">
  5407. <propmap name="namespace_constraint">Dependent on the &v-value; of the
  5408. <code>namespace</code> &i-attribute;: if absent, then <pt>any</pt>, otherwise as follows:<glist>
  5409.   <gitem>
  5410.    <label>##any</label>
  5411.    <def>
  5412.     <p><pt>any</pt></p>
  5413.    </def>
  5414.   </gitem>
  5415.   <gitem>
  5416.    <label>##other</label>
  5417.    <def>
  5418.     <p>a pair of <pt>not</pt> and the &v-value; of the <code>targetNamespace</code> &i-attribute; of the <eltref ref="schema"/> ancestor
  5419. element information item if present, otherwise <termref def="key-null">absent</termref>.</p>
  5420.    </def>
  5421.   </gitem>
  5422.   <gitem>
  5423.    <label><emph>otherwise</emph></label>
  5424.    <def>
  5425.     <p>a set whose members are namespace names corresponding to the
  5426. space-delimited substrings of the string, except
  5427.      <olist>
  5428.       <item>
  5429.        <p>if one such
  5430. substring is <code>##targetNamespace</code>, the corresponding member is the &v-value; of the <code>targetNamespace</code> &i-attribute; of the <eltref ref="schema"/> ancestor
  5431. element information item if present, otherwise <termref def="key-null">absent</termref>.</p>
  5432.       </item>
  5433.       <item>
  5434.        <p>if one such
  5435. substring is <code>##local</code>, the corresponding member is <termref def="key-null">absent</termref>.</p>
  5436.       </item>
  5437.      </olist>
  5438.     </p>
  5439.    </def>
  5440.   </gitem>
  5441.  </glist>
  5442. </propmap>
  5443.   <propmap name="process_contents">The &v-value; of the
  5444. <code>processContents</code> &i-attribute;, if present, otherwise <pt>strict</pt>.</propmap>
  5445. <propmap name="w-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
  5446. &i-children;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  5447. </reprcomp></reprdef>
  5448.     <p>Wildcards are subject to the same ambiguity constraints
  5449. (<specref ref="cos-nonambig"/>) as other
  5450. content model particles:  If an instance element could match either an explicit
  5451. particle and a wildcard, or one of two wildcards, within the content model of a
  5452. type, that model is in error.</p>
  5453.    </div3>
  5454.     <div3>
  5455.      <head>Constraints on XML Representations of Wildcards</head>
  5456.     <constraintnote type="src" id="src-wildcard">
  5457.    <head>Wildcard Representation OK</head>
  5458.    <p>In addition to the conditions imposed on <eltref ref="any"/> element
  5459. information items by the schema for schemas, the corresponding particle and model group must satisfy the conditions set
  5460. out in <specref ref="coss-modelGroup"/> and <specref ref="coss-particle"/>.</p>
  5461.   </constraintnote>
  5462.     </div3>
  5463.     <div3>
  5464.      <head>Wildcard Validation Rules</head>
  5465.     <constraintnote type="cvc" id="cvc-wildcard">
  5466.      <head>Item Valid (Wildcard)</head>
  5467.      <p>For an element or attribute information item to be locally <termref def="key-vn">valid</termref> with respect to a wildcard
  5468. constraint
  5469.       its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref> must be <termref def="key-vn">valid</termref> with respect to the wildcard constraint, as defined in <specref ref="cvc-wildcard-namespace"/>.</p>
  5470.      <p>When this constraint applies
  5471.       <olist role="case">
  5472.        <item>
  5473.         <p role="if"><propref ref="process_contents"/> is <pt>lax</pt></p>
  5474.         <p role="then">the item has no <termref def="key-dd">context-determined declaration</termref> with respect to <specref ref="sic-e-outcome"/>, <specref ref="cvc-assess-elt"/> and <specref ref="cvc-assess-attr"/>.</p>
  5475.        </item>
  5476.        <item>
  5477.         <p role="if"><propref ref="process_contents"/> is <pt>strict</pt></p>
  5478.         <p role="then">the item's <termref def="key-dd">context-determined declaration</termref> is <pt>mustFind</pt>.</p>
  5479.        </item>
  5480.        <item>
  5481.         <p role="if"><propref ref="process_contents"/> is <pt>skip</pt></p>
  5482.         <p role="then">the item's <termref def="key-dd">context-determined declaration</termref> is <pt>skip</pt>.</p>
  5483.        </item>
  5484.       </olist>
  5485.      </p>
  5486.     </constraintnote>
  5487.     <constraintnote type="cvc" id="cvc-wildcard-namespace">
  5488.      <head>Wildcard allows Namespace Name</head>
  5489.      <p>For a value which is either a namespace name or <termref def="key-null">absent</termref> to be <termref def="key-vn">valid</termref> with respect to a wildcard constraint (the
  5490. value of a <propref ref="namespace_constraint"/>)
  5491.       <olist role="or">
  5492.        <item>
  5493.         <p>The constraint must be <pt>any</pt>.</p>
  5494.        </item>
  5495.        <item>
  5496.         <olist role="And">
  5497.          <item>
  5498.           <p>The constraint is a pair of <pt>not</pt> and a namespace name or
  5499. <termref def="key-null">absent</termref> (<termdef id="key-nst" term="namespace test" role="local">call this the <term>namespace test</term>)</termdef>.</p>
  5500.          </item>
  5501.          <item>
  5502.             <p>The value must not be identical to the <termref def="key-nst">namespace test</termref>.</p>
  5503.            </item>
  5504.          <item>
  5505.           <p>The value must not be <termref def="key-null">absent</termref>.</p>
  5506.          </item>
  5507.         </olist>        
  5508.        </item>
  5509.        <item>
  5510.         <p>The constraint is a set, and the value is identical to one of the members of the set.</p>
  5511.        </item>
  5512.       </olist>
  5513.      </p>
  5514.     </constraintnote>
  5515.     </div3>
  5516.     <div3>
  5517.      <head>Wildcard Information Set Contributions</head>
  5518.      <p>None as such.</p>
  5519.     </div3>
  5520.     <div3 id="coss-wildcard">
  5521.      <head>Constraints on Wildcard Schema Components</head>
  5522.   <p>All wildcards (see <specref ref="Wildcards"/>) must satisfy the following constraint.</p>
  5523.   <constraintnote type="cos" id="w-props-correct">
  5524.    <head>Wildcard Properties Correct</head>
  5525.    <p>The values of the properties of a wildcard must be as described in
  5526. the property tableau in
  5527. <specref ref="Wildcard_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  5528.   </constraintnote>
  5529.   <p>The following constraints define a relation appealed to elsewhere in this specification.</p>
  5530.   <constraintnote type="cos" id="cos-ns-subset">
  5531.   <head>Wildcard Subset</head>
  5532.    <p>For a namespace constraint (call it <local>sub</local>) to be an intensional subset of
  5533. another namespace constraint (call it <local>super</local>)
  5534.     <olist role="or">
  5535.      <item>
  5536.       <p><local>super</local> must be <pt>any</pt>.</p>
  5537.      </item>
  5538.      <item>
  5539.       <olist role="And">
  5540.        <item><p><local>sub</local> must be a pair of <pt>not</pt> and a namespace name or
  5541. <termref def="key-null">absent</termref>.</p></item>
  5542.        <item><p><local>super</local> must be a pair of <pt>not</pt> and the same value.</p></item>
  5543.       </olist>
  5544.      </item>
  5545.      <item>
  5546.       <olist role="And">
  5547.        <item>
  5548.         <p><local>sub</local> must be a set whose members are either namespace names or
  5549. <termref def="key-null">absent</termref>.</p>
  5550.        </item>
  5551.        <item>
  5552.         <olist role="Or">
  5553.        <item>
  5554.         <p><local>super</local> must be the same set or a superset thereof.</p>
  5555.        </item>
  5556.          <item>
  5557.          <p><local>super</local> must be a pair of <pt>not</pt> and a namespace name or
  5558. <termref def="key-null">absent</termref> and that value must not be in <local>sub</local>'s set.</p>
  5559.         </item>
  5560.       </olist>
  5561.        </item>
  5562.       </olist>
  5563.      </item>
  5564.     </olist>
  5565.    </p>
  5566.   </constraintnote>
  5567.      <constraintnote id="cos-aw-union" type="cos">
  5568.    <head>Attribute Wildcard Union</head>
  5569.    <p>For a wildcard's <propref ref="namespace_constraint"/> value to be the intensional
  5570. union of two other such values (call them <local>O1</local> and <local>O2</local>):
  5571.     <olist role="case">
  5572.      <item>
  5573.       <p role="if"><local>O1</local> and <local>O2</local> are the same value</p>
  5574.       <p role="then">that value must be the value.</p>
  5575.      </item>
  5576.      <item>
  5577.       <p role="if">either <local>O1</local> or <local>O2</local> is <pt>any</pt></p>
  5578.       <p role="then"><pt>any</pt> must be the value.</p>
  5579.      </item>
  5580.      <item>
  5581.       <p role="if">both <local>O1</local> and <local>O2</local> are sets of (namespace names
  5582. or <termref def="key-null">absent</termref>)</p>
  5583.       <p role="then">the union of those sets must be the value.</p>
  5584.      </item>
  5585.      <item>
  5586.       <p role="if">the two are negations of different namespace names</p>
  5587.       <p role="then">the intersection is not expressible.</p>
  5588.      </item>
  5589.      <item>
  5590.       <p role="if">either <local>O1</local> or <local>O2</local> is a pair of <pt>not</pt>
  5591. and a namespace name and the other is a set of (namespace names or <termref def="key-null">absent</termref>)</p>
  5592.       <p role="then">
  5593.        <olist role="Case">
  5594.         <item>
  5595.          <p role="if">the set includes the negated namespace name</p>
  5596.          <p role="then"><pt>any</pt> must be the value.</p>
  5597.         </item>
  5598.         <item>
  5599.          <p role="if">the set does not include the negated namespace name</p>
  5600.          <p role="then">whichever of <local>O1</local> or <local>O2</local> is a pair of <pt>not</pt>
  5601. and a namespace name must be the value.</p>
  5602.         </item>
  5603.        </olist>
  5604.       </p>
  5605.      </item>
  5606.     </olist>
  5607.     In the case where there are more than two values, the intensional
  5608. intersection is determined by identifying the intensional intersection of two
  5609. of the values as above, then the intensional intersection of that value with
  5610. the third (providing the first intersection was expressible), and so on as required.
  5611.    </p>
  5612.   </constraintnote>
  5613.   <constraintnote id="cos-aw-intersect" type="cos">
  5614.    <head>Attribute Wildcard Intersection</head>
  5615.    <p>For a wildcard's <propref ref="namespace_constraint"/> value to be the intensional
  5616. intersection of two other such values (call them <local>O1</local> and <local>O2</local>):
  5617.     <olist role="case">
  5618.      <item>
  5619.       <p role="if"><local>O1</local> and <local>O2</local> are the same value</p>
  5620.       <p role="then">that value must be the value.</p>
  5621.      </item>
  5622.      <item>
  5623.       <p role="if">either <local>O1</local> or <local>O2</local> is <pt>any</pt></p>
  5624.       <p role="then">the
  5625. other must be the value.</p>
  5626.      </item>
  5627.      <item>
  5628.       <p role="if">either <local>O1</local> or <local>O2</local> is a pair of <pt>not</pt>
  5629. and a namespace name and the other is a set of (namespace names or <termref def="key-null">absent</termref>)</p>
  5630.       <p role="then">that set,
  5631. minus the negated namespace name if it was in the set, must be the value.</p>
  5632.      </item>
  5633.      <item>
  5634.       <p role="if">both <local>O1</local> and <local>O2</local> are sets of (namespace names
  5635. or <termref def="key-null">absent</termref>)</p>
  5636.       <p role="then">the intersection of those sets must be the value.</p>
  5637.      </item>
  5638.      <item>
  5639.       <p role="if">the two are negations of different namespace names</p>
  5640.       <p role="then">the intersection is not expressible.</p>
  5641.      </item>
  5642.     </olist>
  5643.     In the case where there are more than two values, the intensional
  5644. intersection is determined by identifying the intensional intersection of two
  5645. of the values as above, then the intensional intersection of that value with
  5646. the third (providing the first intersection was expressible), and so on as required.
  5647.    </p>
  5648.   </constraintnote>
  5649.     </div3>
  5650.    </div2>
  5651. <div2 id="c&Constraint;_Definitions">
  5652.     <head>&Constraint; Definitions</head>
  5653. <p>&Constraint; definition components provide for uniqueness and
  5654. reference constraints with respect to the contents of multiple elements and attributes.</p>
  5655.  <note role="example">
  5656.   <eg xml:space="preserve"><![CDATA[<xs:key name="fullName">
  5657.  <xs:selector xpath=".//person"/>
  5658.  <xs:field xpath="forename"/>
  5659.  <xs:field xpath="surname"/>
  5660. </xs:key>
  5661.  
  5662. <xs:keyref name="personRef" refer="fullName">
  5663.  <xs:selector xpath=".//personPointer"/>
  5664.  <xs:field xpath="@first"/>
  5665.  <xs:field xpath="@last"/>
  5666. </xs:keyref>
  5667.  
  5668. <xs:unique name="nearlyID">
  5669.  <xs:selector xpath=".//*"/>
  5670.  <xs:field xpath="@id"/>
  5671. </xs:unique>]]></eg>
  5672.   <p>XML representations for the three kinds of &constraint; definitions.</p>
  5673.  </note>
  5674.     <div3 id="&Constraint;_Definition_details">
  5675.      <head>The &Constraint; Definition Schema Component</head>
  5676.      <p>The &constraint; definition schema component has the following
  5677. properties:
  5678. </p>   
  5679.  
  5680.   <compdef name="&Constraint; Definition" ref="&Constraint;_Definition">
  5681.  
  5682.    <proplist>
  5683.   <propdef id="c-name" name="name">
  5684.     An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
  5685.    </propdef>
  5686.   <propdef id="c-target_namespace" name="target namespace">
  5687.     Either <termref def="key-null">absent</termref> or a namespace name, as defined in <bibref ref="ref-xml-namespaces"/>.
  5688.    </propdef>
  5689.   <propdef id="&constraint;_name" name="&constraint; category">
  5690.     One of <pt>key</pt>, <pt>keyref</pt> or <pt>unique</pt>.
  5691.    </propdef>
  5692.   <propdef id="selector" name="selector">
  5693.     A restricted XPath (<bibref ref="bib-xpath"/>) expression.</propdef>
  5694.   <propdef id="fields" name="fields">
  5695.     A non-empty list of restricted XPath (<bibref ref="bib-xpath"/>) expressions.</propdef>
  5696.   <propdef id="referenced_key" name="referenced key">
  5697.     Required if <propref ref="&constraint;_name"/> is <pt>keyref</pt>, forbidden
  5698. otherwise.  An &constraint; definition with <propref ref="&constraint;_name"/>
  5699. equal to <pt>key</pt> or <pt>unique</pt>.
  5700.    </propdef>
  5701.     <propdef id="rc-annotation" name="annotation">Optional.  An annotation.</propdef>
  5702. </proplist>
  5703.   </compdef>
  5704. <p>&Constraint; definitions are identified by their <propref ref="c-name"/> and <propref ref="c-target_namespace"/>; &Constraint; definition identities must be unique within an <termref def="key-schema">XML Schema</termref>.  See <specref ref="composition-schemaImport"/> for the use of component
  5705. identifiers when importing one schema into another.</p>
  5706. <p>Informally, <propref ref="&constraint;_name"/> identifies the &Constraint; definition as playing one of
  5707. three roles:
  5708. <ulist>
  5709.  
  5710. <item><p>(<pt>unique</pt>) the &Constraint; definition asserts uniqueness, with respect to the content
  5711. identified by <propref ref="selector"/>, of the tuples resulting from
  5712. evaluation of the <propref ref="fields"/> XPath expression(s). </p></item>
  5713.  
  5714. <item>
  5715. <p>(<pt>key</pt>) the &Constraint; definition asserts uniqueness as for
  5716. <pt>unique</pt>.  <pt>key</pt> further asserts that all selected content
  5717. actually has such tuples.</p>
  5718. </item>
  5719. <item><p>(<pt>keyref</pt>) the &Constraint; definition asserts a correspondence, with respect to the content
  5720. identified by <propref ref="selector"/>, of the tuples resulting from
  5721. evaluation of the <propref ref="fields"/> XPath expression(s), with those of the <propref ref="referenced_key"/>. </p></item>
  5722. </ulist> </p>
  5723. <p>These constraints are specified along side the specification of types for the
  5724. attributes and elements involved, i.e. something declared as of type integer
  5725. may also serve as a key.  Each constraint declaration has a name, which exists in a
  5726. single symbol space for constraints.  The equality and inequality conditions
  5727. appealed to in checking these constraints apply to the <emph>value</emph> of
  5728. the fields selected, so that for example <code>3.0</code> and <code>3</code>
  5729. would be conflicting keys if they were both number, but non-conflicting if
  5730. they were both strings, or one was a string and one a number.  Values of
  5731. differing type can only be equal if one type is derived from the other, and the
  5732. value is in the value space of both.</p>
  5733.     <p>Overall the augmentations to XML's <code>ID/IDREF</code> mechanism are:</p>
  5734.     <ulist>
  5735.      <item>
  5736. <p>Functioning as a part of an &constraint; is in addition to, not instead of,
  5737. having a type;</p>
  5738.      </item>
  5739.      <item><p>Not just attribute values, but also element content and combinations
  5740. of values and content can be declared to be unique;</p></item>
  5741.      <item><p>&Constraint;s are specified to hold within the scope of particular elements;</p></item>
  5742.      <item><p>(Combinations of) attribute values and/or element content can be
  5743. declared to be keys, that is, not only unique, but always present and non-nillable;</p></item>
  5744.      <item>
  5745.       <p>The comparison between <pt>keyref</pt> <propref ref="fields"/> and
  5746. <pt>key</pt> or <pt>unique</pt> <propref ref="fields"/> is by value equality,
  5747. not by string equality.</p>
  5748.      </item>
  5749.     </ulist>
  5750.     <p><propref ref="selector"/> specifies a restricted XPath (<bibref ref="bib-xpath"/>) expression relative to
  5751. instances of the element being declared.  This must identify a node set of
  5752. subordinate elements (i.e. contained within the declared element) to which the constraint applies.</p>
  5753.     <p><propref ref="fields"/> specifies XPath expressions relative to each
  5754. element selected by a <propref ref="selector"/>.  This must identify
  5755. a single node (element or attribute) whose content or value, which must be
  5756. of a simple type, is used in the constraint.  It is possible to specify an
  5757. ordered list of <propref ref="fields"/>s, to cater to multi-field keys,
  5758. keyrefs, and uniqueness constraints.
  5759.      </p>
  5760.      <p>In order to reduce the burden on implementers, in particular
  5761. implementers of streaming processors, only restricted subsets of XPath
  5762. expressions are allowed in <propref ref="selector"/> and <propref ref="fields"/>.  The details are given in <specref ref="coss-&constraint;"/>.</p>
  5763.  <note>
  5764.       <p>Provision for multi-field keys etc. goes beyond what is supported by <code>xsl:key</code>.</p>
  5765.      </note>
  5766.      <p>See <specref ref="cAnnotations"/> for information on the role of the
  5767. <propref ref="rc-annotation"/> property.</p>
  5768.     </div3>
  5769.  <div3 id="declare-key">
  5770.     <head>XML Representation of &Constraint; Definition Schema Components</head>
  5771. <p>The XML representation for an &constraint; definition schema component is
  5772. either a
  5773. <eltref ref="key"/>, a <eltref ref="keyref"/> or a <eltref ref="unique"/>
  5774. element information item.    The correspondences between the
  5775. properties of those information items and
  5776. properties of the component they correspond to are as follows:</p>
  5777.     <reprdef>
  5778.  <reprelt eltname="unique"/>
  5779.  <reprelt eltname="key"/>
  5780.  <reprelt eltname="keyref"/>
  5781.  <reprelt eltname="selector"/>
  5782.  <reprelt eltname="field"/>
  5783.  <reprcomp abstract="&Constraint; Definition" ref="&Constraint;_Definition_details"><propmap name="c-name">The &v-value; of the <code>name</code> &i-attribute;</propmap>
  5784.   <propmap name="c-target_namespace">The &v-value; of the
  5785. <code>targetNamespace</code> &i-attribute; of the parent <code>schema</code>
  5786. element information item.</propmap>
  5787. <propmap name="&constraint;_name">One of <pt>key</pt>, <pt>keyref</pt> or
  5788. <pt>unique</pt>, depending on the item.</propmap>
  5789. <propmap name="selector">A restricted XPath expression corresponding to the &v-value; of
  5790. the <code>xpath</code> &i-attribute; of the <eltref ref="selector"/> element information item among the &i-children;</propmap>
  5791. <propmap name="fields">A sequence of XPath expressions, corresponding to the
  5792. &v-value;s of the <code>xpath</code> &i-attribute;s of the <eltref ref="field"/> element information item &i-children;, in order.</propmap>
  5793. <propmap name="referenced_key">If the item is a <eltref ref="keyref"/>, the
  5794. &constraint; definition <termref def="src-resolve">resolved</termref> to by the
  5795. &v-value; of the <code>refer</code> &i-attribute;, otherwise <termref def="key-null">absent</termref>.</propmap>
  5796. <propmap name="rc-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
  5797. &i-children;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  5798. </reprcomp></reprdef>
  5799.     
  5800.     <note role="example">
  5801.      <eg xml:space="preserve"><![CDATA[<xs:element name="vehicle">
  5802.  <xs:complexType>
  5803.   . . .
  5804.   <xs:attribute name="plateNumber" type="xs:integer"/>
  5805.   <xs:attribute name="state" type="twoLetterCode"/>
  5806.  </xs:complexType>
  5807. </xs:element>
  5808.  
  5809. <xs:element name="state">
  5810.  <xs:complexType>
  5811.   <xs:sequence>
  5812.    <xs:element name="code" type="twoLetterCode"/>
  5813.    <xs:element ref="vehicle" maxOccurs="unbounded"/>
  5814.    <xs:element ref="person" maxOccurs="unbounded"/>
  5815.   </xs:sequence>
  5816.  </xs:complexType>
  5817.  
  5818.  <xs:key name="reg"> <!-- vehicles are keyed by their plate within states -->
  5819.   <xs:selector xpath=".//vehicle"/>
  5820.   <xs:field xpath="@plateNumber"/>
  5821.  </xs:key>
  5822. </xs:element>
  5823.  
  5824. <xs:element name="root">
  5825.  <xs:complexType>
  5826.   <xs:sequence>
  5827.    . . .
  5828.    <xs:element ref="state" maxOccurs="unbounded"/>
  5829.    . . .
  5830.   </xs:sequence>
  5831.  </xs:complexType>
  5832.  
  5833.  <xs:key name="state"> <!-- states are keyed by their code -->
  5834.   <xs:selector xpath=".//state"/>
  5835.   <xs:field xpath="code"/>
  5836.  </xs:key>
  5837.  
  5838.  <xs:keyref name="vehicleState" refer="state">
  5839.   <!-- every vehicle refers to its state -->
  5840.   <xs:selector xpath=".//vehicle"/>
  5841.   <xs:field xpath="@state"/>
  5842.  </xs:keyref>
  5843.  
  5844.  <xs:key name="regKey"> <!-- vehicles are keyed by a pair of state and plate -->
  5845.   <xs:selector xpath=".//vehicle"/>
  5846.   <xs:field xpath="@state"/>
  5847.   <xs:field xpath="@plateNumber"/>
  5848.  </xs:key>
  5849.  
  5850.  <xs:keyref name="carRef" refer="regKey"> <!-- people's cars are a reference -->
  5851.   <xs:selector xpath=".//car"/>
  5852.   <xs:field xpath="@regState"/>
  5853.   <xs:field xpath="@regPlate"/>
  5854.  </xs:keyref>
  5855.  
  5856. </xs:element>
  5857.  
  5858. <xs:element name="person">
  5859.  <xs:complexType>
  5860.   <xs:sequence>
  5861.    . . .
  5862.    <xs:element name="car">
  5863.     <xs:complexType>
  5864.      <xs:attribute name="regState" type="twoLetterCode"/>
  5865.      <xs:attribute name="regPlate" type="xs:integer"/>
  5866.     </xs:complexType>
  5867.    </xs:element>
  5868.   </xs:sequence>
  5869.  </xs:complexType>
  5870. </xs:element>]]></eg>
  5871.      <p>A <code>state</code> element is defined, which
  5872. contains a <code>code</code> child and some <code>vehicle</code> and <code>person</code>
  5873. children.  A <code>vehicle</code> in turn has a <code>plateNumber</code> attribute,
  5874. which is an integer, and a <code>state</code> attribute.  State's
  5875. <code>code</code>s are a key for them within the document.  Vehicle's
  5876. <code>plateNumber</code>s are a key for them within states, and
  5877. <code>state</code> and
  5878. <code>plateNumber</code> is asserted to be a <pt>key</pt> for
  5879. <code>vehicle</code> within the document as a whole.  Furthermore, a <code>person</code> element has
  5880. an empty <code>car</code> child, with <code>regState</code> and
  5881. <code>regPlate</code> attributes, which are then asserted together to refer to
  5882. <code>vehicle</code>s via the <code>carRef</code> constraint.  The requirement
  5883. that a <code>vehicle</code>'s <code>state</code> match its containing
  5884. <code>state</code>'s <code>code</code> is not expressed here.</p>
  5885.     </note>
  5886.  </div3>
  5887.     <div3>
  5888.      <head>Constraints on XML Representations of &Constraint; Definitions</head>
  5889.     <constraintnote type="src" id="src-&constraint;">
  5890.    <head>&Constraint; Definition Representation OK</head>
  5891.    <p>In addition to the conditions imposed on <eltref ref="key"/>, <eltref ref="keyref"/> and <eltref ref="unique"/> element
  5892. information items by the schema for schemas, the corresponding &constraint; definition must satisfy the conditions set
  5893. out in <specref ref="coss-&constraint;"/>.</p>
  5894.   </constraintnote>
  5895.     </div3>
  5896.     <div3>
  5897.      <head>&Constraint; Definition Validation Rules</head>
  5898.  <constraintnote type="cvc" id="cvc-&constraint;">
  5899.   <head>&Constraint; Satisfied</head>
  5900.   <p>For an element information item to be locally <termref def="key-vn">valid</termref> with respect to an &constraint;
  5901.    <olist role="and">
  5902.     <item>
  5903.      <p>The <propref ref="selector"/>, with the element information item as the
  5904. context node, evaluates to a node-set (as defined in
  5905. <bibref ref="bib-xpath"/>).  <termdef id="key-tns" term="target node set" role="local">Call this the <term>target node set</term></termdef>.</p>
  5906.     </item>
  5907.     <item>
  5908.      <p>Each node in the <termref def="key-tns">target node set</termref> is an
  5909. element node among the descendants of the context node.</p>
  5910.     </item>
  5911.     <item>
  5912.      <p>For each node in the <termref def="key-tns">target node set</termref> all of the <propref ref="fields"/>, with that node as the context
  5913. node, evaluate to either an empty node-set or a node-set with exactly one
  5914. member, which must have a simple type.  <termdef id="key-ks" term="key-sequence" role="local">Call the sequence of the
  5915. type-determined values (as defined in <bibref ref="ref-xsp2"/>) of the
  5916. <xpropref role="psviAnon">schema normalized value</xpropref> of the element and/or attribute information items in those node-sets in order the <term>key-sequence</term> of the node</termdef>.</p>
  5917.     </item>
  5918.     <item>
  5919.      <p>
  5920.    <termdef id="key-qns" term="qualified node set" role="local">Call the subset of the <termref def="key-tns">target node set</termref> for
  5921. which all the <propref ref="fields"/> evaluate to a node-set with exactly one
  5922. member which is an element or attribute node with a simple type the <term>qualified node set</term></termdef>.
  5923.      <olist role="Case">
  5924.     <item id="c-u">
  5925.      <p role="if">the <propref ref="&constraint;_name"/> is <pt>unique</pt></p>
  5926.      <p role="then">no two members of the <termref def="key-qns">qualified node
  5927. set</termref> have <termref def="key-ks">key-sequences</termref> whose members
  5928. are pairwise equal, as defined by <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#equal">Equal</xtermref> in <bibref ref="ref-xsp2"/>.</p>
  5929.     </item>
  5930.       <item id="c-k">
  5931.      <p role="if">the <propref ref="&constraint;_name"/> is <pt>key</pt></p>
  5932.        <p role="then">
  5933.         <olist role="and">
  5934.          <item>
  5935.      <p>The <termref def="key-tns">target node set</termref> and the <termref def="key-qns">qualified node
  5936. set</termref> are equal, that is, every member of the <termref def="key-tns">target node set</termref> is also a member of the <termref def="key-qns">qualified node
  5937. set</termref> and <emph>vice versa</emph>.</p>
  5938.          </item>
  5939.     <item>
  5940.      <p>No two members of the <termref def="key-qns">qualified node
  5941. set</termref> have <termref def="key-ks">key-sequences</termref> whose members
  5942. are pairwise equal, as defined by <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#equal">Equal</xtermref> in <bibref ref="ref-xsp2"/>.</p>
  5943.     </item>
  5944.     <item id="c-nlbl">
  5945.      <p>No element member of the <termref def="key-ks">key-sequence</termref> of any
  5946. member of the <termref def="key-qns">qualified node
  5947. set</termref> was assessed as <termref def="key-vn">valid</termref> by reference to an element
  5948. declaration whose <propref ref="nillable"/> is <pt>true</pt>.</p>
  5949.     </item>
  5950.         </olist>
  5951.        </p>
  5952.     </item>
  5953.     <item>
  5954.      <p role="if">the <propref ref="&constraint;_name"/> is <pt>keyref</pt></p>
  5955.      <p role="then">for each member of the <termref def="key-qns">qualified node
  5956. set</termref> (call this the <local>keyref member</local>), there must be a <termref def="key-nt">node table</termref> associated with the
  5957. <propref ref="referenced_key"/> in the <propref role="psvi" ref="e-id_constraint_table"/>
  5958. of the element information item (see <specref ref="sic-key"/>, which must be
  5959. understood as logically prior to this clause of this constraint, below) and
  5960. there must be an entry in that table whose
  5961. <termref def="key-ks">key-sequence</termref> is equal to the
  5962. <local>keyref member's</local> <termref def="key-ks">key-sequence</termref> member for
  5963. member, as defined by <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#equal">Equal</xtermref> in <bibref ref="ref-xsp2"/>.</p>
  5964.     </item>
  5965.    </olist>
  5966.      </p>
  5967.     </item>
  5968.    </olist>
  5969.   </p>
  5970.   <note>
  5971.    <p>The use of  <xpropref role="psviAnon">schema normalized value</xpropref> in the definition
  5972. of <termref def="key-ks">key sequence</termref> above means that
  5973. <pt>default</pt> or <pt>fixed</pt> value constraints may play a part in <termref def="key-ks">key sequence</termref>s.</p>
  5974.   </note>
  5975.  </constraintnote>
  5976.  <note>
  5977.   <p>Although this specification defines a &PSVI;
  5978. contribution which would enable schema-aware processors to implement <clauseref ref="c-nlbl"/> above (<specref ref="sic-elt-decl"/>), processors are not required to
  5979. provide it.  This clause can be read as if in the absence of this infoset contribution, the
  5980. value of the relevant <propref ref="nillable"/> property must be available.</p>
  5981.  </note>
  5982.     </div3>
  5983.     <div3>
  5984.      <head>&Constraint; Definition Information Set Contributions</head>
  5985.  <constraintnote type="sic" id="sic-key">
  5986.   <head>&Constraint; Table</head>
  5987.   <p><termdef id="key-ec" term="eligible &constraint;" role="local">An <term>eligible
  5988. &constraint;</term> of an element information item is one such that <clauseref ref="c-u"/> or <clauseref ref="c-k"/> of <specref ref="cvc-&constraint;"/> is satisfied
  5989. with respect to that item and that constraint,
  5990. or such that any of the element information item &i-children; of that item have an
  5991. <propref role="psvi" ref="e-id_constraint_table"/> property whose value has an entry for that constraint</termdef>.</p>
  5992.   <p><termdef id="key-nt" term="node table" role="local">A <term>node table</term> is a set
  5993. of pairs each consisting of
  5994. a <termref def="key-ks">key-sequence</termref> and an element node</termdef>.</p>
  5995.   <p>Whenever an element information item has one or more <termref def="key-ec">eligible &constraint;s</termref>, in the &PSVI; that element information item has a property as follows:</p>
  5996.   <proplist item="element" role="psvi">
  5997.     <propdef id="e-id_constraint_table" name="&constraint; table">
  5998.      one
  5999. <local>&Constraint; Binding</local>
  6000. information item for each <termref def="key-ec">eligible &constraint;</termref>, with
  6001. properties as follows:
  6002.      <proplist item="&Constraint; Binding" role="psvi">
  6003.       <propdef id="cb-definition" name="definition">The <termref def="key-ec">eligible &constraint;</termref>.</propdef>
  6004.       <propdef id="cb-node_table" name="node table">A <termref def="key-nt">node table</termref> with one entry for every
  6005. <termref def="key-ks">key-sequence</termref> (call it <local>k</local>) and node (call it <local>n</local>) such that
  6006.    <olist role="or">
  6007.     <item id="c-kc">
  6008.      <p>There is an entry in one of the <termref def="key-nt">node
  6009. tables</termref> associated with the <propref role="psvi" ref="cb-definition"/> in an
  6010. <local>&Constraint; Binding</local>
  6011. information item in at least one of the <propref role="psvi" ref="e-id_constraint_table"/>s of the element information item &i-children; of the element
  6012. information item whose <termref def="key-ks">key-sequence</termref> is <local>k</local> and whose node is <local>n</local>;</p>
  6013.     </item>
  6014.     <item>
  6015.      <p><local>n</local> appears with
  6016. <termref def="key-ks">key-sequence</termref> <local>k</local> in the <termref def="key-qns">qualified node
  6017. set</termref> for the <propref role="psvi" ref="cb-definition"/>.</p>
  6018.     </item>
  6019.    </olist>
  6020. provided no two entries have the same <termref def="key-ks">key-sequence</termref> but distinct nodes.  Potential conflicts are resolved by not including any conflicting entries which would have owed their inclusion to <clauseref ref="c-kc"/> above.  Note that if all the conflicting entries arose under <clauseref ref="c-kc"/> above, this means no entry at all will appear for the offending <termref def="key-ks">key-sequence</termref>.</propdef>
  6021.      </proplist>
  6022.     </propdef>
  6023.    </proplist>
  6024.   <note>
  6025.    <p>The complexity of the above arises from the fact that
  6026. <pt>keyref</pt> &constraint;s may be defined on domains distinct from the
  6027. embedded domain of the &constraint; they reference, or the domains may be the
  6028. same but self-embedding at some depth.  In either case the <termref def="key-nt">node
  6029. table</termref> for the referenced &constraint; needs to propagate upwards, with
  6030. conflict resolution.</p>
  6031.    <p>The <local>&Constraint; Binding</local>
  6032. information item, unlike others in this
  6033. specification, is essentially an internal bookkeeping mechanism.  It is introduced to
  6034. support the definition of <specref ref="cvc-identity-constraint"/> above. 
  6035. Accordingly, conformant processors may, but are <emph>not</emph> required to,
  6036. expose them via
  6037. <propref role="psvi" ref="e-id_constraint_table"/> properties in the &PSVI;.
  6038. In other words, the above constraints may be read as saying <termref def="key-vn">validation</termref> of
  6039. &constraint;s proceeds <emph>as if</emph> such infoset items existed. 
  6040. </p></note>
  6041.  </constraintnote>
  6042.     </div3>
  6043.     <div3 id="coss-&constraint;">
  6044.      <head>Constraints on &Constraint; Definition Schema Components</head>
  6045.   <p>All &constraint; definitions (see <specref ref="c&Constraint;_Definitions"/>) must satisfy the following constraint.</p>
  6046.   <constraintnote type="cos" id="c-props-correct">
  6047.    <head>&Constraint; Definition Properties Correct</head>
  6048.    <olist role="And">
  6049.     <item>
  6050.      <p>The values of the properties of an &constraint; definition must be as described in
  6051. the property tableau in
  6052. <specref ref="&Constraint;_Definition_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  6053.     </item>
  6054.     <item>
  6055.      <p>If the <propref ref="&constraint;_name"/> is <pt>keyref</pt>, the
  6056. cardinality of the <propref ref="fields"/> must equal that of the <propref ref="fields"/> of the <propref ref="referenced_key"/>.</p>
  6057.     </item>
  6058.    </olist>
  6059.   </constraintnote>
  6060.      <constraintnote type="cos" id="c-selector-xpath">
  6061.       <head>Selector Value OK</head>
  6062.       <olist role="And">
  6063.        <item>
  6064.       <p>The <propref ref="selector"/> must be a valid XPath
  6065. expression, as defined in <bibref ref="bib-xpath"/>.</p>
  6066.        </item>
  6067.        <item>
  6068.         <olist role="Or">
  6069.          <item>
  6070.           <p>It must conform to the following extended BNF:
  6071.         <scrap lang="ebnf">
  6072.          <head>Selector XPath expressions</head>
  6073.          <prod id="Selector">
  6074.           <lhs>Selector</lhs>
  6075.           <rhs><nt def="Path">Path</nt> ( '|' <nt def="Path">Path</nt> )*</rhs>
  6076.          </prod>
  6077.          <prod id="Path">
  6078.           <lhs>Path</lhs>
  6079.           <rhs>('.//')? <nt def="Step">Step</nt> ( '/' <nt def="Step">Step</nt> )*</rhs>
  6080.          </prod>
  6081.          <prod id="Step">
  6082.           <lhs>Step</lhs>
  6083.           <rhs>'.' | <nt def="NameTest">NameTest</nt></rhs>
  6084.          </prod>
  6085.          <prod id="NameTest">
  6086.           <lhs>NameTest</lhs>
  6087.           <rhs><xnt href="http://www.w3.org/TR/REC-xml-names/#NT-QName">QName</xnt> | '*' | <xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</xnt> ':' '*'</rhs>
  6088.          </prod>
  6089.         </scrap>
  6090.         </p>
  6091.          </item>
  6092.          <item>
  6093.           <p>It must be an XPath expression involving the <code>child</code> axis whose abbreviated form is
  6094. as given above.</p>
  6095.          </item>
  6096.         </olist>
  6097.        </item>
  6098.       </olist>
  6099.      </constraintnote>
  6100.      <constraintnote type="cos" id="c-fields-xpaths">
  6101.       <head>Fields Value OK</head>
  6102.       <olist role="And">
  6103.        <item>
  6104.       <p>Each member of the <propref ref="fields"/> must be a valid XPath
  6105. expression, as defined in <bibref ref="bib-xpath"/>.</p>
  6106.        </item>
  6107.        <item>
  6108.         <olist role="Or">
  6109.          <item>
  6110.           <p>It must conform to the extended BNF given
  6111. above for <nt def="Selector">Selector</nt>, with the following modification:
  6112.         <scrap>
  6113.          <head>Path in Field XPath expressions</head>
  6114.          <prod id="fPath">
  6115.           <lhs>Path</lhs>
  6116.           <rhs>('.//')? ( <nt def="Step">Step</nt> '/' )* ( <nt def="Step">Step</nt> | '@' <nt def="NameTest">NameTest</nt> )</rhs>
  6117.          </prod>
  6118.         </scrap>
  6119.            This production differs from the one above in allowing the final
  6120. step to match an attribute node.
  6121.         </p>
  6122.          </item>
  6123.          <item>
  6124.           <p>It must be an XPath expression involving the <code>child</code> and/or <code>attribute</code> axes whose abbreviated form is
  6125. as given above.</p>
  6126.          </item>
  6127.         </olist>
  6128.        </item>
  6129.       </olist>
  6130.      </constraintnote>
  6131.     </div3>
  6132.    </div2>
  6133.    <div2 id="cNotation_Declarations">
  6134.     <head>Notation Declarations</head>
  6135.     <p>Notation declarations reconstruct XML 1.0 NOTATION declarations.</p>
  6136.     <note role="example">
  6137.      <eg xml:space="preserve"><![CDATA[<xs:notation name="jpeg" public="image/jpeg" system="viewer.exe">]]></eg>
  6138.      <p>The XML representation of a notation declaration.</p>
  6139.     </note>
  6140.     <div3 id="Notation_Declaration_details">
  6141.      <head>The Notation Declaration Schema Component</head>
  6142.     <p>The notation declaration schema component has the following
  6143. properties:</p>
  6144.  
  6145.   <compdef name="Notation Declaration" ref="Notation_Declaration">
  6146.    <proplist>
  6147.   <propdef id="n-name" name="name">
  6148.     An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
  6149.    </propdef>
  6150.   <propdef id="n-target_namespace" name="target namespace">
  6151.     Either <termref def="key-null">absent</termref> or a namespace name, as defined in <bibref ref="ref-xml-namespaces"/>.
  6152.    </propdef>
  6153.   <propdef id="system_identifier" name="system identifier">
  6154.     Optional if <propref ref="public_identifier"/> is present.  A URI reference.
  6155.    </propdef>
  6156.   <propdef id="public_identifier" name="public identifier">
  6157.     Optional if <propref ref="system_identifier"/> is present.  A public identifier, as defined in <bibref ref="ref-xml"/>.
  6158.    </propdef>
  6159.     <propdef id="n-annotation" name="annotation">Optional.  An annotation.</propdef>
  6160. </proplist>
  6161.  
  6162.   </compdef>
  6163.     <p>Notation declarations do not participate in <termref def="key-vn">validation</termref> as such.
  6164. They are referenced in the course of <termref def="key-vn">validating</termref> strings as members of
  6165. the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#NOTATION">NOTATION</xtermref> simple type.</p>
  6166.      <p>See <specref ref="cAnnotations"/> for information on the role of the
  6167. <propref ref="n-annotation"/> property.</p>
  6168.     </div3>
  6169. <div3 id="declare-notation">
  6170. <head>XML Representation of Notation Declaration Schema Components</head>
  6171. <p>The XML representation for a notation declaration schema component is
  6172. a
  6173. <eltref ref="notation"/>
  6174. element information item.    The correspondences between the
  6175. properties of that information item and
  6176. properties of the component it corresponds to are as follows:</p>
  6177.  <reprdef>
  6178.  <reprelt eltname="notation"/>
  6179.  <reprcomp abstract="Notation Declaration" ref="Notation_Declaration_details">
  6180. <propmap name="n-name">The &v-value; of the
  6181. <code>name</code> &i-attribute;</propmap>
  6182.   <propmap name="n-target_namespace">The &v-value; of the
  6183. <code>targetNamespace</code> &i-attribute; of the parent <code>schema</code>
  6184. element information item.</propmap>
  6185. <propmap name="system_identifier">The &v-value; of the <code>system</code>
  6186. &i-attribute;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  6187. <propmap name="public_identifier">The &v-value; of the <code>public</code> &i-attribute;</propmap>
  6188. <propmap name="n-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
  6189. &i-children;, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  6190. </reprcomp></reprdef>
  6191. <note role="example">
  6192. <eg xml:space="preserve"><xs:notation name="jpeg"
  6193.              public="image/jpeg" system="viewer.exe" />
  6194.  
  6195. <xs:element name="picture">
  6196.  <xs:complexType>
  6197.   <xs:simpleContent>
  6198.    <xs:extension base="xs:hexBinary">
  6199.     <xs:attribute name="pictype">
  6200.      <xs:simpleType>
  6201.       <xs:restriction base="xs:NOTATION">
  6202.        <xs:enumeration value="jpeg"/>
  6203.        <xs:enumeration value="png"/>
  6204.        . . .
  6205.       </xs:restriction>
  6206.      </xs:simpleType>
  6207.     </xs:attribute>
  6208.    </xs:extension>
  6209.   </xs:simpleContent>
  6210.  </xs:complexType>
  6211. </xs:element>
  6212.  
  6213. <picture pictype="jpeg">...</picture></eg>
  6214.  
  6215. </note>
  6216. </div3>
  6217.     <div3>
  6218.      <head>Constraints on XML Representations of Notation Declarations</head>
  6219.  <constraintnote type="src" id="src-notation">
  6220.    <head>Notation Definition Representation OK</head>
  6221.    <p>In addition to the conditions imposed on <eltref ref="notation"/> element
  6222. information items by the schema for schemas, the corresponding notation definition must satisfy the conditions set
  6223. out in <specref ref="coss-notation"/>.</p>
  6224.   </constraintnote>
  6225.     </div3>
  6226.     <div3>
  6227.      <head>Notation Declaration Validation Rules</head>
  6228.      <p>None as such.</p>
  6229.     </div3>
  6230.     <div3>
  6231.      <head>Notation Declaration Information Set Contributions</head>
  6232.     <constraintnote id="sic-notation-used" type="sic">
  6233.      <head>Validated with Notation</head>
  6234.      <p>Whenever an attribute information item is <termref def="key-vn">valid</termref> with respect to a <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#NOTATION">NOTATION</xtermref>, in the &PSVI; its parent element information item either has a property as follows:</p>
  6235.      <proplist item="element" role="psvi">
  6236.        <propdef id="e-notation" name="notation">An
  6237. <termref def="key-iso">item isomorphic</termref> to the notation declaration whose <propref ref="n-name"/> and <propref ref="n-target_namespace"/> match the <termref def="q-local">local name</termref> and <termref def="q-uri">namespace name</termref> (as defined in <specref ref="src-qname"/>) of the attribute item's &v-value;</propdef>
  6238.       </proplist>
  6239.      <p>or has a pair of properties as follows:</p>
  6240.      <proplist item="element" role="psvi">
  6241.       <propdef id="e-notation_system" name="notation system">The value of the <propref ref="system_identifier"/> of that notation declaration.</propdef>
  6242.       <propdef id="e-notation_public" name="notation public">The value of the <propref ref="public_identifier"/> of that notation declaration.</propdef>
  6243.      </proplist>
  6244.      <note>
  6245.       <p>For compatibility, only one such attribute should appear on any given
  6246. element.  If more than one such attribute <emph>does</emph> appear, which one
  6247. supplies the infoset property or properties above is not defined.</p>
  6248.      </note>
  6249.     </constraintnote>
  6250.     </div3>
  6251.     <div3 id="coss-notation">
  6252.      <head>Constraints on Notation Declaration Schema Components</head>
  6253.   <p>All notation declarations (see <specref ref="cNotation_Declarations"/>) must satisfy the following constraint.</p>
  6254.   <constraintnote type="cos" id="n-props-correct">
  6255.    <head>Notation Declaration Correct</head>
  6256.      <p>The values of the properties of a notation declaration must be as described in
  6257. the property tableau in
  6258. <specref ref="Notation_Declaration_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>   
  6259.   </constraintnote>
  6260.     </div3>
  6261.    </div2>
  6262.    <div2 id="cAnnotations">
  6263.     <head>Annotations</head>
  6264.     <p>Annotations provide for human- and machine-targeted annotations of
  6265. schema components.</p>
  6266.     <note role="example">
  6267.       <eg xml:space="preserve"><![CDATA[<xs:simpleType fn:note="special">
  6268.   <xs:annotation>
  6269.    <xs:documentation>A type for experts only</xs:documentation>
  6270.    <xs:appinfo>
  6271.     <fn:specialHandling>checkForPrimes</fn:specialHandling>
  6272.    </xs:appinfo>
  6273.   </xs:annotation>]]>
  6274.      </eg>
  6275.       <p>XML representations of three kinds of annotation.</p>
  6276.      </note>
  6277. <div3 id="Annotation_details">
  6278.      <head>The Annotation Schema Component</head>
  6279.     <p>The annotation schema component has the following
  6280. properties:</p>
  6281. <compdef name="Annotation" ref="Annotation">
  6282.    <proplist>
  6283.   <propdef id="application_information" name="application information">
  6284.     A sequence of element information items.
  6285.    </propdef>
  6286.   <propdef id="user_information" name="user information">
  6287.     A sequence of element information items.
  6288.    </propdef>
  6289.     <propdef id="attributes" name="attributes">A sequence of attribute
  6290. information items.</propdef>
  6291. </proplist>
  6292.   </compdef>
  6293.     <p><propref ref="user_information"/> is intended for human consumption,
  6294. <propref ref="application_information"/> for automatic processing.  In both
  6295. cases, provision is made for an optional URI reference to supplement the local
  6296. information, as the value of the <code>source</code> attribute of the
  6297. respective element information items.  <termref def="key-vn">Validation</termref> does <emph>not</emph> involve dereferencing these URIs, when present.  In the case of <propref ref="user_information"/>, indication should be given as to the identity of the (human) language used in the contents, using the <code>xml:lang</code> attribute.</p>
  6298.      <p><propref ref="attributes"/> ensures that when schema authors take
  6299. advantage of the provision for adding attributes from namespaces other than the
  6300. XML Schema namespace to schema documents, they are available within the components
  6301. corresponding to the element items where such attributes appear.</p>
  6302.     <p>Annotations do not participate in <termref def="key-vn">validation</termref> as such.  Provided
  6303. an annotation itself satisfies all relevant <termref def="gloss-cos">Schema
  6304. Component Constraints</termref> it <emph>cannot</emph> affect the <termref def="key-vn">validation</termref> of element information items.</p>
  6305.     </div3>
  6306.     <div3 id="declare-annotation">
  6307. <head>XML Representation of Annotation Schema Components</head>
  6308.  <p>Annotation of schemas and schema components, with material for human or
  6309. computer consumption, is provided for by allowing application information and
  6310. human information at the beginning of most major schema elements, and anywhere
  6311. at the top level of schemas.  The XML representation for an annotation schema component is
  6312. an
  6313. <eltref ref="annotation"/>
  6314. element information item.    The correspondences between the
  6315. properties of that information item and
  6316. properties of the component it corresponds to are as follows:</p>
  6317.  <reprdef>
  6318.  <reprelt eltname="annotation"/>
  6319.  <reprelt eltname="appinfo"/>
  6320.  <reprelt eltname="documentation"/>
  6321.  <reprcomp abstract="Annotation" ref="Annotation_details">
  6322. <propmap name="application_information">A sequence of the <eltref ref="appinfo"/> element
  6323. information items from among the &i-children;, in order, if any, otherwise the
  6324. empty sequence.</propmap>
  6325. <propmap name="user_information">A sequence of the <eltref ref="documentation"/> element
  6326. information items from among the &i-children;, in order, if any, otherwise the
  6327. empty sequence.</propmap>
  6328.   <propmap name="attributes">A sequence of attribute information items, namely
  6329. those allowed by the attribute wildcard in the type definition for the <eltref ref="annotation"/> item itself or for the enclosing items which correspond to the component within which the annotation component is located.</propmap>
  6330. </reprcomp></reprdef>
  6331. <p>The annotation component corresponding to the <eltref ref="annotation"/>
  6332. element in the example above will have one element item in each of its <propref ref="user_information"/> and <propref ref="application_information"/> and one attribute item in its <propref ref="attributes"/>.</p></div3>
  6333.     <div3>
  6334.      <head>Constraints on XML Representations of Annotations</head>
  6335.  <constraintnote type="src" id="src-annotation">
  6336.    <head>Annotation Definition Representation OK</head>
  6337.    <p>In addition to the conditions imposed on <eltref ref="annotation"/> element
  6338. information items by the schema for schemas, the corresponding annotation must satisfy the conditions set
  6339. out in <specref ref="coss-annotation"/>.</p>
  6340.   </constraintnote>
  6341.     </div3>
  6342.     <div3>
  6343.      <head>Annotation Validation Rules</head>
  6344.      <p>None as such.</p>
  6345.     </div3>
  6346.     <div3>
  6347.      <head>Annotation Information Set Contributions</head>
  6348.      <p>None as such: the addition of annotations to the &PSVI; is
  6349. covered by the &PSVI; contributions of the enclosing components.</p>
  6350.     </div3>
  6351.     <div3 id="coss-annotation">
  6352.      <head>Constraints on Annotation Schema Components</head>
  6353.   <p>All annotations (see <specref ref="cAnnotations"/>) must satisfy the following constraint.</p>
  6354.   <constraintnote type="cos" id="an-props-correct">
  6355.    <head>Annotation Correct</head>
  6356.    <p>The values of the properties of an annotation must be as described in
  6357. the property tableau in
  6358. <specref ref="Annotation_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  6359.   </constraintnote>
  6360.     </div3>
  6361.    </div2>
  6362. <div2 id="Simple_Type_Definitions">
  6363.     <head>Simple Type Definitions</head>
  6364.  <note>
  6365.   <p>This section consists of a combination of non-normative versions of
  6366. normative material from <bibref ref="ref-xsp2"/>, for local cross-reference
  6367. purposes, and normative material relating to the interface between schema
  6368. components defined in this specification and the simple type definition component.</p>
  6369.  </note>
  6370.     <p>Simple type definitions provide for constraining character information item &i-children; of element and attribute
  6371. information items.</p>
  6372. <note role="example">
  6373.       <eg xml:space="preserve"><![CDATA[<xs:simpleType name="farenheitWaterTemp">
  6374.  <xs:restriction base="xs:number">
  6375.   <xs:fractionDigits value="2"/>
  6376.   <xs:minExclusive value="0.00"/>
  6377.   <xs:maxExclusive value="100.00"/>
  6378.  </xs:restriction>
  6379. </xs:simpleType>]]></eg>
  6380.  <p>The XML representation of a simple type definition.</p>
  6381.      </note>
  6382.     <div3 id="Simple_Type_Definition_details">
  6383.      <head>(non-normative) The Simple Type Definition Schema Component</head>
  6384. <p>The simple type definition schema component has the following properties:
  6385. </p>
  6386.  <compdef name="Simple Type Definition" ref="Simple_Type_Definition">
  6387.   <proplist>
  6388.    <propdef id="st-name" name="name">Optional.  An NCName as defined by
  6389. <bibref ref="ref-xml-namespaces"/>.</propdef>
  6390.    <propdef id="st-target_namespace" name="target namespace">Either
  6391. <termref def="key-null">absent</termref> or a namespace name, as defined in
  6392. <bibref ref="ref-xml-namespaces"/>.</propdef>
  6393.    <propdef id="st-base_type_definition" name="base type definition">A simple type definition, which may be the
  6394. <termref def="simple-ur-type-itself">simple ur-type definition</termref>.</propdef>
  6395.    <propdef id="facets" name="facets">A set of constraining
  6396. facets.</propdef>
  6397.    <propdef id="fundamental_facets" name="fundamental facets">A set of
  6398. fundamental facets.</propdef>
  6399.    <propdef id="st-final" name="final">
  6400.     A subset of {<pt>extension</pt>, <pt>list</pt>, <pt>restriction</pt>, <pt>union</pt>}.
  6401.    </propdef>
  6402.    <propdef id="variety" name="variety">One of {<pt>atomic</pt>, <pt>list</pt>,
  6403. <pt>union</pt>}.  Depending on the value of <propref ref="variety"/>, further properties are
  6404. defined as follows:
  6405.     <glist>
  6406.      <gitem>
  6407.       <label>atomic</label>
  6408.       <def>
  6409.        <proplist>
  6410.         <propdef id="st-primitive_type_definition" name="primitive type definition">A
  6411. built-in primitive simple type definition (or the
  6412. <termref def="simple-ur-type-itself">simple ur-type definition</termref>).</propdef>
  6413.        </proplist>
  6414.       </def>
  6415.      </gitem>
  6416.      <gitem>
  6417.       <label>list</label>
  6418.       <def>
  6419.        <proplist>
  6420.         <propdef id="st-item_type_definition" name="item type definition">A
  6421. simple type definition.</propdef>
  6422.        </proplist>
  6423.       </def>
  6424.      </gitem>
  6425.      <gitem>
  6426.       <label>union</label>
  6427.       <def>
  6428.        <proplist>
  6429.         <propdef id="st-member_type_definitions" name="member type definitions">A non-empty sequence of
  6430. simple type definitions.</propdef>
  6431.        </proplist>
  6432.       </def>
  6433.      </gitem>
  6434.     </glist>
  6435.    </propdef>    
  6436.    <propdef id="st-annotation" name="annotation">Optional.  An
  6437. annotation.</propdef>
  6438.   </proplist>
  6439.   </compdef>
  6440.  
  6441.    
  6442. <p>Simple types are identified by their <propref ref="st-name"/> and <propref ref="st-target_namespace"/>.  Except
  6443. for anonymous simple types (those with no <propref ref="st-name"/>), since
  6444. type definitions (i.e. both simple and complex type definitions taken together) must be uniquely identified within an <termref def="key-schema">XML
  6445. Schema</termref>, no simple type definition can have the same name as another
  6446. simple or complex type definition.  Simple type <propref ref="st-name"/>s and <propref ref="ct-target_namespace"/>s
  6447. are provided for reference from
  6448. instances (see <specref ref="xsi_type"/>), and for use in the XML
  6449. representation of schema components
  6450. (specifically in <eltref ref="element"/> and <eltref ref="attribute"/>).  See <specref ref="composition-schemaImport"/> for the use of component
  6451. identifiers when importing one schema into another.</p>
  6452. <note>
  6453. <p>The <propref ref="st-name"/> of a simple type is not <emph>ipso
  6454. facto</emph> the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">(local) name</xpropref> of the
  6455.   element or attribute information items <termref def="key-vn">validated</termref> by that definition. The connection between a
  6456.   name and a type definition is described in <specref ref="cElement_Declarations"/> and <specref ref="cAttribute_Declarations"/>. </p>
  6457. </note>
  6458.      <p>A simple type definition with an empty specification for <propref ref="st-final"/> can be used as the
  6459. <propref ref="st-base_type_definition"/> for other types derived by either of
  6460. extension or restriction, or as the <propref ref="st-item_type_definition"/> in
  6461. the definition of a list, or in the <propref ref="st-member_type_definitions"/> of
  6462. a union; the explicit values <pt>extension</pt>, <pt>restriction</pt>,
  6463. <pt>list</pt> and <pt>union</pt> prevent further
  6464. derivations by extension (to yield a complex type) and restriction (to yield a
  6465. simple type) and use in constructing lists and unions respectively.</p>
  6466. <p><propref ref="variety"/> determines whether the simple type corresponds to
  6467. an <pt>atomic</pt>, <pt>list</pt> or <pt>union</pt> type as defined by &XSP2;.</p> 
  6468. <p>As described in <specref ref="Type_Derivation"/>, every simple type definition is
  6469. a <termref def="key-typeRestriction">restriction</termref> of some other simple
  6470. type (the <propref ref="st-base_type_definition"/>), which is the simple
  6471. <termref def="key-urType">ur-type definition</termref> if and only if the type
  6472. definition in question is one of the built-in primitive datatypes, or a list or
  6473. union type definition. Each
  6474. <emph>atomic</emph> type is ultimately a restriction of exactly one such built-in simple <propref ref="st-primitive_type_definition"/>.</p>
  6475. <p><propref ref="facets"/> for each simple type definition are selected from those defined in
  6476. &XSP2;.  For <pt>atomic</pt> definitions, these are restricted to those appropriate for
  6477. the corresponding <propref ref="st-primitive_type_definition"/>.  Therefore, the value
  6478. space and lexical space (i.e. what is <termref def="key-vn">validated</termref> by any atomic simple type) is determined by the
  6479. pair (<propref ref="st-primitive_type_definition"/>, <propref ref="facets"/>). </p>
  6480. <p>As specified in &XSP2;, <pt>list</pt> simple type definitions <termref def="key-vn">validate</termref> space separated tokens, each of
  6481. which conforms to a specified simple type definition, the <propref ref="st-item_type_definition"/>.  The item type specified
  6482. must not itself be a <pt>list</pt> type, and must be one of the types identified in &XSP2; as a
  6483. suitable item type for a list simple type.  In this case the <propref ref="facets"/>
  6484. apply to the list itself, and are restricted to those appropriate for lists.</p>
  6485. <p>A <pt>union</pt> simple type definition <termref def="key-vn">validates</termref> strings which satisfy at
  6486. least one of its <propref ref="st-member_type_definitions"/>.  As in the case of
  6487. <pt>list</pt>, the <propref ref="facets"/>
  6488. apply to the union itself, and are restricted to those appropriate for unions.</p>
  6489.  <p>As discussed in
  6490. <specref ref="Type_Derivation"/>, the <termref def="key-urType">ur-type
  6491. definition</termref> functions as a simple type when used as the <termref def="st-base_type_definition">base type definition</termref> for the built-in primitive datatypes and for list and union type definitions.  It is considered to have an unconstrained lexical space, and a value space consisting of the union of the value spaces of all the built-in primitive datatypes and the set of all lists of all members of the value spaces of all the built-in primitive datatypes.</p>
  6492.  <p>The simple <termref def="key-urType">ur-type
  6493. definition</termref> must <emph>not</emph> be named as the <termref def="st-base_type_definition">base type definition</termref> of any user-defined simple types:  as it has no constraining facets, this would be incoherent.</p>
  6494.      <p>See <specref ref="cAnnotations"/> for information on the role of the
  6495. <propref ref="st-annotation"/> property.</p>
  6496.     </div3>
  6497.  <div3 id="declare-datatype">
  6498.   <head>(non-normative) XML Representation of Simple Type Definition Schema Components</head>
  6499. <note>
  6500.   <p>This section reproduces a version of material from <bibref ref="ref-xsp2"/>, for local cross-reference purposes.</p>
  6501.  </note>
  6502.  <reprdef>
  6503.  <reprelt eltname="simpleType" type="simpleType"/>
  6504.  <reprelt eltname="restriction"/>
  6505.  <reprelt eltname="list"/>
  6506.  <reprelt eltname="union"/>
  6507.  <reprcomp abstract="Simple Type Definition" ref="Simple_Type_Definition_details">
  6508.   <propmap name="st-name">The &v-value; of the <code>name</code> &i-attribute; if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  6509.   <propmap name="st-target_namespace">The &v-value; of the
  6510. <code>targetNamespace</code> &i-attribute; of the <eltref ref="schema"/> ancestor
  6511. element information item if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  6512.   <propmap name="st-base_type_definition">
  6513.    <olist role="Caseval">
  6514.     <item>
  6515.      <p role="if">the <eltref ref="restriction"/> alternative is chosen</p>
  6516.      <p role="then">the type definition <termref def="src-resolve">resolved</termref> to by the
  6517. &v-value; of the <code>base</code> &i-attribute; of <eltref ref="restriction"/>, if present, otherwise the
  6518. type definition corresponding to the <eltref ref="simpleType"/> among
  6519. the &i-children; of <eltref ref="restriction"/>.</p>
  6520.     </item>
  6521.     <item>
  6522.      <p role="if">the <eltref ref="list"/> or <eltref ref="union"/> alternative is chosen</p>
  6523.      <p role="then">the <termref def="simple-ur-type-itself">simple ur-type definition</termref>.</p>
  6524.     </item>
  6525.    </olist>
  6526.   </propmap>
  6527.   <propmap name="st-final">As for the <propref ref="ct-exact"/> property of
  6528. complex type definitions, but using the
  6529. <code>final</code> and <code>finalDefault</code> &i-attributes; in place of the
  6530. <code>block</code> and <code>blockDefault</code>
  6531. &i-attributes; and with the
  6532. relevant set being <code>{</code><pt>extension</pt>,
  6533. <pt>restriction</pt>, <pt>list</pt>, <pt>union</pt><code>}</code>.</propmap>
  6534.   <propmap name="variety">If the <eltref ref="list"/> alternative is chosen,
  6535. then <pt>list</pt>, otherwise if the <eltref ref="union"/> alternative is
  6536. chosen, then <pt>union</pt>, otherwise (the <eltref ref="restriction"/>
  6537. alternative is chosen), then the <propref ref="variety"/> of the <propref ref="st-base_type_definition"/>.</propmap>
  6538. </reprcomp>
  6539.   <p>If the <propref ref="variety"/> is <pt>atomic</pt>, the following
  6540. additional property mappings also apply:</p>
  6541.   <reprcomp abstract="Atomic Simple Type Definition" ref="Simple_Type_Definition_details">
  6542.    <propmap name="st-primitive_type_definition">The built-in primitive type
  6543. definition from which the <propref ref="st-base_type_definition"/> is derived.</propmap>
  6544.    <propmap name="facets">A set of facet components <termref def="key-facets-restriction">constituting a restriction</termref>
  6545. of the <propref ref="facets"/> of the
  6546. <propref ref="st-base_type_definition"/> with respect to a
  6547. set of facet components corresponding to the appropriate element information items among the
  6548. &i-children; of <eltref ref="restriction"/> (i.e. those which specify facets, if any), as
  6549. defined in <specref ref="st-restrict-facets"/>.</propmap>
  6550. </reprcomp>
  6551.   <p>If the <propref ref="variety"/> is <pt>list</pt>, the following
  6552. additional property mappings also apply:</p>
  6553.   <reprcomp abstract="List Simple Type Definition" ref="Simple_Type_Definition_details">
  6554.    <propmap name="st-item_type_definition">
  6555.     <olist role="Caseval">
  6556.      <item>
  6557.       <p role="if">the <eltref ref="list"/> alternative is chosen</p>
  6558.       <p role="then">the type definition <termref def="src-resolve">resolved</termref> to by the
  6559. &v-value; of the <code>itemType</code> &i-attribute; of <eltref ref="list"/>, if present, otherwise the
  6560. type definition corresponding to the <eltref ref="simpleType"/> among
  6561. the &i-children; of <eltref ref="list"/>.</p>
  6562.      </item>
  6563.      <item>
  6564.       <p role="if">the <eltref ref="restriction"/> option is chosen</p>
  6565.       <p role="then">the <propref ref="st-item_type_definition"/> of the <propref ref="st-base_type_definition"/>.</p>
  6566.      </item>
  6567.     </olist>
  6568.    </propmap>
  6569.    <propmap name="facets">If the <eltref ref="restriction"/> alternative is
  6570. chosen, a set of facet components <termref def="key-facets-restriction">constituting a restriction</termref>
  6571. of the <propref ref="facets"/> of the
  6572. <propref ref="st-base_type_definition"/> with respect to a
  6573. set of facet components corresponding to the appropriate element information items among the
  6574. &i-children; of <eltref ref="restriction"/> (i.e. those which specify facets, if any), as
  6575. defined in <specref ref="st-restrict-facets"/>, otherwise the empty set.</propmap>
  6576. </reprcomp>
  6577.   <p>If the <propref ref="variety"/> is <pt>union</pt>, the following
  6578. additional property mappings also apply:</p>
  6579.   <reprcomp abstract="Union Simple Type Definition" ref="Simple_Type_Definition_details">
  6580.    <propmap name="st-member_type_definitions"><olist role="Caseval">
  6581.      <item>
  6582.       <p role="if">the <eltref ref="union"/> alternative is chosen</p>
  6583.       <p role="then"><termdef id="key-exm" term="explicit members" role="local">define the
  6584. <term>explicit members</term> as</termdef> the type definitions <termref def="src-resolve">resolved</termref> to by the
  6585. items in the &v-value; of the <code>memberTypes</code>
  6586. &i-attribute;, if any, followed by the
  6587. type definitions corresponding to the <eltref ref="simpleType"/>s among the
  6588. &i-children; of <eltref ref="union"/>, if any.  The actual value is then formed by replacing any union type definition
  6589. in the <termref def="key-exm">explicit members</termref> with the members of
  6590. their <propref ref="st-member_type_definitions"/>, in order.</p>
  6591.      </item>
  6592.      <item>
  6593.       <p role="if">the <eltref ref="restriction"/> option is chosen</p>
  6594.       <p role="then">the <propref ref="st-member_type_definitions"/> of the <propref ref="st-base_type_definition"/>.</p>
  6595.      </item>
  6596.     </olist>
  6597.    </propmap>
  6598.    <propmap name="facets">If the <eltref ref="restriction"/> alternative is
  6599. chosen, a set of facet components <termref def="key-facets-restriction">constituting a restriction</termref>
  6600. of the <propref ref="facets"/> of the
  6601. <propref ref="st-base_type_definition"/> with respect to a
  6602. set of facet components corresponding to the appropriate element information items among the
  6603. &i-children; of <eltref ref="restriction"/> (i.e. those which specify facets, if any), as
  6604. defined in <specref ref="st-restrict-facets"/>, otherwise the empty set.</propmap>
  6605. </reprcomp>
  6606.  </reprdef>
  6607. </div3>
  6608.     <div3>
  6609.      <head>(non-normative) Constraints on XML Representations of Simple Type Definitions</head>
  6610.      <constraintnote type="src" id="src-simple-type">
  6611.       <head>Simple Type Definition Representation OK</head>
  6612.       <p>In addition to the conditions imposed on <eltref ref="simpleType"/> element
  6613. information items by the schema for schemas,
  6614.    <olist role="and">
  6615.     <item>
  6616.      <p>The corresponding simple type definition, if any, must satisfy the conditions set
  6617. out in <specref ref="coss-st"/>.</p>
  6618.     </item>
  6619.     <item><p>If the <eltref ref="restriction"/> alternative is chosen, either
  6620. it must have a <code>base</code> &i-attribute; or a <eltref ref="simpleType"/>
  6621. among its &i-children;, but not both.</p>
  6622.     </item>
  6623.     <item><p>If the <eltref ref="list"/> alternative is chosen, either
  6624. it must have an <code>itemType</code> &i-attribute; or a <eltref ref="simpleType"/>
  6625. among its &i-children;, but not both.</p>
  6626.     </item>
  6627.     <item>
  6628.       <p>Circular union type definition is disallowed.  That is, if the <eltref ref="union"/> alternative is chosen, there must not be any entries in the <code>memberTypes</code> &i-attribute; at any depth which resolve to the component corresponding to the <eltref ref="simpleType"/>.</p>
  6629.      </item>
  6630.    </olist>
  6631.   </p>
  6632.      </constraintnote>
  6633.   <constraintnote type="src" id="st-restrict-facets">
  6634.    <head>Simple Type Restriction (Facets)</head>
  6635.    <p>For a simple type definition (call it <local>R</local>) to restrict another simple type
  6636. definition (call it <local>B</local>) with a
  6637. set of facets (call this <local>S</local>)
  6638.     <olist role="and">
  6639.      <item>
  6640.       <p>The <propref ref="variety"/> and <propref ref="st-primitive_type_definition"/> of <local>R</local> are the same as those of <local>B</local>.</p>
  6641.      </item>
  6642.      <item id="c-fr">
  6643.       <p>The <propref ref="facets"/> of <local>R</local> are the union of <local>S</local> and
  6644. the <propref ref="facets"/> of <local>B</local>, eliminating duplicates.  To eliminate
  6645. duplicates, when a facet of the same kind occurs in both <local>S</local> and
  6646. the <propref ref="facets"/> of <local>B</local>, the one in the <propref ref="facets"/>
  6647. of <local>B</local> is not included, with the exception of <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-enumeration">enumeration</xtermref> and <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dt-pattern">pattern</xtermref> facets, for which multiple occurrences with distinct values are allowed.</p>
  6648.      </item>
  6649.     </olist>
  6650.    </p>
  6651.    <p><termdef id="key-facets-restriction" term="constitute a restriction" role="local">If
  6652. <clauseref ref="c-fr"/> above holds, the <propref ref="facets"/> of <local>R</local>
  6653. <term>constitute a restriction</term> of the <propref ref="facets"/> of
  6654. <local>B</local> with respect to <local>S</local></termdef>.</p>
  6655.   </constraintnote>
  6656.     </div3>
  6657.     <div3>
  6658.      <head>Simple Type Definition Validation Rules</head>
  6659.  <constraintnote type="cvc" id="cvc-simple-type">
  6660.  <head>String Valid</head>
  6661.  <p>A string is locally <termref def="key-vn">valid</termref> with respect to a simple type definition if
  6662.   it is schema-valid with respect to that definition as defined by
  6663. <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#cvc-datatype-valid">Datatype Valid</xtermref> in <bibref ref="ref-xsp2"/>.
  6664.  </p>
  6665. </constraintnote>
  6666.     </div3>
  6667.     <div3>
  6668.      <head>Simple Type Definition Information Set
  6669. Contributions</head>
  6670.      <p>None as such.</p>
  6671.     </div3>
  6672.     <div3 id="coss-st">
  6673.      <head>Constraints on Simple Type Definition
  6674. Schema Components</head>
  6675.   <p>All simple type definitions (see <specref ref="Simple_Type_Definitions"/>) must satisfy the following constraints.</p>
  6676.   <constraintnote type="cos" id="st-props-correct">
  6677.    <head>Simple Type Definition Properties Correct</head>
  6678.    <olist role="And">
  6679.     <item><p>The values of the properties of a simple type definition must be as described in
  6680. the property tableau in
  6681. <xspecref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#dc-defn">Datatype definition</xspecref>, modulo the impact of <specref ref="conformance-missing"/>.</p></item>
  6682.     <item><p>Circular definitions are disallowed.  That is, it must be possible to reach a built-in
  6683. primitive datatype or the <termref def="simple-ur-type-itself">simple ur-type definition</termref> by repeatedly following the <propref ref="st-base_type_definition"/>.</p></item>
  6684.     <item>
  6685.            <p>The <propref ref="st-final"/> of the <propref ref="st-base_type_definition"/> must not contain <pt>restriction</pt>.</p>
  6686.           </item>
  6687.     <item>
  6688.      <p>If the <propref ref="st-base_type_definition"/> is not the <termref def="simple-ur-type-itself">simple ur-type definition</termref>, 
  6689.       <olist role="and">
  6690.        <item>
  6691.         <p>The definition must be a <termref def="cd-st-restriction">valid restriction</termref> as defined in
  6692. <specref ref="cos-st-restricts"/>.</p>
  6693.        </item>
  6694.        <item>
  6695.         <p>If <propref ref="variety"/> is not <pt>atomic</pt>, then
  6696.          <olist role="case">
  6697.          <item>
  6698.           <p role="if">the <propref ref="variety"/> is <pt>list</pt></p>
  6699.           <p role="then">the <propref ref="st-final"/> of the <propref ref="st-base_type_definition"/> must not contain <pt>list</pt>.</p>
  6700.          </item>
  6701.          <item>
  6702.           <p role="if">the <propref ref="variety"/> is <pt>union</pt></p>
  6703.           <p role="then">the <propref ref="st-final"/> of the <propref ref="st-base_type_definition"/> must not contain <pt>union</pt>.</p>
  6704.          </item>
  6705.         </olist>
  6706.         </p>
  6707.        </item>
  6708.       </olist>
  6709.      </p>
  6710.     </item>
  6711.    </olist>
  6712.  
  6713.   </constraintnote>
  6714.   <constraintnote type="cos" id="cos-st-restricts">
  6715. <head>Derivation Valid (Restriction, Simple)</head>
  6716.    <olist role="Case">
  6717.     <item>
  6718.      <p role="if">the <propref ref="variety"/> is <pt>atomic</pt></p>
  6719.      <p role="then">
  6720.       <olist role="and">
  6721.       <item>
  6722.        <p>The <propref ref="st-base_type_definition"/> must be an atomic simple type
  6723. definition or a built-in
  6724. primitive datatype.</p>
  6725.       </item>
  6726.        <item>
  6727.            <p>The <propref ref="st-final"/> of the <propref ref="st-base_type_definition"/> must not contain <pt>restriction</pt>.</p>
  6728.           </item>
  6729.       <item>
  6730.        <p>For each facet in the <propref ref="facets"/> there must be a facet of the same kind in the
  6731. <propref ref="facets"/> of the <propref ref="st-base_type_definition"/> of
  6732. whose <xpropref role="anon">value</xpropref> the facet in question's <xpropref role="anon">value</xpropref> must be a valid restriction as
  6733. defined in <bibref ref="ref-xsp2"/>.</p>
  6734.       </item>
  6735.      </olist></p>
  6736.     </item>
  6737.     <item>
  6738.        <p role="if">the <propref ref="variety"/> is <pt>list</pt></p>
  6739.        <p role="then">
  6740.         <olist role="and">
  6741.         <item>
  6742.          <p>The <propref ref="st-item_type_definition"/> must have a <propref ref="variety"/> of <pt>atomic</pt> or <pt>union</pt> (in which case all the <propref ref="st-member_type_definitions"/> must be <pt>atomic</pt>).</p>
  6743.         </item>
  6744.         <item><p>Only <pt>length</pt>, <pt>minLength</pt>, <pt>maxLength</pt>,
  6745. <pt>pattern</pt> and <pt>enumeration</pt> facet components are allowed among
  6746. the <propref ref="facets"/>.</p></item>
  6747.         <item>
  6748.           <p>If the <propref ref="st-base_type_definition"/> is not the
  6749. <termref def="simple-ur-type-itself">simple ur-type definition</termref>, then 
  6750.            <olist role="and">
  6751.             <item>
  6752.              <p>The <propref ref="st-base_type_definition"/> must have a <propref ref="variety"/> of <pt>list</pt>.</p>
  6753.             </item>
  6754.             <item>
  6755.            <p>The <propref ref="st-final"/> of the <propref ref="st-base_type_definition"/> must not contain <pt>restriction</pt>.</p>
  6756.           </item>
  6757.             <item>
  6758.              <p>for each facet in the <propref ref="facets"/> there must be a facet of the same kind in the
  6759. <propref ref="facets"/> of the <propref ref="st-base_type_definition"/> of
  6760. whose <xpropref role="anon">value</xpropref> the facet in question's <xpropref role="anon">value</xpropref> must be a valid restriction as
  6761. defined in <bibref ref="ref-xsp2"/>.</p>
  6762.             </item>
  6763.            </olist>
  6764.           </p>
  6765.          </item>
  6766.        </olist></p>
  6767.       </item>
  6768.     <item>
  6769.        <p role="if">the <propref ref="variety"/> is <pt>union</pt></p>
  6770.        <p role="then">
  6771.         <olist role="and">
  6772.         <item>
  6773.          <p>The <propref ref="st-member_type_definitions"/> must all have <propref ref="variety"/> of <pt>atomic</pt> or <pt>list</pt>.</p>
  6774.         </item>
  6775.         <item><p>Only <pt>pattern</pt> and <pt>enumeration</pt> facet components are allowed among
  6776. the <propref ref="facets"/>.</p></item>
  6777.         <item>
  6778.           <p>If the <propref ref="st-base_type_definition"/> is not the
  6779. <termref def="simple-ur-type-itself">simple ur-type definition</termref>, then 
  6780.            <olist role="and">
  6781.             <item>
  6782.              <p>The <propref ref="st-base_type_definition"/> must have a <propref ref="variety"/> of <pt>union</pt>.</p>
  6783.             </item>
  6784.             <item>
  6785.            <p>The <propref ref="st-final"/> of the <propref ref="st-base_type_definition"/> must not contain <pt>restriction</pt>.</p>
  6786.           </item>
  6787.             <item>
  6788.              <p>for each facet in the <propref ref="facets"/> there must be a facet of the same kind in the
  6789. <propref ref="facets"/> of the <propref ref="st-base_type_definition"/> of
  6790. whose <xpropref role="anon">value</xpropref> the facet in question's <xpropref role="anon">value</xpropref> must be a valid restriction as
  6791. defined in <bibref ref="ref-xsp2"/>.</p>
  6792.             </item>
  6793.            </olist>
  6794.           </p>
  6795.          </item>
  6796.        </olist></p>
  6797.       </item>
  6798.    </olist>
  6799.    <p><termdef id="cd-st-restriction" term="valid restriction">If this
  6800. constraint <specref ref="cos-st-restricts"/> holds of a simple type definition, it is a <term>valid
  6801. restriction</term> of its <termref def="st-base_type_definition">base type definition</termref></termdef>.</p>
  6802. </constraintnote>
  6803.     <p>The following constraint defines relations appealed to elsewhere in this specification.</p>
  6804.     <constraintnote id="cos-st-derived-ok" type="cos">
  6805.    <head>Type Derivation OK (Simple)</head>
  6806.    <p>For a simple type definition (call it <local>D</local>, for derived) to be validly
  6807. derived from a simple type definition (call this <local>B</local>, for base) given a
  6808. subset of {<pt>extension</pt>, <pt>restriction</pt>, <pt>list</pt>, <pt>union</pt>} (of which
  6809. only <pt>restriction</pt> is actually relevant)
  6810.     <olist role="or">
  6811.      <item>
  6812.       <p>They are the same type definition.</p>
  6813.      </item>
  6814.      <item>
  6815.       <olist role="And">     
  6816.      <item>
  6817.       <p><pt>restriction</pt> is not in the
  6818. subset, or in the <propref ref="st-final"/> of its own <propref ref="st-base_type_definition"/>;</p>
  6819.      </item>
  6820.      <item>      
  6821.       <olist role="Or">
  6822.       <item>
  6823.       <p><local>D</local>'s <termref def="st-base_type_definition">base type definition</termref> is <local>B</local>.</p>
  6824.      </item>
  6825.        <item>
  6826.          <p><local>D</local>'s <termref def="st-base_type_definition">base type definition</termref> is not the
  6827. <termref def="simple-ur-type-itself">simple ur-type definition</termref> and is validly derived
  6828. from <local>B</local> given the subset, as defined by this constraint.</p>
  6829.         </item>
  6830.        <item>
  6831.          <p><local>D</local>'s <propref ref="variety"/> is <pt>list</pt> or <pt>union</pt> and <local>B</local>
  6832. is the <termref def="simple-ur-type-itself">simple ur-type definition</termref>.</p>
  6833.         </item>
  6834.        <item>
  6835.         <p><local>B</local>'s <propref ref="variety"/> is <pt>union</pt> and
  6836. <local>D</local> is validly derived
  6837. from a type definition in <local>B</local>'s <propref ref="st-member_type_definitions"/> given the subset, as defined by this constraint.</p>
  6838.        </item>
  6839.     </olist> 
  6840.      </item>
  6841.     </olist>
  6842.      </item>
  6843.     </olist>    
  6844.    </p>
  6845.   </constraintnote>
  6846.     </div3>
  6847.  <div3>
  6848.   <head>Built-in Simple Type Definition</head>
  6849.  <p>There is a simple type definition nearly equivalent to the simple version
  6850. of the <termref def="key-urType">ur-type definition</termref> present in every
  6851. schema by definition.  It has the following properties:</p>
  6852.  <schemaComp id="simple-ur-type-itself">
  6853.      <head>Simple Type Definition of the Ur-Type</head>
  6854.      <pvlist>
  6855.       <pvpair ref="st-name">anySimpleType</pvpair>
  6856.       <pvpair ref="st-target_namespace">http://www.w3.org/2001/XMLSchema</pvpair>
  6857.       <pvpair ref="st-base_type_definition"><termref def="ur-type-itself">the
  6858. ur-type definition</termref></pvpair>
  6859.       <pvpair ref="st-final">The empty set</pvpair>
  6860.       <pvpair ref="variety"><termref def="key-null">absent</termref></pvpair>
  6861.      </pvlist>
  6862.     </schemaComp>
  6863.   <p>Simple type definitions for all the built-in primitive datatypes, namely <pt>string</pt>, <pt>boolean</pt>, <pt>float</pt>,
  6864. <pt>double</pt>, <pt>number</pt>, <pt>dateTime</pt>, <pt>duration</pt>,
  6865. <pt>time</pt>, <pt>date</pt>, <pt>gMonth</pt>, <pt>gMonthDay</pt>, <pt>gDay</pt>, <pt>gYear</pt>, <pt>gYearMonth</pt>, <pt>hexBinary</pt>, <pt>base64Binary</pt>, <pt>anyURI</pt> (see the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#built-in-primitive-datatypes">Primitive
  6866. Datatypes</xtermref> section of &XSP2;), as well as for the
  6867. simple and complex <termref def="key-urType">ur-type definitions</termref> (as previously described), are present by definition in every schema.  All
  6868. are in the XML Schema <propref ref="st-target_namespace"/> (namespace
  6869. name <code>http://www.w3.org/2001/XMLSchema</code>), have an <pt>atomic</pt> <propref ref="variety"/> with an empty
  6870. <propref ref="facets"/> and the simple <termref def="key-urType">ur-type definition</termref> as
  6871. their <termref def="st-base_type_definition">base type definition</termref> and themselves as <propref ref="st-primitive_type_definition"/>.</p>
  6872. <p>Similarly, simple type definitions for all the built-in derived
  6873. datatypes (see the <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#built-in-derived">Derived
  6874. Datatypes</xtermref> section of &XSP2;) are present by definition in every schema, with
  6875. properties as specified in &XSP2; and as represented in XML in
  6876. <specref ref="normative-schemaSchema"/>.</p>
  6877.  </div3>
  6878.    </div2>
  6879.    <div2 id="Schemas">
  6880.     <head>Schemas as a Whole</head>
  6881.     <p>A schema consists of a set of schema components.</p>
  6882.     <note role="example">
  6883.         <eg xml:space="preserve"><xs:schema
  6884.     xmlns:xs="http://www.w3.org/2001/XMLSchema"
  6885.     targetNamespace="http://www.example.com/example">
  6886.   . . .
  6887. </xs:schema></eg>
  6888.         <p>The XML representation of the skeleton of a schema.</p>
  6889.     </note>
  6890.     <div3 id="Schema_details">
  6891.      <head>The Schema Itself</head>
  6892.     <p>At the abstract level, the schema itself is just a container for its components.</p>
  6893.     <compdef name="Schema" ref="key-schema">
  6894.      <proplist>
  6895.       <propdef id="type_definitions" name="type definitions">A set of
  6896. named simple and complex type definitions.</propdef>
  6897.       <propdef id="attribute_declarations" name="attribute declarations">A set of
  6898. named (top-level) attribute declarations.</propdef>
  6899.       <propdef id="element_declarations" name="element declarations">A set of
  6900. named (top-level) element declarations.</propdef>
  6901.       <propdef id="attribute_group_definitions" name="attribute group definitions">A set of named
  6902. attribute group definitions.</propdef>
  6903.       <propdef id="model_group_definitions" name="model group definitions">A set of named
  6904. model group definitions.</propdef>
  6905.       <propdef id="notation_declarations" name="notation declarations">A set of
  6906. notation declarations.</propdef>
  6907.       <propdef id="annotations" name="annotations">A set of annotations.</propdef>
  6908.      </proplist>
  6909.     </compdef>
  6910.     </div3>
  6911.     <div3 id="declare-schema">
  6912.       <head>XML Representations of Schemas</head>
  6913.      <p>A schema is represented in XML by one or more <termref def="key-schemaDoc">schema documents</termref>, that is, one or more <eltref ref="schema"/> element information items.  A <termref def="key-schemaDoc">schema document</termref> contains representations for a collection of schema components, e.g. type definitions and element declarations, which have a common <xpropref role="anon">target namespace</xpropref>.  A <termref def="key-schemaDoc">schema document</termref> which has one or more <eltref ref="import"/> element information items corresponds to a schema with components with more than one <xpropref role="anon">target namespace</xpropref>, see <specref ref="src-import"/>.</p>
  6914.      <reprdef>
  6915.       <reprelt eltname="schema"/>
  6916.       <reprcomp abstract="Schema" ref="key-schema">
  6917.        <propmap name="type_definitions">The simple and complex type definitions
  6918. corresponding to all the <eltref ref="simpleType"/> and <eltref ref="complexType"/> element information items in the
  6919. &i-children;, if any, plus any included or imported definitions, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
  6920.        <propmap name="attribute_declarations">The (top-level) attribute declarations
  6921. corresponding to all the <eltref ref="attribute"/> element information items in the
  6922. &i-children;, if any, plus any included or imported declarations, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
  6923.        <propmap name="element_declarations">The (top-level) element declarations
  6924. corresponding to all the <eltref ref="element"/> element information items in the
  6925. &i-children;, if any, plus any included or imported declarations, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
  6926.        <propmap name="attribute_group_definitions">The attribute group definitions
  6927. corresponding to all the <eltref ref="attributeGroup"/> element information items in the
  6928. &i-children;, if any, plus any included or imported definitions, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
  6929.        <propmap name="model_group_definitions">The model group definitions
  6930. corresponding to all the <eltref ref="group"/> element information items in the
  6931. &i-children;, if any, plus any included or imported definitions, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
  6932.        <propmap name="notation_declarations">The notation declarations
  6933. corresponding to all the <eltref ref="notation"/> element information items in the
  6934. &i-children;, if any, plus any included or imported declarations, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
  6935.        <propmap name="annotations">The annotations
  6936. corresponding to all the <eltref ref="annotation"/> element information items in the
  6937. &i-children;, if any.</propmap>
  6938.       </reprcomp>
  6939.      </reprdef>
  6940.      <p>Note that none of the attribute information items displayed above
  6941. correspond directly to properties of schemas.  The <code>blockDefault</code>,
  6942. <code>finalDefault</code>, <code>attributeFormDefault</code>, <code>elementFormDefault</code>and <code>targetNamespace</code> attributes are appealed to in the sub-sections above, as they provide
  6943. global information applicable to many representation/component correspondences.  The
  6944. other attributes (<code>id</code> and <code>version</code>) are for user
  6945. convenience, and this specification defines no semantics for them.</p>
  6946.  <p>The definition of the schema abstract data model in <specref ref="concepts-data-model"/> makes clear that most components have a <xpropref role="anon">target namespace</xpropref>.  Most components corresponding to representations within a given <eltref ref="schema"/> element information item will have a <xpropref role="anon">target namespace</xpropref> which corresponds to the <code>targetNamespace</code> attribute. </p>
  6947.      <p>Since the empty string is not a legal namespace name, supplying
  6948. an empty string for <code>targetNamespace</code> is incoherent, and is <emph>not</emph> the same
  6949. as not specifying it at all.  The appropriate form of schema document
  6950. corresponding to a <termref def="key-schema">schema</termref> whose components have no
  6951. <propref ref="e-target_namespace"/> is one which has no
  6952. <code>targetNamespace</code> attribute specified at all.</p>
  6953.      <note><p>The XML namespaces Recommendation discusses only instance document syntax for
  6954. elements and attributes; it therefore provides no direct framework for managing
  6955. the names of type definitions, attribute group definitions, and so on.
  6956. Nevertheless, the specification applies the target namespace facility uniformly to all
  6957. schema components, i.e. not only declarations but also definitions have a <xpropref role="anon">target namespace</xpropref>.</p>
  6958. </note>
  6959.      <p>Although the example schema at the beginning of this section might be a complete XML document, <eltref ref="schema"/>
  6960. need not be the document element, but can appear within other documents.
  6961. Indeed there is no requirement that a schema correspond to a (text) document
  6962. at all:  it could correspond to an element information item constructed 'by
  6963. hand', for instance via a DOM-conformant API.</p>
  6964.     <p>Aside from <eltref ref="include"/> and <eltref ref="import"/>, which do not correspond directly to any schema component at all, each of the element information
  6965. items which may appear in the content of <eltref ref="schema"/> corresponds to
  6966. a schema component, and all except <eltref ref="annotation"/> are named.  The
  6967. sections below
  6968. present each such item in turn, setting out the
  6969. components to which it may correspond.</p>
  6970. <div4 id="refSchemaConstructs">
  6971.   <head>References to Schema Components</head>
  6972.   <p>Reference to
  6973.    schema components from a schema document is managed in a uniform way,
  6974. whether the component corresponds to an element information item from the same schema document or is imported
  6975. (<specref ref="composition-schemaImport"/>) from an external schema (which may,
  6976. but need not, correspond to an actual schema document). The form
  6977. of all such references is a
  6978.     <termref def="gloss-QName">QName</termref>.</p>
  6979.  <p><termdef id="gloss-QName" term="QName">A <term>QName</term> is a name
  6980. with an optional namespace qualification, as defined in <bibref ref="ref-xml-namespaces"/>.  When used in connection with the XML
  6981. representation of schema components or references to them, this refers to the
  6982. simple type <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#QName">QName</xtermref> as defined in <bibref ref="ref-xsp2"/></termdef>.</p>
  6983.  <p><termdef id="gloss-NCName" term="NCName">An <term>NCName</term> is a name
  6984. with no colon, as defined in <bibref ref="ref-xml-namespaces"/>.  When used in connection with the XML
  6985. representation of schema components in this specification, this refers to the
  6986. simple type <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#NCName">NCName</xtermref> as defined in <bibref ref="ref-xsp2"/></termdef>.</p>
  6987.  <p>In each of the XML
  6988. representation expositions in the following sections, an attribute is shown as
  6989. having type <code>QName</code> if and only if it is
  6990. interpreted as referencing a schema component.</p>
  6991.  
  6992.   <note role="example">
  6993.     <eg xml:space="preserve"><![CDATA[<xs:schema xmlns:xs="]]>http://www.w3.org/2001/XMLSchema<![CDATA["
  6994.             xmlns:xhtml="http://www.w3.org/1999/xhtml"
  6995.             xmlns="http://www.example.com"
  6996.             targetNamespace="http://www.example.com">
  6997.   . . .
  6998.  
  6999.   <xs:element name="elem1" type="Address"/>
  7000.  
  7001.   <xs:element name="elem2" type="xhtml:blockquote"/>
  7002.  
  7003.   <xs:attribute name="attr1"
  7004.                 type="xsl:quantity"/>
  7005.   . . .
  7006. </xs:schema>
  7007. ]]>
  7008. </eg>
  7009.     <p>The first of these is most probably a local reference, i.e. a reference
  7010. to a type
  7011. definition corresponding to a <eltref ref="complexType"/> element information item
  7012. located elsewhere in the schema document, the other two refer to type
  7013. definitions from schemas for other namespaces and assume that their namespaces
  7014. have been declared for import.  See <specref ref="composition-schemaImport"/> for a discussion of importing.</p>
  7015. </note>
  7016. </div4>
  7017.     <div4>
  7018.   <head>References to Schema Components from Elsewhere</head>
  7019.     <p>The names of schema components such as type definitions and element
  7020. declarations are not of type <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref>:  they are not
  7021. unique within a schema, just within a symbol space.  This means that simple
  7022. fragment identifiers will not always work to reference schema components from outside
  7023. the context of schema documents.</p>
  7024.     <p>There is currently no provision in the definition of the interpretation
  7025. of fragment identifiers for the <code>text/xml</code> MIME type, which is the
  7026. MIME type for schemas, for referencing
  7027. schema components as such.  However, 
  7028. <bibref ref="ref-xpointer"/> provides a mechanism which maps well onto the
  7029. notion of symbol spaces as it is reflected in the XML representation of schema components.  A fragment identifier of the form
  7030. <code>#xpointer(xs:schema/xs:element[@name="person"])</code> will uniquely identify
  7031. the representation of a top-level element declaration with name <code>person</code>, and similar fragment
  7032. identifiers can obviously be constructed for the other global symbol spaces.</p>
  7033.   <p>Short-form fragment identifiers may also be used in some cases, that is
  7034. when a DTD or XML Schema is available for the schema in question, and the
  7035. provision of an <code>id</code> attribute for the representations of all primary and secondary schema
  7036. components, which <emph>is</emph> of type
  7037. <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref>, has been exploited.</p>
  7038.   <p>It is a matter for applications to specify whether they interpret
  7039. document-level references of either of the above varieties as being to the relevant element information item (i.e. without
  7040. special recognition of the relation of schema documents to schema components) or as being to the
  7041. corresponding schema component.</p>
  7042.  </div4>
  7043. </div3>
  7044.     <div3>
  7045.      <head>Constraints on XML Representations of Schemas</head>
  7046.  <constraintnote type="src" id="src-qname">
  7047.   <head>QName Interpretation</head>
  7048.   <p>Where the type of an attribute information item in a document involved in
  7049. <termref def="key-vn">validation</termref> is
  7050. identified as
  7051. <termref def="gloss-QName">QName</termref>, its &v-value; is composed of a
  7052.  <termdef id="q-local" term="local name" role="local"><term>local name</term></termdef> and a <termdef id="q-uri" term="namespace name" role="local"><term>namespace name</term></termdef>.  Its &v-value; is determined based on its &i-value; and
  7053. the containing element information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">in-scope
  7054. namespaces</xpropref> following <bibref ref="ref-xml-namespaces"/>:</p>
  7055.   <p><olist role="Case">
  7056.     <item>
  7057.      <p role="if">its &i-value; is prefixed</p>
  7058.      <p role="then">
  7059.       <olist role="and">
  7060.        <item>
  7061.         <p>There must be a namespace in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">in-scope
  7062. namespaces</xpropref> whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.namespace">prefix</xpropref> matches the prefix.</p>
  7063.        </item>
  7064.        <item>
  7065.        <p role="then">its <termref def="q-uri">namespace name</termref> is the
  7066. <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.namespace">namespace
  7067. name</xpropref> of that namespace.</p></item>
  7068.        <item>
  7069.         <p>Its <termref def="q-local">local name</termref> is the portion of
  7070. its &i-value; after the colon (<code>':'</code>).</p>
  7071.        </item>
  7072.       </olist>
  7073.      </p>     
  7074.     </item>
  7075.     <item>
  7076.      <p role="otherwise">(its &i-value; is unprefixed) <olist role="and">
  7077.        <item>
  7078.         <p>its <termref def="q-local">local name</termref> is its &i-value;.</p>
  7079.        </item>
  7080.        <item>
  7081.         <olist role="Case">
  7082.        <item>
  7083.         <p role="if">there is a namespace in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">in-scope
  7084. namespaces</xpropref> whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.namespace">prefix</xpropref> has no value</p>
  7085.         <p role="then">its <termref def="q-uri">namespace name</termref> is the
  7086. <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.namespace">namespace
  7087. name</xpropref> of that namespace.</p>
  7088.        </item>
  7089.        <item>
  7090.         <p role="otherwise">its <termref def="q-uri">namespace name</termref> is <termref def="key-null">absent</termref>.</p>
  7091.        </item>
  7092.       </olist>
  7093.        </item>
  7094.       </olist></p>
  7095.     </item>
  7096.    </olist></p>
  7097.   <p>In the absence of the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">in-scope namespaces</xpropref> property in the infoset for the schema document in question, processors must reconstruct equivalent information as necessary, using the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element"> namespace attributes</xpropref> of the containing element information item and its ancestors.</p>
  7098.  </constraintnote>
  7099.  <p><termdef id="key-resolve" term="resolve">Whenever the word <term>resolve</term> in any form is used in this
  7100. chapter in connection with a <termref def="gloss-QName">QName</termref> in a
  7101. schema document, the
  7102. following definition <specref ref="src-resolve"/> should be understood</termdef>:</p>
  7103.  <constraintnote type="src" id="src-resolve">
  7104.   <head>QName resolution (Schema Document)</head>
  7105.   <p>For a <termref def="gloss-QName">QName</termref>
  7106. to resolve to a schema component of a specified kind
  7107.    <olist role="and">
  7108.     <item>
  7109.      <p>That component is a member of the value of the appropriate
  7110. property of the schema which corresponds to the schema
  7111. document within which the <termref def="gloss-QName">QName</termref>
  7112. appears, that is
  7113.       <olist role="case">
  7114.     <item>
  7115.      <p role="if">the kind specified is simple or complex type definition</p>
  7116.      <p role="then">the property is the <propref ref="type_definitions"/>.</p>
  7117.     </item>
  7118.     <item>
  7119.      <p role="if">the kind specified is attribute declaration</p>
  7120.      <p role="then">the property is the <propref ref="attribute_declarations"/>.</p> 
  7121.     </item>
  7122.     <item>
  7123.      <p role="if">the kind specified is element declaration</p>
  7124.      <p role="then">the property is the <propref ref="element_declarations"/>.</p> 
  7125.     </item>
  7126.     <item>
  7127.      <p role="if">the kind specified
  7128. is attribute group</p>
  7129.      <p role="then">the property is the <propref ref="attribute_group_definitions"/>.</p> 
  7130.     </item>
  7131.     <item>
  7132.      <p role="if">the kind specified is
  7133. model group</p>
  7134.      <p role="then">the property is the <propref ref="model_group_definitions"/>.</p>
  7135.     </item>
  7136.     <item>
  7137.      <p role="if">the kind specified is notation declaration</p>
  7138.      <p role="then">the property is the <propref ref="notation_declarations"/>.</p> 
  7139.     </item>
  7140.    </olist>
  7141.      </p>
  7142.     </item>
  7143.     <item>
  7144.      <p>its <xpropref role="anon">local name</xpropref> matches the <termref def="q-local">local
  7145. name</termref> of the <termref def="gloss-QName">QName</termref>;</p>
  7146.     </item>
  7147.     <item>
  7148.      <p>its <xpropref role="anon">target namespace</xpropref> is identical to the <termref def="q-uri">namespace name</termref> of the <termref def="gloss-QName">QName</termref>;</p>
  7149.     </item>
  7150.     <item>
  7151.      <p>its <termref def="q-uri">namespace name</termref> is either the target
  7152. namespace of the schema document containing the <termref def="gloss-QName">QName</termref> or that schema document contains an <eltref ref="import"/> element information item the &v-value; of whose <code>namespace</code> &i-attribute; is identical to that <termref def="q-uri">namespace name</termref>.</p>
  7153.     </item>
  7154.    </olist>
  7155.   </p>
  7156.  </constraintnote>
  7157.     </div3>
  7158.     <div3>
  7159.      <head>Validation Rules for Schemas as a Whole</head>
  7160.  <p>As the discussion above at <specref ref="components"/> makes clear, at the level of schema components and <termref def="key-vn">validation</termref>, reference to components by name is normally not involved.  In a
  7161. few cases, however, qualified names appearing in information items being
  7162. <termref def="key-vn">validated</termref> must be resolved to schema components by such lookup.  The following
  7163. constraint is appealed to in these cases.</p>
  7164.    <constraintnote type="cvc" id="cvc-resolve-instance">
  7165.   <head>QName resolution (Instance)</head>
  7166.   <p>A pair of a local name and a namespace name (or <termref def="key-null">absent</termref>)
  7167. resolve to a schema component of a specified kind in the context of <termref def="key-vn">validation</termref> by appeal to the appropriate
  7168. property of the schema being used for the <termref def="key-va">assessment</termref>.  Each such property indexes components by name.  The property to use is determined by the kind of component specified, that is,
  7169.    <olist role="case">
  7170.     <item>
  7171.      <p role="if">the kind specified is simple or complex type definition</p>
  7172.      <p role="then">the property is the <propref ref="type_definitions"/>.</p>
  7173.     </item>
  7174.     <item>
  7175.      <p role="if">the kind specified is attribute declaration</p>
  7176.      <p role="then">the property is the <propref ref="attribute_declarations"/>.</p> 
  7177.     </item>
  7178.     <item>
  7179.      <p role="if">the kind specified is element declaration</p>
  7180.      <p role="then">the property is the <propref ref="element_declarations"/>.</p> 
  7181.     </item>
  7182.     <item>
  7183.      <p role="if">the kind specified
  7184. is attribute group</p>
  7185.      <p role="then">the property is the <propref ref="attribute_group_definitions"/>.</p> 
  7186.     </item>
  7187.     <item>
  7188.      <p role="if">the kind specified is
  7189. model group</p>
  7190.      <p role="then">the property is the <propref ref="model_group_definitions"/>.</p>
  7191.     </item>
  7192.     <item>
  7193.      <p role="if">the kind specified is notation declaration</p>
  7194.      <p role="then">the property is the <propref ref="notation_declarations"/>.</p> 
  7195.     </item>
  7196.    </olist>
  7197.    The component resolved to is the entry in the table whose <xpropref role="anon">local
  7198. name</xpropref> matches the local name of the pair and whose <xpropref role="anon">target namespace</xpropref> is identical to the namespace name of the pair.
  7199.   </p>
  7200.  </constraintnote>
  7201.     </div3>
  7202.     <div3>
  7203.      <head>Schema Information Set Contributions</head>
  7204.      <constraintnote type="sic" id="sic-schema">
  7205.      <head>Schema Information</head>
  7206.      <p>Schema components provide a wealth of information about the basis of
  7207. <termref def="key-va">assessment</termref>, which may well be of relevance to
  7208. subsequent processing.  Reflecting component structure into a form suitable for
  7209. inclusion in the &PSVI; is the way this specification provides for making this
  7210. information available.</p>
  7211.      <p>Accordingly, <termdef id="key-iso" term="item isomorphic to a component"> by an <term>item isomorphic</term> to a component is meant an information item whose type is equivalent to the component's, with one property per property of the component, with the same name, and value either the same atomic value, or an information item corresponding in the same way to its component value, recursively, as necessary</termdef>.</p>
  7212.       <p>Processors must add a property in the &PSVI;
  7213. to the element information item at which <termref def="key-va">assessment</termref> began, as follows:</p>
  7214.       <proplist item="element" role="psvi">
  7215.        <propdef id="e-schema_information" name="schema information">A set of <iiName>namespace schema information</iiName> information items, one for each namespace name which appears as the
  7216. <xpropref role="anon">target namespace</xpropref> of any schema component in the schema used for that
  7217. assessment, and one for <termref def="key-null">absent</termref> if any schema
  7218. component in the schema had no <xpropref role="anon">target namespace</xpropref>.  Each <iiName>namespace schema information</iiName> information item has the
  7219. following properties and values:
  7220.         <proplist item="namespace schema information" role="psvi">
  7221.          <propdef id="nsi-schema_namespace" name="schema namespace">A namespace
  7222. name or <termref def="key-null">absent</termref>.</propdef>
  7223.          <propdef id="nsi-schema_components" name="schema components">A (possibly
  7224. empty) set of schema component information items, each one an <termref def="key-iso">item isomorphic</termref> to a component whose <xpropref role="anon">target
  7225. namespace</xpropref> is the sibling <propref ref="nsi-schema_namespace" role="psvi"/>
  7226. property above, drawn from the schema used for <termref def="key-va">assessment</termref>.</propdef>
  7227.          <propdef name="schema documents" id="nsi-schema_documents">A
  7228. (possibly empty) set of <iiName>schema document</iiName> information items, with
  7229. properties and values as follows, for each schema document which
  7230. contributed components to the schema, and whose
  7231. <code>targetNamespace</code> matches the sibling <propref role="psvi" ref="nsi-schema_namespace"/> property above (or whose
  7232. <code>targetNamespace</code> was <termref def="key-null">absent</termref>
  7233. but that contributed components to that namespace by being <eltref ref="include"/>d
  7234. by a schema document with that <code>targetNamespace</code> as per <specref ref="compound-schema"/>):
  7235.           <proplist item="schema document" role="psvi">
  7236.            <propdef name="document location" id="sd-document_location">Either a URI reference, if available, otherwise
  7237. <termref def="key-null">absent</termref>
  7238.            </propdef>
  7239.            <propdef name="document" id="sd-document">A document
  7240. information item, if available, otherwise <termref def="key-null">absent</termref>.</propdef>
  7241.           </proplist>
  7242.          </propdef>
  7243.         </proplist>
  7244.        </propdef>
  7245.       </proplist>
  7246.      <p>The <propref ref="nsi-schema_components"/> property is provided for
  7247. processors which wish to provide a single access point to the
  7248. components of the schema which was used during <termref def="key-va">assessment</termref>.  Lightweight processors are free to leave it empty, but if it <emph>is</emph> provided, it must contain at a minimum all the top-level (i.e. named) components which actually figured in the <termref def="key-va">assessment</termref>, either directly or (because an anonymous component which figured is contained within) indirectly.</p>
  7249.     </constraintnote>
  7250.      <constraintnote type="sic" id="sic-id">
  7251.   <head>ID/IDREF Table</head>
  7252.       <p>In the &PSVI; a set of <iiName>ID/IDREF binding</iiName> information items is associated
  7253. with the <termref def="key-vr">validation root</termref> element information
  7254. item:</p>
  7255.       <proplist item="element" role="psvi">
  7256.        <propdef name="ID/IDREF table" id="e-ii_table">A (possibly empty) set of
  7257. <iiName>ID/IDREF binding</iiName> information items, as specified below.</propdef>
  7258.       </proplist>
  7259.       <p><termdef id="key-eas" term="eligible item set" role="local">Let the
  7260. <term>eligible item set</term> be the set of consisting of every attribute or element
  7261. information item</termdef> for which
  7262.          <olist role="andtest">
  7263.             <item>
  7264.              <p>its  <xpropref role="psviAnon">validation context</xpropref> is the
  7265. <termref def="key-vr">validation root</termref>;</p>
  7266.             </item>
  7267.             <item>
  7268.              <p>it was successfully <termref def="key-vn">validated</termref> with respect to an attribute
  7269. declaration as per <specref ref="cvc-attribute"/> or element declaration as per
  7270. <specref ref="cvc-elt"/> (as appropriate) whose attribute <propref ref="a-simple_type_definition"/> or element <propref ref="type_definition"/> (respectively) is the
  7271. built-in <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref>, <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#IDREF">IDREF</xtermref> or <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#IDREFS">IDREFS</xtermref> simple type definition or a type derived from one of them.</p>
  7272.             </item>
  7273.            </olist></p>
  7274.       <p>Then there is one <iiName>ID/IDREF binding</iiName> in the <propref ref="e-ii_table" role="psvi"/>
  7275. for every distinct string which is</p><olist role="orval">
  7276.         <item>
  7277.          <p>the &v-value; of a member of the <termref def="key-eas">eligible
  7278. item set</termref> whose type definition is or is derived from <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref> or <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#IDREF">IDREF</xtermref>;</p>
  7279.         </item>
  7280.         <item>
  7281.          <p>one of the items in the &v-value; of a member of the <termref def="key-eas">eligible
  7282. item set</termref> whose type definition is or is derived from <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#IDREFS">IDREFS</xtermref>.</p>
  7283.         </item>
  7284.        </olist>
  7285.       <p>Each <iiName>ID/IDREF binding</iiName> has properties as follows:</p>
  7286.       <proplist item="ID/IDREF binding" role="psvi">
  7287.         <propdef name="id" id="iib-id">The string identified above.</propdef>
  7288.         <propdef id="iib-binding" name="binding">A set consisting of every element information item for which
  7289.           <olist role="andtest">
  7290.             <item>
  7291.              <p>its <propref role="psvi" ref="e-validation_context"/> is the
  7292. <termref def="key-vr">validation root</termref>;</p>
  7293.             </item>
  7294.             <item>
  7295.              <p>it has an attribute information item in
  7296. its &i-attributes; or an element information item in its &i-children; which was <termref def="key-vn">validated</termref> by the
  7297. built-in <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#ID">ID</xtermref> simple type definition or a type derived from it whose
  7298.  <xpropref role="psviAnon">schema normalized value</xpropref> is the <propref role="psvi" ref="iib-id"/> of
  7299. this <iiName>ID/IDREF binding</iiName>.</p>
  7300.             </item>
  7301.            </olist>
  7302.         </propdef>
  7303.        </proplist>
  7304. <p>The net effect of the above is to have one entry for every string used as an
  7305. id, whether by declaration or by reference, associated with those elements, if
  7306. any, which actually purport to have that id.  See <specref ref="cvc-id"/> above
  7307. for the validation rule which actually checks for errors here.</p>
  7308.   <note>
  7309.    <p>The <iiName>ID/IDREF binding</iiName>
  7310. information item, unlike most other aspects of this
  7311. specification, is essentially an internal bookkeeping mechanism.  It is introduced to
  7312. support the definition of <specref ref="cvc-id"/> above. 
  7313. Accordingly, conformant processors may, but are <emph>not</emph> required to,
  7314. expose it in the &PSVI;.
  7315. In other words, the above constraint may be read as saying <termref def="key-va">assessment</termref> proceeds <emph>as if</emph> such an infoset item existed.</p></note>
  7316.  </constraintnote>
  7317.     </div3>
  7318.     <div3 id="coss-schema">
  7319.      <head>Constraints on Schemas as a Whole</head>
  7320.   <p>All schemas (see <specref ref="Schemas"/>) must satisfy the following constraint.</p>
  7321.   <constraintnote type="cos" id="sch-props-correct">
  7322.    <head>Schema Properties Correct</head>
  7323.    <olist role="And">
  7324.     <item>
  7325.      <p>The values of the properties of a schema must be as described in
  7326. the property tableau in
  7327. <specref ref="Schema_details"/>, modulo the impact of <specref ref="conformance-missing"/>;</p>
  7328.     </item>
  7329.     <item id="c-nmd">
  7330.      <p>Each of the <propref ref="type_definitions"/>,  <propref ref="element_declarations"/>, <propref ref="attribute_group_definitions"/>, <propref ref="model_group_definitions"/> and <propref ref="notation_declarations"/> must not contain two or more schema components with the same <xpropref role="anon">name</xpropref> and <xpropref role="anon">target
  7331. namespace</xpropref>.</p>
  7332.     </item>
  7333.    </olist>
  7334.   </constraintnote>
  7335.  
  7336.     </div3>
  7337.    </div2>
  7338.   </div1>
  7339.    <div1 id="composition">
  7340.     <head>Schemas and Namespaces: Access and Composition</head>
  7341. <p>This chapter defines the mechanisms by which this specification establishes the necessary
  7342. precondition for <termref def="key-va">assessment</termref>, namely access to
  7343. one or more schemas. This chapter also sets out in detail the relationship
  7344. between schemas and namespaces, as well as mechanisms for
  7345. modularization of schemas, including provision for incorporating definitions
  7346. and declarations from one schema in another, possibly with modifications.</p>
  7347. <p><specref ref="concepts-conformance"/> describes three levels of conformance for schema
  7348. processors, and <specref ref="conformance"/> provides a formal definition of
  7349. <termref def="key-va">assessment</termref>. This section sets out
  7350. in detail the 3-layer architecture implied by the three conformance levels.
  7351. The layers
  7352. are: </p>
  7353. <olist>
  7354.   <item><p>The <termref def="key-va">assessment</termref> core, relating schema components and instance
  7355. information items; </p></item>
  7356.   <item><p>Schema representation: the connections between XML
  7357. representations and schema components, including the
  7358.   relationships between namespaces and schema components; </p></item>
  7359.   <item><p>XML Schema web-interoperability guidelines: instance->schema and
  7360.   schema->schema connections for the WWW. </p></item></olist>
  7361. <p>Layer 1 specifies the manner in which a schema composed of schema components
  7362. can be applied to in the <termref def="key-va">assessment</termref> of an instance element information item. Layer 2 specifies the use of <eltref ref="schema"/>
  7363. elements in XML documents as the standard XML representation for
  7364. schema information in a broad range of computer systems and execution
  7365. environments. To support interoperation over the World Wide Web in particular,
  7366. layer 3 provides a set of conventions for schema reference on the
  7367. Web. Additional details on each of the three layers is provided in the sections below.</p>
  7368. <div2 id="layer1">
  7369. <head>Layer 1: Summary of the Schema-validity Assessment Core</head>
  7370. <p>The fundamental purpose of the <termref def="key-va">assessment</termref> core is to define <termref def="key-va">assessment</termref> for a single
  7371. element information item and its descendants with respect to a
  7372. complex type
  7373. definition. All processors are required to implement this core predicate in a
  7374. manner which conforms exactly to this specification. </p>
  7375. <p><termref def="key-va">assessment</termref> is defined with reference to an <termref def="key-schema">XML Schema</termref> (note <emph>not</emph> a
  7376. <termref def="key-schemaDoc">schema document</termref>) which consists of (at a minimum) the set of schema
  7377. components (definitions and declarations) required for that
  7378. <termref def="key-va">assessment</termref>.  This is not a circular definition, but rather a
  7379. <emph>post facto</emph> observation:  no element information item can
  7380. be fully assessed unless all the components required by any aspect of
  7381. its (potentially recursive) <termref def="key-va">assessment</termref> are present in the schema.</p>
  7382. <p>As specified above, each schema component is associated directly or
  7383. indirectly with a target namespace, or explicitly with no namespace. In the case of multi-namespace documents,
  7384. components for more than one target namespace will co-exist in a schema.</p>
  7385. <p>Processors have the option to assemble (and perhaps to optimize or
  7386. pre-compile) the entire schema prior to the start of an <termref def="key-va">assessment</termref> episode, or to
  7387. gather the schema lazily as individual components are required. In all
  7388. cases it is required that:</p>
  7389. <ulist>
  7390.   <item><p>The processor succeed in locating the <termref def="key-component">schema components</termref>
  7391.   transitively required to complete an <termref def="key-va">assessment</termref> (note that components derived
  7392. from <termref def="key-schemaDoc">schema documents</termref> can be integrated
  7393. with components obtained through other means);</p></item>
  7394.   <item><p>no definition or declaration changes once it has been established;</p></item>
  7395.   <item><p>if the processor chooses to acquire declarations and definitions
  7396.   dynamically, that there be no side effects of such dynamic acquisition that
  7397.   would cause the results of <termref def="key-va">assessment</termref> to differ from that which would have
  7398.   been obtained from the same schema components acquired in bulk.</p></item></ulist>
  7399. <note><p> the <termref def="key-va">assessment</termref> core is defined in terms of schema components at the
  7400. abstract level, and no mention is made of the schema definition
  7401. syntax (i.e. <eltref ref="schema"/>). Although many processors will acquire
  7402. schemas in this format, others may operate on compiled representations, on a
  7403. programmatic representation as exposed in some programming language, etc.
  7404. </p></note>
  7405. <p>The obligation of a schema-aware processor as far as the <termref def="key-va">assessment</termref>
  7406. core is concerned is to implement one or more of the options for <termref def="key-va">assessment</termref> given below in <specref ref="validation_outcome"/>. Neither the
  7407. choice of element information item for that <termref def="key-va">assessment</termref>, nor which of the
  7408. means of initiating <termref def="key-va">assessment</termref> are used, is within the scope of this specification.</p>
  7409. <p>Although <termref def="key-va">assessment</termref> is defined recursively, it is also intended to be
  7410. implementable in streaming
  7411. processors.  Such processors may choose to incrementally assemble the schema during
  7412. processing in response, for example, to encountering new namespaces. 
  7413. The implication of the
  7414. invariants expressed above is that such incremental assembly must
  7415. result in an <termref def="key-va">assessment</termref> 
  7416. outcome that is the 
  7417. <emph>same</emph> as would
  7418. be given if <termref def="key-va">assessment</termref> was undertaken again
  7419. with the final, fully assembled schema. </p>
  7420. </div2>
  7421. <div2 id="layer2">
  7422. <head>Layer 2: Schema Documents, Namespaces and Composition</head>
  7423. <p>The sub-sections of <specref ref="components"/> define an
  7424. XML representation for type definitions and element declarations and so on,
  7425. specifying their target namespace and collecting them into schema documents.
  7426. The two following sections relate to assembling a complete schema for <termref def="key-va">assessment</termref> from multiple sources.  They should <emph>not</emph> be understood as a form of text substitution, but rather as providing mechanisms for distributed definition of schema components, with appropriate schema-specific semantics.</p>
  7427. <note><p> The core <termref def="key-va">assessment</termref> architecture requires that a complete schema with
  7428. all the necessary declarations and definitions be
  7429. available. This may involve resolving both
  7430. instance->schema and schema->schema references. As observed earlier in <specref ref="concepts-conformance"/>,  the precise mechanisms for resolving such references are expected to evolve over time.
  7431. In support of such evolution, this specification observes the design principle that references from
  7432. one schema document to a schema use mechanisms that directly parallel those used to
  7433. reference a schema from an instance document.</p></note>
  7434. <note><p>In the sections below, "schemaLocation" really belongs at layer 3. 
  7435. For convenience, it is documented with the layer 2 mechanisms of import and
  7436. include, with which it is closely associated.</p></note>
  7437.  <div3 id="compound-schema">
  7438. <head>Assembling a schema for a single target namespace from multiple schema definition documents</head>
  7439.  <p>Schema components for a single target namespace can be assembled from
  7440. several <termref def="key-schemaDoc">schema documents</termref>, that is several <eltref ref="schema"/> element
  7441. information items: </p>
  7442.  <reprdef>
  7443.  <reprelt eltname="include"/>
  7444. </reprdef>
  7445.  <p>A <eltref ref="schema"/> information item may contain any number of <eltref ref="include"/> elements. Their <code>schemaLocation</code> attributes, consisting of a URI reference, identify other <termref def="key-schemaDoc">schema documents</termref>, that is <eltref ref="schema"/> information items. 
  7446. </p>
  7447. <p>The <termref def="key-schema">XML Schema</termref> corresponding 
  7448. to <eltref ref="schema"/> contains not only the components corresponding to its definition and declaration &i-children;, but also
  7449. all the components of all the <termref def="key-schema">XML Schemas</termref> corresponding to any <eltref ref="include"/>d schema documents.
  7450. Such included schema documents must either (a) have the same
  7451. <code>targetNamespace</code> as the <eltref ref="include"/>ing schema document, or 
  7452. (b) no <code>targetNamespace</code> at all, in which case the <eltref ref="include"/>d schema document is converted to the <eltref ref="include"/>ing schema document's <code>targetNamespace</code>.</p>
  7453.  <constraintnote type="src" id="src-include">
  7454.  <head>Inclusion Constraints and Semantics</head>
  7455.  <p>In addition to the conditions imposed on <eltref ref="include"/> element
  7456. information items by the schema for schemas, 
  7457.     <olist role="and">
  7458.     <item id="c-ins">
  7459.      <p>If the &v-value; of the <code>schemaLocation</code> &i-attribute;
  7460. successfully resolves
  7461.       <olist role="or">
  7462.        <item id="c-vxd">
  7463.         <p>It resolves to (a fragment of) a resource which is an XML
  7464. document (of type
  7465. <code>application/xml</code> or <code>text/xml</code> with an XML declaration
  7466. for preference, but this is not required), which in turn corresponds to a <eltref ref="schema"/>
  7467. element information item in a well-formed information set, which in turn
  7468. corresponds to a valid schema.</p>
  7469.        </item>
  7470.        <item>
  7471.         <p>It resolves to a <eltref ref="schema"/>
  7472. element information item in a well-formed information set, which in turn
  7473. corresponds to a valid schema.</p>
  7474.        </item>
  7475.       </olist>
  7476.       In either case call the <eltref ref="include"/>d <eltref ref="schema"/> item <local>SII</local>, the valid
  7477. schema <local>I</local> and the <eltref ref="include"/>ing item's parent <eltref ref="schema"/> item <local>SII’</local>.</p>
  7478.     </item>
  7479.      <item>
  7480.       <olist role="Or">
  7481.        <item id="c-normi">
  7482.         <p><local>SII</local> has a <code>targetNamespace</code> &i-attribute;, and its &v-value; is identical to the &v-value; of the <code>targetNamespace</code> &i-attribute; of <local>SII’</local> (which must have such an &i-attribute;).</p>
  7483.        </item>
  7484.        <item id="c-normi2"><p>Neither <local>SII</local> nor <local>SII’</local> have a <code>targetNamespace</code> &i-attribute;.</p></item>
  7485.        <item id="c-chami"><p><local>SII</local> has no <code>targetNamespace</code>
  7486. &i-attribute; (but <local>SII’</local> does).</p></item>
  7487.       </olist>      
  7488.      </item>
  7489.      <item>
  7490.       <olist role="Case">
  7491.        <item>
  7492.          <p role="if"><clauseref ref="c-normi"/> or <clauseref ref="c-normi2"/> above is satisfied</p>
  7493.         <p role="then">the schema corresponding to <local>SII’</local> must include not only definitions or
  7494. declarations corresponding to the appropriate members of its own &i-children;, but also components identical to all the <termref def="key-component">schema components</termref> of <local>I</local>.</p>
  7495.         </item>
  7496.         <item id="c-docham">
  7497.          <p role="if"><clauseref ref="c-chami"/> above is satisfied</p>
  7498.          <p role="then">the schema corresponding to the
  7499. <eltref ref="include"/>d
  7500. item's parent <eltref ref="schema"/> must include not only definitions or
  7501. declarations corresponding to the appropriate members of its own &i-children;,
  7502. but also components identical to all the <termref def="key-component">schema
  7503. components</termref> of <local>I</local>, except that anywhere the <termref def="key-null">absent</termref> target
  7504. namespace name would have appeared, the &v-value; of the
  7505. <code>targetNamespace</code> &i-attribute; of <local>SII’</local> is used.  In
  7506. particular, it replaces <termref def="key-null">absent</termref> in the following places:
  7507.           <olist>
  7508.            <item><p>The  <xpropref role="anon">target namespace</xpropref> of named schema
  7509. components, both at the top level and (in the case of nested type
  7510. definitions and nested attribute and
  7511. element declarations whose <code>code</code> was <pt>qualified</pt>) nested within definitions;</p></item>
  7512.            <item><p>The <propref ref="namespace_constraint"/> of a wildcard, whether negated or not;</p></item>
  7513.           </olist>
  7514.          </p>
  7515.         </item>
  7516.        </olist>
  7517.      </item>
  7518.    </olist>
  7519.    </p>
  7520.  <p>It is <emph>not</emph> an error for the &v-value; of the
  7521. <code>schemaLocation</code> &i-attribute; to fail to resolve it all, in which case no
  7522. corresponding inclusion is performed.  It
  7523. <emph>is</emph> an error for it to resolve but the rest of clause 1 above to
  7524. fail to be satisfied.  Failure to resolve may well cause less than complete
  7525. <termref def="key-va">assessment</termref> outcomes, of course.</p>
  7526.   <note>
  7527.    <p>As discussed in <specref ref="conformance-missing"/>, <termref def="gloss-QName">QName</termref>s in XML representations may fail to
  7528. <termref def="key-resolve">resolve</termref>, rendering components incomplete
  7529. and unusable because of missing subcomponents.  During schema construction,
  7530. implementations are likely to retain <termref def="gloss-QName">QName</termref> values for such references, in case subsequent processing provides a referent.  <termref def="key-null">Absent</termref> target <termref def="q-uri">namespace name</termref>s of such as-yet unresolved reference <termref def="gloss-QName">QName</termref>s in <eltref ref="include"/>d components should also be converted if <clauseref ref="c-docham"/> is satisfied.</p>
  7531.   </note>
  7532. </constraintnote>
  7533.  <note><p>The above is carefully worded so that multiple <eltref ref="include"/>ing of the same schema document will not constitute a violation of
  7534. <clauseref ref="c-nmd"/> of <specref ref="sch-props-correct"/>, but applications are
  7535. allowed, indeed encouraged, to avoid <eltref ref="include"/>ing the same schema document more than once to forestall the necessity of establishing identity
  7536. component by component.</p></note>
  7537. </div3>
  7538. <div3 id="modify-schema">
  7539. <head>Including modified component definitions</head>
  7540.  <p>In order to provide some support for evolution and versioning, it is
  7541. possible to incorporate components corresponding to a schema document
  7542. <emph>with modifications</emph>.  The modifications have a pervasive impact,
  7543. that is, only the redefined components are used, even when referenced from
  7544. other incorporated components, whether redefined themselves or not.</p>
  7545.  <reprdef>
  7546.  <reprelt eltname="redefine"/>
  7547. </reprdef>
  7548.  <p>A <eltref ref="schema"/> information item may contain any number of <eltref ref="redefine"/> elements. Their <code>schemaLocation</code> attributes, consisting of a URI reference, identify other <termref def="key-schemaDoc">schema documents</termref>, that is <eltref ref="schema"/> information items. 
  7549. </p>
  7550. <p>The <termref def="key-schema">XML Schema</termref> corresponding 
  7551. to <eltref ref="schema"/> contains not only the components corresponding to its definition and declaration &i-children;, but also
  7552. all the components of all the <termref def="key-schema">XML Schemas</termref> corresponding to any <eltref ref="redefine"/>d schema documents.
  7553. Such schema documents must either (a) have the same
  7554. <code>targetNamespace</code> as the <eltref ref="redefine"/>ing schema document, or 
  7555. (b) no <code>targetNamespace</code> at all, in which case  the <eltref ref="redefine"/>d schema document is converted to the <eltref ref="redefine"/>ing schema document's <code>targetNamespace</code>.</p>
  7556.  <p>The definitions within the <eltref ref="redefine"/> element itself are
  7557. restricted to be redefinitions of components from the <eltref ref="redefine"/>d
  7558. schema document, <emph>in terms of themselves</emph>.  That is, 
  7559.   <ulist>
  7560.    <item>
  7561.     <p>Type
  7562. definitions must use themselves as their base type definition;</p>
  7563.    </item>
  7564.    <item>
  7565.     <p>
  7566.      Attribute
  7567. group definitions and model group definitions must be supersets or subsets of their original
  7568. definitions, either by including exactly one
  7569. reference to themselves or by containing only (possibly restricted) components
  7570. which appear in a corresponding way in their <eltref ref="redefine"/>d selves.</p>
  7571.    </item>
  7572.   </ulist>Not all the components of the <eltref ref="redefine"/>d
  7573. schema document need be redefined.</p>
  7574.  <p>This mechanism is intended to provide a declarative and modular approach to
  7575. schema modification, with functionality no different except in scope from what
  7576. would be achieved by wholesale text copying and redefinition by editing.  In
  7577. particular redefining a type is not guaranteed to be side-effect free:  it may
  7578. have unexpected impacts on other type definitions which are based
  7579. on the redefined one, even to the extent that some such definitions become
  7580. ill-formed.</p>
  7581.  <note>
  7582.   <p>The pervasive impact of redefinition reinforces the need for
  7583. implementations to adopt some form of lazy or 'just-in-time' approach to
  7584. component construction, which is also called for in order to avoid
  7585. inappropriate dependencies on the order in which definitions and references appear in (collections of) schema documents.</p>
  7586.  </note>
  7587.  <note role="example">
  7588.   <eg xml:space="preserve"><![CDATA[v1.xsd:
  7589.  <xs:complexType name="personName">
  7590.   <xs:sequence>
  7591.    <xs:element name="title" minOccurs="0"/>
  7592.    <xs:element name="forename" minOccurs="0" maxOccurs="unbounded"/>
  7593.   </xs:sequence>
  7594.  </xs:complexType>
  7595.  
  7596.  <xs:element name="addressee" type="personName"/>
  7597.  
  7598. v2.xsd:
  7599.  <xs:redefine schemaLocation="v1.xsd">
  7600.   <xs:complexType name="personName">
  7601.    <xs:complexContent>
  7602.     <xs:extension base="personName">
  7603.      <xs:sequence>
  7604.       <xs:element name="generation" minOccurs="0"/>
  7605.      </xs:sequence>
  7606.     </xs:extension>
  7607.    </xs:complexContent>
  7608.   </xs:complexType>
  7609.  </xs:redefine>
  7610.  
  7611.  <xs:element name="author" type="personName"/>]]>
  7612.   </eg>
  7613.   <p>The schema corresponding to <code>v2.xsd</code> has everything specified
  7614. by <code>v1.xsd</code>, with the <code>personName</code> type redefined, as
  7615. well as everything it specifies itself.  According to
  7616. this schema, elements constrained
  7617. by the <code>personName</code> type may end with a <code>generation</code>
  7618. element.  This includes not only the <code>author</code> element, but also the
  7619. <code>addressee</code> element.</p>
  7620.  </note>
  7621.  <constraintnote type="src" id="src-redefine">
  7622.  <head>Redefinition Constraints and Semantics</head>
  7623.  <p>In addition to the conditions imposed on <eltref ref="redefine"/> element
  7624. information items by the schema for schemas
  7625.     <olist role="and">
  7626.      <item><p>If there are any element information items among the &i-children;
  7627. other than <eltref ref="annotation"/> then the &v-value; of the
  7628. <code>schemaLocation</code> &i-attribute; must
  7629. successfully resolve.</p></item>
  7630.     <item>
  7631.      <p>If the &v-value; of the <code>schemaLocation</code> &i-attribute;
  7632. successfully resolves
  7633.       <olist role="or">
  7634.        <item>
  7635.         <p>it resolves to (a fragment of) a resource which is an XML document
  7636. (see <clauseref ref="c-vxd"/>), which in turn corresponds to a <eltref ref="schema"/>
  7637. element information item in a well-formed information set, which in turn
  7638. corresponds to a valid schema.</p>
  7639.        </item>
  7640.        <item>
  7641.         <p>It resolves to a <eltref ref="schema"/>
  7642. element information item in a well-formed information set, which in turn
  7643. corresponds to a valid schema.</p>
  7644.        </item>
  7645.       </olist>
  7646.       In either case call the <eltref ref="redefine"/>d <eltref ref="schema"/> item <local>SII</local>, the valid
  7647. schema <local>I</local> and the <eltref ref="redefine"/>ing item's parent <eltref ref="schema"/> item <local>SII’</local>.</p>
  7648.     </item>
  7649.      <item>
  7650.       <olist role="Or">
  7651.        <item id="c-normir">
  7652.         <p><local>SII</local> has a <code>targetNamespace</code> &i-attribute;, and its &v-value; is identical to the &v-value; of the <code>targetNamespace</code> &i-attribute; of <local>SII’</local> (which must have such an &i-attribute;).</p>
  7653.        </item>
  7654.        <item id="c-normi2r"><p>Neither <local>SII</local> nor <local>SII’</local> have a <code>targetNamespace</code> &i-attribute;.</p></item>
  7655.        <item id="c-chamir"><p><local>SII</local> has no <code>targetNamespace</code>
  7656. &i-attribute; (but <local>SII’</local> does).</p></item>
  7657.       </olist>      
  7658.      </item>
  7659.      <item>
  7660.       <olist role="Case">
  7661.        <item>
  7662.          <p role="if"><clauseref ref="c-normir"/> or <clauseref ref="c-normi2r"/> above is satisfied</p>
  7663.         <p role="then">the schema corresponding to <local>SII’</local> must include not only definitions or
  7664. declarations corresponding to the appropriate members of its own
  7665. &i-children;, but also components identical to all the <termref def="key-component">schema components</termref> of <local>I</local>, with the
  7666. exception of those explicitly redefined (see <specref ref="src-expredef"/> below).</p>
  7667.         </item>
  7668.         <item>
  7669.          <p role="if"><clauseref ref="c-chamir"/> above is satisfied</p>
  7670.          <p role="then">the schema corresponding to <local>SII’</local> must include not only definitions or
  7671. declarations corresponding to the appropriate members of its own &i-children;,
  7672. but also components identical to all the <termref def="key-component">schema
  7673. components</termref> of <local>I</local>, with the
  7674. exception of those explicitly redefined (see <specref ref="src-expredef"/>
  7675. below), except that anywhere the <termref def="key-null">absent</termref> target
  7676. namespace name would have appeared, the &v-value; of the
  7677. <code>targetNamespace</code> &i-attribute; of <local>SII’</local> is
  7678. used (see <clauseref ref="c-docham"/> in <specref ref="src-include"/> for details).</p>
  7679.         </item>
  7680.        </olist>       
  7681.      </item>
  7682.      <item>
  7683.       <p>Within the &i-children;, each <eltref ref="simpleType"/> must
  7684. have a <eltref ref="restriction"/> among its &i-children; and each <eltref ref="complexType"/> must have a <code>restriction</code> or <code>extension</code> among its grand-&i-children; the &v-value; of whose <code>base</code> &i-attribute; must be the same as the &v-value; of its own <code>name</code> attribute plus target namespace;</p>
  7685.      </item>
  7686.      <item>
  7687.       <p>Within the &i-children;, for each <eltref ref="group"/> <olist role="case">
  7688.        <item>
  7689.         <p role="if">it has a <eltref ref="group"/> among its contents at some level the &v-value; of whose
  7690. <code>ref</code> &i-attribute; is the same as the &v-value; of its own
  7691. <code>name</code> attribute plus target namespace</p>
  7692.         <p role="then">
  7693.          <olist role="and">
  7694.           <item>
  7695.            <p>It must have exactly one such group.</p>
  7696.           </item>
  7697.           <item>
  7698.            <p>The &v-value; of both that group's <code>minOccurs</code> and
  7699. <code>maxOccurs</code> &i-attribute; must be <code>1</code> (or <termref def="key-null">absent</termref>).</p>
  7700.           </item>
  7701.          </olist>
  7702.         </p>
  7703.        </item>
  7704.        <item>
  7705.         <p role="if">it has no such self-reference</p>
  7706.         <p role="then">
  7707.          <olist role="and">
  7708.          <item>
  7709.           <p>The &v-value; of its own <code>name</code> attribute plus target
  7710. namespace must successfully <termref def="key-resolve">resolve</termref> to a
  7711. model group definition in <local>I</local>.</p>
  7712.          </item>
  7713.          <item>
  7714.           <p>The <propref ref="model_group"/> of the model group definition which
  7715. corresponds to it per <specref ref="declare-namedModelGroup"/> must be a <termref def="cd-model-restriction">valid
  7716. restriction</termref> of the <propref ref="model_group"/> of that model group
  7717. definition in <local>I</local>, as defined in <specref ref="cos-particle-restrict"/>.</p>
  7718.          </item>
  7719.         </olist></p>
  7720.        </item>
  7721.       </olist></p>
  7722.       
  7723.      </item>
  7724.      <item>
  7725.       <p>Within the &i-children;, for each <eltref ref="attributeGroup"/>
  7726.        <olist role="case">
  7727.        <item>
  7728.         <p role="if">it has an <eltref ref="attributeGroup"/> among its contents the &v-value; of whose
  7729. <code>ref</code> &i-attribute; is the same as the &v-value; of its own
  7730. <code>name</code> attribute plus target namespace</p>
  7731.         <p role="then">it must have exactly one such group.</p>
  7732.        </item>
  7733.        <item id="c-agrere">
  7734.         <p role="if">it has no such self-reference</p>
  7735.         <p role="then">
  7736.          <olist role="and">
  7737.          <item>
  7738.           <p>The &v-value; of its own <code>name</code> attribute plus target
  7739. namespace must successfully <termref def="key-resolve">resolve</termref> to an
  7740. attribute group definition in <local>I</local>.</p>
  7741.          </item>
  7742.          <item>
  7743.           <p>The <propref ref="ag-attribute_declarations"/> and <propref ref="ag-attribute_wildcard"/> of the attribute group definition which
  7744. corresponds to it per <specref ref="declare-attributeGroup"/> must be <termref def="cd-model-restriction">valid
  7745. restrictions</termref> of the <propref ref="ag-attribute_declarations"/> and
  7746. <propref ref="ag-attribute_wildcard"/> of that attribute group
  7747. definition in <local>I</local>, as defined in <clauseref ref="c-rad"/>, <clauseref ref="c-rad2"/> and <clauseref ref="c-raw"/> of <specref ref="derivation-ok-restriction"/> (where references to the base type definition are understood as references to the attribute group
  7748. definition in <local>I</local>).</p>
  7749.          </item>
  7750.         </olist></p>
  7751.        </item>
  7752.       </olist>
  7753.        <note>
  7754.         <p>An attribute group restrictively redefined per <clauseref ref="c-agrere"/> corresponds to an attribute group whose <propref ref="ag-attribute_declarations"/> consist all and only of those attribute uses corresponding to <eltref ref="attribute"/>s  explicitly present among the &i-children; of the <eltref ref="redefine"/>ing <eltref ref="attributeGroup"/>. No inheritance from the <eltref ref="redefine"/>d attribute group occurs.  Its  <propref ref="ag-attribute_wildcard"/> is similarly based purely on an explicit <eltref ref="anyAttribute"/>, if present.</p>
  7755.        </note>
  7756.       </p>
  7757.      </item>
  7758.    </olist>
  7759.    </p>
  7760. </constraintnote>
  7761.  <constraintnote type="src" id="src-expredef">
  7762.   <head>Individual Component Redefinition</head>
  7763.   <p>Corresponding to each non-<eltref ref="annotation"/> member of the
  7764. &i-children; of a <eltref ref="redefine"/> there are one or two schema components in
  7765. the <eltref ref="redefine"/>ing schema:</p>
  7766.   <olist>
  7767.    <item>
  7768.     <p>The <eltref ref="simpleType"/> and <eltref ref="complexType"/>
  7769. &i-children; information items each
  7770. correspond to two components:</p>
  7771.     <olist>
  7772.      <item>
  7773.       <p>One component which corresponds to the top-level definition item with
  7774. the same <code>name</code> in
  7775. the <eltref ref="redefine"/>d schema document, as defined in <specref ref="components"/>, except that its <xpropref role="anon">name</xpropref> is <termref def="key-null">absent</termref>;</p>
  7776.      </item>
  7777.      <item>
  7778.       <p>One component which corresponds to the information item itself, as defined
  7779. in <specref ref="components"/>, except that its <xpropref role="anon">base type definition</xpropref> is
  7780. the component defined in 1.1 above.</p>
  7781.      </item>
  7782.     </olist>
  7783.     <p>This pairing ensures the coherence constraints on type definitions
  7784. are respected, while at the same time achieving the desired effect, namely that
  7785. references to names of redefined components in both the <eltref ref="redefine"/>ing and
  7786. <eltref ref="redefine"/>d schema documents resolve to the redefined component
  7787. as specified in 1.2 above.</p>
  7788.    </item>
  7789.    <item>
  7790.     <p>The <eltref ref="group"/> and <eltref ref="attributeGroup"/>
  7791. &i-children; each correspond to a single component, as defined in <specref ref="components"/>, except that if and when a self-reference based on a  <code>ref</code> &i-attribute; whose &v-value; is the same as the item's <code>name</code> plus target namespace is resolved, a component which corresponds to the top-level definition item of that name and the appropriate kind in
  7792. <local>I</local> is used.</p>
  7793.    </item>
  7794.   </olist>
  7795.   <p>In all cases there must be a top-level definition item of the appropriate name and kind in
  7796. the <eltref ref="redefine"/>d schema document.</p>
  7797.  </constraintnote>
  7798.  <note><p>The above is carefully worded so that multiple equivalent <eltref ref="redefine"/>ing of the same schema document will not constitute a violation of
  7799. <clauseref ref="c-nmd"/> of <specref ref="sch-props-correct"/>, but applications are
  7800. allowed, indeed encouraged, to avoid <eltref ref="redefine"/>ing the same
  7801. schema document in the same way more than once to forestall the necessity of
  7802. establishing identity component by component (although this will have to be
  7803. done for the individual redefinitions themselves).</p></note>
  7804. </div3>
  7805. <div3 id="composition-schemaImport">
  7806. <head>References to schema components across namespaces</head>
  7807. <p>As described in <specref ref="concepts-data-model"/>, every top-level schema component is associated with
  7808. a target namespace (or, explicitly, with none).  This section sets out
  7809. the exact mechanism and syntax in the XML form of
  7810. schema definition by which a reference to a foreign component is made, that is, a component with a different target namespace from that of the referring component.</p>
  7811. <p>Two things are required: not only a means
  7812. of addressing such foreign components but also a signal to schema-aware processors that a
  7813. schema document contains such references:</p>
  7814.  <reprdef>
  7815.  <reprelt eltname="import"/>
  7816. </reprdef>
  7817.  <p>The <eltref ref="import"/> element information item identifies namespaces
  7818. used in external references, i.e. those whose
  7819. <termref def="gloss-QName">QName</termref> identifies them as coming from a
  7820. different namespace (or none) than the enclosing schema document's
  7821. <code>targetNamespace</code>.  The &v-value; of its <code>namespace</code>
  7822. &i-attribute; indicates that the containing schema document may contain
  7823. qualified references to schema components in that namespace (via one or more
  7824. prefixes declared with namespace declarations in the normal way).  If that
  7825. attribute is absent, then the import allows unqualified reference to components
  7826. with no target namespace.
  7827. Note that components to be imported need not be in the form of a
  7828. <termref def="key-schemaDoc">schema document</termref>;  the processor
  7829. is free to access or construct components using means of its own
  7830. choosing.</p>
  7831. <p>The
  7832. &v-value; of the <code>schemaLocation</code>, if present, gives a
  7833. hint as to where a serialization of a <termref def="key-schemaDoc">schema document</termref> with declarations and definitions for that
  7834. namespace (or none) may be found.  When no
  7835. <code>schemaLocation</code> &i-attribute; is present, the schema author is leaving the
  7836. identification of that schema to the instance, application or user, via the mechanisms described
  7837. below in <specref ref="composition-instances"/>.  When a <code>schemaLocation</code> is present, it
  7838. must contain a single URI reference which the schema author
  7839. warrants will resolve to a serialization of a <termref def="key-schemaDoc">schema document</termref> containing the component(s) in the
  7840. <eltref ref="import"/>ed namespace referred to elsewhere in the containing
  7841. schema document.</p>
  7842.  <note>
  7843.   <p>Since both the <code>namespace</code> and <code>schemaLocation</code>
  7844. &i-attribute; are optional, a bare <code><import/></code> information item
  7845. is allowed.  This simply allows unqualified reference to foreign
  7846. components with no target namespace without giving any hints as to where to find them.</p>
  7847.  </note>
  7848.  <note role="example"><p>The same namespace may be used both for real work, and in the course of
  7849. defining schema components in terms of foreign components:</p>
  7850. <eg xml:space="preserve"><schema xmlns="http://www.w3.org/2001/XMLSchema"
  7851.         xmlns:html="http://www.w3.org/1999/xhtml"
  7852.         targetNamespace="uri:mywork" xmlns:my="uri:mywork">
  7853.  
  7854.  <import namespace="http://www.w3.org/1999/xhtml"/>
  7855.  
  7856.  <annotation>
  7857.   <documentation>
  7858.    <html:p>[Some documentation for my schema]</html:p>
  7859.   </documentation>
  7860.  </annotation>
  7861.  
  7862.  . . .
  7863.  
  7864.  <complexType name="myType">
  7865.   <sequence>
  7866.    <element ref="html:p" minOccurs="0"/>
  7867.   </sequence>
  7868.   . . .
  7869.  </complexType>
  7870.  
  7871.  <element name="myElt" type="my:myType"/>
  7872. </schema>
  7873. </eg>
  7874. <p>The treatment of references as <termref def="gloss-QName">QNames</termref> implies that since (with the exception of
  7875. the schema for schemas) the target namespace and the XML Schema namespace
  7876. differ, without massive redeclaration of the default namespace
  7877. <emph>either</emph> internal references to the names being defined in a schema document
  7878. <emph>or</emph> the schema declaration and definition elements themselves must
  7879. be explicitly qualified.  This example takes the first option -- most other
  7880. examples in this specification have taken the second.</p>
  7881. </note>
  7882.  <constraintnote type="src" id="src-import">
  7883.  <head>Import Constraints and Semantics</head>
  7884.  <p>In addition to the conditions imposed on <eltref ref="import"/> element
  7885. information items by the schema for schemas
  7886.     <olist role="and">
  7887.      <item>
  7888.       <olist role="Case">
  7889.        <item>
  7890.         <p role="if">the <code>namespace</code> &i-attribute; is present</p>
  7891.         <p role="then">its &v-value; must not match the &v-value; of the
  7892. enclosing <eltref ref="schema"/>'s <code>targetNamespace</code> &i-attribute;.</p>
  7893.        </item>
  7894.        <item>
  7895.         <p role="if">the <code>namespace</code> &i-attribute; is not present</p>
  7896.         <p role="then">the enclosing <eltref ref="schema"/> must have a <code>targetNamespace</code> &i-attribute;</p>
  7897.        </item>
  7898.       </olist>
  7899.      </item>
  7900.     <item id="c-ims">
  7901.      <p>If the application schema reference strategy using the &v-value;s of
  7902. the <code>schemaLocation</code> and <code>namespace</code> &i-attributes;,
  7903. provides a referent, as defined by <specref ref="schema_reference"/>, 
  7904.       <olist role="or">
  7905.        <item>
  7906.         <p>The referent is (a fragment of) a resource which is an XML document
  7907. (see <clauseref ref="c-vxd"/>), which in turn corresponds to a <eltref ref="schema"/>
  7908. element information item in a well-formed information set, which in turn
  7909. corresponds to a valid schema.</p>
  7910.        </item>
  7911.        <item>
  7912.         <p>The referent is a <eltref ref="schema"/>
  7913. element information item in a well-formed information set, which in turn
  7914. corresponds to a valid schema.</p>
  7915.        </item>
  7916.       </olist>
  7917.       In either case call the <eltref ref="schema"/> item <local>SII</local> and the valid schema <local>I</local>.</p>
  7918.     </item>
  7919.      <item>
  7920.       <olist role="Case">
  7921.        <item>
  7922.         <p role="if">there is a <code>namespace</code> &i-attribute;</p>
  7923.         <p role="then">its &v-value; must be identical to the &v-value; of the <code>targetNamespace</code> &i-attribute; of <local>SII</local>.</p>
  7924.        </item>
  7925.        <item>
  7926.         <p role="if">there is no <code>namespace</code> &i-attribute;</p>
  7927.         <p role="then"><local>SII</local>
  7928. must have no <code>targetNamespace</code> &i-attribute;</p>
  7929.        </item>
  7930.       </olist>
  7931.      </item>
  7932.    </olist>
  7933.    </p>
  7934.  <p>It is <emph>not</emph> an error for the application schema reference
  7935. strategy to fail.  It
  7936. <emph>is</emph> an error for it to resolve but the rest of <clauseref ref="c-ims"/> above to
  7937. fail to be satisfied.  Failure to find a referent may well cause less than complete
  7938. <termref def="key-va">assessment</termref> outcomes, of course.</p>
  7939.  <p>The <termref def="key-component">schema components</termref> (that is
  7940. <propref ref="type_definitions"/>, <propref ref="attribute_declarations"/>, <propref ref="element_declarations"/>, <propref ref="attribute_group_definitions"/>, <propref ref="model_group_definitions"/>, <propref ref="notation_declarations"/>) of a schema corresponding to a
  7941. <eltref ref="schema"/> element information item with one or more <eltref ref="import"/> element information items must include not only definitions or declarations corresponding to the appropriate members of its &i-children;, but also, for each of those <eltref ref="import"/> element information items for which <clauseref ref="c-ims"/> above is satisfied, a set of <termref def="key-component">schema components</termref> identical to all the <termref def="key-component">schema components</termref> of <local>I</local>.</p>
  7942. </constraintnote>
  7943.  <note><p>The above is carefully worded so that multiple <eltref ref="import"/>ing of the same schema document will not constitute a violation of
  7944. <clauseref ref="c-nmd"/> of <specref ref="sch-props-correct"/>, but applications are
  7945. allowed, indeed encouraged, to avoid <eltref ref="import"/>ing the same schema document more than once to forestall the necessity of establishing identity
  7946. component by component.  Given that the <code>schemaLocation</code>
  7947. &i-attribute; is only a hint, it is open to applications to ignore all but the
  7948. first <eltref ref="import"/> for a given namespace, regardless of the &v-value; of
  7949. <code>schemaLocation</code>, but such a strategy risks missing useful
  7950. information when new <code>schemaLocation</code>s are offered.</p></note>
  7951. </div3></div2>
  7952. <div2 id="composition-instances">
  7953. <head>Layer 3: Schema Document Access and Web-interoperability</head>
  7954. <p>Layers 1 and 2 provide a framework for <termref def="key-va">assessment</termref> and XML definition of schemas in a broad variety of environments. Over time, a range
  7955. of standards and conventions may well evolve to support interoperability of XML
  7956. Schema implementations on the World Wide Web. Layer 3 defines the minimum level
  7957. of function required of all conformant processors operating on the Web:
  7958. it is intended that, over time, future standards (e.g. XML Packages) for interoperability on the
  7959. Web and in other environments can be introduced without the need to republish
  7960. this specification.</p>
  7961. <div3 id="schema-repr">
  7962. <head>Standards for representation of schemas and retrieval of schema documents on the Web</head>
  7963. <p>For interoperability, serialized <termref def="key-schemaDoc">schema documents</termref>, like all other Web resources, may be identified by
  7964. URI and retrieved using the standard mechanisms of the Web (e.g. http, https,
  7965. etc.) Such documents on the Web must be part of XML documents (see <clauseref ref="c-vxd"/>), and are represented in the
  7966. standard XML schema definition form described by layer 2 (that is as <eltref ref="schema"/>
  7967. element information items). </p>
  7968. <note><p> there will often be times when a schema document will be a
  7969. complete XML 1.0 document whose document element is <eltref ref="schema"/>. There will be
  7970. other occasions in which <eltref ref="schema"/> items will be contained in other
  7971. documents, perhaps referenced using fragment and/or XPointer notation.
  7972. </p></note>
  7973.  <note>
  7974.   <p>The variations among server software and web site administration policies
  7975. make it difficult to recommend any particular approach to retrieval requests
  7976. intended to retrieve serialized <termref def="key-schemaDoc">schema documents</termref>.  An <code>Accept</code> header of <code>application/xml,
  7977. text/xml; q=0.9, */*</code> is perhaps a reasonable starting point.</p>
  7978.  </note>
  7979. </div3>
  7980. <div3 id="schema-loc">
  7981. <head>How schema definitions are located on the Web</head>
  7982. <p>As described in <specref ref="layer1"/>, processors are responsible for providing the
  7983. schema components (definitions and declarations) needed for <termref def="key-va">assessment</termref>. This
  7984. section introduces a set of normative conventions to facilitate interoperability
  7985. for instance and schema documents retrieved and processed from the Web.</p>
  7986. <note><p> As discussed above in <specref ref="layer2"/>, other non-Web mechanisms for delivering schemas for <termref def="key-va">assessment</termref> may exist, but are outside the scope of this specification.</p></note>
  7987. <p>Processors on the Web are free to undertake <termref def="key-va">assessment</termref> against arbitrary
  7988. schemas in any of the ways set out in <specref ref="validation_outcome"/>. However, it
  7989. is useful to have a common convention for determining the schema to use. Accordingly, general-purpose schema-aware processors (i.e. those not
  7990. specialized to one or a fixed set of pre-determined schemas)
  7991. undertaking <termref def="key-va">assessment</termref> of a document on the web
  7992. must behave as follows:
  7993. <ulist>
  7994. <item>
  7995. <p>unless directed otherwise by the user, <termref def="key-va">assessment</termref> is undertaken on the document
  7996. element information item of the specified document;</p>
  7997. </item>
  7998. <item>
  7999. <p>unless directed otherwise by the user, the
  8000. processor is required to construct a schema corresponding to a schema document
  8001. whose <code>targetNamespace</code> is
  8002. identical to the
  8003. namespace name, if any, of the element information item on which <termref def="key-va">assessment</termref> is undertaken.</p>
  8004. </item>
  8005. </ulist>
  8006. </p>
  8007. <p>The composition of the complete
  8008. schema for use in <termref def="key-va">assessment</termref> is discussed in <specref ref="layer2"/> above.
  8009. The means used to locate appropriate schema document(s) are processor and
  8010. application dependent, subject to the following requirements: </p>
  8011. <olist>
  8012.   <item><p>Schemas are represented on the Web in the form specified above in <specref ref="schema-repr"/>;</p></item>
  8013.   <item><p>The author of a document uses namespace declarations to indicate the intended
  8014. interpretation of names appearing therein; there may or may not be a schema
  8015. retrievable via the namespace name.  Accordingly whether a processor's default
  8016. behavior is or is not to attempt such dereferencing, it must always provide
  8017. for user-directed overriding of that default.
  8018. </p>
  8019. <note><p> Experience suggests that it is not in all cases safe or desirable from
  8020. a performance point of view to dereference namespace names as a matter of course.  User community and/or
  8021. consumer/provider agreements may establish circumstances in which such dereference is a sensible
  8022. default strategy:  this specification allows but does not require particular communities to
  8023. establish and implement such conventions.  Users are always free to supply namespace names as schema location information when dereferencing <emph>is</emph> desired:  see below.</p></note></item>
  8024. <item>
  8025. <p>
  8026. On the other hand, in case a document author (human or not) created a
  8027. document with a particular schema in view, and warrants that some or
  8028. all of the document is conforms to that schema, the
  8029. <code>schemaLocation</code> and <code>noNamespaceSchemaLocation</code> &i-attributes; (in the XML Schema instance namespace,
  8030. that is, <code>http://www.w3.org/2001/XMLSchema-instance</code>) (hereafter
  8031. <code>xsi:schemaLocation</code> and
  8032. <code>xsi:noNamespaceSchemaLocation</code>) are provided.  The first records
  8033. the author's warrant with pairs of URI references (one for the namespace name, and
  8034. one for a hint as to the location of a schema document defining names for that
  8035. namespace name).  The second similarly provides a URI reference as a hint as to
  8036. the location of a schema document with no <code>targetNamespace</code> &i-attribute;.</p>
  8037. <p>Unless directed otherwise, for example by the invoking application
  8038. or by command line option, processors
  8039. should attempt to dereference each schema document location URI in the
  8040. &v-value; of such
  8041. <code>xsi:schemaLocation</code> and <code>xsi:noNamespaceSchemaLocation</code> &i-attributes;, see details below.</p>
  8042. </item>
  8043. <item>  <p><code>xsi:schemaLocation</code> and
  8044. <code>xsi:noNamespaceSchemaLocation</code> &i-attributes; can occur on any
  8045. element.  However, it is an error if such an attribute occurs
  8046. <emph>after</emph> the first appearance of an element or attribute information
  8047. item within an
  8048. element information item initially <termref def="key-vn">validated</termref> whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref> it addresses. According to the rules of
  8049.   <specref ref="layer1"/>, the corresponding schema may be lazily assembled, but is otherwise
  8050.   stable throughout <termref def="key-va">assessment</termref>. Although schema location attributes can occur
  8051.   on any element, and can be processed incrementally as discovered, their effect
  8052.   is essentially global to the <termref def="key-va">assessment</termref>. Definitions and declarations remain
  8053.   in effect beyond the scope of the element on which the binding is declared.
  8054.   </p></item>
  8055. </olist>
  8056. <note role="example"><p>Multiple schema bindings can be declared using a single
  8057. attribute.  For example consider a stylesheet:</p>
  8058. <eg xml:space="preserve">
  8059.  <stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
  8060.             xmlns:html="http://www.w3.org/1999/xhtml"
  8061.             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  8062.             xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform
  8063.                                 http://www.w3.org/1999/XSL/Transform.xsd
  8064.                                 http://www.w3.org/1999/xhtml
  8065.                                 http://www.w3.org/1999/xhtml.xsd">
  8066. </eg><p>The namespace names used in <code>schemaLocation</code> can, but need not
  8067.   be identical to those actually qualifying the element within whose start tag
  8068. it is found or its other attributes. For example, as above, all
  8069.   schema location information can be declared on the document element
  8070. of a document, if desired,
  8071.   regardless of where the namespaces are actually used. </p></note>
  8072.  <constraintnote id="schema_reference" type="src">
  8073.  <head>Schema Document Location Strategy</head>
  8074. <p>Given a namespace name (or none) and (optionally) a URI reference from
  8075. <code>xsi:schemaLocation</code> or <code>xsi:noNamespaceSchemaLocation</code>,
  8076. schema-aware processors may implement any combination of the following 
  8077. strategies, in any order:
  8078. <olist><item><p>
  8079. Do nothing, for instance because a schema containing components for the
  8080. given namespace name is already known to be available, or because it
  8081. is known in advance that no efforts to locate schema documents will be successful 
  8082. (for
  8083. example in embedded systems);
  8084. </p></item>
  8085. <item><p>
  8086. Based on the location URI, 
  8087. identify an existing schema document,
  8088. either as a resource which is an XML document or a <eltref ref="schema"/> element
  8089. information item, in some local schema repository;
  8090. </p></item>
  8091.  
  8092. <item><p>
  8093. Based on the namespace name, identify an existing schema document,
  8094. either as a resource which is an XML document or a <eltref ref="schema"/> element
  8095. information item, in some local schema repository;
  8096. </p></item>
  8097. <item><p>
  8098. Attempt to resolve the location URI, 
  8099. to locate a
  8100. resource on the web which is or contains or references a <eltref ref="schema"/> element;
  8101. </p></item>
  8102. <item><p>
  8103. Attempt to resolve the namespace name to locate such a resource.
  8104. </p></item>
  8105. </olist>
  8106. Whenever possible configuration and/or invocation options for selecting and/or ordering 
  8107. the implemented strategies should be provided.
  8108. </p>
  8109. </constraintnote>
  8110. <p>Improved or alternative conventions for Web interoperability can
  8111. be standardized in the future without reopening this specification. For
  8112. example, the W3C is currently considering initiatives to standardize the
  8113. packaging of resources relating to particular documents and/or namespaces: this
  8114. would be an addition to the mechanisms described here for layer 3. This
  8115. architecture also facilitates innovation at layer 2: for example, it would be
  8116. possible in the future to define an additional standard for the representation of
  8117. schema components which allowed e.g. type definitions to be specified piece by
  8118. piece, rather than all at once.</p>
  8119. </div3>
  8120. </div2>
  8121.  
  8122. </div1>
  8123. <div1 id="conformance">
  8124. <head>Schemas and Schema-validity Assessment</head>
  8125.  <p>The architecture of schema-aware processing allows for a rich characterization of XML documents:  schema validity is not a binary predicate.</p>
  8126.  <p>This specification distinguishes between errors in schema construction and structure, on the
  8127. one hand, and schema validation outcomes, on the other.</p>
  8128. <div2 id="conformance-schemaValidity">
  8129. <head>Errors in Schema Construction and Structure</head>
  8130.  <p>Before <termref def="key-va">assessment</termref> can be attempted, a schema is required. 
  8131. Special-purpose applications are free to determine a schema for use in <termref def="key-va">assessment</termref> by whatever
  8132. means are appropriate, but general purpose processors should implement the
  8133. strategy set out in <specref ref="schema_reference"/>, starting with the
  8134. namespaces declared in the document whose <termref def="key-va">assessment</termref> is being undertaken, and the &v-value;s of the
  8135. <code>xsi:schemaLocation</code> and <code>xsi:noNamespaceSchemaLocation</code>
  8136. &i-attributes; thereof, if any, along with an other information about
  8137. schema identity or schema document location provided by users in
  8138. application-specific ways, if any.</p>
  8139.  <p>It is an
  8140. error if a
  8141. schema and all the components which are the value of any of its properties,
  8142. recursively, fail to satisfy all the relevant Constraints on Schemas set out in
  8143. the last section of each of the subsections of <specref ref="components"/>.</p>
  8144.  <p>If a schema is derived from one or more schema documents (that is, one or
  8145. more <eltref ref="schema"/> element information items) based on the
  8146. correspondence rules set out in <specref ref="components"/> and <specref ref="composition"/>, two additional
  8147. conditions hold:
  8148.   <ulist>
  8149.    <item>
  8150.     <p>It is an error if any such schema document would not be fully valid with respect
  8151. to a schema corresponding to the <specref ref="normative-schemaSchema"/>, that
  8152. is, following schema-validation with such a schema, the <eltref ref="schema"/> element
  8153. information items would have a <propref role="psvi" ref="e-validation_attempted"/>
  8154. property with value <pt>full</pt> or <pt>partial</pt> and a
  8155. <propref role="psvi" ref="e-validity"/> property
  8156. with value <pt>valid</pt>.</p>
  8157.    </item>
  8158.    <item>
  8159.     <p>It is an error if any such schema document is or contains any element
  8160. information items which violate any of the relevant Schema Representation
  8161. Constraints set out in <specref ref="outcome-src"/>.</p>
  8162.    </item>
  8163.   </ulist>
  8164.  </p>
  8165.  <p>The three cases described above are the only types of error which this
  8166. specification defines.  With respect to the processes of the checking of schema structure
  8167. and the construction of schemas corresponding to schema documents, this
  8168. specification imposes no restrictions on processors after an error is detected.
  8169. However <termref def="key-va">assessment</termref> with respect to schema-like entities which do <emph>not</emph>
  8170. satisfy all the above conditions is incoherent.  Accordingly, conformant
  8171. processors must not attempt to undertake <termref def="key-va">assessment</termref> using such non-schemas.</p>
  8172. </div2>
  8173.  <div2 id="validation_outcome">
  8174.   <head>Assessing Schema-Validity</head>
  8175.   <p>With a schema which satisfies the conditions expressed in <specref ref="conformance-schemaValidity"/> above, the schema-validity of an element information item can be assessed.  Three primary approaches to this are possible:
  8176.    <olist>
  8177.     <item>
  8178.      <p>The user or application identifies a complex type definition from among the
  8179. <propref ref="type_definitions"/> of the schema, and appeals to <specref ref="cvc-assess-elt"/> (<clauseref ref="c-td"/>);</p>
  8180.     </item>
  8181.     <item id="c-res">
  8182.     <p>The user or application identifies a element declaration  from among the
  8183. <propref ref="element_declarations"/> of the schema, checks that its <propref ref="e-name"/> and <propref ref="e-target_namespace"/> match the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">local name</xpropref> and <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref> of the item, and appeals to <specref ref="cvc-assess-elt"/> (<clauseref ref="c-ed"/>);</p></item>
  8184.     <item>
  8185.      <p>The processor starts from <specref ref="cvc-assess-elt"/> with no
  8186. stipulated declaration or definition, and either <termref def="key-sva">strict</termref> or <termref def="key-lva">lax</termref> assessment ensues, depending on whether or not the element information and the schema determine either an element declaration (by name) or a type definition (via <code>xsi:type</code>) or not.</p>
  8187.     </item>
  8188.    </olist>
  8189.   </p>
  8190.   <p>The outcome of this effort, in any case, will be manifest in the
  8191.  <xpropref role="psviAnon">validation attempted</xpropref>
  8192. and  <xpropref role="psviAnon">validity</xpropref> properties on
  8193. the element information item and its &i-attributes; and &i-children;,
  8194. recursively, as defined by <specref ref="sic-e-outcome"/> and <specref ref="sic-a-outcome"/>.  It is up to applications to decide what constitutes a successful outcome.</p>
  8195.   <p>Note that every element and attribute information item
  8196. participating in the <termref def="key-va">assessment</termref> will also have a  <xpropref role="psviAnon">validation context</xpropref> property
  8197. which refers back to the element information item at which <termref def="key-va">assessment</termref> began.  <termdef id="key-vr" term="validation root">This item, that is the element information item at which <termref def="key-va">assessment</termref> began, is called the <term>validation root</term></termdef>.</p>
  8198.   <note>
  8199.     <p>This specification does not reconstruct the XML 1.0 notion of
  8200.       <emph>root</emph> in either schemas or instances.  Equivalent
  8201. functionality is provided for at <termref def="key-va">assessment</termref>
  8202. invocation, via <clauseref ref="c-res"/> above.</p>
  8203.   </note>
  8204.   <note>
  8205.    <p>This specification has nothing normative to say about multiple <termref def="key-va">assessment</termref>
  8206. episodes.  It should however be clear from the above that if a processor
  8207. restarts <termref def="key-va">assessment</termref> with respect to a &PSVI;
  8208. some &PSVI; contributions from the previous <termref def="key-va">assessment</termref>
  8209. may be overwritten.  Restarting nonetheless may be useful, particularly at a node whose
  8210.  <xpropref role="psviAnon">validation attempted</xpropref> property is <pt>none</pt>, in which
  8211. case there are three obvious cases in which additional useful information may result:
  8212.     <ulist>
  8213.      <item>
  8214.       <p><termref def="key-va">assessment</termref> was not attempted because
  8215. of a <termref def="key-vn">validation</termref> failure, but declarations
  8216. and/or definitions are available for at least some of the &i-children; or &i-attributes;;</p>
  8217.      </item>
  8218.      <item>
  8219.       <p><termref def="key-va">assessment</termref> was not attempted because a
  8220. named definition or declaration was missing, but after further effort the
  8221. processor has retrieved it.</p>
  8222.      </item>
  8223.      <item>
  8224.       <p><termref def="key-va">assessment</termref> was not attempted because
  8225. it was <pt>skip</pt>ped, but the processor has at least some declarations
  8226. and/or definitions available for at least some of the &i-children; or &i-attributes;.</p>
  8227.      </item>
  8228.     </ulist>
  8229.    </p>
  8230.   </note>
  8231.  </div2>
  8232.  <div2 id="conformance-missing">
  8233.   <head>Missing Sub-components</head>
  8234.   <p>At the beginning of <specref ref="components"/>, attention is drawn to the
  8235. fact that most kinds of schema components have properties which are described therein
  8236. as having other components, or sets of other components, as values, but that
  8237. when components are constructed on the basis of their correspondence with
  8238. element information items in schema documents, such properties usually
  8239. correspond to <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#QName">QNames</xtermref>, and the
  8240. <termref def="src-resolve">resolution</termref> of such <xtermref href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#QName">QNames</xtermref> may fail, resulting in one or more values of or containing <termref def="key-null">absent</termref> where a component is mandated.</p>
  8241.   <p>If at any time during <termref def="key-va">assessment</termref>, an
  8242. element or attribute information item is being <termref def="key-vn">validated</termref> with respect to a component of any kind any of whose
  8243. properties has or contains such an <termref def="key-null">absent</termref> value,
  8244. the <termref def="key-vn">validation</termref> is modified, as following:
  8245.    <ulist>
  8246.     <item>
  8247.      <p>In the case of attribute information items, the effect is
  8248. as if <clauseref ref="c-a1"/> of <specref ref="cvc-attribute"/> had failed;</p>
  8249.     </item>
  8250.     <item>
  8251.      <p>In the case of element information items, the effect is
  8252. as if <clauseref ref="c-ea"/> of <specref ref="cvc-elt"/> had failed;</p>
  8253.     </item>
  8254.     <item>
  8255.      <p>In the case of element information items, processors may choose to
  8256. continue <termref def="key-va">assessment</termref>: see <termref def="key-lva">lax assessment</termref>.</p>
  8257.     </item>
  8258.    </ulist>
  8259.   </p>
  8260.   <p>Because of the value specification for <propref role="psvi" ref="e-validation_attempted"/> in <specref ref="sic-e-outcome"/>, if this situation ever arises, the
  8261. document as a whole cannot show a <propref role="psvi" ref="e-validation_attempted"/>
  8262. of <pt>full</pt>.</p>
  8263.  </div2>
  8264.  
  8265. <div2 id="conformance-processorResponsibilities">
  8266. <head>Responsibilities of Schema-aware Processors</head>
  8267.  <p>Schema-aware processors are responsible for processing XML documents,
  8268. schemas and schema documents, as appropriate given the level of conformance
  8269. (as defined in <specref ref="concepts-conformance"/>) they support,
  8270. consistently with the conditions set out above.</p>
  8271. </div2>
  8272. </div1>
  8273. </body>
  8274.  
  8275. <back>
  8276. <div1 id="normative-schemaSchema">
  8277. <head>Schema for Schemas (normative)</head>
  8278. <p>The XML Schema definition for &XSP1; itself is presented here as normative
  8279. part of the specification, and as an illustrative example of the XML Schema in
  8280. defining itself with the very constructs that it defines. The names of XML
  8281. Schema language types, elements, attributes and groups defined here
  8282. are evocative of their purpose, but are occasionally verbose. </p>
  8283. <p>There is some annotation in comments, but a fuller annotation will require
  8284. the use of embedded documentation facilities or a hyperlinked external
  8285. annotation for which tools are not yet readily available.</p>
  8286. <p>Since an &XSP1; is an XML document, it has optional XML and doctype
  8287. declarations that are provided here for completeness. The root
  8288. <code>schema</code> element defines a new schema. Since this is a schema for
  8289. &XSP1;, the <code>targetNamespace</code> references the XML Schema namespace itself.</p>
  8290. <eg xml:space="preserve" text="http://www.w3.org/2001/05/XMLSchema.xsd,txt"/>
  8291. <note>
  8292. <p>And that is the end of the schema for &XSP1;.</p>
  8293. </note>
  8294.  
  8295.  
  8296. </div1>
  8297. <div1 id="normative-references">
  8298. <head>References (normative)</head>
  8299. <blist> 
  8300. <bibl id="ref-xsp2" key="XML Schemas: Datatypes">
  8301. <emph>XML Schema Part 2: Datatypes</emph>, Paul V. Biron and Ashok
  8302. Malhotra, eds., W3C, 2 May 2001.  See <loc href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html">http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html</loc> </bibl>
  8303. <bibl id="ref-xsreq" key="XML Schema Requirements">
  8304. <emph>XML Schema Requirements </emph>, Ashok Malhotra and Murray Maloney, eds.,
  8305. W3C, 15 February 1999. See <loc href="http://www.w3.org/TR/1999/NOTE-xml-schema-req-19990215">http://www.w3.org/TR/1999/NOTE-xml-schema-req-19990215</loc> </bibl>
  8306. <bibl id="ref-xml" key="XML 1.0 (Second Edition)"> <emph>Extensible
  8307. Markup Language (XML) 1.0, Second Edition</emph>, Tim Bray et al., eds., W3C,
  8308. 6 October 2000. See
  8309. <loc href="http://www.w3.org/TR/2000/REC-xml-20001006">http://www.w3.org/TR/2000/REC-xml-20001006</loc>
  8310. </bibl>
  8311. <bibl id="ref-xmlinfo" key="XML-Infoset"><emph>XML Information Set</emph>,
  8312. John Cowan and Richard Tobin, eds., W3C, 16 March 2001. See
  8313. <loc href="http://www.w3.org/TR/2001/WD-xml-infoset-20010316/">http://www.w3.org/TR/2001/WD-xml-infoset-20010316/</loc>
  8314. </bibl>
  8315. <bibl id="ref-xml-namespaces" key="XML-Namespaces">
  8316. <emph>Namespaces in XML</emph>, Tim Bray et al., eds., W3C, 14 January 1999. See
  8317. <loc href="http://www.w3.org/TR/1999/REC-xml-names-19990114/">http://www.w3.org/TR/1999/REC-xml-names-19990114/</loc> </bibl>
  8318. <bibl id="ref-xpointer" key="XPointer"> <emph>XML
  8319. Pointer Language (XPointer)</emph>, Eve Maler and Steve DeRose, eds., W3C, 8 January 2001. See <loc href="http://www.w3.org/TR/2001/WD-xptr-20010108/">http://www.w3.org/TR/2001/WD-xptr-20010108/</loc> </bibl>
  8320.  <bibl id="bib-xpath" key="XPath"><emph>XML Path Language</emph>, James Clark
  8321. and Steve DeRose, eds., W3C, 16 November 1999.  See <loc href="http://www.w3.org/TR/1999/REC-xpath-19991116">http://www.w3.org/TR/1999/REC-xpath-19991116</loc></bibl>
  8322. </blist>
  8323. </div1>
  8324.  <div1 id="outcomes">
  8325.   <head>Outcome Tabulations (normative)</head>
  8326.   <p>To facilitate consistent reporting of schema errors and <termref def="key-vn">validation</termref>
  8327. failures, this section tabulates and provides unique names for all the
  8328. constraints listed in this document.  Wherever such constraints have numbered
  8329. parts, reports should use the name given below plus the part number, separated
  8330. by a period ('.').  Thus for example <code>cos-ct-extends.1.2</code> should be
  8331. used to report a violation of the <clauseref ref="c-cte"/> of
  8332. <specref ref="cos-ct-extends"/>.</p>
  8333.   <div2 id="validation_failures">
  8334.    <head>Validation Rules</head>
  8335.    <p/>
  8336.   </div2>
  8337.   <div2 id="PSVI_contributions">
  8338.    <head>Contributions to the &PSVI;</head>
  8339.   </div2>
  8340.   <div2 id="outcome-src">
  8341.    <head>Schema Representation Constraints</head>
  8342.    <p/>
  8343.   </div2>
  8344.   <div2 id="outcome-cos">
  8345.    <head>Schema Component Constraints</head>
  8346.   </div2>
  8347.  </div1>
  8348.  <div1 id="infoset">
  8349.   <head>Required Information Set Items and Properties (normative)</head>
  8350.   <p>This specification requires as a precondition for <termref def="key-va">assessment</termref> an information set as defined in <bibref ref="ref-xmlinfo"/> which supports at least the following information items and properties:</p>
  8351.   <glist>
  8352.    <gitem>
  8353.     <label>Attribute Information Item</label>
  8354.     <def>
  8355.      <p><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref>, <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref>,
  8356. <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">normalized value</xpropref></p>
  8357.     </def>
  8358.    </gitem>
  8359.    <gitem>
  8360.     <label>Character Information Item</label>
  8361.     <def>
  8362.      <p><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.character">character code</xpropref></p>
  8363.     </def>
  8364.    </gitem>
  8365.    <gitem>
  8366.     <label>Element Information Item</label>
  8367.     <def>
  8368.      <p><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">local name</xpropref>, <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref>,
  8369. <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref>, <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">in-scope namespaces</xpropref> or
  8370. <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace attributes</xpropref></p>
  8371.     </def>
  8372.    </gitem>
  8373.    <gitem>
  8374.     <label>Namespace Information Item</label>
  8375.     <def>
  8376.      <p><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.namespace">prefix</xpropref>, <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.namespace">namespace name</xpropref></p>
  8377.     </def>
  8378.    </gitem>
  8379.   </glist>
  8380.   <p>This specification does not require any destructive alterations to the input
  8381. information set: all the information set contributions specified herein are additive.</p>
  8382.   <p>This appendix is intended to satisfy the requirements for <xspecref href="http://www.w3.org/TR/2001/WD-xml-infoset-20010316/#conformance">Conformance</xspecref> to the <bibref ref="ref-xmlinfo"/> specification.</p>
  8383.  </div1>
  8384.  <div1 id="component-diagram">
  8385.   <head>Schema Components Diagram (non-normative)</head>
  8386.   <graphic source="components.gif" alt="Diagram of schema components" map="compImage"/>
  8387.   <imagemap source="image-map.html" id="compImage"/>
  8388.  </div1>
  8389.  
  8390. <div1 id="normative-glossary">
  8391. <head>Glossary (non-normative)</head>
  8392. <p>The listing below is for the benefit of readers of a printed version of this
  8393. document:  it collects together all the definitions which appear in the
  8394. document above.</p>
  8395. <ednote role="glossary">
  8396. <edtext>An XSL macro is used to
  8397. collect definitions from throughout the spec and gather them here for easy
  8398. reference.</edtext>
  8399. </ednote>
  8400.  
  8401. </div1>
  8402.  <div1 id="nonnormative-schemaDTD">
  8403. <head>DTD for Schemas (non-normative)</head>
  8404. <p>The DTD for &XSP1; is given below.  Note there is <emph>no</emph>
  8405. implication here the <code>schema</code> must be the root element of a
  8406. document.</p>
  8407. <p>Although this DTD is non-normative, any XML document which is
  8408.      not valid per this DTD, given redefinitions in its internal subset of the
  8409.      'p' and 's' parameter entities below appropriate to its namespace
  8410.      declaration of the XML Schema namespace, is almost certainly not
  8411.      a valid schema document, with the exception of documents with multiple namespace
  8412.      prefixes for the XML Schema namespace itself.  Accordingly
  8413. authoring XML Schema documents using this DTD and DTD-based authoring tools, and
  8414. specifying it as the DOCTYPE of documents intended to be XML Schema
  8415. documents and validating them with a validating XML parser, are
  8416. sensible development strategies which users are encouraged to adopt
  8417. until XML Schema-based authoring tools and validators are more widely available.</p>
  8418. <eg xml:space="preserve" text="http://www.w3.org/2001/05/XMLSchema.dtd,txt"/>
  8419. </div1>
  8420.  <div1 id="non-ambig">
  8421.   <head>Analysis of the Unique Particle Attribution Constraint (non-normative)</head>
  8422.   <p>A specification of the import of <specref ref="cos-nonambig"/> which does
  8423. not appeal to a processing model is difficult.  What follows is intended as
  8424. guidance, without claiming to be complete.</p>
  8425.    <p><termdef term="overlap" id="key-overlap" role="local">Two non-group
  8426. particles <term>overlap</term> if </termdef>
  8427.    <ulist>
  8428.     <item>
  8429.      <p>They are both element declaration particles whose declarations have the
  8430. same <propref ref="e-name"/> and <propref ref="e-target_namespace"/>.</p>
  8431.     </item>
  8432.    </ulist>
  8433.     or
  8434.     <ulist>
  8435.     <item>
  8436.      <p>They are both element declaration particles one of which is in the
  8437. other's <termref def="key-eq">substitution group</termref>.</p>
  8438.     </item>
  8439.    </ulist>
  8440.     or
  8441.     <ulist>
  8442.      <item>
  8443.       <p>They are both wildcards, and the intensional intersection of their <propref ref="namespace_constraint"/>s as defined
  8444. in <specref ref="cos-aw-intersect"/> is not the empty set.</p>
  8445.      </item>
  8446.     </ulist>
  8447.     or
  8448.     <ulist>
  8449.      <item>
  8450.       <p>One is a wildcard and the other an element declaration, and the
  8451. <propref ref="e-target_namespace"/> of the element declaration, or of any
  8452. member of its <termref def="key-eq">substitution group</termref>, is <termref def="key-vn">valid</termref> with respect to the <propref ref="namespace_constraint"/> of the wildcard.</p>
  8453.      </item>
  8454.     </ulist>
  8455.    </p>
  8456.    <p>A content model will violate the unique attribution constraint if it
  8457. contains two particles which <termref def="key-overlap">overlap</termref> and which either
  8458.     <ulist>
  8459.      <item>
  8460.       <p>are both in the <propref ref="particles"/> of a <pt>choice</pt> or
  8461. <pt>all</pt> group</p>
  8462.      </item>
  8463.     </ulist>
  8464.     or
  8465.     <ulist>
  8466.      <item>
  8467.       <p>may <termref def="key-vn">validate</termref> adjacent information items and the first has
  8468. <propref ref="p-min_occurs"/> less than <propref ref="p-max_occurs"/>.</p>
  8469.      </item>
  8470.     </ulist>
  8471.    </p>
  8472.    <p>Two particles may <termref def="key-vn">validate</termref> adjacent information items if they are
  8473. separated by at most epsilon transitions in the most obvious transcription of a
  8474. content model into a finite-state automaton.</p>
  8475.   <p>A precise formulation of this constraint can also be offered in terms of
  8476. operations on finite-state automaton:  transcribe the content model into an
  8477. automaton in the usual way using epsilon transitions for optionality and
  8478. unbounded maxOccurs, unfolding other numeric occurrence ranges and treating the heads of substitution groups as if
  8479. they were choices over all elements in the group, <emph>but</emph> using not
  8480. element QNames as transition labels, but rather pairs of element QNames and
  8481. positions in the model.  Determinize this automaton, treating wildcard transitions as opaque.  Now replace all
  8482. QName+position transition labels with the element QNames alone.  If the result has any states
  8483. with two or more identical-QName-labeled transitions from it, or a
  8484. QName-labeled transition and a wildcard transition which subsumes it, or two
  8485. wildcard transitions whose intentional intersection is non-empty, the model does not
  8486. satisfy the Unique Attribution constraint.   </p>
  8487.  </div1>
  8488.  <div1 id="nonnormative-references">
  8489.   <head>References (non-normative)</head>
  8490.   <blist>
  8491. <bibl id="ref-dcd" key="DCD"> <emph>Document
  8492. Content Description for XML (DCD)</emph>, Tim Bray et al., eds., W3C, 10 August 1998.
  8493. See <loc href="http://www.w3.org/TR/1998/NOTE-dcd-19980731">http://www.w3.org/TR/1998/NOTE-dcd-19980731</loc> </bibl>
  8494. <bibl id="ref-ddml" key="DDML"> <emph>Document
  8495. Definition Markup Language</emph>, Ronald Bourret, John Cowan, Ingo Macherius,
  8496. Simon St. Laurent, eds., W3C, 19 January 1999. See
  8497. <loc href="http://www.w3.org/TR/1999/NOTE-ddml-19990119">http://www.w3.org/TR/1999/NOTE-ddml-19990119
  8498. </loc></bibl>
  8499.  <bibl id="bib-expo" key="XML Schema: Primer"><emph>XML Schema Part 0:
  8500. Primer</emph>, David C. Fallside, ed., W3C, 2 May 2001.  See <loc href="http://www.w3.org/TR/2001/REC-xmlschema-0-20010502/primer.html">http://www.w3.org/TR/2001/REC-xmlschema-0-20010502/primer.html</loc></bibl>
  8501. <bibl id="ref-sox" key="SOX"> <emph>Schema for
  8502. Object-oriented XML</emph>, Andrew Davidson et al., eds., W3C, 1998. See
  8503. <loc href="http://www.w3.org/1999/07/NOTE-SOX-19990730/">http://www.w3.org/1999/07/NOTE-SOX-19990730/</loc> </bibl>
  8504. <bibl id="ref-sox-1.1" key="SOX-2"> <emph>Schema
  8505. for Object-oriented XML</emph>, Version 2.0, Andrew Davidson, et al., W3C, 30
  8506. July 1999. See
  8507. <loc href="http://www.w3.org/TR/NOTE-SOX/">http://www.w3.org/TR/NOTE-SOX/</loc></bibl>
  8508. <bibl id="ref-xdr" key="XDR"> <emph>XML-Data
  8509. Reduced</emph>, Charles Frankston and Henry S. Thompson, 3 July 1998.  See
  8510. <loc href="http://www.ltg.ed.ac.uk/~ht/XMLData-Reduced.htm">http://www.ltg.ed.ac.uk/~ht/XMLData-Reduced.htm
  8511. </loc> </bibl>
  8512. <bibl id="ref-xml-data" key="XML-Data">
  8513. <emph>XML-Data</emph>, Andrew Layman et al., W3C, 05 January 1998. See
  8514. <loc href="http://www.w3.org/TR/1998/NOTE-XML-data-0105/">http://www.w3.org/TR/1998/NOTE-XML-data-0105/</loc> </bibl>
  8515.   </blist>
  8516.  </div1>
  8517. <div1 id="acknowledgments">
  8518. <head>Acknowledgements (non-normative)</head>
  8519.  <p>The following have contributed material to this draft:</p>
  8520.  <slist>
  8521.   <sitem>David Fallside, IBM</sitem>
  8522.   <sitem>Scott Lawrence, Agranat Systems</sitem>
  8523.   <sitem>Andrew Layman, Microsoft</sitem>
  8524.   <sitem>Eve L. Maler, Sun Microsystems</sitem>
  8525.   <sitem>Asir S. Vedamuthu, webMethods, Inc</sitem>
  8526.  </slist>
  8527. <p>The editors acknowledge the members of the XML Schema Working Group, the members of other W3C Working Groups, and industry experts in other
  8528. forums who have contributed directly or indirectly to the process or content of
  8529. creating this document. The Working Group is particularly grateful to Lotus
  8530. Development Corp. and IBM for providing teleconferencing facilities.</p>
  8531.  <p>The current members of the XML Schema Working Group are:</p>
  8532. <orglist>
  8533. <member>
  8534.  <name>Jim Barnette</name>
  8535.  <affiliation>Defense Information Systems Agency (DISA)</affiliation>
  8536. </member>
  8537. <member>
  8538.  <name>Paul V. Biron</name>
  8539.  <affiliation>Health Level Seven</affiliation>
  8540. </member>
  8541. <member>
  8542.  <name>Don Box</name>
  8543.  <affiliation>DevelopMentor</affiliation>
  8544. </member>
  8545. <member>
  8546.  <name>Allen Brown</name>
  8547.  <affiliation>Microsoft</affiliation>
  8548. </member>
  8549. <member>
  8550.  <name>Lee Buck</name>
  8551.  <affiliation>TIBCO Extensibility</affiliation>
  8552. </member>
  8553. <member>
  8554.  <name>Charles E. Campbell</name>
  8555.  <affiliation>Informix</affiliation>
  8556. </member>
  8557.  <member>
  8558.   <name>Wayne Carr</name>
  8559.   <affiliation>Intel</affiliation>
  8560.  </member>
  8561. <member>
  8562.  <name>Peter Chen</name>
  8563.  <affiliation>Bootstrap Alliance and LSU</affiliation>
  8564. </member>
  8565. <member>
  8566.  <name>David Cleary</name>
  8567.  <affiliation>Progress Software</affiliation>
  8568. </member>
  8569. <member>
  8570.  <name>Dan Connolly</name>
  8571.  <affiliation>W3C</affiliation>
  8572.  <role>staff contact</role>
  8573. </member>
  8574. <member>
  8575.  <name>Ugo Corda</name>
  8576.  <affiliation>Xerox</affiliation>
  8577. </member>
  8578. <member>
  8579.  <name>Roger L. Costello</name>
  8580.  <affiliation>MITRE</affiliation>
  8581. </member>
  8582.  <member>
  8583.   <name>Haavard Danielson</name>
  8584.   <affiliation>Progress Software</affiliation>
  8585.  </member>
  8586.  <member>
  8587.   <name>Josef Dietl</name>
  8588.   <affiliation>Mozquito Technologies</affiliation>
  8589.  </member>
  8590. <member>
  8591.  <name>David Ezell</name>
  8592.  <affiliation>Hewlett-Packard Company</affiliation>
  8593. </member>
  8594.  <member>
  8595.   <name>Alexander Falk</name>
  8596.   <affiliation>Altova GmbH</affiliation>
  8597.  </member>
  8598. <member>
  8599.  <name>David Fallside</name>
  8600.  <affiliation>IBM</affiliation>
  8601. </member>
  8602.  <member>
  8603.   <name>Dan Fox</name>
  8604.   <affiliation>Defense Logistics Information Service (DLIS)</affiliation>
  8605.  </member>
  8606. <member>
  8607.  <name>Matthew Fuchs</name>
  8608.  <affiliation>Commerce One</affiliation>
  8609. </member>
  8610. <member>
  8611.  <name>Andrew Goodchild</name>
  8612.  <affiliation>Distributed Systems Technology Centre (DSTC Pty Ltd)</affiliation>
  8613. </member>
  8614. <member>
  8615.  <name>Paul Grosso</name>
  8616.  <affiliation>Arbortext, Inc</affiliation>
  8617. </member>
  8618. <member>
  8619.  <name>Martin Gudgin</name>
  8620.  <affiliation>DevelopMentor</affiliation>
  8621. </member>
  8622. <member>
  8623.  <name>Dave Hollander</name>
  8624.  <affiliation>Contivo, Inc</affiliation>
  8625.  <role>co-chair</role>
  8626. </member>
  8627. <member>
  8628.  <name>Mary Holstege</name>
  8629.  <affiliation>Invited Expert</affiliation>
  8630. </member>
  8631. <member>
  8632.  <name>Jane Hunter</name>
  8633.  <affiliation>Distributed Systems Technology Centre (DSTC Pty Ltd)</affiliation>
  8634. </member>
  8635.  <member>
  8636.   <name>Rick Jelliffe</name>
  8637.   <affiliation>Academia Sinica</affiliation>
  8638.  </member>
  8639.  <member>
  8640.   <name>Simon Johnston</name>
  8641.   <affiliation>Rational Software</affiliation>
  8642.  </member>
  8643.  <member>
  8644.   <name>Bob Lojek</name>
  8645.   <affiliation>Mozquito Technologies</affiliation>
  8646.  </member>
  8647. <member>
  8648.  <name>Ashok Malhotra</name>
  8649.  <affiliation>Microsoft</affiliation>
  8650. </member>
  8651.  <member>
  8652.   <name>Lisa Martin</name>
  8653.   <affiliation>IBM</affiliation>
  8654.  </member>
  8655. <member>
  8656.  <name>Noah Mendelsohn</name>
  8657.  <affiliation>Lotus Development Corporation</affiliation>
  8658. </member>
  8659.  <member>
  8660.   <name>Adrian Michel</name>
  8661.   <affiliation>Commerce One</affiliation>
  8662.  </member>
  8663.  <member>
  8664.   <name>Alex Milowski</name>
  8665.   <affiliation>Invited Expert</affiliation>
  8666.  </member>
  8667. <member>
  8668.  <name>Don Mullen</name>
  8669.  <affiliation>TIBCO Extensibility</affiliation>
  8670. </member>
  8671.  <member>
  8672.   <name>Dave Peterson</name>
  8673.   <affiliation>Graphic Communications Association</affiliation>
  8674.  </member>
  8675. <member>
  8676.  <name>Jonathan Robie</name>
  8677.  <affiliation>Software AG</affiliation>
  8678. </member>
  8679. <member>
  8680.  <name>Eric Sedlar</name>
  8681.  <affiliation>Oracle Corp.</affiliation>
  8682. </member>
  8683. <member>
  8684.  <name>C. M. Sperberg-McQueen</name>
  8685.  <affiliation>W3C</affiliation>
  8686.  <role>co-chair</role>
  8687. </member>
  8688. <member>
  8689.  <name>Bob Streich</name>
  8690.  <affiliation>Calico Commerce</affiliation>
  8691. </member>
  8692.  <member>
  8693.   <name>William K. Stumbo</name>
  8694.   <affiliation>Xerox</affiliation>
  8695.  </member>
  8696. <member>
  8697.  <name>Henry S. Thompson</name>
  8698.  <affiliation>University of Edinburgh</affiliation>
  8699. </member>
  8700. <member>
  8701.  <name>Mark Tucker</name>
  8702.  <affiliation>Health Level Seven</affiliation>
  8703. </member>
  8704.  <member>
  8705.   <name>Asir S. Vedamuthu</name>
  8706.   <affiliation>webMethods, Inc</affiliation>
  8707.  </member>
  8708. <member>
  8709.  <name>Priscilla Walmsley</name>
  8710.  <affiliation>XMLSolutions</affiliation>
  8711. </member>
  8712. <member>
  8713.  <name>Norm Walsh</name>
  8714.  <affiliation>Sun Microsystems</affiliation>
  8715. </member>
  8716. <member>
  8717.  <name>Aki Yoshida</name>
  8718.  <affiliation>SAP AG</affiliation>
  8719. </member>
  8720.  <member>
  8721.  <name>Kongyi Zhou</name>
  8722.  <affiliation>Oracle Corp.</affiliation>
  8723. </member>
  8724. </orglist>
  8725.  <p>The XML Schema Working Group has benefited in its work from the
  8726. participation and contributions of a number of people not currently
  8727. members of the Working Group, including
  8728. in particular those named below.  Affiliations given are those current at
  8729. the time of their work with the WG.
  8730. </p>
  8731.  <orglist>
  8732. <member>
  8733.  <name>Paula Angerstein</name>
  8734.  <affiliation>Vignette Corporation</affiliation>
  8735. </member>
  8736. <member>
  8737.  <name>David Beech</name>
  8738.  <affiliation>Oracle Corp.</affiliation>
  8739. </member>
  8740.  <member>
  8741.   <name>Gabe Beged-Dov</name>
  8742.   <affiliation>Rogue Wave Software</affiliation>
  8743.  </member>
  8744. <member>
  8745.  <name>Greg Bumgardner</name>
  8746.  <affiliation>Rogue Wave Software</affiliation>
  8747. </member>
  8748. <member>
  8749.  <name>Dean Burson</name>
  8750.  <affiliation>Lotus Development Corporation</affiliation>
  8751. </member>
  8752.  <member>
  8753.   <name>Mike Cokus</name>
  8754.   <affiliation>MITRE</affiliation>
  8755.  </member>
  8756.  <member>
  8757.  <name>Andrew Eisenberg</name>
  8758.  <affiliation>Progress Software</affiliation>
  8759. </member>
  8760. <member>
  8761.  <name>Rob Ellman</name>
  8762.  <affiliation>Calico Commerce</affiliation>
  8763. </member>
  8764.  <member>
  8765.   <name>George Feinberg</name>
  8766.   <affiliation>Object Design</affiliation>
  8767.  </member>
  8768.  <member>
  8769.   <name>Charles Frankston</name>
  8770.   <affiliation>Microsoft</affiliation>
  8771.  </member>
  8772.  <member>
  8773.   <name>Ernesto Guerrieri</name>
  8774.   <affiliation>Inso</affiliation>
  8775.  </member>
  8776.  <member>
  8777.   <name>Michael Hyman</name>
  8778.   <affiliation>Microsoft</affiliation>
  8779.  </member>
  8780. <member>
  8781.  <name>Renato Iannella</name>
  8782.  <affiliation>Distributed Systems Technology Centre (DSTC Pty Ltd)</affiliation>
  8783. </member>
  8784.  <member>
  8785.   <name>Dianne Kennedy</name>
  8786.   <affiliation>Graphic Communications Association</affiliation>
  8787.  </member>
  8788. <member>
  8789.  <name>Janet Koenig</name>
  8790.  <affiliation>Sun Microsystems</affiliation>
  8791. </member>
  8792. <member>
  8793.  <name>Setrag Khoshafian</name>
  8794.  <affiliation>Technology Deployment International (TDI)</affiliation>
  8795. </member>
  8796. <member>
  8797.  <name>Ara Kullukian</name>
  8798.  <affiliation>Technology Deployment International (TDI)</affiliation>
  8799. </member>
  8800.  <member>
  8801.  <name>Andrew Layman</name>
  8802.  <affiliation>Microsoft</affiliation>
  8803. </member>
  8804. <member>
  8805.  <name>Dmitry Lenkov</name>
  8806.  <affiliation>Hewlett-Packard Company</affiliation>
  8807. </member>
  8808. <member>
  8809.  <name>John McCarthy</name>
  8810.  <affiliation>Lawrence Berkeley National Laboratory</affiliation>
  8811. </member>
  8812. <member>
  8813.  <name>Murata Makoto</name>
  8814.  <affiliation>Xerox</affiliation>
  8815. </member>
  8816. <member>
  8817.  <name>Eve Maler</name>
  8818.  <affiliation>Sun Microsystems</affiliation>
  8819. </member>
  8820. <member>
  8821.  <name>Murray Maloney</name>
  8822.  <affiliation>Muzmo Communication, acting for Commerce One</affiliation>
  8823. </member>
  8824.  <member>
  8825.   <name>Chris Olds</name>
  8826.   <affiliation>Wall Data</affiliation>
  8827.  </member>
  8828. <member>
  8829.  <name>Frank Olken</name>
  8830.  <affiliation>Lawrence Berkeley National Laboratory</affiliation>
  8831. </member>
  8832. <member>
  8833.  <name>Shriram Revankar</name>
  8834.  <affiliation>Xerox</affiliation>
  8835. </member>
  8836. <member>
  8837.  <name>Mark Reinhold</name>
  8838.  <affiliation>Sun Microsystems</affiliation>
  8839. </member>
  8840. <member>
  8841.  <name>John C. Schneider</name>
  8842.  <affiliation>MITRE</affiliation>
  8843. </member>
  8844.  <member>
  8845.   <name>Lew Shannon</name>
  8846.   <affiliation>NCR</affiliation>
  8847.  </member>
  8848.  <member>
  8849.   <name>William Shea</name>
  8850.   <affiliation>Merrill Lynch</affiliation>
  8851.  </member>
  8852.  <member>
  8853.   <name>Ralph Swick</name>
  8854.   <affiliation>W3C</affiliation>
  8855.  </member>
  8856.  <member>
  8857.   <name>Tony Stewart</name>
  8858.   <affiliation>Rivcom</affiliation>
  8859.  </member>
  8860. <member>
  8861.  <name>Matt Timmermans</name>
  8862.  <affiliation>Microstar</affiliation>
  8863. </member>
  8864.   <member>
  8865.  <name>Jim Trezzo</name>
  8866.  <affiliation>Oracle Corp.</affiliation>
  8867. </member>
  8868. <member>
  8869.  <name>Steph Tryphonas</name>
  8870.  <affiliation>Microstar</affiliation>
  8871. </member>
  8872.  </orglist>
  8873. </div1>
  8874. </back>
  8875. </spec>
  8876.