<?xml version="1.0" encoding="utf-8"?><!-- Id: structures.xml,v 1.6.2.125 2006/08/29 06:08:16 cmsmcq Exp  --><?xml-stylesheet type='text/xsl' href='xmlschema_nodiffs.xsl'?>
<!DOCTYPE spec
  SYSTEM "local.dgdf.dtd">
<spec dgdf="dg-wd.xml" dgdf_desc="" xml:lang="en" w3c-doctype="wd" status="final" otherSpec="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html" schemaDump="./XMLSchema.xsd.dmp" schemaProper="./XMLSchema.xsd" datatypeDoc="../WD-xmlschema11-2-20060217/datatypes.xml" schemaExample="./example.xsd.dmp" docStatus="final" me="WD-xmlschema11-1-20060831">
 <header>
  <title>XML Schema 1.1 Part 1: Structures</title>
  <w3c-designation>wd-20060831</w3c-designation>
  <w3c-doctype>W3C Working Draft</w3c-doctype>
  <pubdate>
   <day>31</day>
   <month>August</month>
   <year>2006</year><!--  Id: structures.xml,v 1.6.2.125 2006/08/29 06:08:16 cmsmcq Exp  -->
  </pubdate>
  <publoc> 
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/">http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/</loc> 
  </publoc>
  <altlocs><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.xml">XML</loc>
<!--*
   <loc href="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.diff-1.0.html">XHTML with changes since version 1.0 marked</loc>
   <loc href="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.diff-wd.html">XHTML with changes since previous Working Draft marked</loc>
*-->
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.diff-1.0.html">XHTML with changes since version 1.0 marked</loc>
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.diff-wd.html">XHTML with changes since previous Working Draft marked</loc>
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/2001/XMLSchema.xsd">Independent copy of the schema for schema
    documents</loc>
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/2001/XMLSchema.dtd">Independent copy of the DTD for schema documents</loc>
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="compDefs.xml">Independent tabulation of components and microcomponents</loc>
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/2003/03/Translations/byTechnology?technology=xmlschema">List of translations</loc>
  </altlocs>
  <latestloc>
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xmlschema11-1/">http://www.w3.org/TR/xmlschema11-1/</loc>
  </latestloc>
  <prevlocs>
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060330/">http://www.w3.org/TR/2006/WD-xmlschema11-1-20060330/</loc>
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2005/WD-xmlschema11-1-20050224/">http://www.w3.org/TR/2005/WD-xmlschema11-1-20050224/</loc>
   <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2004/WD-xmlschema11-1-20040716/">http://www.w3.org/TR/2004/WD-xmlschema11-1-20040716/</loc>
  </prevlocs>
  <authlist>
   <author>
    <name>Henry S. Thompson</name>
    <affiliation>University of Edinburgh</affiliation>
    <email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:ht@inf.ed.ac.uk">ht@inf.ed.ac.uk</email>
   </author>
   <author>
    <name>C. M. Sperberg-McQueen</name>
    <affiliation>World Wide Web Consortium</affiliation>
    <email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:cmsmcq@w3.org">cmsmcq@w3.org</email>
   </author>
   <author>
    <name>Shudi (Sandy) Gao 高殊镝</name>
    <affiliation>IBM</affiliation>
    <email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:sandygao@ca.ibm.com">sandygao@ca.ibm.com</email>
   </author>
   <author role="1.0">
    <name>Noah Mendelsohn</name>
    <affiliation>IBM</affiliation>
    <email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:noah_mendelsohn@us.ibm.com">noah_mendelsohn@us.ibm.com</email>
   </author>
   <author role="1.0">
    <name>David Beech</name>
    <affiliation>Oracle Corporation (retired)</affiliation>
    <email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:davidbeech@earthlink.net">davidbeech@earthlink.net</email>
   </author>
   <author role="1.0">
    <name>Murray Maloney</name>
    <affiliation>Muzmo Communications</affiliation>
    <email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:murray@muzmo.com">murray@muzmo.com</email>
   </author>
  </authlist>

<status>
<p><emph>This section describes the status of this document at the
time of its publication. Other documents may supersede this document.
A list of current W3C publications and the latest revision of this
technical report can be found in the <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/">W3C technical reports index</loc> at
http://www.w3.org/TR/.</emph></p>
<p>This is a 
<!--*
* material suppressed here by diff group wg-internal *
*-->
Public Working Draft of XML Schema 1.1.  It 
<!--*
* material suppressed here by diff group wg-internal *
*-->
is here made
available for review by W3C members<phrase dg="wg-internal"> 
and the public</phrase>.  It is intended to
give an indication of the W3C XML Schema Working Group's intentions
for this new version of the XML Schema language and our progress in
achieving them.  It attempts to be complete in indicating
<emph>what</emph> will change from version 1.0, but does
<emph>not</emph> specify in all cases <emph>how</emph> things will
change.
<!--*
* material suppressed here by diff group wg-internal *
*-->
</p>
<!--*
* material suppressed here by diff group telltale *
*-->
<!--* draft of March 2006 *-->
<p dg="wd-200603">This draft was published 
on 31 August 2006.
The major changes since the previous draft are:
<ulist>
<item dg="rq17p">
<p>The rules for checking validity of complex-type restrictions
have been simplified by reformulating the constraint in terms
of local validity:  the set of elements or attributes accepted
by a restriction as locally valid must be a subset of those accepted by its
base type.</p>
</item>
 
<item dg="all-2506-1">
<p>Several of the constraints imposed by version 1.0 of this
specification on <pt>all</pt>-groups have been relaxed:
<ulist><item>
<p>Wildcards are now allowed in <pt>all</pt> groups.</p>
</item>
<item>
<p>The value of <att>maxOccurs</att> may now be greater than 1 on particles
in an <pt>all</pt> group.  The elements which match a particular
particle need not be adjacent in the input.</p>
</item>
</ulist>
</p></item>

<item>
<p>The presentation of the <termref def="key-psvi">post-schema-validation infoset</termref> has been simplified by removing
the suggestion that the <termref def="key-psvi">post-schema-validation infoset</termref> varies from processor to processor.
Instead, the exposition now makes clearer that the body of information 
available in principle after schema-validity assessment is consistent 
across all 
processors; processors may make different subsets of the <termref def="key-psvi">post-schema-validation infoset</termref>
accessible to downstream applications, but when they do so 
the variation reflects the implementors' decisions
about what information to expose, not variation in the information
in the <termref def="key-psvi">post-schema-validation infoset</termref>.</p>
</item>
<item>
<p>Terms have been defined to describe different subsets of the
<termref def="key-psvi">post-schema-validation infoset</termref> which may be exposed by processors.</p>
</item>

<item>
<p>The different levels of conformance have been given shorter
and more convenient names.</p>
</item>
<item>
<p>A checklist has been included listing ways in which conforming 
processors may vary from each other, and terminology has been
provided for some of the more important properties of conforming
processors, in an attempt to make it easier for implementors to
describe concisely which options their processors exercise, and
easier for users to describe what kinds of processor they 
require.</p>
</item>
<item>
<p>The discussion of schema-validity assessment and the invocation
of conforming processors has been revised; additional invocation
patterns have been identified, and names have been given to
the different methods of invoking a processor.</p>
</item>
<item>
<p>When an element cannot be strictly validated because no
element declaration or type definition is available 
for it, fallback to lax validation (validating the element
against the built-in type <pt>anyType</pt>) is now required;
in earlier drafts of this document, fallback to lax validation
was optional.</p>
</item>
<item>
<p>The Unique Particle Attribution constraint has been relaxed.
It is no longer prohibited for a content model to have
element particles and wildcard particles which compete with 
each other; competition is still prohibited between
element particles and between wildcard particles.
The exposition of the constraint has also been revised
for clarity.</p>
</item>
<item>
<p>Wildcards may now be defined which allow names in any
namespace but those in a set of proscribed namespaces.
(In version 1.0 of this specification, only a single
namespace, the target namespace of a schema document,
could be proscribed.)  Also, wildcards can now be written
which match any element in a set of namespaces but
which exclude a particular set of qualified names from
matching the wildcard.</p>
</item>
<item>
<p>A check-clause mechanism has been added.  Complex types
may now include assertions about interrelations among their
attributes and descendants, which must be satisfied in order
for elements to be locally valid against the type. </p>
</item>

</ulist>
</p>

<p>For those primarily interested in the changes since version 1.0,
the <specref ref="changes"/> appendix, which summarizes
both changes already made and also those in prospect, with links to
the relevant sections of this draft, is the recommended starting
point.  Accompanying versions of this document display in color
all changes to normative text since version 1.0 and since the
previous Working Draft.</p>
<p>Please send comments on this Working Draft to 
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:www-xml-schema-comments@w3.org">www-xml-schema-comments@w3.org</loc> 
(<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://lists.w3.org/Archives/Public/www-xml-schema-comments/">archive</loc>).</p>


<p diff="nsq-add" dg="b2333-feedback">Although feedback based on any
aspect of this specification is welcome, there are certain aspects of
the design presented herein for which the Working Group is
particularly interested in feedback. These are designated
<quote>priority feedback</quote> aspects of the design, and
identified as such in editorial notes at appropriate points in this
draft.</p>

<p>Publication as a Working Draft does not imply endorsement by the
W3C Membership. This is a draft document and may be updated, replaced
or obsoleted by other documents at any time. It is inappropriate to
cite this document as other than work in progress.</p>

<p>
This document has been produced by the 
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/XML/Schema">W3C XML Schema Working Group</loc>
as part of the W3C <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/XML/Activity">XML
Activity</loc>. The goals of the XML Schema language version 1.1 are
discussed in the <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2003/WD-xmlschema-11-req-20030121/">Requirements 
for XML Schema 1.1</loc> document. The authors of this document are
the members of the XML Schema Working Group.  Different parts of this
specification have different editors.
</p>
<!--*

<p>Patent disclosures relevant to this specification may be found on
the Working Group's <loc role="disclosure"
href="http://www.w3.org/2004/01/pp-impl/19482/status">Patent
disclosure page</loc> in conformance with the <loc
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">W3C Patent
Policy</loc> of 5 February 2004.  An individual who has actual
knowledge of a patent which the individual believes contains Essential
Claim(s) with respect to this specification should disclose the
information in accordance with <loc
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</loc>.</p>

*-->
<p>This document was produced by a group operating under the <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</loc>. W3C maintains a <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/2004/01/pp-impl/19482/status">public list of
any patent disclosures</loc> made in connection with the deliverables
of the group; that page also includes instructions for disclosing a
patent. An individual who has actual knowledge of a patent which the
individual believes contains <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential 
Claim(s)</loc> must disclose the information in accordance with <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 
6 of the W3C Patent Policy</loc>. </p>
      
<!--* <p>In accordance with 
<loc href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Exclusion">section 
4 of the W3C Patent Policy</loc>, Working Group participants have 150
days from the title page date of this document to exclude essential
claims from the W3C RF licensing requirements with respect to this
document series. Exclusions are with respect to the exclusion
reference document, defined by the <loc href="http://www.w3.org/Consortium/Patent-Policy-20040205/">W3C Patent
Policy</loc> to be the latest version of a document in this series
that is published no later than 90 days after the title page date of
this document.</p> *-->

<p>The English version of this specification is the only normative
version. Information about translations of this document is available
at <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/2003/03/Translations/byTechnology?technology=xmlschema">http://www.w3.org/2003/03/Translations/byTechnology?technology=xmlschema</loc>.</p>

</status>

  <abstract id="abstract">
   <p><emph>XML Schema: Structures</emph> specifies the XML Schema definition language,
    which offers facilities for describing the structure and constraining the contents
    of XML<!--*
* material suppressed here by diff group fpwd *
*--> documents, including those which exploit the XML
    Namespace facility. The schema language, which is itself represented in XML<!--*
* material suppressed here by diff group fpwd *
*--> and uses namespaces, substantially reconstructs and considerably extends the capabilities found in XML<!--*
* material suppressed here by diff group fpwd *
*--> document type
    definitions (DTDs).  This specification depends on <emph>XML Schema<phrase dg="fpwd">
      1.1</phrase> Part 2:
     Datatypes</emph>.          
<!--* <issue id="RQ-152i" role="1.1">
     <p><loc href="&reqs;#xml1.1" target="reqs">RQ-152 (xml1.1)</loc></p>
     <p>How should this specification be aligned with XML 1.1?  The changes in
      character set and name characters, and the question of what determines which
      ones to use, must be addressed.</p>
    </issue> *-->
   </p>
  </abstract>
  <pubstmt>
   <p>Edinburgh, et al.: World-Wide Web Consortium, XML
    Working Group, 2004.</p>
  </pubstmt>
  <sourcedesc>
   <p>Created in electronic form using XML, starting from <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/XML/Group/2003/09/xmlschema-1/structures.xml">[internal draft
     of] XML Schema Part 1: Structures, Second Edition</loc>.</p>
  </sourcedesc>
  <langusage>
   <language id="EN">English</language>
   <language id="ebnf">Extended Backus-Naur Form (formal grammar)</language>
   <language>Extensible Markup Language (XML)</language> </langusage>
<revisiondesc>
<slist>
<sitem>For changes, see CVS change log at the end of the document.
For marked diff groups, see the following items.</sitem>
<sitem id="fpwd">Changes made (and with very few exceptions 
marked as such) in the first public working draft of July 2004.
Mostly approved 2005-02-18.  (What wasn't approved is now 
tagged ep01.)</sitem>
<sitem id="m01">Minor typos and corrections made by MSM; these
will be batched together and handled in an editorial change 
proposal.  Approved as part of EP-06, 2005-02-18.</sitem>
<sitem id="imp">Changes to the section on import (mostly — 
some go beyond import to the rest of the section), based on
NM's proposal in Brisbane.  Approved as EP-07, 2005-02-18.</sitem>
<sitem id="rq17">Non-status-quo draft changes to implement
Brisbane partial consensus wrt RQ-17.
Discussed 2005-02-18, into WD as non-status-quo text.
</sitem>
<sitem id="rq17a">Additional changes to fix links broken by rq17.
Not discussed 2005-02-18, but into WD anyway as non-status-quo text
(because otherwise links are broken).
</sitem>
<sitem id="rq17aux">Auxiliary diff group for RQ-17.  Has no independent
value; its sole purpose is to make the output valid when diff group
rq17 and rq17a are not adopted.  Display as 'pre' iff rq17 is pre,
otherwise display as 'post'.
Added 2005-02-19.  Needs no discussion or approval; it's just
an artifact of our diff system.
</sitem>
<sitem id="rq144">Draft rough wording (not status quo) for RQ-144.
Discussed 2005-02-18, into WD as non-status-quo text.
This is bug 2822; cf. bug 2846=RQ-142.
Approved 2006-08-04.
</sitem>
<sitem id="rq144-wrap2">Replacement wrapper (after rq144 became
status quo).</sitem>
<sitem id="rq144a">Fixes to broken links caused by diff group rq144.
Not discussed 2005-02-18, not sure what to do.  This should go
together with rq144sc (schema construction variations).
Approved 2006-08-18.
</sitem>
<sitem id="rq144nv">Sub-part of RQ-144: no variation in PSVI.
Approved 2006-08-04.</sitem>
<sitem id="rq144sc">Sub-part of RQ-144: schema construction variations.
Approved 2006-08-18.</sitem>
<sitem id="rq144fb">Sub-part of RQ-144: fallback variation.</sitem>
<sitem id="rq144fl">Sub-part of RQ-144: psvi flavors.</sitem>
<sitem id="rq144si">Sub-part of RQ-144: schema invocation details.</sitem>
<sitem id="rq144cf">Sub-part of RQ-144: conformance clauses.
Approved 2006-08-04.</sitem>
<sitem id="rq144aux">Auxiliary diff group for RQ-144. Has no
independent value; its sole purpose is to make the output document valid
with or without rq144.  Display as 'pre' iff rq144 is pre;
otherwise display as 'post'.
Added 2005-02-19.  Does not need WG discussion or approval; it's
just a mechanism for controlling the diff and the markup.
</sitem>
<sitem id="rq144wg">Changes made by WG in RQ-144 during meetings of
4 and 18 August.</sitem>
<sitem id="rq144wgno">'New Orleans' changes requested by WG in RQ-144
and approved in advance by a 'New Orleans' vote,  during meetings of
4 and 18 August.</sitem>
<sitem id="rq144wg2">Changes made by WG in RQ-144 during ftf meetings of
21-23 18 August.</sitem>
<sitem id="rq144-abandoned">Deletions to RQ-144 proposal agreed on by WG 
during ftf meetings of 21-23 18 August.</sitem>
<sitem id="modals">An editorial proposal prepared by MSM.
Eliminate nested modals, to avoid entailing modal logic.
Check all occurrences of 'must', 'may', and 'should', eliminate
where not aligned with RFC 2119.  (Not entirely successful; I
eliminated almost all non-2119 occcurrences of 'may', but not of
'should'.)
Partly approved 2005-02-18 as EP-08, partly postponed.  Postponed bits
('may') retagged as diff group 'may'.
</sitem>
<sitem id="may">Originally part of "modals".  Split off 2005-02-18
after HT and MSM were unable to agree on specific cases; to be taken
up again later.
</sitem>
<sitem id="ep06a">Proposed amendments to EP-06 (2005-02).
Approved 2005-02-18.</sitem>
<sitem id="ep08a">Proposed amendments to EP-08 (2005-02).
Approved 2005-02-18.</sitem>
<sitem id="ep01">Diff group for changes related to micro-components 
(were originally tagged fpwd).  Split off from fpwd 2005-02-18.</sitem>
 <sitem id="ep01-part1">Misnamed for split-off addition of Scope to CTD --
overtaken by context-2338.</sitem>
<sitem id="dgaat">Diff group for changes related to anyAtomicType
(were originally tagged fpwd).  Approved 2005-02-18.</sitem>
<sitem id="wd2hax">Other last-minute fixes for WD 2 (2005-02).</sitem>
<sitem id="wd2.silent">Changes which we record for the sake of
the audit trail but which are not to be shown colored in WD 2 (2005-02).</sitem>
<sitem id="nsq">Dummy diff group for sample non-status-quo text.</sitem>
<sitem id="abandoned">Change markup which we decided against, but
which for whatever reason (sentimentality, or a suspicion that
we might change our minds back, or just a hope we will) we do
not wish to delete. Yet.</sitem>
<sitem id="iff">Selective change of "if" to "if and only if"
(and other attempts to make sentences with "if" clearer).</sitem>
<sitem id="iff.144">Changes of "if"/"then" related to RQ-144 (and thus
possibly more controversial than those of "iff").</sitem>
<sitem id="opt.144">Changes of "is" to "may" related to RQ-144 (and thus
distinct in impact from those of "iff.144").
(2006-07-26: N.B. the opt.144 changes reflect the proposition that
what is in the PSVI is always / must be exposed by a conforming
validator.  The WG seems to have moved firmly to the opposing
view, that all PSVI properties are always present, and an 
implementation does or doesn't expose them.  As a result, the 
opt.144 changes look like an utter disaster.  Do NOT try turning
them on!)</sitem>
<sitem id="iff.144.r">Reverted changes formerly marked iff.144.
Agreed 15 April 2005 (http://www.w3.org/2005/04/15-xmlschema-minutes.html#item10),
22 April (http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2005Apr/0056.html).
</sitem>
 <sitem id="rec12-main">Changes to reconcile overlap/conflict between parts 1 and 2</sitem>
 <sitem id="rec12-map">Changes to reconcile overlap/conflict between parts 1
and 2 in the XML&lt;-&gt;component mapping rules</sitem>
<sitem id="std-1915">Changes in tableaux for simple type definition to align with
part 2, as agreed in Edinburgh.
(These could be folded into rec12-map, probably, but
I'm making them separate just out of caution. -MSM)</sitem>
<sitem id="std-1915-scope">Deletion of scope property in tableau for anySimpleType.
This change was made as part of / at the same time as std-1915, but since
scope was added after 1.0, it needs to be treated separately to get the colors
in the diffs to come out right.</sitem>
 <sitem id="rq129">Remove dependency on canonical forms</sitem>
 <sitem id="rq129bis">Second pass on RQ-129, to implement WG instructions
 of 2006-02-17 (no real need for this to be separate from rq129
 except that I'm uncertain about these changes and want to be able
 to roll them back easily)</sitem>
 <sitem id="rq129ter">Additional pass to implement WG instructions
 of 2006-02-17 within nsq RQ-17 text.
 This does need to be separate from rq129.</sitem>
 <sitem id="derive-1913">Implement RQ-120, use 'derived' consistently 
vis a vis 'constructed'</sitem>
 <sitem id="scope-1973">Implement fix for R-96, bug in scope when decl is
inside group defn</sitem>
<sitem id="b1892">Fix for R-180, bug 1892.  (The entry for 1892 says 
it's 1.0 only, but the text is the same in 1.0 and 1.1, so I'm putting
this fix in here.)</sitem>
<sitem id="b1915bis">Late amendments to the omnibus proposal which
included both 1913 and 1915.  Approved by WG 16 December 2005.</sitem>
<sitem id="b2532-rq127-r196">Health warning about white space normalization,
approved at Toronto ftf meeting (according to bug 2532 - I seem to have
read past it when processing the Toronto minutes).</sitem>
<sitem id="b2333">Bug 2333 (= R-198, union of unions).  Changes to
eliminate flattening of unions to make them contain only atomic and list
types.  This requires changing the description of [member type
definition] and friends; three designs are sketched, labeled b2333a,
b2333b, and b2333c.</sitem>
<sitem id="b2333a">Bug 2333 (= R-198, union of unions).  One way to
handle member type definition properties in the PSVI.
Make [member type definition] refer to the ground (bottom-level) 
atomic or list type to which a value was ultimately assigned.
Cost:  constraints imposed by other types in the derivation chain
are not visible.  Cost:  if the same ground type appears more than
once in the membership tree, we cannot know which appearance we are
dealing with.  (This is already true in 1.0.  But in 1.0, when
restrictions on sub-unions are lost, what difference can it
make which appearance we have?)</sitem>
<sitem id="b2333b">Bug 2333 (= R-198, union of unions).  Second way to
handle member type definition properties in the PSVI. Make [member
type definition] contain a sequence of type definitions (beginning
with the immediate member of the declared type and ending with the
non-union, i.e. atomic or list type) to which the value was ultimately
assigned.  Cost:  change to component structure will disturb some WG
members.  Cost:  the properties [member type definition name],
[member type definition namespace],  and [member type definition
anonymous] become kind of clumsy.  (Our own damn fault for not
defining structures for expanded names.)</sitem>
<sitem id="b2333c">Bug 2333 (= R-198, union of unions).  Third way to
handle member type definition properties in the PSVI.
Bite the bullet: make [member type definition] refer to the primitive 
type to which a value was ultimately assigned.
Cost:  constraints imposed by other types in the derivation chain
are not visible.  Cost:  change in component semantics will disturb
some WG members.  Cost:  if the same primitive type appears several
times in the membership tree, it won't be clear which intermediate
unions were involved.</sitem>
<sitem id="b2333-feedback">Priority feedback request for fix
2333.  Drafted by MSM 2006-01-27, not status quo until the
other editors review and agree.</sitem>

<sitem id="b1838">Changes for Bugzilla 1838 = RQ-152 = support for XML
1.1.</sitem>

<sitem id="eg-1852">End-game resolution of dangling inconsistencies between
parts 1 and 2</sitem>
<sitem id="eg-1852-silent">Text movement in eg-1852.  Added by MSM; I have
not done anything like a systematic search, but happened to notice that
the definition of key-baseTypeDefinition had moved and was marked as a
deletion in old location but not as an insertion in new one.  The
eg-1852-silent diff group is to hold the insertion.  Mark it either pre
or post, not colour, so that the micro-changes can be seen.</sitem>
 <sitem id="rec12-main-eg-1852-override">Added in rec12-main, but deleted in eg-1852</sitem>
 <sitem id="context-2338">Add {context} property to CTDs</sitem>
 <sitem id="ep01-revert">Revert an ep01 change per WG request</sitem>
 <sitem id="rq17p">Separate out content-model aspect of
restriction-is-subsumption for separate consideration</sitem>
 <sitem id="ww-all">Introduce simple weakened wildcards, resolving
Bugzilla 3519.  This proved to require more work than had been
expected, because the existing UPA appears not to be an
effective concept.  The group "ww-all" is used as an umbrella
for several smaller changes: ww-LM, ww-p, and ww.</sitem>
 <sitem id="ww-LM">Auxiliary proposal, preparatory setup for ww / 3519.
Introduces the notion that particles denote languages and
introduces the notation L(P) for the language accepted by
particle P.</sitem>
 <sitem id="ww-p">Auxiliary proposal, preparatory setup for ww / 3519.
Introduces the notions of path and competition between particles.
</sitem> 
<sitem id="ww">Introduce simple weakened wildcards.  This group
has the core change, making UPA allow competition between element
declarations and weakened wildcards.
IN ITS CURRENT STATE, IT DEPENDS CRUCIALLY ON GROUPS "ww-LM" AND "ww-p".</sitem>
<sitem id="ww-x">Speculative / experimental text for ww / 3519.
(At the moment, it's used for text which hasn't yet been classified
as ww-LM, ww-p, or ww.)
</sitem>
<sitem id="ww-geniza">Old text for ww / 3519 which I'm afraid to
throw away lest i need it.  (Reduce this to rubble when ww is
accepted or finished.)</sitem>
<sitem id="ww-1">Changes asked for by the WG at the ftf of 2006-08.</sitem>
<sitem id="rq146">Runtime EDC</sitem>
<sitem id="rq146-1">Runtime EDC revision</sitem>
<sitem id="wg-internal">Phrases in status section which apply only to
to WG-internal draft copies.</sitem>
<sitem id="telltale">Material (in status section and possibly elsewhere) 
which applies only to change proposals.</sitem>
<sitem id="lp">Literate programming change:  make the master source of 
the schema for schemas live in this document, not elsewhere.
This was finally incorporated into dg-approved in 2006-03.
</sitem>
<sitem id="ast-pim">Addition of ptd, itd, and mtd to display
for simple type definitions.  This happened after the WD of 200502 and should
be marked as an add vis-a-vis that WD and vis-a-vis 1.0.</sitem>
<sitem id="wd-200603">SOTD prose for the draft of March 2006.</sitem>
<sitem id="wd3hax">Last-minute editorial changes prior to publication 
of March 2006.</sitem>
<sitem id="all-2506-1">Partial resolution of bug 2506, relax constraints
on 'all' groups.  Drafted by SG, transcribed here by MSM.</sitem>
<sitem id="all-2506-x">Another proposal for bug 2506:  allow extension of
'all' groups to be 'all' groups.  Drafted by SG as part of his proposal,
but separated here because it's lacks phase-1 consensus.</sitem>
<sitem id="ep17">Editorial proposal to tag all component references 
not currently tagged. 

   attribute (declaration).
   element (declaration).
   complex type (definition).
   attribute use.
   attribute group (definition).
   model group.
   named model group.
 x particle done 2006-07-24.
   wildcards
   identity-constraint (definition)
   notation (declaration)
   annotation
   simple type definition 

</sitem>
<sitem id="ed18-errors">An editorial proposal to remove the one
place where we deviate violently from the rule that behavior of
conforming processors in the face of errors is out of scope.
</sitem>
<sitem id="vm3-0">Preliminary changes for versioning mechanism v-m3:
fallback to declared type.  Editorial changes, no substantive changes
here.</sitem>
<sitem id="vm3-1">Proposal for versioning mechanism v-m3: fallback to
declared type.  Will probalby rely on vm3-0.</sitem>
<sitem id="b2861cc-1">Bug 2861, co-constraints as check clauses,
part / level 1.</sitem>
<sitem id="b2861cc-1a">MSM's modifications to SG's 2861 proposal;
mostly kept separate to make them easier to roll back, but
some changes in ednotes etc. not separated.</sitem>
<sitem id="b2861cc-1b">Chagned made based on WG's feedback from 08/2006
f2f meetings.</sitem>
<sitem id="b2861cc-1g">To support assertions in named (attribute)
groups. Rejected at 08/2006 f2f meeting.</sitem>
<sitem id="b2861cc-1m">To support mixed content in assert/report
elements.</sitem>
<sitem id="b2861cc-1p">To carry assertions in particles.
Rejected at 08/2006 f2f meeting.</sitem>
<sitem id="b2861cc-2">Co-constraints level 2 (use them ourselves).
Not currently present except in a reminder note.</sitem>
<sitem id="b2867-1">Negative wildcards, part 1.</sitem>
<sitem id="b2867-1a">Changes made based on WG's feedback from 08/2006
f2f meeting.</sitem>
<sitem id="b2867-2">Negative wildcards, part 2.</sitem>


<!-- Dummy components to discharge IDREFs which will turn into xspecrefs. 
        Any actual use of these _should_ be
        accompanied by a name attribute allowing an xtermref to
        Part 2 to be generated. -->
<sitem id="f-w">Whitespace facet</sitem>
<sitem id="ff">Fundamental facet</sitem>
<sitem id="f">Constraining facet</sitem>
</slist>
</revisiondesc>
  </header>
  <body>
    <div1 id="intro">
      <head>Introduction</head>
      <p>This document sets out the structural part (<emph>XML Schema: Structures</emph>) of the XML Schema definition language.</p>
      <p>Chapter 2 presents a <specref ref="concepts"/> for XML Schemas, including
        an introduction to the nature of XML Schemas and an introduction
to the XML Schema abstract data model, along with
        other terminology used throughout this document. </p>
      <p>Chapter 3, <specref ref="components"/>, specifies the precise
semantics of each component of the abstract model, the representation of each 
component in XML, with reference to a DTD and XML Schema
for an XML Schema document type, along with a detailed mapping between the elements and
attribute vocabulary of this representation and the components and properties
of the abstract model.</p>
      <p>Chapter 4 presents <specref ref="composition"/>, including the
connection between documents and schemas, the import, inclusion and redefinition of declarations and definitions and
        the foundations of schema-validity assessment.</p>
      <p>Chapter 5 discusses <specref ref="conformance"/>, including the
overall approach to schema-validity assessment of documents, and responsibilities of schema-aware
        processors. </p>
      <p>The normative appendices include a <specref ref="normative-schemaSchema"/> for the XML representation of schemas and
        <specref ref="normative-references"/>.</p>
     <p>The non-normative appendices include the <specref ref="nonnormative-schemaDTD"/> and a <specref ref="normative-glossary"/>.</p>
     <p>This document is primarily intended as a language definition reference.
As such, although it contains a few examples, it is <emph>not</emph> primarily designed
to serve as a motivating introduction to the design and its features, or as a
tutorial for new users.
Rather it presents a careful and fully explicit definition of that design, suitable
for guiding implementations.  For those in search of a step-by-step
introduction to the design, the non-normative <bibref ref="bib-expo"/> is a much better
starting point than this document.</p>

    <div2 id="intro1.1" dg="fpwd">
   <head>Introduction to Version 1.1</head>
   <!--* <ednote diff="add" dg="b2861cc-1">
     <edtext>The addition of co-constraints to the language appears to exhibit a shift in
      the Working Group's goals for XML Schema 1.1.  The Working Group should check
      to make sure the changes to this description of those goals are acceptable.
     </edtext>
    </ednote> *-->

<p>The Working Group has <!--*
* material suppressed here by diff group b2861cc-1 *
*--><phrase dg="b2861cc-1">three</phrase> main goals for this version of W3C XML
Schema:</p>
<ulist>
<item><p>Significant improvements in simplicity of design and clarity
of exposition <emph>without</emph> loss of backward <emph>or</emph>
forward compatibility;
</p></item>

<item><p>Provision of support for versioning of XML languages defined using
the XML Schema specification, including the XML transfer syntax for
schemas itself.</p></item>

<item dg="b2861cc-1"><p>Provision of support for co-occurrence constraints, that is 
constraints which make the presence of an attribute or element,
or the values allowable for it, depend on the value or presence
of other attributes or elements.</p></item>

</ulist>
<p>These goals are <!--*
* material suppressed here by diff group ep06a *
*--> in
tension with one another<!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">.
The</phrase> Working Group's strategic guidelines for changes between
versions 1.0 and 1.1<phrase dg="ep06a"> can be summarized
as follows</phrase>:</p>
<olist>

<item><p><!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">Support</phrase> for versioning (acknowledging
that this <emph>may</emph> be slightly disruptive to the XML transfer
syntax at the margins)</p></item>

<item dg="b2861cc-1"><p>Support for co-occurrence
constraints (which will certainly involve additions to the XML
transfer syntax, which will not be understood by 1.0
processors)</p></item>

<item><p><!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">B</phrase>ug fixes (unless in specific cases we
decide that the fix is too disruptive for a point release)</p></item>

<item><p><!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">E</phrase>ditorial changes</p></item>

<item><p><!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">D</phrase>esign cleanup <!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">will
possibly</phrase> change behavior in edge cases</p></item>

<item><p><!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">N</phrase>on-disruptive
changes to type hierarchy (to better support current and forthcoming
international standards and W3C recommendations)</p></item>

<item><p><!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">D</phrase>esign cleanup <!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">will
possibly</phrase> change component structure (changes to functionality
restricted to edge cases)</p></item>

<item><p><!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">No</phrase> significant
changes in <phrase dg="b2861cc-1b">existing</phrase>
functionality</p></item>

<item><p><!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">No</phrase> changes to XML
transfer syntax except those required by version control hooks<phrase dg="b2861cc-1b">,
co-occurrence constraints</phrase> and bug fixes</p></item>

</olist>
<p>The <!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">aim with regard
to</phrase> compatibility is that</p>

<ulist>
<item><p>All schema documents conformant to version 1.0 of this
    specification should also conform to version 1.1, and should have
    the same validation behavio<!--*
* material suppressed here by diff group b2861cc-1 *
*-->r 
    across 1.0 and 1.1 implementations
    (except possibly in edge cases and in the details of the resulting
    PSVI);</p></item>
<item><p>The vast majority of schema documents conformant to version 1.1 of
    this specification should also conform to version 1.0, leaving
    aside any incompatibilities arising from support for versioning<phrase dg="b2861cc-1">
    or co-occurrence constraints</phrase>,
    and when they are conformant to version 1.0 (or are made
    conformant by the removal of versioning information), should have
    the same validation behavio<!--*
* material suppressed here by diff group b2861cc-1 *
*-->r 
    across 1.0 and 1.1 implementations
    (again except possibly in edge cases and in the details of the
    resulting PSVI);
 </p></item>
</ulist>
    </div2>
      <div2 id="intro-purpose">
      <head>Purpose</head>
      <p>The purpose of <emph>XML Schema: Structures</emph> is to define the nature of XML schemas
and their component parts,
provide an inventory of XML markup
        constructs with which to represent schemas, and define the
application of schemas to XML documents. </p>
      <p>The purpose of an <emph>XML Schema: Structures</emph> schema is to define and describe a class of
        XML documents by using schema components to constrain and document the meaning,
        usage and relationships of their constituent parts: datatypes, elements and
        their content and attributes and their values. Schemas <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> also provide for the specification of additional
        document information, such as normalization and defaulting of attribute
and element values. Schemas have
facilities for self-documentation. Thus, <emph>XML Schema: Structures</emph> can be used to define, describe and catalogue XML
        vocabularies for classes of XML documents. </p>

     <p>Any application that consumes well-formed XML can use the <emph>XML Schema: Structures</emph>
        formalism to express syntactic, structural and value constraints applicable to
        its document instances. The <emph>XML Schema: Structures</emph> formalism allows a useful level of
        constraint checking to be described and implemented for a wide spectrum of XML
        applications.  However, the language defined by this specification does not attempt to provide
        <emph>all</emph> the facilities that might be needed by <emph>any</emph>
        application. Some applications <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> require constraint capabilities not
        expressible in this language, and so <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> need to perform their own additional
        validations.</p>
    </div2>

<div2 id="intro-relatedWork">
<head>Dependencies on Other Specifications</head>
<p>The definition of <emph>XML Schema: Structures</emph> depends on the following specifications:
<bibref ref="ref-xmlinfo"/>,
<bibref ref="ref-xml-namespaces"/>,
<bibref ref="bib-xpath"/>, <phrase dg="b2861cc-1"><bibref ref="bib-xpath2"/>, </phrase>and
<bibref ref="ref-xsp2"/>.</p>
<p>See <specref ref="infoset"/> for a tabulation of the information items
and properties specified in <bibref ref="ref-xmlinfo"/> which this
specification requires as a precondition to schema-aware processing.</p>
<p dg="b1838"><bibref ref="ref-xsp2"/> defines some
datatypes which depend on definitions in <bibref ref="ref-xml"/> and 
<bibref ref="ref-xml-namespaces"/>; those definitions, and therefore
the datatypes based on them, vary between version 1.0 (<bibref ref="ref-xml-1.0"/>, <bibref ref="ref-xml-namespaces-1.0"/>) and
version 1.1 (<bibref ref="ref-xml"/>, <bibref ref="ref-xml-namespaces"/>) of those specifications.  In any given
schema-validity-<termref def="key-va">assessment</termref> episode,
the choice of the 1.0 or the 1.1 definition of those datatypes is
implementation-defined.</p>
<p dg="b1838">
Conforming implementations of this specification <rfc2119>may</rfc2119> provide
either the 1.1-based datatypes or the 1.0-based datatypes, or
both.  If both are supported, the choice of which datatypes to
use in a particular assessment episode <rfc2119>should</rfc2119> be under
user control.
</p>
<note dg="b1838"><p>
Implementations <rfc2119>may</rfc2119> provide the heuristic of using the 1.1 datatypes
if the input is labeled as XML 1.1, and the 1.0 datatypes if the input
is labeled 1.0. It should be noted however that the XML version number is
not required to be present in the input to an assessment episode, and in
any case the heuristic <rfc2119>should</rfc2119> be subject to override by users, to
support cases where users wish to accept XML 1.1 input but validate it
using the 1.0 datatypes, or accept XML 1.0 input and validate it using
the 1.1 datatypes.
</p>
</note>
<note dg="b1838">
<p>
Some users will perhaps wish to accept only XML 1.1 input, or only XML
1.0 input. Conforming implementations of this specification which accept
XML input <rfc2119>may</rfc2119> accept XML 1.0, XML 1.1, or both and <rfc2119>may</rfc2119> provide user
control over which versions of XML to accept.
</p>
</note>
</div2>

    <div2 id="intro-terminology">
        <head>Documentation Conventions and Terminology</head>
        <p>The section introduces the highlighting and typography as used in
          this document to present technical material.</p>
     <p dg="fpwd">Aspects of this document which the Working Group are committed to
changing, but where (all) changes are not yet in place, are signalled by the
appearance of an Issue, with a link to the associated version 1.1 Requirement,
for example:</p>
     <issue id="xmpl" role="example" status="open">
      <p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public">Issue nnnn (RQ-nnn)</loc></p>
     </issue>
     <p dg="fpwd">All such issues are 
      <!--*
* material suppressed here by diff group wd2.silent *
*--><phrase dg="wd2.silent">tabulated</phrase> 
      in <specref ref="issues"/><phrase dg="wd2.silent">.</phrase></p>
        <p>Special terms are defined at their point of
introduction in the text.  For example <termdef id="key-sampledef" term="term" role="local">a <term>term</term> is
          something used with a special meaning</termdef>.  The definition is
labeled as such and the term it defines is displayed in boldface.  The end of the definition is not specially marked
in the displayed or printed text.  Uses of defined terms are links to
their definitions, set off with middle dots, for instance <termref def="key-sampledef">term</termref>.</p>
          <p>Non-normative examples are set off in boxes and accompanied by a brief
explanation:</p>
        <note role="example">
          <eg xml:space="preserve">&lt;schema targetNamespace="http://www.example.com/XMLSchema/1.0/mySchema"&gt;</eg>
          <p>And an explanation of the example.</p>
      </note>
      <p>The definition of each kind of schema component consists of a list of
      its properties and their contents, followed by descriptions of the
      semantics of the properties:</p>
        <!--* !!! not sure whether it's sensible or feasible to mark this 
            * as deletion and insertion.  It changed in first WD (vis a vis
            * 1.0 2E), but I'll leave it for now. *-->
        <compdef name="Example" abbrev="ex" showAKO="true">
         <property arity="singleton" name="example property" required="true" type="Component" valueType="component">
          <description>
           <p>An example property</p>
          </description>
         </property>
        </compdef>
     <p>References to properties of schema components are links to
the relevant definition as exemplified above, set off with curly braces, for instance 
<propref comp="ex" prop="example property"/>.</p>
      <p>The correspondence between an element information item which
is part of the XML representation of a schema and one or more schema
components is presented in a tableau which illustrates the element
information item(s) involved. This is followed by a tabulation of the
correspondence between properties of the component and properties of
the information item.  Where context <phrase dg="may">may determine</phrase><!--*
* material suppressed here by diff group may *
*--> which of several different components
<phrase dg="may">may arise</phrase><!--*
* material suppressed here by diff group may *
*-->, several
tabulations, one per context, are given.  The property correspondences
are normative, as are the illustrations of the XML representation
element information items.
</p>
     <p>In the XML representation, bold-face
attribute names (e.g. <term>count</term> below) indicate a required
attribute information item, and the rest are
optional.  Where an attribute information item has an enumerated type
definition, the values are shown separated by vertical bars, as for
<code>size</code> below; if there is a default value, it is shown
following a colon.  Where an attribute information item has a built-in simple
type definition defined in <bibref ref="ref-xsp2"/>, a hyperlink to its
definition therein is given.</p>
     <p>The allowed content of the information item is
shown as a grammar fragment, using the Kleene operators <code>?</code>,
<code>*</code> and <code>+</code>.  Each element name therein is a hyperlink to
its own illustration.</p>
     <note>
      <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
the form of XML representations.</p>
     </note>
<reprdef>
 <reprelt eltname="example"/>
 <reprcomp abstract="Example" ref="intro-terminology">
<propmap comp="ex" prop="example property">Description of what the property corresponds to, e.g. the value of the <code>size</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>
</propmap>
</reprcomp>
 </reprdef>
     <p>References to elements in the text are links to
the relevant illustration as exemplified above, set off with angle brackets, for instance <eltref ref="example"/>.</p>
     <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 <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>.</p>
     <p>Properties which this specification defines for information items are
introduced as follows:</p>
     <proplist item="example" role="psvi">
      <propdef id="ex-foo" name="new property">The value the property gets.</propdef>
     </proplist>
<p>References to properties of information items defined in this specification
are notated as links to their introduction as exemplified above, set off with square brackets, for example <propref role="psvi" ref="ex-foo"/>.</p>
      <p>The following highlighting is used for non-normative commentary in
        this document:</p>


      <note>
        <p>General comments directed to all readers. </p>
      </note>
     <p><!--*
* material suppressed here by diff group ep06a *
*--><phrase dg="ep06a">W</phrase>ithin normative prose 
in this specification, the words <rfc2119>may</rfc2119><!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="ep06a">, <rfc2119>should</rfc2119></phrase><phrase dg="fpwd">,</phrase> <rfc2119>must</rfc2119><phrase dg="fpwd"> and <rfc2119>must not</rfc2119></phrase> 
are defined as follows:</p>
     <glist>
      <gitem>
       <label><rfc2119>may</rfc2119></label>
       <def>
        <p>Conforming documents and XML Schema-aware processors are permitted to but need not behave as described.</p>
       </def>
<!--*
5. MAY   This word, or the adjective "OPTIONAL", mean that an item is
   truly optional.  One vendor may choose to include the item because a
   particular marketplace requires it or because the vendor feels that
   it enhances the product while another vendor may omit the same item.
   An implementation which does not include a particular option MUST be
   prepared to interoperate with another implementation which does
   include the option, though perhaps with reduced functionality. In the
   same vein an implementation which does include a particular option
   MUST be prepared to interoperate with another implementation which
   does not include the option (except, of course, for the feature the
   option provides.)
*-->
      </gitem>
      <gitem dg="ep06a">
       <label><rfc2119>should</rfc2119></label>
       <def>
        <p>It is recommended that conforming documents and 
XML Schema-aware processors behave as described, but there can
be valid reasons for them not to; it is important that the 
full implications be understood and carefully weighed before
adopting behavior at variance with the recommendation.</p>
       </def>
<!--*
3. SHOULD   This word, or the adjective "RECOMMENDED", mean that there
   may exist valid reasons in particular circumstances to ignore a
   particular item, but the full implications must be understood and
   carefully weighed before choosing a different course.
*-->
<!--*
4. SHOULD NOT   This phrase, or the phrase "NOT RECOMMENDED" mean that
   there may exist valid reasons in particular circumstances when the
   particular behavior is acceptable or even useful, but the full
   implications should be understood and the case carefully weighed
   before implementing any behavior described with this label.
*-->
      </gitem>
      <gitem>
       <label><rfc2119>must</rfc2119></label>
       <def>
        <p>Conforming documents and XML Schema-aware processors are required to behave as described; otherwise they are in error.</p>
       </def>
<!--*
1. MUST   This word, or the terms "REQUIRED" or "SHALL", mean that the
   definition is an absolute requirement of the specification.
*-->
      </gitem>
      <gitem dg="fpwd">
       <label><rfc2119>must not</rfc2119></label>
       <def>
        <p dg="fpwd">Conforming documents and XML Schema-aware processors are forbidden
to behave as described; if they do they are in error.</p>
       </def>
<!--*
2. MUST NOT   This phrase, or the phrase "SHALL NOT", mean that the
   definition is an absolute prohibition of the specification.
*-->
      </gitem>


     </glist>
<p dg="ep06a">These definitions describe in
terms specific to this document the meanings assigned to
these terms by <bibref ref="rfc-2119"/>.
The specific wording follows that of
<bibref ref="ref-xml"/>.
</p>
     <p><!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd">This</phrase> specification
provides a definition of error and of conformant processors'
responsibilities with respect to errors <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd">in</phrase>
<specref ref="conformance"/><!--*
* material suppressed here by diff group fpwd *
*-->.</p>

    </div2>
  </div1>
  <div1 id="concepts">
    <head>Conceptual Framework</head>
<p>This chapter gives an overview of <emph>XML Schema: Structures</emph> at the level of its
abstract data model.  <specref ref="components"/> provides details on
this model, including a normative representation in XML for the
components of the model. Readers interested primarily in learning to
write schema documents <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> wish to first read <bibref ref="bib-expo"/> for a tutorial introduction, and
only then consult the sub-sections of 
<specref ref="components"/> named <emph>XML Representation of
...</emph> for the details.</p>
   <div2 id="xsover">
    <head>Overview of XML Schema</head>
    <p>An XML Schema <!--*
* material suppressed here by diff group rq144nv *
*--><phrase dg="rq144nv">is a
set</phrase> of components such as type definitions and element
declarations. These can be used to assess the validity of well-formed
element and attribute information items (as defined in <bibref ref="ref-xmlinfo"/>), and furthermore <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> specify
augmentations to those items and their descendants. This augmentation
makes explicit information <phrase dg="may">which may have
been</phrase> implicit in the original document, such as normalized
and/or default values for attributes and elements and the types of
element and attribute information items. <phrase dg="rq144nv">The input information set can also be augmented with
information about the validity of the item, or about other properties
described in this specification.</phrase> <termdef term="post-schema-validation infoset" id="key-psvi">We refer to the
augmented infoset which results from conformant processing as defined
in this specification as the <term>post-schema-validation
infoset</term>, or <term>PSVI</term></termdef>. <phrase dg="rq144nv">Conforming processors <rfc2119>may</rfc2119> provide access to <!--*
* material suppressed here by diff group rq144wg *
*--><phrase dg="rq144wg">some or all</phrase> of the PSVI<phrase dg="rq144fl">, as described in
<specref ref="var_psvi"/></phrase>. The mechanisms by which processors provide
<phrase dg="rq144wg">such</phrase> access to the PSVI are
neither defined nor constrained by this specification.</phrase></p>

    <!--*
* material suppressed here by diff group opt.144 *
*-->

	<issue id="RQ-142i" role="1.1" status="open">
<!--*
	  <p><loc href="&reqs;#PSVIProp" target="reqs">RQ-142 (PSVIProp)</loc>,
             <loc href="&reqs;#WhichPSVIPropertiesReqd" target="reqs">RQ-144 
             (WhichPSVIPropertiesReqd)</loc></p>
*-->
<p>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2846" target="reqs">Issue 2846 (RQ-142 PSVI properties)</loc>,
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2822" target="reqs">Issue 2822 (RQ-144 required properties)</loc></p>
  <p>Version 1.0 included several properties in the PSVI whose absence carried
information (e.g. <propref role="psvi" ref="e-type_definition"/>), while at the
same time not being completely clear about which PSVI properties, if any, were
required.  The Working Group intends to eliminate the former and clarify the latter.</p>
  <resolution>
   <p>For 142, which mandates that insofar as possible absence of a property
should not in general signify, when it does explicit 'if-and-only-if' language
is required, the effect is distributed throughout the PSVI sub-sub-sections in
section 3.</p>
   <p>The Working Group appears to be close to consensus (although no final
decision has been made) on views which can be summarized thus:
<olist>
 <item>
<p>We should eliminate any dependency on the absence of specific
    properties (i.e. important situations should be describable
    and distinguishable in terms of properties and their values,
    without appeal to the absence of particular properties), or if
    this proves unfeasible in particular cases we should say 
    explicitly that a property is present "if and only if" certain
    conditions apply.  Any remaining "if" (if any) would be a
    true conditional, not an equivalence.</p>
 </item>
 <item>
<p>Any specification of a class of processors (including ours) can
    require specific additional information not in the PSVI, though
    should note that interoperability is better if applications depend
    only on the properties present in the PSVI as we define it.</p>
 </item>
 <item>
<p>In our own specification of processor classes, we should be
    explicit that processors may provide additional information.
    (Or alternatively be explicit that they must not -- but the
    chair believes the WG consensus was to allow it.)</p>
 </item>
</olist> 
</p>
   <p>For 144, a few general remarks here about flexible-but-firm conformance
are wanted here; most of the new work should end up in section 4 and/or 5.</p>
  </resolution>
	  </issue>
    <p>Schema-validity assessment has two aspects:
<olist><item id="c-lsv"><p>Determining local schema-validity, that is
whether an element or attribute information item satisfies the
constraints embodied in the relevant
components of an XML Schema;</p></item>
<item><p>Synthesizing an overall validation outcome for the item,
combining local schema-validity with the results of schema-validity
assessments of its descendants, if any, and
adding appropriate augmentations to the infoset to record this outcome.</p></item></olist></p>
    <p>Throughout this specification, <termdef id="key-vn" term="valid">the
word <term>valid</term> and its derivatives are used to refer to
<clauseref ref="c-lsv"/> above, the determination of local
schema-validity</termdef>.</p>
<p>Throughout this specification, <termdef id="key-va" term="assessment"> 
the word <term>assessment</term> is used to refer
to the overall process of
local validation, schema-validity assessment and infoset augmentation</termdef>.</p>
   </div2>
   <div2 id="concepts-data-model">
    <head>XML Schema Abstract Data Model</head>
    <p>This specification builds on <bibref ref="ref-xml"/> and
<bibref ref="ref-xml-namespaces"/>.  The concepts and definitions used
herein regarding XML are framed at the abstract level of <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-infoset/#infoitem">information
items</xtermref> as defined in <bibref ref="ref-xmlinfo"/>.  By
definition, this use of the infoset provides <emph>a priori</emph> guarantees of <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml/#sec-well-formed">well-formedness</xtermref>
(as defined in <bibref ref="ref-xml"/>) and <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml-names/#Conformance">namespace
conformance</xtermref> (as defined in <bibref ref="ref-xml-namespaces"/>) for
all candidates for <termref def="key-va">assessment</termref> and for all <termref def="key-schemaDoc">schema documents</termref>.</p>
    <p>Just as <bibref ref="ref-xml"/> and
<bibref ref="ref-xml-namespaces"/> can be described in terms of
information items, XML Schemas can be described in terms of an
abstract data model.  In defining XML Schemas in terms of an abstract
data model, this specification rigorously specifies the information which
<rfc2119>must</rfc2119> be available to a conforming XML Schema processor.  The abstract
model for schemas is conceptual only, and does not mandate any
particular implementation or representation of this information.  To
facilitate interoperation and sharing of schema information, a
normative XML interchange format for schemas is provided.</p>
<!--* 
    <issue id="CC" role="1.1">
     <p><loc href="http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2003Jun/0090.html">2003-06-13 minutes (Component cleanup)</loc> (W3C-member-only link)</p>
     <p>Some aspects of the abstract components used to organise this
specification have proved clumsy and/or susceptible to improvement.  The way in
which components and their properties are referenced in constraints and
validation rules is sometimes irritatingly verbose.  Wherever possible these
problems should be addressed.</p>
     <resolution>
      <p>Changes to the component structure which do not produce
    substantially different functionality (i.e. change behavior only in
    edge cases) [are consistent with our overall goals].  Such changes might be made in order to make the
    component structure easier to understand, reason about, document,
    or talk about.  This class is not, however, restricted to changes
    which do not affect the information-theoretic information content
    of the component structure.  That is, it may contain changes
    that go beyond renaming or other changes which do not affect
    information content.</p>
      <p>These changes will be disruptive to (some) implementors, but (MSM
    suggested) not to all users, and probably not to any (or: many)
    users.</p>
      <p>The editor intends under this heading to make the presentation of
components much more systematic, because auto-generated from an XML-notated
explicit definition of components and properties, for example:</p>
      <p><![CDATA[<component name="Attribute Declaration" base="Component"
           abstract="false" abbrev="ad">
  <property name="type definition" valueType="component" arity="singleton"
            type="Simple Type Definition" required="true"/>
  . . .]]></p>
      <p>The editor also intends to introduce a number of 'micro-components',
replacing all values with complicated value types, e.g. replacing "A pair consisting of a value and one of <pt>default</pt>, <pt>fixed</pt>." with a
Value Contstraint micro-component.</p>
     </resolution>
    </issue> *-->
<p><termdef id="c" term="schema component"><term>Schema component</term> 
is the generic term for the building blocks that comprise the abstract data model of the schema.
</termdef>
<termdef id="key-schema" term="XML Schema">
An <term>XML Schema</term> is a
set of <termref def="c">schema components</termref></termdef>.  There are
<!--*
* material suppressed here by diff group b2861cc-1 *
*--><phrase dg="b2861cc-1">14</phrase> kinds of
component in all, falling into three groups.  The primary components,
which <rfc2119>may</rfc2119>
(type definitions) or <rfc2119>must</rfc2119> (element and attribute declarations) have names,
are as follows:</p>
<ulist>
<item><p>Simple type definitions
</p></item>
<item><p>Complex type definitions</p></item>
<item><p>Attribute declarations</p></item>
 <item><p>Element declarations</p></item>
</ulist><p>The secondary components,
 <!--*
* material suppressed here by diff group b2861cc-1 *
*-->are as follows:</p>
<ulist>
<item><p>Attribute group definitions</p></item>
<item><p>Identity-constraint definitions</p></item>
<item><p><phrase dg="b2861cc-1">Assertions</phrase></p></item>
<item><p>Model group definitions</p></item>
<item><p>Notation declarations</p></item>
</ulist>
<p>Finally, the <quote>helper</quote> components provide small parts of
other components; they are not independent of their context:</p>
<ulist>
<item><p>Annotations</p></item>
<item><p>Model groups</p></item>
<item><p>Particles</p></item>
<item><p>Wildcards</p></item>
<item><p>Attribute Uses</p></item>
</ulist>
    <p dg="ep01-revert">The name <compdef name="Component" abbrev="xc" role="termdef" showAKO="true"> 
covers all the different kinds of component defined in this specification.</compdef></p>
     <p>During <termref def="key-vn">validation</termref>, <termdef id="key-declaration" term="declaration"><term>declaration</term> components are associated by
(qualified) name to information items being <termref def="key-vn">validated</termref></termdef>.</p>
<p>On the other hand, <termdef id="key-definition" term="definition"><term>definition</term> components define
internal schema components that can be used in other schema components</termdef>.
</p>
<p>
<termdef id="key-compName" term="component name">Declarations and
definitions <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> <phrase dg="modals">and in some cases <rfc2119>must</rfc2119></phrase>
have and be identified by <term>name</term>s,
which are NCNames as defined by <bibref ref="ref-xml-namespaces"/></termdef>.</p>

    <p>  <termdef id="key-targetNS" term="target namespace">Several kinds
of component have a <term>target namespace</term>, which is either
<termref def="key-null">absent</termref> or a namespace name, also as
defined by <bibref ref="ref-xml-namespaces"/></termdef>.  The <termref def="key-targetNS">target
namespace</termref> serves to identify the namespace within which the
association between the component and its name exists.  In the case of
declarations, this in turn determines the namespace name of, for example, the element
information items it <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> <termref def="key-vn">validate</termref>.</p>
    <note>
     <p>At the abstract level, there is
no requirement that the components of a schema share a
<termref def="key-targetNS">target namespace</termref>.  Any schema for use in
<termref def="key-va">assessment</termref> of documents containing names from more than one namespace
will of necessity include components with different <termref def="key-targetNS">target namespaces</termref>.  This contrasts with
the situation at the level of the XML representation of components, in which each schema document contributes
definitions and declarations to a single target namespace.</p>
    </note>
    <p><termref def="key-vn">Validation</termref>, defined in detail
in <specref ref="components"/>, is a relation between information
items and schema components.  For example, an attribute information
item <phrase dg="may">may <termref def="key-vn">validate</termref></phrase><!--*
* material suppressed here by diff group may *
*--> with
respect to an attribute declaration, a list of element information
items <phrase dg="may">may <termref def="key-vn">validate</termref></phrase> with respect to a content
model, and so on.  The following sections briefly introduce the kinds
of components in the schema abstract data model, other major features
of the abstract model, and how they contribute to <termref def="key-vn">validation</termref>.</p>
     <div3 id="Type_Definition_Summary">
<head>Type Definition Components</head>
<p>The abstract model provides two kinds of type definition component: simple
and complex.</p>
<p><termdef id="td" term="type definition">This specification uses
the phrase <term>type definition</term> in cases where no distinction
need be made between simple and complex types</termdef>.</p>
<p>Type definitions form a hierarchy with a single root.  The subsections below first describe characteristics of that
hierarchy, then provide an introduction to simple and complex type definitions themselves.</p>
<div4 id="Type_Derivation">
<head>Type Definition Hierarchy</head>
<!--*    <issue id="RQ-120i" role="1.1">
	      <p><loc href="&reqs;#term-&derived_AV;" target="reqs">RQ-120 (term-derived)</loc></p>
      <p>There is an inconsistency in the use of the word '&derived;' and related
words between parts 1 and 2 of version 1.0:  Sometimes it refers only to types
defined by
restriction and/or extension, but other times includes lists and unions as
well.  This terminological problem, and the underlying conceptual issue, should
be addressed.</p>
      <resolution>
       <p><loc href="http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004May/0007.html">http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004May/0007.html</loc>, <loc href="http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004May/0009.html">http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004May/0009.html</loc> (W3C-member-only links)</p>
       <p>In anticipation of a change in this area, the editor has replaced all
occurrences of '&derived;' and related words with one of two entity references:
&amp;&derived;; for restriction and extension only, and &amp;constructedDiff; for
restriction, extension, list and union.  The former is defined to be
'derived' for now, the latter a diff-marked replacement of 'derived'
by 'constructed'.</p>
      </resolution>
	      </issue> *-->
<p>
<termdef id="key-typeDefinitionHierarchy" term="Type Definition Hierarchy">Except for a distinguished <termref def="key-urType">ur-type definition</termref>, every <termref def="td">type definition</termref> is, by construction, either a
<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>.
</p>
<p dg="eg-1852-silent"><termdef id="key-baseTypeDefinition" term="base type definition"><!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">The</phrase> type definition used as the
basis for an <termref def="key-typeExtension">extension</termref> or
<termref def="key-typeRestriction">restriction</termref> is known as
the <term>base type definition</term> of that definition</termdef>.
</p>
<p><termdef id="key-typeRestriction" term="restriction"><phrase diff="nsq-del" dg="rq17"><!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">A type defined with the
same constraints as its <termref def="key-baseTypeDefinition"/>, or with more,</phrase> 
is said to be a <term>restriction</term></phrase>
   <phrase diff="nsq-add" dg="rq17">A type defined by appropriate use of facets or
declarations so as to validate a subset of
what another type definition validates, with consistent PSVI outcomes, is a
<term>restriction</term> of the other type</phrase></termdef>.
<phrase diff="nsq-del" dg="rq17">The <!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">added constraints</phrase> might include narrowed ranges or reduced
alternatives.
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.</phrase></p>
 <!--* <ednote>
  <edtext>What are we doing with these issue pointers? [Tentative answer:
    keep for now, delete when phase-2 wording is accepted. Actually, 
    for now, we should probably say 'there is draft wording here ...'
    But I have not yet done that.]</edtext>
 </ednote> *-->
	    <issue id="RQ-17i" role="1.1" status="open">
<!--* <p><loc href="&reqs;#restrictn-rules" target="reqs">RQ-17 (restrictn-rules)</loc></p> *-->
<p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2820" target="reqs">Issue 2820 (RQ-17 simplify restriction rules)</loc></p>
      <p>Version 1.0 made clear that the <emph>intention</emph>
for derivation by restriction was that restrictions validated a subset of what their
base validated.  However, the constructive rules for what constituted valid content model
restrictions for complex type definition not only failed to enforce this
completely correctly, but also ruled out various cases which evidently should
have been allowed.  The Working Group has decided to shift to a much higher
level statement of what constitutes a valid restriction, appealing directly to
the subset requirement, in order to address these problems.</p>
      <resolution>
       <p>A major change in definition/presentation, with only modest changes
in consequences for schemas and validity, will be made, by
<emph>defining</emph> restriction for complex type definitions in terms of the desired result, that is that
all members of a restricted type are members of its base type.  In the
normative part of the spec. this will be done by appeal to local validity.</p>
       <p><quote>Clarifying: R restricts B: any EII that is locally valid [per R]
<rfc2119>must</rfc2119> also be locally valid [per B], with side conditions on properties on terms
you appeal to [to] get same child allowed by two content models.</quote>
[-<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/XML/Group/2004/05/xml-schema-ftf-minutes.html">F2F
2004-03-12, section Subsumption</loc> (W3C-member-only link)]</p>
       <p>A non-normative appendix will provide references to published
algorithms for enforcing the constraint.</p>
      </resolution>
	      </issue>
<p><termdef id="key-typeExtension" term="extension">A complex type definition
which allows element or attribute content in addition to that allowed by
another specified type
definition is said to be an <term>extension</term></termdef>.</p>
<p><termdef id="key-urType" term="ur-type definition">A distinguished complex
type definition, the <term>ur-type 
definition</term>, whose
name is <phrase diff="nsq-del" dg="rq17"><pt>anyType</pt></phrase><phrase diff="nsq-add" dg="rq17"><pt>rootType</pt></phrase> in the XML Schema namespace, is present in each <termref def="key-schema">XML Schema</termref>, serving as the root of the type
definition hierarchy for that schema</termdef>.  
</p>
 <p diff="nsq-add" dg="rq17"><termdef id="key-anyType" term="definition of anyType">A further 
special complex type definition, whose name is <pt>anyType</pt> in the XML Schema 
namespace, is also present in each <termref def="key-schema">XML Schema</termref>.
The <term>definition of anyType</term> serves as default type
definition for element declarations whose XML representation does not specify 
one</termdef>.  <!--* why is the termdef closed inside the full stop?
                      HST: Because I always do it that way :-) *-->
</p>
<!--*
* material suppressed here by diff group eg-1852 *
*-->
</div4><div4 id="Simple_Type_Definition">

     <head>Simple Type Definition</head>
     <p>A simple type definition is a set of constraints on strings and information about the values they encode, applicable to the <termref def="key-nv">normalized value</termref> of an attribute
information item or of an element information item with no element children.
Informally, it applies to the values of attributes and the text-only content of elements.
</p>
     <p>Each simple type definition, whether built-in (that is, defined in <bibref ref="ref-xsp2"/>) or
user-defined, is a <termref def="key-typeRestriction">restriction</termref> of <!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">its</phrase> <termref def="key-baseTypeDefinition">base type
definition</termref>.  <!--*
* material suppressed here by diff group eg-1852 *
*--><termdef id="key-simpleUrType" term="simple ur-type definition"><!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">The</phrase> <term>simple
ur-type definition</term>, a special <termref def="key-typeRestriction">restriction</termref> of the
<termref def="key-urType">ur-type
definition</termref>, whose name is <local>anySimpleType</local> in the XML
Schema namespace</termdef><phrase dg="eg-1852"> is the root of the
<termref def="key-typeDefinitionHierarchy"/> for the simple type
definitions</phrase>.   The <termref def="key-simpleUrType">simple ur-type
definition</termref> 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.<phrase dg="eg-1852">  The
built-in list datatypes all have the <termref def="key-simpleUrType">simple ur-type
definition</termref> as their <termref def="key-baseTypeDefinition">base type
definition</termref>.</phrase></p>
        <p dg="eg-1852"><termdef id="key-anyAtomicType" term="anyAtomicType">There is a
further special datatype called <term>anyAtomicType</term>, a <termref def="key-typeRestriction">restriction</termref> of the <termref def="key-simpleUrType">simple ur-type
definition</termref>, which is the <termref def="key-baseTypeDefinition">base type
definition</termref> of all the primitive built-in datatypes.</termdef>  It too
is considered to have an unconstrained lexical space.  Its value space consists of the union of the value spaces of all the built-in
primitive datatypes.</p>
        <p>The mapping from lexical space to value space is
unspecified for items whose type definition is the
<termref def="key-simpleUrType">simple ur-type definition</termref><phrase dg="eg-1852">or <termref def="key-anyAtomicType"/></phrase>. 
Accordingly this specification does not constrain processors' behavio<!--*
* material suppressed here by diff group b2861cc-1 *
*-->r in
areas where this mapping is implicated, for example checking such items against
enumerations, constructing default attributes or elements whose declared type
definition is the
<termref def="key-simpleUrType">simple ur-type definition</termref>, checking
identity constraints involving such items.</p>
        <note>
         <p>The Working Group expects to return to this area in a future
version of this specification.</p>
        </note>
        <p><!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852"><bibref ref="ref-xsp2"/> provides
mechanisms for defining new simple type definitions by <termref def="key-typeRestriction">restricting</termref> one of the built-in primitive or ordinary datatypes.  It also provides mechanisms for constructing new simple type definitions</phrase> whose members are lists of items
themselves constrained by some other simple type definition, or whose
membership is the union of the memberships of some other simple type
definitions.  Such list and union simple type definitions are also <termref def="key-typeRestriction">restrictions</termref> of the <termref def="key-simpleUrType">simple ur-type
definition</termref>.</p>
     <p>For detailed information on simple type definitions, see <specref ref="Simple_Type_Definitions"/> and <bibref ref="ref-xsp2"/>.  The latter also defines an extensive inventory of
pre-defined simple types.</p>
</div4>
<div4 id="Complex_Type_Definition">
<head>Complex Type Definition</head>
<p>A complex type definition is a set of attribute declarations and a
content type, applicable to the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> and <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of an
element information item respectively.  The content type <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*-->
require the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> to contain neither element nor character
information items (that is, to be empty), <phrase dg="modals">or</phrase> to be a string which belongs to a particular
simple type<phrase dg="modals">,</phrase> 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>
     <p>Each complex type definition other than the
<termref def="key-urType">ur-type definition</termref> is either
      <ulist>
       <item>
        <p>a restriction of a complex <termref def="key-baseTypeDefinition">base
type definition</termref></p>
       </item>
      </ulist>
      or
      <ulist><item>
<p>an <termref def="key-typeExtension">extension</termref> of a simple or complex <termref def="key-baseTypeDefinition">base
type definition</termref>.</p>
</item>
</ulist>
      
      
</p>
<p> A
complex type which extends another does so by having additional content model
particles at the end of the other definition's content model,
or by having additional attribute declarations, or both.
  <note>
   <p>This specification allows only appending, and not other kinds of
extensions. This decision
simplifies application processing required to cast instances from <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> to
base type.  Future versions may allow more kinds of extension, requiring more
complex transformations to effect casting.</p>
  </note></p>
     <p>
For detailed information on complex type definitions, see <specref ref="Complex_Type_Definitions"/>.</p>
</div4>
</div3>

     <div3 id="Declarations_Summary">
<head>Declaration Components</head>
<p>There are three kinds of declaration component: element, attribute, and
notation.  Each is described in a section below. Also included is a discussion
of element substitution groups, which is a feature provided in conjunction with
element declarations.</p>
<div4 id="Element_Declaration">
<head>Element Declaration</head>
<p>An element declaration is an association of a name with a type definition, either simple or
complex, an (optional) default value and a (possibly empty) set of identity-constraint
definitions.  The association is either global or scoped to a containing complex type definition.  A
top-level element declaration with name 'A' is broadly comparable to a pair of
DTD declarations as follows, where the associated type definition
fills in the ellipses:</p>
<eg xml:space="preserve">&lt;!ELEMENT A . . .&gt;
&lt;!ATTLIST A . . .&gt;
</eg>
<p>Element declarations contribute to
<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
information item with a matching name and namespace, and by triggering
identity-constraint definition <termref def="key-vn">validation</termref>.</p>
     <p>
For detailed information on element declarations, see <specref ref="cElement_Declarations"/>.</p>
</div4>
<div4 id="Element_Equivalence_Class">
<head>Element Substitution Group</head>
<p>In XML<!--*
* material suppressed here by diff group fpwd *
*-->, the name and content of an element <rfc2119>must</rfc2119> correspond exactly to the element type referenced in the corresponding content model.</p>
<p><termdef id="key-equivalenceClass" term="element substitution group">Through
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>.
Any top-level element declaration can serve as the defining member, or
head, for an element substitution group.  Other top-level element declarations,
regardless of target namespace, can be designated as members of the
substitution group headed by this element.  In a suitably enabled content
model, a reference to the head <termref def="key-vn">validates</termref> not just the head itself, but elements
corresponding to any other member of the substitution group as well.
</p>
<p>All such members <rfc2119>must</rfc2119> have type definitions which are either the same as the
head's type definition or
restrictions or extensions of it.
Therefore, although the names of elements can vary widely as new
namespaces and members of the substitution group are defined, the
content of member elements is strictly limited according to the type
definition of the substitution group head.</p>
<p>Note that element substitution groups are not represented as separate components.  They are
specified in the property values for element declarations (see <specref ref="cElement_Declarations"/>).</p>
</div4>
<div4 id="Attribute_Declaration">
<head>Attribute Declaration</head>
<p>An attribute declaration is an association between a name and a simple type definition, together
with occurrence information and (optionally) a default value. The
association is either global, or local to its containing complex type definition.  Attribute declarations contribute to
<termref def="key-vn">validation</termref> as part of complex type definition <termref def="key-vn">validation</termref>, when their
occurrence, defaults and type components are checked against an attribute
information item with a matching name and namespace.</p>
     <p>
For detailed information on attribute declarations, see <specref ref="cAttribute_Declarations"/>.</p>
</div4>
<div4 id="Notation_Declaration">
<head>Notation Declaration</head>
<p>A notation declaration is an association between a name and an identifier for a
notation.  For an attribute information item to be <termref def="key-vn">valid</termref> with respect to a
<code>NOTATION</code> simple type definition, its value <rfc2119>must</rfc2119> have been declared
with a notation declaration.</p>
     <p>
For detailed information on notation declarations, see <specref ref="cNotation_Declarations"/>.</p>
</div4>
</div3>

     <div3 id="Model_Group_Summary">
<head>Model Group Components</head>
<p>The model group, particle, and wildcard components contribute to
the portion of a complex type definition that controls an element
information item's content.</p>
<div4 id="Model_Group">
<head>Model Group</head>
<p>A model group is a constraint in the form of a grammar fragment that applies to
lists of element information items.  It consists of a list of particles, i.e.
element declarations, wildcards and model groups.  There are three varieties of
model group:</p>
<ulist>
<item><p>Sequence (the element information items
match the particles in sequential order);</p></item>
<item><p>Conjunction (the element information items match the
particles, in any order);</p></item>
<item><p>Disjunction (the element information items match
one of the particles).</p></item>
</ulist>

<p dg="ww-1">Each model group denotes a set of sequences 
of element information items.  Regarding
that set of sequences as a language, the set of sequences recognized
by a group <var>G</var> may be written <var>L</var>(<var>G</var>).
<termdef id="key-accept-g" term="accept">A model group <var>G</var>is said to
<term>accept</term> or <term>recognize</term> the members of
<var>L</var>(<var>G</var>).</termdef>
</p>

     <p>
For detailed information on model groups, see <specref ref="Model_Groups"/>.</p>
</div4>
<div4 id="Particle">
<head>Particle</head>
<p>A particle is a term in the grammar for element content, consisting of 
either an element
declaration, a wildcard or a model group, together with
occurrence constraints.  Particles contribute to
<termref def="key-vn">validation</termref> as part of complex type definition <termref def="key-vn">validation</termref>, when they allow anywhere
from zero to many element information items or sequences thereof, depending on
their contents and occurrence
constraints.</p>
 
<p dg="ep01">The name <compdef name="Term" abbrev="t" role="termdef" showAKO="true"> is used to refer to any of the three kinds of
components which can appear in particles.</compdef>  All <termref def="t">Terms</termref> are themselves <termref def="ac">Annotated
Components</termref>. <phrase dg="ww-LM"><termdef id="key-basic-term" term="basic term">A <term>basic term</term> is an
<compref ref="ed"/> or a <compref ref="w"/>.</termdef> <termdef id="key-basic-particle" term="basic particle">A <term>basic
particle</term> is a <compref ref="p"/> whose <propref comp="p" prop="term"/> is a <termref def="key-basic-term"/>.</termdef></phrase></p>

<p><termdef id="key-contentModel" term="content model">A particle can
be used in a complex type definition to constrain the <termref def="key-vn">validation</termref> of the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of an element
information item; such a particle is called a <term>content
model</term></termdef>.
<note>
<p><emph>XML Schema: Structures</emph> <termref def="key-contentModel">content models</termref> are
similar to but more expressive than
<bibref ref="ref-xml"/> content models; unlike <bibref ref="ref-xml"/>, <emph>XML Schema: Structures</emph> applies <termref def="key-contentModel">content models</termref> to the <termref def="key-vn">validation</termref> of both mixed and element-only
content. </p>
</note></p>

<p dg="ww-LM">Each content model, indeed each particle,
denotes a set of sequences of element information items.  Regarding
that set of sequences as a language, the set of sequences recognized
by a particle <var>P</var> may be written <var>L</var>(<var>P</var>).
<termdef id="key-accept" term="accept">A particle <var>P</var> is said to
<term>accept</term> or <term>recognize</term> the members of
<var>L</var>(<var>P</var>).</termdef>
</p>
<note dg="ww-LM">
<p>The language accepted by a content model plays a role in determining
whether an element information item is locally valid or not: if the
appropriate content model does not accept the sequence of elements
among its children, then the element information item is not locally
valid.<phrase dg="ww">  (Some additional constraints must also be met: not every
sequence in <var>L</var>(<var>P</var>) is locally valid against <var>P</var>.  See
<specref ref="group-validation"/>.)</phrase></p>
<p>
<!--* 
The local validity of an element is determined in part by whether
its content model accepts the sequence of element information items
among its children.  *-->
No assumption is made, in the definition above,
that the items in the sequence are themselves valid; only the
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2004/REC-xml-names11-20040204/#dt-expname">expanded names</xspecref> of the items in the sequence are relevant in
determining whether the sequence is accepted by a particle.
Their validity does affect whether their parent is (recursively)
valid as well as locally valid.</p>
</note>
<p dg="ww-p">If a sequence <var>S</var> is a member of <var>L</var>(<var>P</var>), then it
is necessarily possible to trace a path through the 
<termref def="key-basic-particle">basic particles</termref>
within <var>P</var>, with each item within <var>S</var> corresponding to a matching particle
within <var>P</var>. The sequence of particles within <var>P</var> corresponding to <var>S</var>
is called the <termref def="key-path"/> of <var>S</var> in <var>P</var>.</p>
<note dg="ww-p"><p>This <termref def="key-path"/> has nothing to do
with <bibref ref="bib-xpath"/> or XPath expressions. When there
may otherwise be danger of confusion, the <termref def="key-path"/> described here
may be referred to as the <termref def="key-path">match path</termref> of <var>S</var> in <var>P</var>.
</p></note>

<p>
For detailed information on particles, see <specref ref="cParticles"/>.</p>
</div4>
      <div4 id="Attribute_Use">
       <head>Attribute Use</head>
       <p>An attribute use plays a role similar to that of a particle, but for
attribute declarations:  an attribute declaration within a complex type definition
is embedded within an attribute use, which specifies whether the declaration
requires or merely allows its attribute, and whether it has a default or fixed value.</p>
      </div4>
      <div4 id="Wildcard">
<head>Wildcard</head>
<p>A wildcard is a special kind of particle which matches element and attribute
 information items dependent on their namespace name<phrase dg="b2867-1">s</phrase><!--*
* material suppressed here by diff group b2867-1a *
*-->
 <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1">and optionally on</phrase> their local names.</p>
     <p>
For detailed information on wildcards, see <specref ref="Wildcards"/>.</p>
</div4>
</div3>

     <div3 id="Constraint_Summary">
<head><!--*
* material suppressed here by diff group b2861cc-1 *
*--><phrase dg="b2861cc-1">Constraint</phrase> Components</head>
      <div4 id="Identity-constraint_Definition">
<head><phrase dg="b2861cc-1">Identity-constraint Definition</phrase></head>
<p>An identity-constraint definition is an association between a name and one of
several varieties of
identity-constraint related to uniqueness and reference.  All the
varieties use <bibref ref="bib-xpath"/> expressions to pick out sets of
information items relative to particular target element
information items which are unique, or a key, or a <termref def="key-vn">valid</termref> reference, within
a specified scope. An element information item is only <termref def="key-vn">valid</termref> with
respect to an element declaration
with identity-constraint definitions if those definitions are all satisfied for all the descendants
of that element information item which they pick out.</p>
     <p>
For detailed information on identity-constraint definitions, see <specref ref="cIdentity-constraint_Definitions"/>.</p>
<note dg="b2861cc-1b">
 <p>
  Identity constraints currently uses XPath 1.0. This may change in future working drafts
  of this specification to use XPath 2.0. Such change will not affect evaluation of
  identity constraints, given the XPath subset it uses.
 </p>
</note>
       </div4>

     <div4 id="Assertion" dg="b2861cc-1">
      <head>Assertion</head>

<p>An assertion is a predicate associated with a type,
which is checked for each instance of the type.  Depending
on their formulation, assertions are either required to be
true of the instance, or required to be false.  If an 
element or attribute information item fails to satisfy an
assertion associated with a given type, then that information
item is not locally <phrase dg="b2861cc-1b"><termref def="key-vn">valid</termref></phrase>
with respect to that type.</p>

      <p>For detailed information on Assertions, see <specref ref="cAssertions"/>.</p>

<note dg="b2861cc-1b">
 <p>
  Assertions are currently only allowed to be specified in complex types.
  It may be deemed useful to also include assertions in named model group
  definitions and/or attribute groups, or even simple types, if proved
  useful.
 </p>
</note>
      
     </div4>
    </div3>
<div3 id="Group_Definitions">
<head>Group Definition Components</head>
<p>There are two kinds of convenience definitions provided to enable
the re-use of pieces of complex type definitions: model group definitions
and attribute group definitions.</p>
<div4 id="Model_Group_Definition">
<head>Model Group Definition</head>
<p>A model group definition is an association between a name and a model group,
enabling re-use of the same model group in several complex type
definitions.</p>
     <p>
For detailed information on model group definitions, see <specref ref="cModel_Group_Definitions"/>.</p>
</div4>
<div4 id="Attribute_Group_Definition">
<head>Attribute Group Definition</head>
<p>An attribute group definition is an association between a name and a set of attribute declarations,
enabling re-use of the same set in several complex type
definitions.</p>
     <p>
For detailed information on attribute group definitions, see <specref ref="cAttribute_Group_Definitions"/>.</p>
</div4>
</div3>
    <div3 id="Annotation">
     <head>Annotation Components</head>
     <p>An annotation is information for human and/or mechanical
consumers. The interpretation of such information is
not defined in this specification.</p>
     <p>
For detailed information on annotations, see <specref ref="cAnnotations"/>.</p>

     </div3>
   </div2>
    <div2 id="concepts-schemaConstraints">
      <head>Constraints and Validation Rules</head>
      <p>The <bibref ref="ref-xml"/> specification describes two kinds of
        constraints on XML documents: <emph>well-formedness</emph> and
        <emph>validity</emph> constraints. Informally, the well-formedness constraints
        are those imposed by the definition of XML itself (such as the rules for the
        use of the &lt; and &gt; characters and the rules for proper nesting of
        elements), while validity constraints are the further constraints on document
        structure provided by a particular DTD. </p>
      <p>The preceding section focused on <termref def="key-vn">validation</termref>, that is
the constraints on information items which schema components supply.  In fact
however this specification provides four different kinds of normative statements about schema
        components, their representations in XML and their contribution to the
<termref def="key-vn">validation</termref> of information items:</p>
      <glist>
        <gitem>
          <label>Schema Component Constraint</label>
          <def>
            <p><termdef id="gloss-cos" term="Schema Component Constraint">Constraints on the schema components themselves, i.e.
conditions components <rfc2119>must</rfc2119> satisfy to be components at all.  Located in the
sixth sub-section of the per-component sections of <specref ref="components"/>
and tabulated in <specref ref="outcome-cos"/></termdef>.</p>
          </def>
        </gitem>
       <gitem>
        <label>Schema Representation Constraint</label>
        <def>
         <p><termdef id="gloss-src" term="Schema Representation Constraint">Constraints on the
representation of schema components in XML beyond those which are expressed
in <specref ref="normative-schemaSchema"/>.  Located in the
third sub-section of the per-component sections of <specref ref="components"/>
and tabulated in <specref ref="outcome-src"/></termdef>.</p>
        </def>
       </gitem>
        <gitem>
          <label>Validation Rules</label>
          <def>
            <p><termdef id="gloss-cvc" term="Validation Rules">Contributions to <termref def="key-vn">validation</termref> associated
with schema components.  Located in the
fourth sub-section of the per-component sections of <specref ref="components"/>
and tabulated in <specref ref="validation_failures"/></termdef>.</p>
          </def>
        </gitem>
       <gitem>
          <label>Schema Information Set
            Contribution</label>
          <def>
            <p><termdef id="gloss-sic" term="Schema Information Set Contribution">Augmentations to <termref def="key-psvi">post-schema-validation infoset</termref>s
expressed by schema components, which follow
              as a consequence of <termref def="key-vn">validation</termref> and/or <termref def="key-va">assessment</termref>.
Located in the
fifth sub-section of the per-component sections of <specref ref="components"/>
and tabulated in <specref ref="PSVI_contributions"/></termdef>.</p>
          </def>
        </gitem>
      </glist>
        <p>The last of these, schema information set
          contributions, are not as new as they might at first seem.  XML<!--*
* material suppressed here by diff group fpwd *
*-->
          validation augments the XML<!--*
* material suppressed here by diff group fpwd *
*--> information set in similar ways,
for example by
          providing values for attributes not present in instances, and by implicitly
          exploiting type information for normalization or access.
(As an example of the latter case, consider the
          effect of <code>NMTOKENS</code> on attribute white space, and the semantics of
          <code>ID</code> and <code>IDREF</code>.) By including schema
information set contributions, this specification makes explicit some features
that XML<!--*
* material suppressed here by diff group fpwd *
*--> <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd">leaves</phrase> implicit.</p>

    </div2>

<div2 id="concepts-conformance">
<head>Conformance</head>

<note dg="rq144cf">
<p>The Working Group expects to revise this discussion of conformance in
future.  A sketch of relevant work can be found in <specref ref="impl-def-list"/>
and <specref ref="var_terminology"/>.</p>
</note>

<p>This specification describes three levels of conformance for schema aware processors.  
The first is
required of all processors.  Support for the other two will depend on the application environments
for which the processor is intended.</p>
<p><termdef id="key-minimallyConforming" term="minimally conforming"><term>Minimally 
conforming</term> processors <rfc2119>must</rfc2119> completely and
correctly implement the <termref def="gloss-cos">Schema Component
Constraints</termref>, <termref def="gloss-cvc">Validation Rules</termref>,
and <termref def="gloss-sic">Schema Information
Set Contributions</termref> contained in this specification</termdef>.</p>

<p><termdef id="key-interchange" term="schema-document aware"><termref def="key-minimallyConforming">Minimally conforming</termref>
processors which accept schemas represented in the form of XML
documents as described in <specref ref="layer2"/> are additionally
said to <!--*
* material suppressed here by diff group rq144cf *
*--><phrase dg="rq144cf">be <term>schema-document aware</term></phrase>.</termdef>
Such processors <rfc2119>must</rfc2119>, when processing schema documents, completely
and correctly implement all <termref def="gloss-src">Schema
Representation Constraints</termref> in this specification, and <rfc2119>must</rfc2119>
adhere exactly to the specifications in <specref ref="components"/>
for mapping the contents
of such documents to <termref def="c">schema components</termref> for
use in <termref def="key-vn">validation</termref> and <termref def="key-va">assessment</termref>.</p>
<p dg="rq144cf"><termdef id="key-XML-unaware" term="non-schema-document-aware">A 
<termref def="key-minimallyConforming">minimally conforming</termref>
processor which is not <termref def="key-interchange"/> is
said to be a <term>non-schema-document-aware</term> processor.</termdef></p>
<note>
<p>By separating the conformance requirements relating to the concrete
syntax of XML schema documents, this specification admits processors
which use schemas stored in optimized binary representations,
dynamically created schemas represented as programming language data
structures, or implementations in which particular schemas are
compiled into executable code such as C or Java.  Such processors can
be said to be <termref def="key-minimallyConforming">minimally
conforming</termref> but not necessarily <!--*
* material suppressed here by diff group rq144cf *
*--><phrase dg="rq144cf"><termref def="key-interchange"/></phrase>.</p>
</note>
<p><termdef id="key-fullyConforming" term="Web-aware"><!--*
* material suppressed here by diff group rq144cf *
*--><phrase dg="rq144cf"><term>Web-aware</term></phrase> processors are
network-enabled processors which are not only both <termref def="key-minimallyConforming">minimally conforming</termref> and
<termref def="key-interchange"><!--*
* material suppressed here by diff group rq144cf *
*--><phrase dg="rq144cf">schema-document aware</phrase></termref>, but
which additionally <rfc2119>must</rfc2119> be capable of accessing schema documents
from the World Wide Web <!--*
* material suppressed here by diff group rq144cf *
*--><phrase dg="rq144cf">as described in</phrase>
<specref ref="web-representation"/> and <specref ref="schema-loc"/>.
</termdef>.
</p>
<note diff="nsq-add" dg="rq144wgno">
<p>In version 1.0 of this specification the class of 
<termref def="key-interchange"/> processors was termed
<quote>conformant to the XML Representation of Schemas</quote>.
Similarly, the class of <termref def="key-fullyConforming"/>
processors was called <quote>fully conforming</quote>.</p>
</note>
<note><p>Although this specification provides just these three
standard levels of conformance, it is anticipated that other
conventions can be established in the future.  For example, the World
Wide Web Consortium is considering conventions for packaging on the
Web a variety of resources relating to individual documents and
namespaces.  Should such developments lead to new conventions for
representing schemas, or for accessing them on the Web, new levels of
conformance can be established and named at that time.  There is no
need to modify or republish this specification to define such
additional levels of conformance.</p></note>
 <p>See <specref ref="composition"/> for a more detailed explanation of the
mechanisms supporting these levels of conformance.</p>
</div2>
    <div2 id="concepts-nameSymbolSpaces">
      <head>Names and Symbol Spaces</head>
      <p>As discussed in <specref ref="concepts-data-model"/>, most schema
        components (<phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*-->) have <termref def="key-compName">names</termref>.
If all such names were assigned from the same <quote>pool</quote>, then
        it would be impossible to have, for example, a simple type definition and an element
declaration both with the name
<quote>title</quote> in a given <termref def="key-targetNS">target namespace</termref>.</p>
      <p>
        Therefore <termdef id="key-symbolSpace" term="symbol space">this specification introduces the term <term>symbol
space</term> to denote a 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 xmlns:xlink="http://www.w3.org/1999/xlink" 
href="http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-breakdown">namespace
partition</xtermref> introduced in <bibref ref="ref-xml-namespaces"/>.
There is a single distinct symbol space within a given <termref def="key-targetNS">target namespace</termref> for each kind of
definition and declaration component identified in <specref ref="concepts-data-model"/>, except that within
a target namespace, simple type definitions and complex type
definitions share a symbol space. Within a given symbol space, names
are unique, but the same name <rfc2119>may</rfc2119> 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.
</p>
      <p>Locally scoped attribute and element
declarations are special with regard to symbol spaces.
Every complex type definition defines its own local attribute and element declaration symbol
        spaces, where these symbol spaces are distinct from each other and from any of the other
symbol spaces.  So, for example, two complex type definitions having
the same target namespace can contain
a local attribute declaration for the unqualified name <quote>priority</quote>, or contain a local element declaration
for the name <quote>address</quote>, without conflict or necessary relation between
the two.</p>
    </div2>
<div2 id="Instance_Document_Constructions"> <head>Schema-Related Markup in
Documents Being Validated</head>
  <p>The XML representation of schema components uses a vocabulary
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
<code>xs:</code> to stand for this namespace; in practice,
any prefix can be used.</p>

 <issue id="RQ-153i" role="1.1" status="open">
<!--* <p><loc href="&reqs;#xsd-1.1-namespace" target="reqs">RQ-153 (xsd-1.1-namespace)</loc></p> 
    *-->
<p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=3047" target="reqs">Issue 3047 (RQ-153 XSD 1.1 namespace)</loc></p>
  <p>This specification must choose either to use the same namespace as XML
Schema 1.0, or to use a different namespace, or to use more than one namespace. 
An explicit decision should be made.</p>
 </issue>

 <p><emph>XML Schema: Structures</emph> also defines several attributes for direct use in any XML documents.  These attributes are in a different namespace,
which has the namespace name <code>http://www.w3.org/2001/XMLSchema-instance</code>.
For brevity, the text and examples in this specification use the prefix
<code>xsi:</code> to stand for this latter namespace; in practice,
any prefix can be used.  All schema processors have appropriate attribute
declarations for these attributes built in, see <specref ref="xsi.type"/>,
<specref ref="xsi.nil"/>, <specref ref="xsi.schemaLocation"/> and <specref ref="xsi.noNamespaceSchemaLocation"/>.</p>
<div3 id="xsi_type">
<head>xsi:type</head>
<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
determined by reference to the appropriate schema components.
An element information item in an instance <rfc2119>may</rfc2119>, however,
explicitly assert its type using the attribute <code>xsi:type</code>.
The value of this attribute is a <termref def="gloss-QName">QName</termref>;  see <specref ref="src-qname"/> for
the means by which the <termref def="gloss-QName">QName</termref> is
associated with a type definition.
</p>
</div3>
<div3 id="xsi_nil">
<head>xsi:nil</head>
<p><emph>XML Schema: Structures</emph> introduces a mechanism for signaling that an element
<!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><rfc2119>must</rfc2119></phrase> be accepted as <termref def="key-vn">valid</termref> when
it has no content despite a content type which does not require or
even necessarily allow empty content.  An element <phrase dg="may">may be</phrase><!--*
* material suppressed here by diff group may *
*--> 
<termref def="key-vn">valid</termref> without
content if it has the attribute <code>xsi:nil</code> with the value
<code>true</code>.  An element so labeled <rfc2119>must</rfc2119> be empty, but can
carry attributes if permitted by the corresponding complex type.</p>
</div3>
<div3 id="xsi_schemaLocation">
<head>xsi:schemaLocation, xsi:noNamespaceSchemaLocation</head>
<p>The <code>xsi:schemaLocation</code> and <code>xsi:noNamespaceSchemaLocation</code> 
attributes can be used in a document to provide
hints as to the physical location of schema documents which <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> 
be used for <termref def="key-va">assessment</termref>.
See <specref ref="schema-loc"/> for details on the use of these attributes.</p>
</div3>
</div2>
<div2 id="web-representation">
<head>Representation of Schemas on the World Wide Web</head>
<p>On the World Wide Web, schemas are conventionally represented as XML
documents (preferably of MIME type
<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
the representation and use of schema documents on the World Wide Web see <specref ref="schema-repr"/> and
<specref ref="schema-loc"/>. </p>
</div2>
 </div1>
  <div1 id="components">
   <head>Schema Component Details</head>
   <div2 id="scIntro">
    <head>Introduction</head>
    <p>The following sections provide full details on the composition of all schema components, together
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
     <olist>
      <item>
       <p>properties:  their values and significance</p>
      </item>
      <item>
       <p>XML representation and the mapping to properties</p>
      </item>
      <item>
       <p>constraints on representation</p>
      </item>
      <item>
       <p>validation rules</p>
      </item>
      <item>
       <p><termref def="key-psvi">post-schema-validation infoset</termref> contributions</p>
      </item>
      <item>
       <p>constraints on the components themselves</p>
      </item>
     </olist>
The sub-sections immediately below introduce conventions and terminology used throughout the component sections.</p>
   <div3>
    <head>Components and Properties</head>
    <p>Components are defined in terms of their
properties, and each property in turn is defined by giving its range,
that is the values it <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> have.  This can be understood as
defining a schema as a labeled directed graph, where the root is a schema,
every other vertex is a schema
component or a literal (string, boolean, <!--*
* material suppressed here by diff group b1915bis *
*--><phrase dg="b1915bis">decimal</phrase>) and every labeled edge is a
property.  The graph is <emph>not</emph> acyclic:  multiple copies of
components with the same name in the same <termref def="key-symbolSpace">symbol space</termref> 
<!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><rfc2119>must not</rfc2119></phrase> 
exist, so in some cases re-entrant chains of properties 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">will</phrase> 
exist.  Equality of components for the purposes of this
specification is always defined as equality of names (including target
namespaces) within symbol spaces.</p>
	  <issue id="RQ-125i" role="1.1" status="open">
<!--* <p><loc href="&reqs;#id-anon-types" target="reqs">RQ-125 (id-anon-types)</loc>, 
<loc href="&reqs;#scd-origin-inheritance" target="reqs">RQ-134 (scd-origin-inheritance)</loc>
*-->
<p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2837" target="reqs">Issue 2837 (RQ-125 identity of anonymous types)</loc>,
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2842" target="reqs">Issue 2842 (RQ-134 inherited portions of content model)</loc>
</p>
    <p>Version 1.0 was deliberately reticent in stating identity conditions for
components.  With hindsight this was a mistake, and will be corrected.</p>
    <resolution>
     <p>Add {scope} property to type definition components
which will either be the enclosing element declaration or "global", by
analogy with element declarations {scope}. [For further
context, see <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/XML/Group/2004/05/xml-schema-ftf-minutes.html">F2F 
2004-03-12, section RQ-125</loc> (W3C-member-only link).]</p>
     <p>This change will solve the anonymous type equality problem by giving an
unequivocal answer to the <quote>who am I?</quote> question for such types by way of the
answer <quote>Your identity is determined by your scope's identity.</quote></p>
    </resolution>
    </issue>
    <note>
    <p>A schema and its components as defined in this chapter are an
idealization of the information a schema-aware processor requires:
implementations are not constrained in how they provide it.  In
particular, no implications about literal embedding versus indirection
follow from the use below of language such as 
<quote>properties . . . having . . . components as values</quote>.</p>
   </note>
    
    <p dg="ep01">Component properties are simply named values.  Most properties have either other components or literals (that is,
strings or booleans or enumerated keywords) for values, but in a few cases,
where more complex values are involved, <termdef id="t-propRec" term="property record">a property value may itself be a collection of
named values, which we call a <term>property record</term></termdef>.</p>
   <p><termdef id="key-null" term="absent">Throughout this specification, the
term <term>absent</term> is used as a distinguished property value denoting
absence</termdef>.<phrase dg="fpwd">  Again this should not be interpreting as
constraining implementations, as for instance between using a <pt>null</pt>
value for such properties or not representing them at all.</phrase></p>
   <p>Any property <!--*
* material suppressed here by diff group rq144nv *
*--><phrase dg="rq144nv">not defined as optional
is always present</phrase>; 
optional properties which are
not present are taken to have <termref def="key-null">absent</termref> as their value.  Any
property identified as a having a set, subset or list value <rfc2119>may</rfc2119> have an empty value 
unless this is explicitly
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 <rfc2119>may</rfc2119> be equal to 
that set, unless a proper superset or subset is explicitly called for.
By 'string' in Part 1 of this specification is meant a
sequence of ISO 10646 characters identified as 
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml/#charsets">legal XML characters</xtermref>
in <bibref ref="ref-xml"/>.</p>
<note dg="b1838">
<p>It is implementation-defined whether a schema processor
uses the definition of legal character from <bibref ref="ref-xml"/>
or <bibref ref="ref-xml-1.0"/>.</p>
</note>
</div3>
   <div3>
    <head>XML Representations of Components</head>
    <p>The principal purpose of <emph>XML Schema: Structures</emph> is to define a set of
      schema components that constrain the contents of instances and augment the
      information sets thereof.  Although no external representation
of schemas is required for this purpose, such representations will
obviously be widely used. To provide for this in an appropriate and
interoperable way, this specification provides a normative XML representation for schemas which
makes provision for every kind of schema
component.  <termdef id="key-schemaDoc" term="schema document">A document in
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
its constituents, the sections below define correspondences between element
information items (with declarations in
<specref ref="normative-schemaSchema"/> and <specref ref="nonnormative-schemaDTD"/>) and
schema components.  All the element information items in the XML representation
of a schema <rfc2119>must</rfc2119> be in the XML Schema namespace, that is their <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref> <rfc2119>must</rfc2119> 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>
    <p>Two aspects of the XML representations of components presented in the
following sections are constant across them all:
    <olist>
     <item>
      <p>All of them allow attributes qualified with namespace names other than
the XML Schema namespace itself: these appear as annotations in the
corresponding schema component;</p>
     </item>
     <item>
      <p>All of them allow an <eltref ref="annotation"/> as their first child, for human-readable documentation and/or machine-targeted information.</p>
     </item>
    </olist>
   </p>
   </div3>
    <div3>
    <head>The Mapping between XML Representations and Components</head>
    <p>For each kind of schema component there is a corresponding normative XML representation.
The sections below describe the correspondences between the properties of each kind of
schema component on the one hand and the properties of information items in
that XML representation on the other, together
with constraints on that representation above and beyond those implicit in the
<specref ref="normative-schemaSchema"/>.</p>
 <p>The language used is as if the correspondences were mappings from XML representation to
schema component, but the mapping in the other direction, and therefore the
correspondence in the abstract, can always be
constructed therefrom.</p>
     <p>In discussing the mapping from XML representations to schema
components below, the value of a component property is often determined by the
value of an attribute information item, one of the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> of an element
information item.  Since schema documents are constrained by the
<specref ref="normative-schemaSchema"/>, there is always a simple type
definition associated with any such attribute information item.  <termdef id="key-vv" term="actual value">The
phrase <term>actual value</term> is used to refer to the member of the value space of the
simple type definition associated with an attribute information item which corresponds to
its <termref def="key-nv">normalized value</termref></termdef>.  This will often be a string, but <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> also be an
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>
   <p>Many properties are identified below as having other schema
components or sets of components as values.  For the purposes of
exposition, the definitions in this section assume that (unless the
property is explicitly identified as optional) all such values are in
fact present.  When schema components are constructed from XML
representations involving reference by name to other components, this
assumption <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be violated if one
or more references cannot be resolved.  This specification addresses
the matter of missing components in a uniform manner, described in
<specref ref="conformance-missing"/>:  no mention of handling missing
components will be found in the individual component descriptions
below.</p>
   <p>Forward reference to named definitions and declarations
<emph>is</emph> allowed, both within and between <termref def="key-schemaDoc">schema documents</termref>. By the time the
component corresponding to an XML representation which contains a
forward reference is actually needed for <termref def="key-vn">validation</termref><!--*
* material suppressed here by diff group may *
*--> an appropriately-named component <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*-->
have become available to discharge the reference: see <specref ref="composition"/> for details.</p>
   </div3>
   <div3>
    <head>White Space Normalization during Validation</head>
    <p>Throughout this specification, <termdef id="key-iv" term="initial value">the
<term>initial value</term> of some
attribute information item is the value of the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">normalized
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
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.character">character code</xpropref> of each character information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of that
element information item</termdef>.</p>
   <p>The above definition means that comments and processing instructions,
even in the midst of text, are ignored for all <termref def="key-vn">validation</termref> purposes.</p>
   <p><termdef id="key-nv" term="normalized value">The
<term>normalized value</term> of an element or
attribute information item is an <termref def="key-iv">initial value</termref> whose white space, if any, has been
normalized according to the value of the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#rf-whiteSpace">whiteSpace facet</xtermref> of the
simple type definition used in its <termref def="key-vn">validation</termref>:
 </termdef>
    <glist>
     <gitem>
      <label>preserve</label>
      <def>
       <p>No normalization is done, the value is the <termref def="key-nv">normalized value</termref></p>
      </def>
     </gitem>
     <gitem>
      <label>replace</label>
      <def>
       <p>All occurrences of <code>#x9</code> (tab), <code>#xA</code> (line feed) and
<code>#xD</code> (carriage return) are replaced with <code>#x20</code> (space).</p>
      </def>
     </gitem>
     <gitem>
      <label>collapse</label>
      <def>
       <p>Subsequent to the replacements specified above under <local>replace</local>,
contiguous sequences of <code>#x20</code>s are collapsed to a single
<code>#x20</code>, and initial and/or final <code>#x20</code>s are deleted.</p>
      </def>
     </gitem>
    </glist>
   </p>
    <p>If the simple type definition used in an item's 
<termref def="key-vn">validation</termref> is the 
<termref def="key-simpleUrType">simple ur-type definition</termref>, 
<phrase dg="iff">then </phrase>the 
<termref def="key-nv">normalized value</termref> <rfc2119>must</rfc2119> be determined 
as in the <local>preserve</local> case above.</p>
   <p>There are three alternative validation rules which <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> supply the 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>
   <p>These three levels of normalization correspond to the processing mandated
in XML<!--*
* material suppressed here by diff group fpwd *
*--> for element content, CDATA attribute 
content and tokenized
attributed content, respectively.  See 
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" 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
value</xpropref> has already been subject to replacement or collapse on the basis of
information in a DTD is necessary to ensure consistent treatment of attributes
regardless of the extent to which DTD-based information has been made use of
during infoset construction.</p>
   <note>
    <p>Even when DTD-based information <emph>has</emph> been appealed
to, and <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml/#AVNormalize">Attribute Value
Normalization</xspecref> has taken place, <phrase dg="may">the above definition of <termref def="key-nv">normalized value</termref> may mean</phrase><!--*
* material suppressed here by diff group may *
*-->
<emph>further</emph> normalization <phrase dg="may">takes</phrase><!--*
* material suppressed here by diff group may *
*--> place, as for instance when character entity references
in attribute values result in white space characters other than spaces
in their <termref def="key-iv">initial value</termref>s.</p>
   </note>
<note dg="b2532-rq127-r196">
<p>The values <local>replace</local> and 
<local>collapse</local> may appear to provide a
convenient way to <quote>unwrap</quote> text (i.e. undo the effects of
pretty-printing and word-wrapping).  In some cases, especially
highly constrained data consisting of lists of artificial tokens
such as part numbers or other identifiers, this appearance is
correct.  For natural-language data, however, the whitespace
processing prescribed for these values is not only unreliable but
will systematically remove the information needed to perform
unwrapping correctly.  For Asian scripts, for example, a correct
unwrapping process will replace line boundaries not with blanks but
with zero-width separators or nothing.  In consequence, it is
normally unwise to use these values for natural-language data, or
for any data other than lists of highly constrained tokens.</p>
</note>
   </div3>
   </div2>
   <div2 id="cAttribute_Declarations">
    <head>Attribute Declarations</head>
    <p>Attribute declarations provide for:</p>
    <ulist>
     <item><p>Local <termref def="key-vn">validation</termref> of attribute information item values using a simple type definition;</p></item>
     <item><p>Specifying default or fixed values for attribute information items.</p></item>
    </ulist>
 <note role="example">
<eg xml:space="preserve">&lt;xs:attribute name="age" type="xs:positiveInteger" use="required"/&gt;
</eg>
<p>The XML representation of an attribute declaration.</p>
</note>
    <div3 id="Attribute_Declaration_details">
     <head>The Attribute Declaration Schema Component</head>
<!--*
     <issue id="RQ-129i" role="1.1">
      <p><loc href="&reqs;#eliminate-canonical" target="reqs">RQ-129 (eliminate-canonical)</loc></p>
      <p>In a few places part 1 of version 1.0 relied on the ability to
determine a (canonical) lexical form for any simple typed value, e.g. in the
construction of default attribute information items.  But not all simple types
<emph>have</emph> such a canonical form.  The dependence on canonical forms,
which part 2 will no longer normatively require, will be removed.</p>
      <resolution>
       <p><loc href="http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004Mar/0072.html">minutes from XML Schema WG call 2004-03-19</loc> (W3C-member-only link)</p>
       <p>Modify the component structure to record / retain a lexical form.
   (There was some speculation in the WG about whether the existing 
   value property should or should not be repurposed, or a new property
   added; the WG did NOT decide this now, preferring to leave it to
   the editor as part of the plumbing and deal with it as part of
   Phase 2.)</p>
       <p>If the component comes from a schema document, then the lexical
   form in the component should be that appearing in the schema
   document.</p>
       <p>Otherwise (i.e. if the component is born binary), the lexical
   form in the component should be any appropriate one.</p>
      </resolution>
     </issue> *-->
    <p>The attribute declaration schema component has the following
properties:</p>
    <compdef name="Attribute Declaration" abbrev="ad" showAKO="true"/>
     <microCompdef name="Scope" abbrev="sc_a" dg="ep01"/>
    <microCompdef name="Value Constraint" abbrev="vc_a" dg="ep01"/>
<p>The <propref comp="ad" prop="name"/> property <rfc2119>must</rfc2119> match the local part of the names of attributes being <termref def="key-vn">validated</termref>.</p>
<p>The value of the attribute <rfc2119>must</rfc2119> conform to the supplied <propref comp="ad" prop="type definition"/>.</p>
    <p>A <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
 value of the <propref comp="ad" prop="target namespace"/> property provides for <termref def="key-vn">validation</termref> of
namespace-qualified attribute information items (which <rfc2119>must</rfc2119> be explicitly
prefixed in the character-level form of XML documents).  <termref def="key-null">Absent</termref> values of
<propref comp="ad" prop="target namespace"/> <termref def="key-vn">validate</termref> unqualified (unprefixed) items.</p>
    <p>A <propref comp="ad" prop="scope"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">with <propref comp="sc_a" prop="variety"/></phrase> <pt>global</pt> identifies attribute declarations
available for use in complex type definitions throughout the schema.  Locally scoped declarations are available for use only within the
<phrase dg="scope-1973">complex type definition</phrase><!--*
* material suppressed here by diff group scope-1973 *
*--> identified by the <propref comp="ad" prop="scope"/><phrase dg="ep01">'s <propref comp="sc_a" prop="parent"/></phrase> property. <phrase dg="scope-1973"> 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.</phrase>
</p>
<p><propref comp="ad" prop="value constraint"/> reproduces the functions of XML<!--*
* material suppressed here by diff group fpwd *
*--> default and <code>#FIXED</code>
attribute values.  <phrase dg="ep01">A <propref comp="vc_a" prop="variety"/> of </phrase><pt>default</pt> specifies that the attribute is to appear unconditionally in
the <termref def="key-psvi">post-schema-validation infoset</termref>, with <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="vc_a" prop="value"/><phrase dg="rq129">
and <propref comp="vc_a" prop="lexical form"/></phrase></phrase> used
whenever the attribute is not actually present; <pt>fixed</pt> indicates that the attribute value if present <rfc2119>must</rfc2119> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">be identical to <propref comp="vc_a" prop="value"/></phrase>, and if absent receives <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="vc_a" prop="value"/><phrase dg="rq129">
and <propref comp="vc_a" prop="lexical form"/></phrase></phrase> as for
<pt>default</pt>.  Note that it is <emph>values</emph> that are
<!--*
* material suppressed here by diff group ep01 *
*-->checked, not strings.</p>
    <p>See <specref ref="cAnnotations"/> for information on the role of the
<propref comp="ad" prop="annotations"/> property.</p>
<note><p>A more complete and formal presentation of the semantics of <propref comp="ad" prop="name"/>, <propref comp="ad" prop="target namespace"/> and <propref comp="ad" prop="value constraint"/> is provided in
conjunction with other aspects of complex type <termref def="key-vn">validation</termref> (see <specref ref="cvc-complex-type"/>.)</p></note>
    <p><bibref ref="ref-xmlinfo"/> distinguishes attributes with names such as <code>xmlns</code> or <code>xmlns:xsl</code> from
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
schemas to contain attribute declarations corresponding to such
namespace declarations, see <specref ref="no-xmlns"/>.  No means is provided in
this specification to supply a
default value for a namespace declaration.</p> 
</div3>
    <div3 id="declare-attribute">
<head>XML Representation of Attribute Declaration Schema
Components</head>
	  <issue id="RQ-121i" role="1.1" status="open">
<!--* <p>
<loc href="&reqs;#prohibited-and-fixed" target="reqs">RQ-121 (prohibited-and-fixed)</loc>
</p> *-->
<p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2835" target="reqs">Issue 2835 (RQ-121 prohibited + fixed)</loc></p>

    <p>Neither the prose of this specification nor the
schema for schema documents rules out XML representations of
attribute declarations containing both <code>use='prohibited'</code> and 
<code>fixed='...'</code>.  It
will be made clear that this is not an error and that
‘<code>prohibited</code>’ wins.</p>
</issue>
<p>The XML representation for an attribute declaration schema
component is an
<eltref ref="attribute"/> element information item.  It specifies a
simple type definition for an attribute either by reference or
explicitly, and <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> provide default information. The
correspondences between the properties of the information item and
properties of the component are as follows:</p>
<reprdef>
 <reprelt eltname="attribute" type="attribute"/>
 <p>If the <eltref ref="attribute"/> element information item has <eltref ref="schema"/> as its parent, the corresponding schema component is as follows:</p>
  <reprcomp ref="Attribute_Declaration_details" abstract="Attribute Declaration">
   <propmap comp="ad" prop="name">The <termref def="key-vv">actual value</termref> of the <code>name</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>
  <propmap comp="ad" prop="target namespace">The <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the parent <eltref ref="schema"/>
element information item, or <termref def="key-null">absent</termref> if there is none.</propmap>
 <propmap comp="ad" prop="type definition">The simple type definition
corresponding to the <eltref ref="simpleType"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise the simple type definition <termref def="src-resolve">resolved</termref> to by
the <termref def="key-vv">actual value</termref> of the <code>type</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise the
<termref def="simple-ur-type-itself">simple ur-type definition</termref>.</propmap>
   <propmap comp="ad" prop="scope"><phrase dg="ep01">A <compref ref="sc_a"/> as follows:</phrase>
    <pvlist>
     <pvpair comp="sc_a" prop="variety"><pt>global</pt></pvpair>
     <pvpair comp="sc_a" prop="parent" dg="ep01"><termref def="key-null">absent</termref></pvpair>
    </pvlist>
   </propmap>
 <propmap comp="ad" prop="value constraint">If there is a <code>default</code> or a <code>fixed</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, then <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">a <compref ref="vc_a"/> as follows</phrase>, otherwise <termref def="key-null">absent</termref>.
  <pvlist>
   <pvpair comp="vc_a" prop="variety">either <pt>default</pt> or <pt>fixed</pt>, as appropriate</pvpair>
   <pvpair comp="vc_a" prop="value">the <termref def="key-vv">actual value</termref> (with respect to the
<propref comp="ad" prop="type definition"/>) of <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">the</phrase> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></pvpair>
   <pvpair comp="vc_a" prop="lexical form" dg="rq129">the <termref def="key-nv">normalized value</termref>
(with respect to the
<propref comp="ad" prop="type definition"/>) of the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></pvpair>
  </pvlist></propmap>
 <propmap comp="ad" prop="annotations">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
 </reprcomp>
 <p>otherwise if the <eltref ref="attribute"/> element information item has
<eltref ref="complexType"/> or <eltref ref="attributeGroup"/> as an ancestor
and the <code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is absent, it corresponds to an
attribute use with properties as follows (unless <code>use='prohibited'</code>, in which case the item
corresponds to nothing at all):</p>
 <reprcomp ref="AU_details" abstract="Attribute Use">
  <propmap comp="au" prop="required"><pt>true</pt> if the <code>use</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present with <termref def="key-vv">actual value</termref> <code>required</code>, otherwise
<pt>false</pt>.</propmap>
  <propmap comp="au" prop="attribute declaration">See the Attribute Declaration mapping
immediately below.</propmap>
  <propmap comp="au" prop="value constraint">If there is a <code>default</code> or a <code>fixed</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, then a <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref ref="vc_au"/> as follows</phrase>, otherwise <termref def="key-null">absent</termref>.
  <pvlist>
   <pvpair comp="vc_au" prop="variety">either <pt>default</pt> or <pt>fixed</pt>, as appropriate</pvpair>
   <pvpair comp="vc_au" prop="value">the <termref def="key-vv">actual value</termref> (with respect to the
<propref comp="ad" prop="type definition"/> of the <propref comp="au" prop="attribute declaration"/>) of <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">the</phrase> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></pvpair>
   <pvpair comp="vc_au" prop="lexical form" dg="rq129">the <termref def="key-nv">normalized value</termref>
(with respect to the
<propref comp="ad" prop="type definition"/> of the <propref comp="au" prop="attribute declaration"/>) of the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></pvpair>
  </pvlist>
  </propmap>
 </reprcomp>
 <reprcomp ref="Attribute_Declaration_details" abstract="Attribute Declaration">
  <propmap comp="ad" prop="name">The <termref def="key-vv">actual value</termref> of the <code>name</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>
  <propmap comp="ad" prop="target namespace">If <code>form</code> is present and its
<termref def="key-vv">actual value</termref> is <code>qualified</code>, or if <code>form</code> is absent and the
<termref def="key-vv">actual value</termref> of <code>attributeFormDefault</code> on the <eltref ref="schema"/>
ancestor is <code>qualified</code>, then the <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the parent <eltref ref="schema"/>
element information item, or <termref def="key-null">absent</termref> if there
is none, otherwise <termref def="key-null">absent</termref>.</propmap>
  <propmap comp="ad" prop="type definition">The simple type definition
corresponding to the <eltref ref="simpleType"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise the simple type definition <termref def="src-resolve">resolved</termref> to by
the <termref def="key-vv">actual value</termref> of the <code>type</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise the
<termref def="simple-ur-type-itself">simple ur-type definition</termref>.</propmap>
  <propmap comp="ad" prop="scope"><phrase dg="ep01">A <compref ref="sc_a"/> as follows:</phrase>
   <pvlist>
     <pvpair comp="sc_a" prop="variety" dg="ep01"><pt>local</pt></pvpair>
     <pvpair comp="sc_a" prop="parent">If the <eltref ref="attribute"/> element information item
has <eltref ref="complexType"/> as an ancestor, the <compref ref="ctd"/>
corresponding to that item, otherwise (the <eltref ref="attribute"/> element
information item is within an <eltref ref="attributeGroup"/> <phrase dg="scope-1973">definition</phrase><!--*
* material suppressed here by diff group scope-1973 *
*-->),
<termref def="key-null" dg="scope-1973">absent</termref><!--*
* material suppressed here by diff group scope-1973 *
*-->.</pvpair>
    </pvlist>
   </propmap>
  <propmap comp="ad" prop="value constraint"><termref def="key-null">absent</termref>.</propmap>
 <propmap comp="ad" prop="annotations">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
 </reprcomp>
 <p>otherwise (the <eltref ref="attribute"/> element information item has
<eltref ref="complexType"/> or <eltref ref="attributeGroup"/> as an ancestor and the
<code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present), it corresponds to an
attribute use with properties as follows (unless <code>use='prohibited'</code>, in which case the item
corresponds to nothing at all):</p>
 <reprcomp ref="AU_details" abstract="Attribute Use">
  <propmap comp="au" prop="required"><pt>true</pt> if the <code>use</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present with <termref def="key-vv">actual value</termref> <code>required</code>, otherwise
<pt>false</pt>.</propmap>
  <propmap comp="au" prop="attribute declaration">The (top-level) attribute declaration <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>
  <propmap comp="au" prop="value constraint">If there is a <code>default</code> or a <code>fixed</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, then a <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref ref="vc_au"/> as follows</phrase>, otherwise <termref def="key-null">absent</termref>.
  <pvlist>
   <pvpair comp="vc_au" prop="variety">either <pt>default</pt> or <pt>fixed</pt>, as appropriate</pvpair>
   <pvpair comp="vc_au" prop="value">the <termref def="key-vv">actual value</termref> (with respect to the
<propref comp="ad" prop="type definition"/> of the <propref comp="au" prop="attribute declaration"/>) of <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">the</phrase> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></pvpair>
   <pvpair comp="vc_au" prop="lexical form" dg="rq129">the <termref def="key-nv">normalized value</termref>
(with respect to the
<propref comp="ad" prop="type definition"/> of the <propref comp="au" prop="attribute declaration"/>) of the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></pvpair>
  </pvlist>
  </propmap>
 </reprcomp>
 </reprdef>
 <p>Attribute declarations can appear at the top level of a schema document, or within complex
type definitions, either as complete (local) declarations, or by reference to top-level
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
built-in or pre-declared simple type definition.  Otherwise an
anonymous <eltref ref="simpleType"/> is provided inline.</p>
 <p>The default when no simple type definition is referenced or
provided is the <termref def="key-simpleUrType">simple ur-type definition</termref>, which imposes no constraints at all.</p>
 <p>Attribute information items <termref def="key-vn">validated</termref> by 
a top-level declaration <rfc2119>must</rfc2119> be qualified with the
<propref comp="ad" prop="target namespace"/> of that declaration<!--*
* material suppressed here by diff group iff *
*--><phrase dg="iff">.
If the 
<propref comp="ad" prop="target namespace"/> is <termref def="key-null">absent</termref>,
the item <rfc2119>must</rfc2119> be unqualified.</phrase>
Control over whether attribute information items
<termref def="key-vn">validated</termref> by a local 
declaration <rfc2119>must</rfc2119> be similarly qualified or not
is provided by the <code>form</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, whose default is provided
by the <code>attributeFormDefault</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> on the 
enclosing <eltref ref="schema"/>, via its determination of 
<propref comp="ad" prop="target namespace"/>.</p>
 <p>The names for top-level attribute declarations are in their own
<termref def="key-symbolSpace">symbol space</termref>.  The names of locally-scoped
attribute declarations reside in symbol spaces local to the type definition which contains
them.</p>
    </div3>
    <div3>
     <head>Constraints on XML Representations of Attribute Declarations</head>
 <constraintnote id="src-attribute" type="src">
  <head>Attribute Declaration Representation OK</head>
  <p>In addition to the conditions imposed on <eltref ref="attribute"/> element
information items by the schema for schemas,
   <olist role="and.apply">
    <item>
     <p><code>default</code> and <code>fixed</code> <rfc2119>must not</rfc2119> both be present.</p>
    </item>
    <item>
     <p>If <code>default</code> and <code>use</code> are both present,
<code>use</code> <rfc2119>must</rfc2119> have the <termref def="key-vv">actual value</termref> <code>optional</code>.</p>
    </item>
    <item>
     <p>If the item's parent is not <eltref ref="schema"/>, then
      <olist role="and">
       <item>
     <p>One of <code>ref</code> or <code>name</code> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> present, but not both.</p>
    </item>
       <item>
        <p>If <code>ref</code> is present, then all of <eltref ref="simpleType"/>,
<code>form</code> and <code>type</code> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> absent.</p>
       </item>
      </olist>
     </p>
    </item>
    <item>
     <p><code>type</code> and <eltref ref="simpleType"/>
<rfc2119>must not</rfc2119> both be present.</p>
    </item>
    <item>
     <p>The corresponding attribute
declaration <rfc2119>must</rfc2119> satisfy the conditions set out in
<specref ref="coss-attribute"/>.</p>
    </item>
   </olist>
  </p>
 </constraintnote>
    </div3>
    <div3>
     <head>Attribute Declaration Validation Rules</head>
   <constraintnote type="cvc" id="cvc-attribute">
     <head>Attribute Locally Valid</head>
     <p>For an attribute information item to be locally <termref def="key-vn">valid</termref> 
with respect to an attribute declaration 
      <olist role="and">
       <item id="c-a1">
        <p>The declaration <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is not</phrase> <termref def="key-null">absent</termref> 
(see <specref ref="conformance-missing"/> for
how this can fail to be the case).</p>
       </item>
       <item id="c-a2">
        <p>Its <propref comp="ad" prop="type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is not</phrase> absent.</p>
       </item>
       <item id="c-sva">
        <p>The item's <termref def="key-nv">normalized value</termref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> locally <termref def="key-vn">valid</termref> 
with respect to that <propref comp="ad" prop="type definition"/> 
as per <specref ref="cvc-simple-type"/>.</p>
       </item>
       <item>
        <p>The item's <termref def="key-vv">actual value</termref> 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">matches</phrase>
 the <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="vc_a" prop="value"/></phrase> of the <propref comp="ad" prop="value constraint"/>, if it is
present and <phrase dg="ep01">its <propref comp="vc_a" prop="variety"/> is </phrase><pt>fixed</pt>.</p>
       </item>
      </olist>
     </p>
    </constraintnote>
    <constraintnote id="cvc-assess-attr" type="cvc">
     <head>Schema-Validity Assessment (Attribute)</head>
     <p>The schema-validity assessment of an attribute information item depends
on its <termref def="key-vn">validation</termref> alone.</p>
  <p><termdef id="key-dd" term="context-determined declaration">During <termref def="key-vn">validation</termref>, associations
between element and attribute information items among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>
and <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> on the one hand, and element and attribute
declarations on the other, are established as a side-effect.  Such
declarations are called the <term>context-determined declarations</term></termdef>. 
See <clauseref ref="c-ctma"/> (in <specref ref="cvc-complex-type"/>) for
attribute declarations, <clauseref ref="c-cdde"/> (in <specref ref="cvc-particle"/>) for element
declarations.</p>
  <p>For an attribute information item's schema-validity to have been assessed
      <olist role="and">
       <item>
        <p>A <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
 attribute declaration
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> known for it, namely
         <olist role="orval">
          <item>
           <p>A declaration which has been established as its <termref def="key-dd">context-determined declaration</termref>;</p>
          </item>
          <item id="c-adbyr">
           <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
not <pt>skip</pt>.</p>
          </item>
          <item id="c-ad" dg="rq144si">
           <p>A declaration was stipulated by the processor (see <specref ref="validation_outcome"/>).</p>
          </item>
         </olist>
        </p>
       </item>
       <item>
        <p>Its <termref def="key-vn">validity</termref> with respect to that
declaration 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> 
been evaluated as per <specref ref="cvc-attribute"/>.</p>
       </item>
       <item>
        <p>Both <clauseref ref="c-a1"/> and <clauseref ref="c-a2"/> of <specref ref="cvc-attribute"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> satisfied.</p>
       </item>
      </olist>
     </p>
<p><termdef id="key-svaa" term="strictly assessed" role="local">For
attributes, there is no difference between assessment and strict
assessment, so <!--*
* material suppressed here by diff group iff *
*--> 
the attribute information item has
been <term>strictly assessed</term></termdef><phrase dg="iff">
if and only if its schema-validity has been assessed</phrase>.</p> 
    </constraintnote>
    </div3>
    <div3>
     <head>Attribute Declaration Information Set Contributions</head>
    <constraintnote id="sic-a-outcome" type="sic">
     <head>Assessment Outcome (Attribute)</head>
<issue id="RQ-143i" role="1.1" status="open">
<!--*
  <p><loc href="&reqs;#AssessmentOfAtts" target="reqs">RQ-143 (AssessmentOfAtts)</loc></p>
*-->
<p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2827" target="reqs">Issue 2827 (RQ-143 attribute assessment)</loc></p>
      <p>An attribute with no type declaration cannot be 'assessed', as defined
by (Schema-Validity Assessment (Attribute)), so it will never have any PSVI
properties, whereas it would be natural for it to have [validation attempted] =
none and [validity] = notKnown.  This will be fixed.</p>
      <resolution>
       <p>It is likely that the current backward-chaining approach to defining
schema-validity assessment will be reworked, in which case this will get fixed as
part of that.</p>
      </resolution>
	      </issue>
     <p>If<!--*
* material suppressed here by diff group iff.144.r *
*--> the schema-validity of an attribute information item has been assessed
as per <specref ref="cvc-assess-attr"/>, then in the <termref def="key-psvi">post-schema-validation infoset</termref> it 
<phrase dg="opt.144">has</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> properties as follows:</p>
     <proplist role="psvi" item="attribute">
       <propdef name="validation context" id="a-validation_context">The nearest ancestor element information
item with a <propref role="psvi" ref="e-schema_information"/> property.</propdef>
       <propdef name="validity" id="a-validity">
        <olist role="Caseval">
       <item>
        <p role="if">it was <termref def="key-svaa">strictly assessed</termref></p>
        <p role="then">
         <olist role="caseval">
          <item>
           <p role="if">it was
<termref def="key-vn">valid</termref> as defined by <specref ref="cvc-attribute"/></p>
           <p role="then"><pt>valid</pt>;</p>
          </item>
          <item>
           <p role="otherwise"><pt>invalid</pt>.</p>
          </item>
         </olist> 
        </p>
       </item>
       <item>
        <p role="otherwise"><pt>notKnown</pt>.</p>
       </item>
      </olist>
       </propdef>
       <propdef name="validation attempted" id="a-validation_attempted">
       <olist role="Caseval">
       <item>
        <p role="if">it was <termref def="key-svaa">strictly assessed</termref></p>
        <p role="then"><pt>full</pt>;</p>
       </item>
       <item>
        <p role="otherwise"><pt>none</pt>.</p>
       </item>
      </olist></propdef>
       <propdef name="schema specified" id="a-schema_specified"><pt>infoset</pt>.  See <specref ref="sic-attrDefault"/> for the other possible value.</propdef>
      </proplist>
    </constraintnote>
    <constraintnote type="sic" id="sic-attr-error-code">
     <head>Validation Failure (Attribute)</head>
     <p>If<phrase dg="iff.144"> and only if</phrase> the local <termref def="key-vn">validity</termref>, as defined 
by <specref ref="cvc-attribute"/>
above, of an attribute information item has been assessed,
<phrase dg="iff.144">then</phrase> in the <termref def="key-psvi">post-schema-validation infoset</termref> the item 
<phrase dg="opt.144">has</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> a property:</p>
     <proplist role="psvi" item="attribute">
      <propdef id="a-schema_error_code" name="schema error code">
       <olist role="Caseval">
        <item>
         <p role="if">the item is <!--*
* material suppressed here by diff group b1892 *
*--><phrase dg="b1892"><termref def="key-vn">invalid</termref></phrase></p>
         <p role="then">a list.  Applications wishing to provide
information as to the reason(s) for the <termref def="key-vn">validation</termref> failure are encouraged to record one or more
error codes (see <specref ref="outcomes"/>) herein.</p>
        </item>
        <item>
         <p role="otherwise"><termref def="key-null">absent</termref>.</p>
        </item>
       </olist>
      </propdef>
     </proplist>
    </constraintnote>

    <constraintnote type="sic" id="sic-attr-decl">
     <head>Attribute Declaration</head>
     <p>If<!--*
* material suppressed here by diff group iff.144.r *
*--> an attribute information item is <termref def="key-vn">valid</termref> with respect to an attribute declaration
as per <specref ref="cvc-attribute"/><phrase dg="iff">,</phrase> then in the <termref def="key-psvi">post-schema-validation infoset</termref> the attribute information item
<!--*
* material suppressed here by diff group rq144nv *
*--><phrase dg="rq144nv">has</phrase> a
property:</p>
     <proplist role="psvi" item="attribute">
      <propdef id="a-declaration" name="attribute declaration">
       An <termref def="key-iso">item isomorphic</termref> to the declaration component itself.
      </propdef>
     </proplist>
    </constraintnote>

    <constraintnote type="sic" id="sic-attrType">
     <head>Attribute Validated by Type</head>
     <p>If<!--*
* material suppressed here by diff group iff.144.r *
*--> <clauseref ref="c-sva"/> of <specref ref="cvc-attribute"/> applies with respect to an attribute information
item, <phrase dg="iff">then</phrase> in the <termref def="key-psvi">post-schema-validation infoset</termref> the
attribute information item <phrase dg="opt.144">has</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> <!--*
* material suppressed here by diff group rq144nv *
*--><phrase dg="rq144nv">the
properties</phrase>:</p>
     <proplist role="psvi" item="attribute">
      
<propdef id="a-schema_normalized_value" name="schema normalized value">
The <termref def="key-nv">normalized value</termref> of the item as <termref def="key-vn">validated</termref>.
</propdef>

<propdef id="a-type_definition" name="type definition" dg="rq144nv">An <termref def="key-iso">item isomorphic</termref> to
the relevant attribute declaration's <propref comp="ad" prop="type definition"/> component.</propdef>

<propdef id="a-type_definition_type" name="type definition type" dg="rq144nv"> <pt>simple</pt>.</propdef>

<propdef id="a-type_definition_namespace" name="type definition namespace" dg="rq144nv">The <propref comp="std" prop="target namespace"/> of the <termref def="td">type
definition</termref>.</propdef>

<propdef name="type definition anonymous" id="a-type_definition_anonymous" dg="rq144nv"><pt>true</pt>
if the <propref comp="std" prop="name"/> of the <termref def="td">type
definition</termref> is <termref def="key-null">absent</termref>,
otherwise <pt>false</pt>.</propdef>

<propdef name="type definition name" id="a-type_definition_name" dg="rq144nv">The <propref comp="std" prop="name"/> of the
<termref def="td">type definition</termref>, if <phrase diff="nsq-del" dg="rq144wgno">it</phrase><phrase diff="nsq-add" dg="rq144wgno">the
<propref comp="std" prop="name"/></phrase> is not <termref def="key-null">absent</termref>.  If <phrase diff="nsq-del" dg="rq144wgno">it</phrase><phrase diff="nsq-add" dg="rq144wgno">the
<termref def="td">type definition</termref>'s
<propref comp="std" prop="name"/> property</phrase> is <termref def="key-null">absent</termref>, <phrase diff="nsq-add" dg="rq144wgno">then</phrase>
schema processors <rfc2119>may</rfc2119>, but need
not, provide a value which uniquely identifies this
type definition among those with the same target namespace.</propdef>

     </proplist>

<!--*
* material suppressed here by diff group rq144nv *
*-->

<!--*
* material suppressed here by diff group rq144nv *
*-->

<!--*
* material suppressed here by diff group rq144nv *
*-->

<!--*
* material suppressed here by diff group rq144nv *
*-->

<!--*
* material suppressed here by diff group rq144nv *
*-->

<note dg="rq144nv">
<p>The
<xpropref role="psviAnon">type definition type</xpropref>,
<xpropref role="psviAnon">type definition namespace</xpropref>,
<xpropref role="psviAnon">type definition name</xpropref>, and
<xpropref role="psviAnon">type definition anonymous</xpropref> properties
are redundant with the 
<xpropref role="psviAnon">type definition</xpropref> property; 
they are defined for the convenience of implementations
which wish to expose those specific properties 
but not the entire type definition.
</p>
</note>


<p dg="b2333b">If the <termref def="td">type
definition</termref> has <propref comp="std" prop="variety"/>
<pt>union</pt>, then calling <termdef id="a-key-amt" term="actual member type definition" role="local"> that <phrase dg="b2333c"><!--*
* material suppressed here by diff group b2333a *
*--><phrase dg="b2333a"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-basicmember">basic
member</xtermref> of its <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-transitivemembership">transitive
membership</xtermref></phrase> which actually <termref def="key-vn">validated</termref></phrase><!--*
* material suppressed here by diff group b2333c *
*--> the attribute item's <termref def="key-nv">normalized value</termref> <!--* <phrase
diff="add" dg="b2333c">was ultimately assigned</phrase> *--> the
<term>actual member type definition</term></termdef>, there <phrase dg="opt.144">are</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> <!--*
* material suppressed here by diff group rq144nv *
*--><phrase dg="rq144nv">four</phrase> additional properties:</p>

<!--*
* material suppressed here by diff group b2333b *
*-->
<!--*
* material suppressed here by diff group b2333b *
*-->

<proplist role="psvi" item="attribute">
<propdef name="member type definition" id="a-member_type_definition" dg="rq144nv">
an <termref def="key-iso">item isomorphic</termref> to 
the <termref def="a-key-amt"/>.
<!--* that <xtermref
href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-basicmember">basic member</xtermref> of its
<xtermref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-transitivemembership">transitive
membership</xtermref> 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>

<propdef name="member type definition namespace" id="a-member_type_definition_namespace">The <propref comp="std" prop="target namespace"/> of the <termref def="a-key-amt">actual
member type definition</termref>.</propdef>
<propdef name="member type definition anonymous" id="a-member_type_definition_anonymous"><pt>true</pt> if the <propref comp="std" prop="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>
<propdef name="member type definition name" id="a-member_type_definition_name">The <propref comp="std" prop="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 <termref def="key-null">absent</termref>, schema processors <rfc2119>may</rfc2119>, but need
not, provide a value unique to the definition.</propdef>
</proplist>

<p>The first (<termref def="key-iso">item isomorphic</termref>)
alternative above is provided for applications such as query
processors which need access to the full range of details about an
item's <termref def="key-va">assessment</termref>, for example the
type hierarchy; the second, for lighter-weight processors for whom
representing the significant parts of the type hierarchy as
information items might be a significant burden.</p>
     
<p>Also, if<phrase dg="iff"> and only if</phrase> the declaration has a <propref comp="ad" prop="value constraint"/>, the item <phrase dg="opt.144">has</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> a property:</p>

     <proplist role="psvi" item="attribute">
      <propdef id="a-schema_default" name="schema default">The 
       <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129"><propref comp="vc_a" prop="lexical form"/> of the </phrase>declaration's <propref comp="ad" prop="value constraint"/><!--*
* material suppressed here by diff group ep01 *
*--><!--*
* material suppressed here by diff group rq129 *
*-->.</propdef>
     </proplist>
     <p>If<!--*
* material suppressed here by diff group iff.144.r *
*--> the attribute information item was not <termref def="key-svaa">strictly assessed</termref>, then instead of the values specified above,
      <olist>
       <item>
        <p>The item's <propref ref="a-schema_normalized_value" role="psvi"/>
property has
the <termref def="key-iv">initial value</termref> of the item as its value;</p>
       </item>
       <item>
        <p>The <propref ref="a-type_definition" role="psvi"/> and
<propref ref="a-member_type_definition" role="psvi"/> properties, or their
alternatives, are based on the <termref def="simple-ur-type-itself">simple ur-type definition</termref>.</p>
       </item>
      </olist>
     </p>   
    </constraintnote>
    </div3>
    <div3 id="coss-attribute">
     <head>Constraints on Attribute Declaration Schema Components</head>
  <p>All attribute declarations (see <specref ref="cAttribute_Declarations"/>) <rfc2119>must</rfc2119> satisfy the following constraints.</p>
  <constraintnote type="cos" id="a-props-correct">
   <head>Attribute Declaration Properties Correct</head>
   <olist role="And">
    <item>
     <p>The values of the properties of an attribute declaration <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as described in
the property tableau in <specref ref="Attribute_Declaration_details"/>, modulo the impact 
of <specref ref="conformance-missing"/>.</p>
    </item>
    <item>
     <p>if there is a <propref comp="ad" prop="value constraint"/>, 
<phrase dg="iff">then</phrase>
      <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129">it is a valid default with respect to the <propref comp="ad" prop="type definition"/> as defined in <specref ref="cos-valid-simple-default"/></phrase>.
     </p>
    </item>
    <item>
     <p>If the <propref comp="ad" prop="type definition"/> is or is <!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> 
from <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref><phrase dg="iff">,</phrase> then there 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is no</phrase>
<propref comp="ad" prop="value constraint"/>.</p>
    </item>
   </olist>
  </constraintnote>
     <constraintnote type="cos" id="cos-valid-simple-default" dg="rq129">
      <head>Simple Default Valid</head>
      <p>For a Value Constraint to be a valid default with respect to a <compref ref="std"/>
       <olist role="andtest">
        <item>
         <p>the Value Constraint's <propref comp="vc_a" prop="lexical form"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase>
<termref def="key-vn">valid</termref> with respect to that <compref ref="std"/> as defined by <specref ref="cvc-simple-type"/>.</p></item>
        <item>
         <p>the Value Constraint's <propref comp="vc_a" prop="lexical form"/>
maps to its <propref comp="vc_a" prop="value"/> in that <compref ref="std"/>'s value space.</p>
        </item>
       </olist>
      </p>
     </constraintnote>
  <constraintnote type="cos" id="no-xmlns">
   <head><code>xmlns</code> Not Allowed</head>
   <p>The <propref comp="ad" prop="name"/> of an attribute declaration <rfc2119>must not</rfc2119> match <code>xmlns</code>.</p>
<note>
<p>The <propref comp="ad" prop="name"/> of an attribute is an <termref def="gloss-NCName">NCName</termref>, which implicitly
prohibits attribute declarations of the form <code>xmlns:*</code>.</p>
</note>
  </constraintnote>
  <constraintnote type="cos" id="no-xsi">
   <head><code>xsi:</code> Not Allowed</head>
   <p>The <propref comp="ad" prop="target namespace"/> of an attribute declaration,
whether local or top-level, <rfc2119>must not</rfc2119> match <code>http://www.w3.org/2001/XMLSchema-instance</code>
(unless it is one of the four built-in declarations given in the next section).</p>
   <note>
<p>This reinforces the special status of these attributes, so that they not
only <emph>need</emph> not be declared to be allowed in instances, but
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><rfc2119>must not</rfc2119></phrase> be declared.  It also removes any temptation to 
experiment with supplying global or fixed values
for e.g. <code>xsi:type</code> or <code>xsi:nil</code>, which would be
seriously misleading, as they would have no effect.</p>
</note>
  </constraintnote>
    </div3>
    <div3>
     <head>Built-in Attribute Declarations</head>
     <p>There are four attribute declarations present in every
schema by definition:</p>
    <schemaComp id="xsi.type">
     <head>Attribute Declaration for the 'type' attribute</head>
     <pvlist>
      <pvpair comp="ad" prop="name"><code>type</code></pvpair>
      <pvpair comp="ad" prop="target namespace"><code>http://www.w3.org/2001/XMLSchema-instance</code></pvpair>
      <pvpair comp="ad" prop="type definition">The built-in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#QName">QName</xtermref> simple
type definition</pvpair>
      <pvpair comp="ad" prop="scope">A <compref ref="sc_a"/> as follows:
       <pvlist>
        <pvpair comp="sc_a" prop="variety"><pt>global</pt></pvpair>
        <pvpair comp="sc_a" prop="parent" dg="ep01"><termref def="key-null">absent</termref></pvpair>
       </pvlist>
      </pvpair>
      <pvpair comp="ad" prop="value constraint"><termref def="key-null">absent</termref></pvpair>
      <pvpair comp="ad" prop="annotations"><termref def="key-null">absent</termref></pvpair>
     </pvlist>
    </schemaComp>
     <schemaComp id="xsi.nil">
     <head>Attribute Declaration for the 'nil' attribute</head>
      <pvlist>
      <pvpair comp="ad" prop="name"><code>nil</code></pvpair>
      <pvpair comp="ad" prop="target namespace"><code>http://www.w3.org/2001/XMLSchema-instance</code></pvpair>
      <pvpair comp="ad" prop="type definition">The built-in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#boolean">boolean</xtermref> simple
type definition</pvpair>
      <pvpair comp="ad" prop="scope">A <compref ref="sc_a"/> as follows:
       <pvlist>
        <pvpair comp="sc_a" prop="variety"><pt>global</pt></pvpair>
        <pvpair comp="sc_a" prop="parent" dg="ep01"><termref def="key-null">absent</termref></pvpair>
       </pvlist>
      </pvpair>
      <pvpair comp="ad" prop="value constraint"><termref def="key-null">absent</termref></pvpair>
      <pvpair comp="ad" prop="annotations"><termref def="key-null">absent</termref></pvpair>
     </pvlist>
     </schemaComp>
     <schemaComp id="xsi.schemaLocation">
     <head>Attribute Declaration for the 'schemaLocation' attribute</head>
      <pvlist>
      <pvpair comp="ad" prop="name"><code>schemaLocation</code></pvpair>
      <pvpair comp="ad" prop="target namespace"><code>http://www.w3.org/2001/XMLSchema-instance</code></pvpair>
      <pvpair comp="ad" prop="type definition">An anonymous simple type definition, as follows:
       <pvlist>
        <pvpair comp="std" prop="name"><termref def="key-null">absent</termref></pvpair>
        <pvpair comp="std" prop="target namespace"><code>http://www.w3.org/2001/XMLSchema-instance</code></pvpair>
        <pvpair comp="std" prop="base type definition">The built in <termref def="simple-ur-type-itself">simple ur-type definition</termref></pvpair>
        <pvpair comp="std" prop="facets"><termref def="key-null">absent</termref></pvpair>
        <pvpair comp="std" prop="variety"><pt>list</pt></pvpair>
        <pvpair comp="std" prop="item type definition">The built-in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#anyURI">anyURI</xtermref> simple
type definition</pvpair>
        <pvpair comp="std" prop="annotations"><termref def="key-null">absent</termref></pvpair>
       </pvlist>
      </pvpair>
      <pvpair comp="ad" prop="scope">A <compref ref="sc_a"/> as follows:
       <pvlist>
        <pvpair comp="sc_a" prop="variety"><pt>global</pt></pvpair>
        <pvpair comp="sc_a" prop="parent" dg="ep01"><termref def="key-null">absent</termref></pvpair>
       </pvlist>
      </pvpair>
      <pvpair comp="ad" prop="value constraint"><termref def="key-null">absent</termref></pvpair>
      <pvpair comp="ad" prop="annotations"><termref def="key-null">absent</termref></pvpair>
     </pvlist>
     </schemaComp>
     <schemaComp id="xsi.noNamespaceSchemaLocation">
     <head>Attribute Declaration for the 'noNamespaceSchemaLocation' attribute</head>
      <pvlist>
      <pvpair comp="ad" prop="name"><code>noNamespaceSchemaLocation</code></pvpair>
      <pvpair comp="ad" prop="target namespace"><code>http://www.w3.org/2001/XMLSchema-instance</code></pvpair>
      <pvpair comp="ad" prop="type definition">The built-in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#anyURI">anyURI</xtermref> simple
type definition</pvpair>
      <pvpair comp="ad" prop="scope">A <compref ref="sc_a"/> as follows:
       <pvlist>
        <pvpair comp="sc_a" prop="variety"><pt>global</pt></pvpair>
        <pvpair comp="sc_a" prop="parent" dg="ep01"><termref def="key-null">absent</termref></pvpair>
       </pvlist> 
      </pvpair>
      <pvpair comp="ad" prop="value constraint"><termref def="key-null">absent</termref></pvpair>
      <pvpair comp="ad" prop="annotations"><termref def="key-null">absent</termref></pvpair>
     </pvlist>
     </schemaComp>
    </div3>
   </div2>
   <div2 id="cElement_Declarations">
    <head>Element Declarations</head>
       <p>Element declarations provide for:</p>
    <ulist>
     <item><p>Local <termref def="key-vn">validation</termref> of element information item values using a type definition;</p></item>
     <item><p>Specifying default or fixed values for an element information items;</p></item>
     <item><p>Establishing uniquenesses and reference constraint relationships among the values of related elements and
attributes;</p>
</item>
     <item><p>Controlling the substitutability of elements through the
mechanism of <termref def="key-equivalenceClass">element substitution groups</termref>.</p>
     </item>
    </ulist>
    <note role="example">
     <eg xml:space="preserve">&lt;xs:element name="PurchaseOrder" type="PurchaseOrderType"/&gt;

&lt;xs:element name="gift"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:sequence&gt;
   &lt;xs:element name="birthday" type="xs:date"/&gt;
   &lt;xs:element ref="PurchaseOrder"/&gt;
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;
</eg>
     <p>XML representations of several different types of element declaration</p>
    </note>
    <div3 id="Element_Declaration_details">
     <head>The Element Declaration Schema Component</head>
<p>The element declaration schema component has the following
properties:</p>

    <compdef name="Element Declaration" abbrev="ed" showAKO="true"/>
     <microCompdef name="Scope" abbrev="sc_e" dg="ep01"/>
    <microCompdef name="Value Constraint" abbrev="vc_e" dg="ep01"/>
<p>The <propref comp="ed" prop="name"/> property <rfc2119>must</rfc2119> match the local part of the names
of element information items being <termref def="key-vn">validated</termref>.</p>
     <p>A <propref comp="ed" prop="scope"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">with <propref comp="sc_e" prop="variety"/></phrase> <pt>global</pt> identifies element declarations
available for use in content models throughout the schema.  Locally scoped declarations are available for use only within the
<phrase dg="scope-1973">complex type</phrase><!--*
* material suppressed here by diff group scope-1973 *
*--> identified by the <propref comp="ed" prop="scope"/><phrase dg="ep01">'s <propref comp="sc_e" prop="parent"/></phrase> property. <phrase dg="scope-1973"> This property is <termref def="key-null">absent</termref> in the case of declarations within named model groups:  their scope will be determined when they are used in the construction of complex type definitions.</phrase>
</p>
    <p>A <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
 value of the <propref comp="ed" prop="target namespace"/> property provides for <termref def="key-vn">validation</termref> of
namespace-qualified element information items.  <termref def="key-null">Absent</termref> values of
<propref comp="ed" prop="target namespace"/> <termref def="key-vn">validate</termref> unqualified items.</p>
<p>An element information item is <termref def="key-vn">valid</termref>
<phrase dg="iff">only </phrase>if it satisfies 
the <propref comp="ed" prop="type definition"/>.  For such an
item, schema information set contributions appropriate to the <propref comp="ed" prop="type definition"/> are added to the
corresponding element information item in the <termref def="key-psvi">post-schema-validation infoset</termref>.
</p>
<p>If <propref comp="ed" prop="nillable"/> is <pt>true</pt>, then an
element <!--*
* material suppressed here by diff group ep08a *
*--><phrase dg="ep08a">can</phrase> also be <termref def="key-vn">valid</termref> if it 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 no text or element content
despite a <propref comp="ctd" prop="content type"/> which would otherwise 
require content. Formal details of
element <termref def="key-vn">validation</termref> are described in
<specref ref="cvc-elt"/>.</p>
<p><propref comp="ed" prop="value constraint"/> establishes a default or fixed
value for an element.  If <phrase dg="ep01">a <propref comp="ed" prop="value constraint"/> with a <propref comp="vc_e" prop="variety"/> of </phrase><pt>default</pt> is <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">present</phrase>, and if the element
being <termref def="key-vn">validated</termref> is empty, then <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129">the <propref comp="ed" prop="value constraint"/>'s <propref comp="vc_e" prop="lexical form"/></phrase> becomes the <propref role="psvi" ref="e-schema_normalized_value"/> of the <termref def="key-vn">validated</termref> element in the <termref def="key-psvi">post-schema-validation infoset</termref>.  If <pt>fixed</pt> is specified, then the element's content
<rfc2119>must</rfc2119> either be empty, in which case <pt>fixed</pt> behaves as <pt>default</pt>,
or its value <rfc2119>must</rfc2119> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">be intentical to</phrase> the <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ed" prop="value constraint"/>'s <propref comp="vc_e" prop="value"/></phrase>.</p>
     <note>
      <p>The provision of defaults for elements goes beyond what is possible in
XML<!--*
* material suppressed here by diff group fpwd *
*--> DTDs, and does not exactly correspond to defaults for attributes.  In
particular, an element with a non-empty <propref comp="ed" prop="value constraint"/> whose simple
type definition includes the empty string in its lexical space will
nonetheless never receive that value, because the <propref comp="ed" prop="value constraint"/> will override it.</p>
     </note>
<p><propref comp="s" prop="identity-constraint definitions"/> express constraints establishing uniquenesses and reference relationships among the values of related elements and
attributes.  See <specref ref="cIdentity-constraint_Definitions"/>.</p>
<p>Element declarations are potential members of the substitution group, if any, identified
by <propref comp="ed" prop="substitution group affiliation"/>.  Potential membership is transitive but not symmetric;  an element
declaration is a potential member of any group of which its <propref comp="ed" prop="substitution group affiliation"/> is a potential member.  
Actual membership <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*-->
be blocked by the effects of <propref comp="ed" prop="substitution group exclusions"/> or <propref comp="ed" prop="disallowed substitutions"/>, see below.</p>
<p>An empty <propref comp="ed" prop="substitution group exclusions"/> allows a declaration to be nominated as
the <propref comp="ed" prop="substitution group affiliation"/> of other element declarations having the same <propref comp="ed" prop="type definition"/> or
types <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> therefrom.  The explicit
values of <propref comp="ed" prop="substitution group exclusions"/> rule out element declarations having types which
are <pt>extension</pt>s or <pt>restriction</pt>s respectively of <propref comp="ed" prop="type definition"/>.  If
both values are specified, then the declaration <rfc2119>must not</rfc2119> be nominated as the
<propref comp="ed" prop="substitution group affiliation"/> of any other declaration.</p>

<p>The supplied values for <propref comp="ed" prop="disallowed substitutions"/> determine
whether an element declaration appearing in a <termref def="key-contentModel">content model</termref> will be prevented from additionally
<termref def="key-vn">validating</termref> elements (a) with an <specref ref="xsi_type"/> that identifies an
<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
substitution group headed by the declared element.
If <propref comp="ed" prop="disallowed substitutions"/> is empty, then all <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> types and substitution group members are allowed.</p>
<p>Element declarations for which <propref comp="ed" prop="abstract"/> is <pt>true</pt> can appear in
content models only when substitution is allowed;
such declarations 
<!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><rfc2119>must not</rfc2119></phrase> 
themselves ever be used to <termref def="key-vn">validate</termref> element content.</p>
     <p>See <specref ref="cAnnotations"/> for information on the role of the
<propref comp="ed" prop="annotations"/> property.</p>
    </div3>
    <div3 id="declare-element">
<head>XML Representation of Element Declaration Schema Components</head>
<p>The XML representation for an element declaration schema component is an
<eltref ref="element"/> element information item.  It specifies a type
definition for an element either by reference or explicitly, and <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> provide
occurrence and default information.  The correspondences between the
properties of the information item and
properties of the component(s) it corresponds to are as follows:</p>
<reprdef>
 <reprelt eltname="element" type="element"/>
<p>If the <eltref ref="element"/> element information item has <eltref ref="schema"/> as its parent, the corresponding schema component is as
follows:</p>
<reprcomp abstract="Element Declaration" ref="Element_Declaration_details">  

<propmap comp="ed" prop="name">The <termref def="key-vv">actual value</termref> of the <code>name</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>.</propmap>

<propmap comp="ed" prop="target namespace">The <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the parent <eltref ref="schema"/> element information item, or <termref def="key-null">absent</termref> if there is none.</propmap>
  
<propmap comp="ed" prop="scope"><phrase dg="ep01">A
<compref ref="sc_e"/> as follows</phrase>
    <pvlist>
     <pvpair comp="sc_e" prop="variety"><pt>global</pt></pvpair>
     <pvpair comp="sc_e" prop="parent" dg="ep01"><termref def="key-null">absent</termref></pvpair>
    </pvlist>
</propmap>

<propmap comp="ed" prop="type definition">The type definition
corresponding to the <eltref ref="simpleType"/> or <eltref ref="complexType"/> element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if
either is present, otherwise the type definition <termref def="src-resolve">resolved</termref> to by the <termref def="key-vv">actual value</termref> of the
<code>type</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, otherwise the
<propref comp="ed" prop="type definition"/> of the element declaration
<termref def="src-resolve">resolved</termref> to by the <termref def="key-vv">actual value</termref> of
the <code>substitutionGroup</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present,
otherwise the <termref diff="nsq-del" def="ur-type-itself" dg="rq17">ur-type definition</termref><termref diff="nsq-add" def="any-type-itself" dg="rq17">definition of anyType</termref>.</propmap>

<propmap comp="ed" prop="nillable">The <termref def="key-vv">actual value</termref> of the <code>nillable</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <pt>false</pt>.</propmap>

<propmap comp="ed" prop="value constraint">If there is a
<code>default</code> or a <code>fixed</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, then
<!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">a <compref ref="vc_e"/> as follows</phrase>,
otherwise <termref def="key-null">absent</termref>. <termdef id="l-std" term="effective simple type definition" role="local" dg="ep01">Use the name <term>effective simple type
definition</term> for the <propref comp="ed" prop="type definition"/>,
if it is a simple type definition, or, if the <propref comp="ed" prop="type definition"/>'s <propref comp="ctd" prop="content type"/> has
<propref comp="ct" prop="variety"/> <pt>simple</pt>, that <propref comp="ctd" prop="content type"/>'s <propref comp="ct" prop="simple type definition"/>, or else the built-in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#string">string</xtermref> simple type
definition).</termdef>
  <pvlist>
   <pvpair comp="vc_e" prop="variety">either <pt>default</pt> or
<pt>fixed</pt>, as appropriate</pvpair>
   <pvpair comp="vc_e" prop="value">the <termref def="key-vv">actual value</termref> (with respect to the
<termref def="l-std"/>) of <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">the</phrase>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></pvpair>
   <pvpair comp="vc_e" prop="lexical form" dg="rq129">the
<termref def="key-nv">normalized value</termref> (with respect to the <termref def="l-std"/>) of the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></pvpair>
  </pvlist></propmap>
  <propmap comp="ed" prop="identity-constraint definitions">A set consisting of the
identity-constraint-definitions corresponding to all the <eltref ref="key"/>, <eltref ref="unique"/> and <eltref ref="keyref"/> element information items in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, otherwise the empty set.</propmap>
  <propmap comp="ed" prop="substitution group affiliation">The element declaration <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the
<code>substitutionGroup</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  <propmap comp="ed" prop="disallowed substitutions">A set depending on the <termref def="key-vv">actual value</termref> of the
<code>block</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise on the <termref def="key-vv">actual value</termref> of the
<code>blockDefault</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the ancestor <eltref ref="schema"/> element
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
 <olist role="caseval">
  <item>
   <p role="if">the <local>EBV</local> is the empty string</p>
   <p role="then">the empty set;</p>
  </item>
  <item>
   <p role="if">the <local>EBV</local> is <code>#all</code></p>
   <p role="then"><code>{</code><pt>extension</pt>, <pt>restriction</pt>, <pt>substitution</pt><code>}</code>;</p>
  </item>
  <item>
   <p role="otherwise">a set with members drawn from the set above, each being present or
absent depending on whether the <termref def="key-vv">actual value</termref> (which is a list) contains an
equivalently named item.
   <note>
       <p>Although the <code>blockDefault</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of
<eltref ref="schema"/> <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> include values other than
<pt>extension</pt>, <pt>restriction</pt> or <pt>substitution</pt>,
those values are ignored in the determination of <propref comp="ed" prop="disallowed substitutions"/> for element declarations (they
<emph>are</emph> used elsewhere).</p>
      </note>
   </p>
  </item>
 </olist>
  </propmap>
  <propmap comp="ed" prop="substitution group exclusions">As for <propref comp="ed" prop="disallowed substitutions"/> above, but using the
<code>final</code> and <code>finalDefault</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> in place of the
<code>block</code> and <code>blockDefault</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> and with the
relevant set being <code>{</code><pt>extension</pt>, <pt>restriction</pt><code>}</code>.</propmap>
  <propmap comp="ed" prop="abstract">The <termref def="key-vv">actual value</termref> of the <code>abstract</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <pt>false</pt>.</propmap>
  <propmap comp="ed" prop="annotations">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
</reprcomp>
 <p>otherwise if the <eltref ref="element"/> element information item has
<eltref ref="complexType"/> or <eltref ref="group"/> as an ancestor and the
<code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is absent, the corresponding schema components
are as follows (unless <code>minOccurs=maxOccurs=0</code>, in which case the item
corresponds to no component at all):</p>
 <reprcomp abstract="Particle" ref="Particle_details">
  <propmap comp="p" prop="min occurs">The <termref def="key-vv">actual value</termref> of the <code>minOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <code>1</code>.</propmap>
  <propmap comp="p" prop="max occurs"><pt>unbounded</pt>, if the <code>maxOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> equals <pt>unbounded</pt>, otherwise the <termref def="key-vv">actual value</termref> of the <code>maxOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <code>1</code>.</propmap>
  <propmap comp="p" prop="term">A (local) element declaration as given below.</propmap>
  
</reprcomp>
 <p> 
An element declaration as in the first case above, with the exception of its <propref comp="ed" prop="target namespace"/> and <propref comp="ed" prop="scope"/> properties, which are as below:</p>
 <reprcomp abstract="Element Declaration" ref="Element_Declaration_details">
  <propmap comp="ed" prop="target namespace">If <code>form</code> is present and its
<termref def="key-vv">actual value</termref> is <code>qualified</code>, or if <code>form</code> is absent and the
<termref def="key-vv">actual value</termref> of <code>elementFormDefault</code> on the <eltref ref="schema"/>
ancestor is <code>qualified</code>, then the <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the parent <eltref ref="schema"/>
element information item, or <termref def="key-null">absent</termref> if there
is none, otherwise <termref def="key-null">absent</termref>.</propmap>
  <propmap comp="ed" prop="scope"><phrase dg="ep01">A <compref ref="sc_e"/> as follows:</phrase>
   <pvlist>
     <pvpair comp="sc_e" prop="variety" dg="ep01"><pt>local</pt></pvpair>
     <pvpair comp="sc_e" prop="parent">If the <eltref ref="element"/> element information item
has <eltref ref="complexType"/> as an ancestor, the <compref ref="ctd"/>
corresponding to that item, otherwise (the <eltref ref="element"/> element
information item is within a named <eltref ref="group"/> <phrase dg="scope-1973">definition</phrase><!--*
* material suppressed here by diff group scope-1973 *
*-->),
<termref def="key-null" dg="scope-1973">absent</termref><!--*
* material suppressed here by diff group scope-1973 *
*-->.</pvpair>
    </pvlist>
   </propmap>
 </reprcomp>
 <p>otherwise (the <eltref ref="element"/> element information item has
<eltref ref="complexType"/> or <eltref ref="group"/> as an ancestor and the
<code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present), the corresponding schema component is as
follows (unless <code>minOccurs=maxOccurs=0</code>, in which case the item
corresponds to no component at all):</p>
 <reprcomp abstract="Particle" ref="Particle_details">
  <propmap comp="p" prop="min occurs">The <termref def="key-vv">actual value</termref> of the <code>minOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <code>1</code>.</propmap>
  <propmap comp="p" prop="max occurs"><pt>unbounded</pt>, if the <code>maxOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> equals <pt>unbounded</pt>, otherwise the <termref def="key-vv">actual value</termref> of the <code>maxOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <code>1</code>.</propmap>
  <propmap comp="p" prop="term">The (top-level) element declaration <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>.</propmap>
</reprcomp>
</reprdef>


<p><eltref ref="element"/> corresponds to an element declaration, and allows
the type definition of that declaration to be specified either by reference or
by explicit inclusion.</p>
  <p><eltref ref="element"/>s within <eltref ref="schema"/> produce
<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
built-in or pre-declared type definition.  Otherwise an
anonymous <eltref ref="simpleType"/> or <eltref ref="complexType"/> is provided inline.</p>
 <p>Element information items <termref def="key-vn">validated</termref> by a top-level 
declaration <rfc2119>must</rfc2119> be qualified with the
<propref comp="ed" prop="target namespace"/> of that 
declaration<!--*
* material suppressed here by diff group iff *
*--><phrase dg="iff">.
If the 
<propref comp="ed" prop="target namespace"/> is <termref def="key-null">absent</termref>,
the item <rfc2119>must</rfc2119> be unqualified.</phrase>
Control over whether element information items <termref def="key-vn">validated</termref> by a local declaration <rfc2119>must</rfc2119> be similarly qualified or not
is provided by the <code>form</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, whose default is provided
by the <code>elementFormDefault</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> on the enclosing <eltref ref="schema"/>, via its determination of <propref comp="ed" prop="target namespace"/>.</p>
<p>As noted above the names for top-level element declarations are in a separate
<termref def="key-symbolSpace">symbol space</termref> from the symbol spaces for
the names of type definitions, so there can (but need
not be) a simple or complex type definition with the same name as a
top-level element.  As with attribute names, the names of locally-scoped
element declarations with no <propref comp="ed" prop="target namespace"/> reside in symbol spaces local to the type definition which contains
them.</p>

  <p>Note that the above allows for two levels of defaulting for unspecified
type definitions.  An <eltref ref="element"/> with no referenced or included type definition will
correspond to an element declaration which has the same type definition as the
head of its substitution group if it identifies one, otherwise the <termref diff="nsq-del" def="key-urType" dg="rq17">ur-type definition</termref><termref diff="nsq-add" def="key-anyType" dg="rq17">definition of anyType</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 (nearly) the most general, validating any combination of text and element content and allowing any attributes, and providing for recursive validation where possible.</p>

 <p>See below at <specref ref="declare-key"/> for <eltref ref="key"/>, <eltref ref="unique"/> and <eltref ref="keyref"/>.</p>


<note role="example">
<eg xml:space="preserve">&lt;xs:element name="unconstrained"/&gt;

&lt;xs:element name="emptyElt"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:attribute ...&gt;. . .&lt;/xs:attribute&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;

&lt;xs:element name="contextOne"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:sequence&gt;
   &lt;xs:element name="myLocalElement" type="myFirstType"/&gt;
   &lt;xs:element ref="globalElement"/&gt;
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;

&lt;xs:element name="contextTwo"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:sequence&gt;
   &lt;xs:element name="myLocalElement" type="mySecondType"/&gt;
   &lt;xs:element ref="globalElement"/&gt;
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;</eg>
<p>The first example above declares an element whose type, by default, is 
<phrase diff="nsq-del" dg="rq17">the</phrase>
<termref diff="nsq-del" def="key-urType" dg="rq17">ur-type
definition</termref><!--* <termref def="key-anyType" diff="add" dg="rq17">definition
of anyType</termref>*--><termref diff="nsq-add" def="key-anyType" dg="rq17">anyType</termref>.  
<!--* NOT "whose type is the definition of anyType", unless you want me 
    * to recite "The name of the song is called ..." at every occasion. *-->
<!--* MSM notes that we're on our way to a spec in which the word 'ur-' 
    * does not occur.  I'm resisting the temptation to stop working on RQ-17
    * and do it now. Maybe later, as dessert. *-->
The second uses an embedded anonymous complex
type definition.</p>
<p>The last two examples illustrate the use of local element declarations.  Instances of <code>myLocalElement</code> within
<code>contextOne</code> will be constrained by <code>myFirstType</code>,
while those within <code>contextTwo</code> will be constrained by
<code>mySecondType</code>. </p>

</note>
<note>
<p>The possibility that differing attribute declarations and/or content models
would apply to elements with the same name in different contexts is an
extension beyond the expressive power of a DTD in XML<!--*
* material suppressed here by diff group fpwd *
*-->.</p>
</note>
  <note role="example">
   <eg xml:space="preserve"> &lt;xs:complexType name="facet"&gt;
  &lt;xs:complexContent&gt;
   &lt;xs:extension base="xs:annotated"&gt;
    &lt;xs:attribute name="value" use="required"/&gt;
   &lt;/xs:extension&gt;
  &lt;/xs:complexContent&gt;
 &lt;/xs:complexType&gt;

 &lt;xs:element name="facet" type="xs:facet" abstract="true"/&gt;

 &lt;xs:element name="encoding" substitutionGroup="xs:facet"&gt;
  &lt;xs:complexType&gt;
   &lt;xs:complexContent&gt;
    &lt;xs:restriction base="xs:facet"&gt;
     &lt;xs:sequence&gt;
      &lt;xs:element ref="annotation" minOccurs="0"/&gt;
     &lt;/xs:sequence&gt;
     &lt;xs:attribute name="value" type="xs:encodings"/&gt;
    &lt;/xs:restriction&gt;
   &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;

 &lt;xs:element name="period" substitutionGroup="xs:facet"&gt;
  &lt;xs:complexType&gt;
   &lt;xs:complexContent&gt;
    &lt;xs:restriction base="xs:facet"&gt;
     &lt;xs:sequence&gt;
      &lt;xs:element ref="annotation" minOccurs="0"/&gt;
     &lt;/xs:sequence&gt;
     &lt;xs:attribute name="value" type="xs:duration"/&gt;
    &lt;/xs:restriction&gt;
   &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
 &lt;/xs:element&gt;

 &lt;xs:complexType name="datatype"&gt;
  &lt;xs:sequence&gt;
   &lt;xs:element ref="facet" minOccurs="0" maxOccurs="unbounded"/&gt;
  &lt;/xs:sequence&gt;
  &lt;xs:attribute name="name" type="xs:NCName" use="optional"/&gt;
  . . .
 &lt;/xs:complexType&gt;
</eg>
   <p>An example from a previous version of the schema for datatypes.  The
<code>facet</code> type is defined
and the <code>facet</code> element is declared to use it. The <code>facet</code> element is abstract -- it's
<emph>only</emph> defined to stand as the head for a substitution group.  Two further
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
allowing <emph>either</emph> <code>period</code> or <code>encoding</code> (or
any other member of the group).</p>
  </note>
</div3>
    <div3>
     <head>Constraints on XML Representations of Element Declarations</head>
 <constraintnote id="src-element" type="src">
  <head>Element Declaration Representation OK</head>
  <p>In addition to the conditions imposed on <eltref ref="element"/> element
information items by the schema for schemas:
   <olist role="and">
    <item>
     <p><code>default</code> and <code>fixed</code> 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are not
both</phrase> present.</p>
    </item>
    <item>
     <p>If the item's parent is not <eltref ref="schema"/>, then
      <olist role="andtest">
       <item>
     <p>One of <code>ref</code> or <code>name</code> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> present, but not both.</p>
    </item>
       <item>
        <p>If <code>ref</code> is present, then all of <eltref ref="complexType"/>,
<eltref ref="simpleType"/>, <eltref ref="key"/>, <eltref ref="keyref"/>,
<eltref ref="unique"/>, <code>nillable</code>, <code>default</code>,
<code>fixed</code>, <code>form</code>, <code>block</code> and <code>type</code> 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> absent,
i.e. only <code>minOccurs</code>, <code>maxOccurs</code>, <code>id</code> 
<phrase dg="modals">and <eltref ref="annotation"/></phrase> are
allowed <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">to appear together with</phrase> 
<code>ref</code><!--*
* material suppressed here by diff group modals *
*-->.</p>
       </item>
      </olist>
     </p>
    </item>
    <item>
     <!--*
* material suppressed here by diff group modals *
*-->
     <p dg="modals"><!--*
* material suppressed here by diff group ep08a *
*--><phrase dg="ep08a">The <eltref ref="element"/> element does not have both a
<eltref ref="simpleType"/> or <eltref ref="complexType"/> child and a
type attribute.</phrase></p>
    </item>
    <item>
     <p>The corresponding particle and/or element declarations 
<!--*
* material suppressed here by diff group modals *
*--> satisfy the conditions set
out in <specref ref="coss-element"/> and <specref ref="coss-particle"/>.</p>
    </item>
   </olist>
  </p>
 </constraintnote>
    </div3>
    <div3 id="eldec_vr">
     <head>Element Declaration Validation Rules</head>
     <constraintnote type="cvc" id="cvc-elt">
      <head>Element Locally Valid (Element)</head>
      <p>For an element information item to be locally <termref def="key-vn">valid</termref> with respect to an element
       declaration
       <olist role="and">
	<item id="c-ea">
	 <p>The declaration <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is not</phrase> <termref def="key-null">absent</termref>.</p>
	</item>
	<item>
	 <p>Its <propref comp="ed" prop="abstract"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase>
	  <pt>false</pt>.</p>
	</item>
	<item>	 
	 <!--*
* material suppressed here by diff group modals *
*-->
	 <olist role="Ortest" dg="modals">
	  <item>
	   <p><propref comp="ed" prop="nillable"/> is <pt>false</pt>,
	    and there is no attribute information item among the
	    element information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> 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>
	  </item>
	  <item id="c-nl">
	   <!--* added after agreement between SG and MSM *-->
	   <p><propref comp="ed" prop="nillable"/> is <pt>true</pt>
	    and 
	    <olist role="ortest">
	     <item>
	      <p>There is no such attribute information item.</p>
	     </item>
	     <item>
	      <p>There is such an attribute information item,
	       and its <termref def="key-vv">actual value</termref> is <code>false</code>.</p>
	     </item>
	     <item>
	      <p>There is such an attribute information item,
	       and its <termref def="key-vv">actual value</termref> is <code>true</code>, and 
	       <olist role="andtest">
		<item>
		 <p>The element information item has no character or
		  element information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>.</p>
		</item>
		<item>
		 <p>There is no <!--*
* material suppressed here by diff group ep01 *
*--><propref comp="ed" prop="value constraint"/><phrase dg="ep01"> with <propref comp="vc_e" prop="variety"/> <pt>fixed</pt></phrase>.</p>
		</item>
	       </olist></p>
	     </item>
	    </olist></p>
	  </item>
	  <!--*
* material suppressed here by diff group abandoned *
*-->
	  <!--*
* material suppressed here by diff group abandoned *
*-->
	  <!--*
* material suppressed here by diff group abandoned *
*-->
	 </olist>
	</item>
	<item>
	 <p>If there is an attribute information item among the
	  element information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> 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
	  <olist role="andtest">
	   <item>
	    <p>The <termref def="key-nv">normalized value</termref> of that attribute information item
	     <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="key-vn">valid</termref> with
	     respect to the built-in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#QName">QName</xtermref> simple type, as
	     defined by <specref ref="cvc-simple-type"/>;</p>
	   </item>
	   <item>
	    <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 <termref def="key-vv">actual value</termref> of that
	     attribute information item <!--*
* material suppressed here by diff group modals *
*--> 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>
	   <item>
	    <p>The <termref def="key-ltd">local type
	      definition</termref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from the
	     <propref comp="ed" prop="type        definition"/> given the union of the <propref comp="ed" prop="disallowed        substitutions"/> and the <propref comp="ed" prop="type        definition"/>'s <propref comp="ctd" prop="prohibited         substitutions"/>, as defined in <specref ref="cos-ct-derived-ok"/> (if it is a complex type
	     definition), or given <propref comp="ed" prop="disallowed        substitutions"/> as defined in <specref ref="cos-st-derived-ok"/> (if it is a simple type
	     definition).</p>
	   </item>
	  </olist> <termdef id="key-atd" term="actual type definition" role="local">The phrase <term>actual type definition</term>
	   occurs below.  If the above three clauses are satisfied,
	   this <rfc2119>must</rfc2119> be understood as referring to the <termref def="key-ltd">local type definition</termref>, otherwise
	   to the <propref comp="ed" prop="type      definition"/></termdef>.
	 </p>
	</item>
	<item>
	 <olist role="Casetest">
	  <item>
	   <p role="if">the declaration has a <propref comp="ed" prop="value constraint"/>, <phrase dg="modals">and</phrase> the item has neither element nor
	    character <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref><phrase dg="modals">,</phrase> and <clauseref ref="c-nl"/> has
	    not applied</p>
	   <p role="then">
	    <olist role="andtest">
	     <item>
	      <p>If the <termref def="key-atd">actual type
		definition</termref> is a <termref def="key-ltd">local
		type definition</termref><phrase dg="iff">,</phrase> 
                then the 
       <!--*
* material suppressed here by diff group rq129 *
*-->declaration's <propref comp="ed" prop="value constraint"/><!--*
* material suppressed here by diff group ep01 *
*--><!--*
* material suppressed here by diff group rq129 *
*--> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a valid default for the
	       <termref def="key-atd">actual type definition</termref>
	       as defined in <specref ref="cos-valid-default"/>.
	      </p>
	     </item>
	     <item>
	      <p>The element information item with the 
       <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129"><propref comp="vc_e" prop="lexical form"/> of the </phrase>declaration's <propref comp="ed" prop="value constraint"/><!--*
* material suppressed here by diff group ep01 *
*--><!--*
* material suppressed here by diff group rq129 *
*--> used as its
	       <termref def="key-nv">normalized value</termref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <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>
	     </item>
	    </olist>
	   </p>
	  </item>
	  <item>
	   <p role="if">the declaration has no <propref comp="ed" prop="value constraint"/><phrase dg="modals">,</phrase> or the item has either element or
	    character <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref><phrase dg="modals">,</phrase> or <clauseref ref="c-nl"/> has
	    applied</p>
	   <p role="then"><olist role="andtest">
	     <item>
	      <p>The element information item <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <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>
	     </item>
	     <item>
	      <p>If there is a <!--*
* material suppressed here by diff group ep01 *
*--><propref comp="ed" prop="value constraint"/><phrase dg="ep01"> with <propref comp="vc_e" prop="variety"/> <pt>fixed</pt></phrase> and
	       <clauseref ref="c-nl"/> has not applied, <phrase dg="iff">then</phrase>
	       <olist role="andtest">
		<item>
		 <p>The element information item <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> no element
		  information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>.</p>
		</item>
		<item>
		 <olist role="Case">
		  <item>
		   <p role="if">the <!--*
* material suppressed here by diff group rq129 *
*--><termref def="key-atd">actual type
		     definition</termref> <phrase dg="rq129">is a <compref ref="ctd"/> whose <propref comp="ctd" prop="content type"/></phrase><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>mixed</pt></p>
		   <p role="then">the <termref def="key-iv">initial
		     value</termref> of the item <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">matches</phrase> the 
       <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129"><propref comp="vc_e" prop="lexical form"/> of the </phrase>declaration's <propref comp="ed" prop="value constraint"/><!--*
* material suppressed here by diff group ep01 *
*--><!--*
* material suppressed here by diff group rq129 *
*-->.</p>
		  </item>
		  <item>
		   <p role="if">the 
                     <!--*
* material suppressed here by diff group rq129 *
*--><termref def="key-atd">actual type
		     definition</termref> <phrase dg="rq129">is a <compref ref="std"/> or
a <compref ref="ctd"/> whose <propref comp="ctd" prop="content type"/> </phrase><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>simple</pt></p>
		   <p role="then">the <termref def="key-vv">actual value</termref> of the item <!--*
* material suppressed here by diff group modals *
*--><!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129">is identical to</phrase> the<!--*
* material suppressed here by diff group rq129 *
*--> <propref comp="ed" prop="value        constraint"/><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">'s <propref comp="vc_e" prop="value"/></phrase>.
     <!--* <ednote>
      <edtext>Most of the above change is actually nothing to do with rq129,
but is a fix for a long-standing bug, which called for the comparison of a
value and a lexical form.  Need to check if we decided on identical or equal.</edtext>
     </ednote> *--></p>
		  </item>
		 </olist>
		</item>
	       </olist>
	      </p>
	     </item>
	    </olist></p>
	  </item>
	 </olist>
	</item>
       
	<item>
	 <p>The element information item <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="key-vn">valid</termref> with respect to each of the
	  <propref comp="s" prop="identity-constraint     definitions"/> as per <specref ref="cvc-identity-constraint"/>.</p>
	</item>
	<item>
	 <p>If the element information item is the <termref def="key-vr"/>, <phrase dg="modals">then</phrase> it <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="key-vn">valid</termref> per <specref ref="cvc-id"/>.</p>
	</item>
      </olist>      
     </p>
    </constraintnote>
    <constraintnote type="cvc" id="cvc-type">
     <head>Element Locally Valid (Type)</head>
     <p>For an element information item to be locally <termref def="key-vn">valid</termref> with respect to a type definition
      <olist role="and">
       <item id="c-ct">
        <p>The type definition <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is not</phrase> <termref def="key-null">absent</termref>;</p>
       </item>
       <item>
        <p>
        It <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">does not</phrase> have
<propref comp="ctd" prop="abstract"/> with value <pt>true</pt>.</p>
       </item>
       <item>
        <olist role="Casetest">
         <item>
        <p role="if">the type definition is a simple type
definition</p>
        <p role="then">
         <olist role="andtest">
          <item><p>The element information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> empty,
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>
          </item>
          <item>
           <p>The element information item <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> no element information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>.</p>
          </item>
          <item id="c-sv1">
           <p>If <clauseref ref="c-nl"/> of <specref ref="cvc-elt"/> did not apply, then the <termref def="key-nv">normalized value</termref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="key-vn">valid</termref> with respect to the type definition as defined by <specref ref="cvc-simple-type"/>.</p>
          </item>
         </olist>
        </p>
       </item>
         <item>
          <p role="if">the type definition is a complex type definition</p>
          <p role="then">the element information item <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="key-vn">valid</termref> with respect to the type definition as per <specref ref="cvc-complex-type"/>;</p>
         </item>
        </olist>
       </item>
      </olist>
     </p>
    </constraintnote>
     <constraintnote type="cvc" id="cvc-id">
  <head>Validation Root Valid (ID/IDREF)</head>
      <p>For an element information item which is the <termref def="key-vr"/> to be <termref def="key-vn">valid</termref>
       <olist role="and">
        <item>
         <p>There <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> no <local>ID/IDREF binding</local> in the item's
<propref ref="e-ii_table" role="psvi"/> whose <propref role="psvi" ref="iib-binding"/> is the
empty set.</p>
        </item>
        <item id="c-uba">
         <p>There <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> 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
than one member.</p>
        </item>
       </olist>
      </p>
      <p>See <specref ref="sic-id"/> for the definition of <local>ID/IDREF binding</local>.</p>
      <note>
       <p>The first clause above applies when there is a reference to an
undefined ID.  The second applies when there is a multiply-defined ID.  They
are separated out to ensure that distinct error codes (see <specref ref="outcomes"/>) are associated with these two cases.</p>
      </note>
      <note>
       <p>Although this rule applies at the <termref def="key-vr"/>, in practice processors,
particularly streaming processors, <phrase dg="may"><rfc2119>may</rfc2119></phrase><!--*
* material suppressed here by diff group may *
*--> wish to detect and signal the <clauseref ref="c-uba"/> case as it arises.</p>
      </note>
      <note>
       <p>This reconstruction of <bibref ref="ref-xml"/>'s <code>ID/IDREF</code>
functionality is imperfect in that if the <termref def="key-vr"/> is not the document element of an XML document, the results will
not necessarily be the same as those a validating parser would give were the
document to have a DTD with equivalent declarations.</p>
      </note>
 </constraintnote>
    <constraintnote id="cvc-assess-elt" type="cvc">
     <head>Schema-Validity Assessment (Element)</head>
     <p>The schema-validity assessment of an element information item depends
on its <termref def="key-vn">validation</termref> and the <termref def="key-va">assessment</termref> of its element information item
children and associated attribute information items, if any.</p>
  <p>So for an element information item's schema-validity to be assessed      
      <olist role="and">
       <item id="c-xd">
        <p><olist role="Ortest">
       <item id="c-ed">        
      <olist role="Andtest">
       <item>
        <p>A <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase> element declaration 
        <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> known for it, because
        <olist role="ortest">
         <item>
          <p>A declaration was stipulated by the processor (see <specref ref="validation_outcome"/>).</p>
         </item>
         <item>
          <p>A declaration has been established as its <termref def="key-dd">context-determined declaration</termref>.</p>
         </item>
         <item>
          <olist role="Andtest">
           <item>
            <p>Its <termref def="key-dd">context-determined declaration</termref> is
not <pt>skip</pt>.</p>
           </item>
           <item>
            <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>
           </item>
          </olist>          
         </item>
        </olist></p>        
       </item>
       <item>
        <p>Its <termref def="key-vn">validity</termref> with respect
to that declaration <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> been
evaluated as per <specref ref="cvc-elt"/>.</p>
       </item>
       <item>
        <p>If that evaluation involved the evaluation of <specref ref="cvc-type"/>, <clauseref ref="c-ct"/> thereof <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> satisfied.</p>
       </item>
      </olist>        
       </item>
            <item id="c-td">
        <olist role="Andtest">
       <item>
<p>A <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
 type definition is known for
it because 
 <olist role="ortest">
  <item>
   <p>A type definition was stipulated by the processor
(see <specref ref="validation_outcome"/>).</p>
  </item>
  <item>
   <olist role="Andtest">
    <item>
     <p>There is an attribute information item among the element
information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> 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>
    </item>
    <item>
        <p>The <termref def="key-nv">normalized value</termref> of that attribute information item is
<termref def="key-vn">valid</termref> with respect to the built-in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#QName">QName</xtermref> simple type, as defined by <specref ref="cvc-simple-type"/>.</p>
       </item>
       <item>
        <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 <termref def="key-vv">actual value</termref> 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>
    <item>
        <p>If there is also a processor-stipulated type definition, the <termref def="key-ltd1">local type definition</termref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase>
validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from that type definition given its <propref comp="ctd" prop="prohibited substitutions"/>,
as defined in <specref ref="cos-ct-derived-ok"/> (if it is a complex type
definition), or given the empty set, as defined in <specref ref="cos-st-derived-ok"/> (if it is a simple type definition).</p>
       </item>
   </olist>
  </item>
 </olist>
</p>
</item>
       
       
         <item>
        <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 <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref>)
or the processor-stipulated type definition (if no <termref def="key-ltd1">local
type definition</termref> is present) has been evaluated as per <specref ref="cvc-type"/>.</p>
       </item>
      </olist>        
       </item>
      </olist>
        </p>
       </item>
       <item>
        <p>The schema-validity of all the element information items among its
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> has been assessed as per <specref ref="cvc-assess-elt"/>, and the
schema-validity of all the attribute information items among its
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> has been assessed as per <specref ref="cvc-assess-attr"/>.</p>
       </item>
      </olist>
     </p>
        <p><termdef id="key-sva" term="strictly assessed" role="local">If either case of
<clauseref ref="c-xd"/> above holds, the element information item has been 
<term>strictly assessed</term></termdef>.</p>
     <p>If the item cannot be <termref def="key-sva">strictly
assessed</termref>, because neither <clauseref ref="c-ed"/> nor
<clauseref ref="c-td"/> above are satisfied, <termdef id="key-lva" term="laxly assessed">an element information item's schema validity
<!--*
* material suppressed here by diff group rq144fb *
*--><phrase dg="rq144fb"><rfc2119>must</rfc2119></phrase> 
be <term>laxly assessed</term> if <phrase dg="modals">and only if</phrase> 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 diff="nsq-del" def="ur-type-itself" dg="rq17">ur-type definition</termref><termref diff="nsq-add" def="any-type-itself" dg="rq17">definition of anyType</termref> as per <specref ref="cvc-type"/></termdef>.</p>

<ednote role="pf" dg="rq144wg2">
<edtext>
In version 1.0 of this specification, the fallback to lax
validation described in the preceding paragraph was optional,
not required.
The XML Schema Working Group solicits input from implementors and
users of this specification as to whether this change is 
desirable and acceptable.
</edtext>
</ednote>
     
<!--* <ednote diff="add" dg="rq144fb">
<edtext>When bug <loc
href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2822">2822</loc>
was discussed by the Working Group in March 2005, there was a
preponderance of opinion in favor of changing the <quote>&may;</quote>
in the definition of lax validation into a <quote>&must;</quote>.
There was also some skepticism.  In discussing this phase-2 proposal,
the WG needs to address this question distinctly.  (Note also that
appendix <specref ref="var_fallback"/> should be dropped if the
change marked here is adopted, and retained only if this change
is dropped.)</edtext>
</ednote> *-->
     <note>
      <p>In general if <clauseref ref="c-ed"/> above holds 
<clauseref ref="c-td"/> does not, and vice versa.  When an
<code>xsi:type</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is involved, however, <clauseref ref="c-td"/> 
<!--* !!! 'takes precedence is surely the wrong phrase here. *-->
takes precedence,
as is made clear in <specref ref="cvc-elt"/>.</p>
     </note>
    </constraintnote>
    <note><p>The <propref comp="ed" prop="name"/> and <propref comp="ed" prop="target namespace"/> properties are not
mentioned above because they are checked during particle <termref def="key-vn">validation</termref>, as per
<specref ref="cvc-particle"/>.</p></note>
    </div3>
    <div3 id="edisc">
     <head>Element Declaration Information Set Contributions</head>
    <constraintnote id="sic-e-outcome" type="sic">
     <head>Assessment Outcome (Element)</head>
     <p>If<phrase dg="iff.144"> and only if</phrase> the schema-validity of an element information item has been assessed
as per <specref ref="cvc-assess-elt"/>, then in the <termref def="key-psvi">post-schema-validation infoset</termref> it <phrase dg="opt.144">has</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> 
properties as follows:</p>
     <proplist role="psvi" item="element">
       <propdef name="validation context" id="e-validation_context">The nearest ancestor element information
item with a <propref role="psvi" ref="e-schema_information"/> property (or this element item itself if it has such a property).</propdef>
       <propdef name="validity" id="e-validity">
        <olist role="Caseval">
       <item>
        <p role="if">it was <termref def="key-sva">strictly
assessed</termref></p>
        <p role="then">
        <olist role="caseval">
         <item>
          <p role="if">
          <olist role="andtest">
           <item>
            <olist role="Ortest">
             <item>
              <p><clauseref ref="c-ed"/> of <specref ref="cvc-assess-elt"/>
applied and the item was
<termref def="key-vn">valid</termref> as defined by <specref ref="cvc-elt"/>;</p>
             </item>
             <item>
              <p><clauseref ref="c-td"/> of <specref ref="cvc-assess-elt"/>
applied and the item was
<termref def="key-vn">valid</termref> as defined by <specref ref="cvc-type"/>.</p>
             </item>
            </olist>            
           </item>
            <item>
             <p>Neither its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> nor its
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> contains an information item (element or attribute respectively) whose  <xpropref role="psviAnon">validity</xpropref> is <pt>invalid</pt>.</p>
            </item>
           <item>
            <p>Neither its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> nor its
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> contains an information item (element or attribute respectively) with a <termref def="key-dd">context-determined declaration</termref> of
<pt>mustFind</pt> whose  <xpropref role="psviAnon">validity</xpropref>
is <pt>notKnown</pt>.</p>
           </item>
          </olist>
          </p>
          <p role="then"><pt>valid</pt>;</p>
         </item>
         <item>
          <p role="otherwise"><pt>invalid.</pt>.</p>
         </item>
        </olist>
        </p>
       </item>
       <item>
        <p role="otherwise"><pt>notKnown</pt>.</p>
       </item>
      </olist>
        </propdef>
       <propdef name="validation attempted" id="e-validation_attempted">
       <olist role="Caseval">
       <item>
        <p role="if">it was <termref def="key-sva">strictly assessed</termref> and neither its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> nor its
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> contains an information item (element or attribute
respectively) whose  <xpropref role="psviAnon">validation attempted</xpropref> is not
<pt>full</pt></p>
        <p role="then"><pt>full</pt>;</p>
       </item>
        <item>
         <p role="if">it was not <termref def="key-sva">strictly assessed</termref> and neither its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> nor its
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> contains an information item (element or attribute
respectively) whose  <xpropref role="psviAnon">validation attempted</xpropref> is not
<pt>none</pt></p>
         <p role="then"><pt>none</pt>;</p>
        </item>
        <item>
        <p role="otherwise"><pt>partial</pt>.</p>
       </item>
      </olist></propdef></proplist>
    </constraintnote>
    <constraintnote type="sic" id="sic-elt-error-code">
     <head>Validation Failure (Element)</head>
     <p>If<phrase dg="iff.144"> and only if</phrase> the local <termref def="key-vn">validity</termref>, as defined by
<specref ref="cvc-elt"/> above and/or <specref ref="cvc-type"/>
below, of an element information item has been assessed, <phrase dg="iff">then</phrase>
in the <termref def="key-psvi">post-schema-validation infoset</termref> the item <phrase dg="opt.144">has</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> a
property:</p>
     <proplist role="psvi" item="element">
      <propdef id="e-schema_error_code" name="schema error code">
       <olist role="Caseval">
        <item>
         <p role="if">the item is <!--*
* material suppressed here by diff group b1892 *
*--><phrase dg="b1892"><termref def="key-vn">invalid</termref></phrase></p>
         <p role="then">a list.  Applications wishing to provide
information as to the reason(s) for the <termref def="key-vn">validation</termref> failure are encouraged to record one or more
error codes (see <specref ref="outcomes"/>) herein.</p>
        </item>
        <item>
         <p role="otherwise"><termref def="key-null">absent</termref>.</p>
        </item>
       </olist>
      </propdef>
     </proplist>
    </constraintnote>
    <constraintnote type="sic" id="sic-elt-decl">
     <head>Element Declaration</head>
     <p>If<phrase dg="iff.144"> and only if</phrase> an element information item is <termref def="key-vn">valid</termref> with respect to an element declaration as
per <specref ref="cvc-elt"/><phrase dg="iff">,</phrase>
then in the <termref def="key-psvi">post-schema-validation infoset</termref> the element information item <!--*
* material suppressed here by diff group rq144nv *
*--><phrase dg="rq144nv">has the
properties</phrase>:</p>
     <!--*
* material suppressed here by diff group rq144nv *
*-->
       <!--*
* material suppressed here by diff group rq144nv *
*-->

     <!--*
* material suppressed here by diff group rq144nv *
*-->
     <proplist role="psvi" item="element" dg="rq144nv">
      <propdef id="e-declaration" name="element declaration">
       an <termref def="key-iso">item isomorphic</termref> to the declaration component itself
      </propdef>
      <propdef id="e-nil" name="nil"><pt>true</pt> if <clauseref ref="c-nl"/> of <specref ref="cvc-elt"/> above is satisfied,
otherwise <pt>false</pt>
      </propdef>
     </proplist>
    </constraintnote>
    <constraintnote type="sic" id="sic-eltType">
     <head>Element Validated by Type</head>
     <p>If<phrase dg="iff.144"> and only if</phrase> an element information item is <termref def="key-vn">valid</termref> with respect to a <termref def="td">type
definition</termref> as per <specref ref="cvc-type"/>, <phrase dg="iff">then</phrase> in the <termref def="key-psvi">post-schema-validation infoset</termref> the item
<phrase dg="opt.144">has</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> <!--*
* material suppressed here by diff group rq144nv *
*--><phrase dg="rq144nv">the
properties</phrase>:</p>
     <proplist role="psvi" item="element">
      <propdef id="e-schema_normalized_value" name="schema normalized value">
      <olist role="Caseval">
         <item><p role="if"><clauseref ref="c-nl"/> of <specref ref="cvc-elt"/> and <specref ref="sic-eltDefault"/> above have
<emph>not</emph> applied and either the <termref def="td">type
definition</termref> is a simple type definition or its <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has
<propref comp="ct" prop="variety"/> <pt>simple</pt></phrase></p>
<p role="then">
the <termref def="key-nv">normalized value</termref> of the item as <termref def="key-vn">validated</termref>.</p>
</item>
<item><p role="otherwise"><termref def="key-null">absent</termref>.</p>
</item>
</olist>
</propdef>
<propdef id="e-type_definition" name="type definition" dg="rq144nv">An <termref def="key-iso">item isomorphic</termref> to the
<termref def="td">type definition</termref> component
itself.</propdef>
<propdef id="e-type_definition_type" name="type definition type" dg="rq144nv">
<pt>simple</pt> or <pt>complex</pt>, depending on the <termref def="td">type definition</termref>.</propdef>
<propdef id="e-type_definition_namespace" name="type definition namespace" dg="rq144nv">The <xpropref role="anon">target
namespace</xpropref> of the <termref def="td">type
definition</termref>.</propdef>
<propdef name="type definition anonymous" id="e-type_definition_anonymous" dg="rq144nv"><pt>true</pt>
if the <xpropref role="anon">name</xpropref> of the <termref def="td">type definition</termref> is <termref def="key-null">absent</termref>, otherwise <pt>false</pt>.</propdef>

<propdef name="type definition name" id="e-type_definition_name" dg="rq144nv">The <xpropref role="anon">name</xpropref> of the
<termref def="td">type definition</termref>, if <phrase diff="nsq-del" dg="rq144wgno">it</phrase><phrase diff="nsq-add" dg="rq144wgno">the
<propref comp="std" prop="name"/></phrase> is not <termref def="key-null">absent</termref>.  If <phrase diff="nsq-del" dg="rq144wgno">it</phrase><phrase diff="nsq-add" dg="rq144wgno">the
<termref def="td">type definition</termref>'s
<propref comp="std" prop="name"/> property</phrase> is <termref def="key-null">absent</termref>, schema processors <rfc2119>may</rfc2119>, but need
not, provide a value unique to the definition.</propdef>

</proplist>

<!--*
* material suppressed here by diff group rq144nv *
*-->

<!--*
* material suppressed here by diff group rq144nv *
*-->
<!--*
* material suppressed here by diff group rq144nv *
*-->
<!--*
* material suppressed here by diff group rq144nv *
*-->
<!--*
* material suppressed here by diff group rq144nv *
*-->

<note dg="rq144nv">
<p>The
<xpropref role="psviAnon">type definition type</xpropref>,
<xpropref role="psviAnon">type definition namespace</xpropref>,
<xpropref role="psviAnon">type definition name</xpropref>, and
<xpropref role="psviAnon">type definition anonymous</xpropref> properties
are redundant with the 
<xpropref role="psviAnon">type definition</xpropref> property; 
they are defined for the convenience of implementations
which wish to expose those specific properties 
but not the entire type definition.</p>
</note>

<p dg="b2333b">If the <termref def="td">type
definition</termref> is a simple type definition<phrase dg="ep01"> with <propref comp="std" prop="variety"/>
<pt>union</pt>,</phrase> or its <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has
<propref comp="ct" prop="variety"/> <pt>simple</pt> and <propref comp="ct" prop="simple type definition"/> a simple type definition
with</phrase> <propref comp="std" prop="variety"/> <pt>union</pt>,
then calling <termdef id="key-amt" term="actual member type definition" role="local"> that <phrase dg="b2333c"><!--*
* material suppressed here by diff group b2333a *
*--><phrase dg="b2333a"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-basicmember">basic member</xtermref> of its
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-transitivemembership">transitive
membership</xtermref></phrase> which actually <termref def="key-vn">validated</termref></phrase><!--*
* material suppressed here by diff group b2333c *
*--> the element item's <termref def="key-nv">normalized value</termref> <!--* <phrase
diff="add" dg="b2333c">was ultimately assigned</phrase> *--> the
<term>actual member type definition</term></termdef>, there are
<!--*
* material suppressed here by diff group rq144nv *
*--><phrase dg="rq144nv">four</phrase> additional properties:</p>


<!--*
* material suppressed here by diff group b2333b *
*-->

    <proplist role="psvi" item="element">
<propdef name="member type definition" id="e-member_type_definition" dg="rq144nv">An <termref def="key-iso">item
isomorphic</termref> to the <termref def="key-amt"/>
<!--* that <xtermref
href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-basicmember">basic member</xtermref> of its
<xtermref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-transitivemembership">transitive
membership</xtermref> which actually <termref
def="key-vn">validated</termref> the element item's
&i-value;.*-->
</propdef>

     <propdef name="member type definition namespace" id="e-member_type_definition_namespace">The <propref comp="std" prop="target namespace"/> of the <termref def="key-amt">actual
member type definition</termref>.</propdef>
     <propdef name="member type definition anonymous" id="e-member_type_definition_anonymous"><pt>true</pt> if the <propref comp="std" prop="name"/> of the <termref def="key-amt">actual member type definition</termref> is <termref def="key-null">absent</termref>, otherwise <pt>false</pt>.</propdef>
     <propdef name="member type definition name" id="e-member_type_definition_name">The <propref comp="std" prop="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
<termref def="key-null">absent</termref>, schema processors <rfc2119>may</rfc2119>, but need not,
provide a value unique to the definition.</propdef>
         </proplist>
     <p>The first (<termref def="key-iso">item isomorphic</termref>) alternative above is provided for applications such as query
processors which need access to the full range of details about an item's
<termref def="key-va">assessment</termref>, for example the type hierarchy; the second, for lighter-weight
processors for whom representing the significant parts of the type hierarchy as
information items might be a significant burden.</p>
     <p>Also, if the declaration has a <propref comp="ed" prop="value constraint"/>, the item has a property:</p>
     <proplist role="psvi" item="element">
      <propdef id="e-schema_default" name="schema default">The 
       <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129"><propref comp="vc_e" prop="lexical form"/> of the </phrase>declaration's <propref comp="ed" prop="value constraint"/><!--*
* material suppressed here by diff group ep01 *
*--><!--*
* material suppressed here by diff group rq129 *
*-->.</propdef>
     </proplist>
     <p>Note that if an element is <termref def="key-lva">laxly assessed</termref>, then the <propref ref="e-type_definition" role="psvi"/> and
<propref ref="e-member_type_definition" role="psvi"/> properties, or their
alternatives, are based on the <termref diff="nsq-del" def="ur-type-itself" dg="rq17">ur-type definition</termref><termref diff="nsq-add" def="any-type-itself" dg="rq17">definition of anyType</termref>.</p>
    </constraintnote>
    <constraintnote type="sic" id="sic-eltDefault">
     <head>Element Default Value</head>
<p>If<phrase dg="iff.144"> and only if</phrase> the local <termref def="key-vn">validity</termref>, as defined by <specref ref="cvc-elt"/>
above, of an element information item has been assessed,
in the <termref def="key-psvi">post-schema-validation infoset</termref> the item <phrase dg="opt.144">has</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> a
property:</p>
<proplist role="psvi" item="element">
<propdef id="e-schema_specified" name="schema specified">
<olist role="Caseval"><item>
<p role="if">the item is <termref def="key-vn">valid</termref> with respect to an element
declaration as per <specref ref="cvc-elt"/> and the <propref comp="ed" prop="value constraint"/> is present, but <clauseref ref="c-nl"/>
of <specref ref="cvc-elt"/> above is not satisfied and the item has no element or character information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref></p>
<p role="then">
<pt>schema</pt>.  Furthermore, the
<termref def="key-psvi">post-schema-validation infoset</termref> has the <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129"><propref comp="vc_e" prop="lexical form"/> of the </phrase> <propref comp="ed" prop="value constraint"/><!--*
* material suppressed here by diff group ep01 *
*--><!--*
* material suppressed here by diff group rq129 *
*--> as the
item's <propref role="psvi" ref="e-schema_normalized_value"/>
property.</p></item>
<item>
<p role="otherwise"><pt>infoset</pt>.</p></item></olist></propdef></proplist>
    </constraintnote>
    </div3>
    <div3 id="coss-element">
     <head>Constraints on Element Declaration Schema Components</head>
  <p>All element declarations (see <specref ref="cElement_Declarations"/>) <rfc2119>must</rfc2119> satisfy the following constraint.</p>
  <constraintnote type="cos" id="e-props-correct">
   <head>Element Declaration Properties Correct</head>
   <olist role="And">
    <item>
     <p>The values of the properties of an element declaration <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as described in
the property tableau in
<specref ref="Element_Declaration_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
    </item>
    <item>
     <p>If there is a <propref comp="ed" prop="value constraint"/>, <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129">it
is a valid default</phrase> with respect to the <propref comp="ed" prop="type definition"/> as defined in <specref ref="cos-valid-default"/>.</p>
    </item>
    <item>
     <p>If there is a <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>

<propref comp="ed" prop="substitution group affiliation"/>, then <propref comp="ed" prop="scope"/><phrase dg="ep01">'s <propref comp="sc_e" prop="variety"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <pt>global</pt>.</p>
    </item>
    <item>
     <p>If there is a <propref comp="ed" prop="substitution group affiliation"/>, the <propref comp="ed" prop="type definition"/> of the
element declaration <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from the <propref comp="ed" prop="type definition"/> of the <propref comp="ed" prop="substitution group affiliation"/>, given the value of the <propref comp="ed" prop="substitution group exclusions"/> of the <propref comp="ed" prop="substitution group affiliation"/>, as defined in <specref ref="cos-ct-derived-ok"/> (if the <propref comp="ed" prop="type definition"/> is complex) or as defined in <specref ref="cos-st-derived-ok"/> (if the <propref comp="ed" prop="type definition"/> is simple).
     </p>
    </item>
    <item>
     <p>If the <propref comp="ed" prop="type definition"/> or <propref comp="ed" prop="type definition"/>'s <propref comp="ctd" prop="content type"/><phrase dg="ep01">'s <propref comp="ct" prop="simple type definition"/></phrase> is or is <!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> from 
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref><phrase dg="iff">,</phrase> then there 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is no</phrase> 
<propref comp="ed" prop="value constraint"/>.</p>
     <note>
      <p>The use of <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref> as a type
definition for elements goes beyond XML<!--*
* material suppressed here by diff group fpwd *
*-->, and <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><rfc2119>should</rfc2119></phrase> be avoided if backwards
compatibility is desired.</p>
     </note>
    </item>
    <item>
     <p><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">There are no circular substitution groups. </phrase>
That is, it
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is not</phrase> possible to return to an element declaration by repeatedly following
the <propref comp="ed" prop="substitution group affiliation"/> property.</p>
    </item>
   </olist>
  </constraintnote>
  <p>The following constraints define relations appealed to elsewhere in this specification.</p>
  <constraintnote id="cos-valid-default" type="cos">
   <head>Element Default Valid (Immediate)</head>
   <p>For a <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129"><compref ref="vc_e"/></phrase> to be a valid default with respect to a type definition
    <olist role="case">
     <item>
      <p role="if">the type definition is a simple type definition<phrase dg="rq129">or a complex type definition whose <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129"><propref comp="ct" prop="variety"/> <pt>simple type definition</pt></phrase></phrase></phrase></p>
      <p role="then">
       <!--*
* material suppressed here by diff group rq129 *
*-->
       <phrase dg="rq129"> the <compref ref="vc_e"/> is a valid
default with respect to the <propref comp="ctd" prop="content type"/>'s
<propref comp="ct" prop="simple type definition"/> as defined by <specref ref="cos-valid-simple-default"/>.</phrase>
       </p>
     </item>
     <item>
      <p role="if">the type definition is a complex type definition <phrase dg="rq129">whose <propref comp="ctd" prop="content type"/>'s <propref comp="ct" prop="variety"/> is not <pt>simple type definition</pt></phrase></p>
      <p role="then">
       <olist role="andtest">
        <item>
         <p>its <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><!--*
* material suppressed here by diff group rq129 *
*--> <phrase dg="ep01">has <propref comp="ct" prop="variety"/> </phrase><pt>mixed</pt>.</p>
        </item>
        <item>
         <!--*
* material suppressed here by diff group rq129 *
*-->
         <p dg="rq129">the <propref comp="ctd" prop="content type"/>'s <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="particle"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="cd-emptiable">emptiable</termref> as defined by <specref ref="cos-group-emptiable"/>.</p>
        </item>
       </olist>
      </p>
     </item>
    </olist>
   </p>
  </constraintnote>
  <constraintnote id="cos-equiv-derived-ok-rec" type="cos">
   <head>Substitution Group OK (Transitive)</head>
   <p>For an element declaration (call it <local>D</local>)  to be validly
substitutable for another element declaration (call it <local>C</local>)
subject to a blocking constraint (a subset of
{<pt>substitution</pt>, <pt>extension</pt>, <pt>restriction</pt>}, the value of
a <propref comp="ed" prop="disallowed substitutions"/>)
    <olist role="or">
     <item>
      <p><local>D</local> and <local>C</local> are the same element declaration.</p>
     </item>
     <item>
      <olist role="Andtest">
     <item>
      <p>The blocking constraint does not contain <pt>substitution</pt>.</p>
     </item>
     <item>
      <p>There is a chain of <propref comp="ed" prop="substitution group affiliation"/>s from <local>D</local> to
<local>C</local>, that is, either <local>D</local>'s <propref comp="ed" prop="substitution group affiliation"/> is
<local>C</local>, or <local>D</local>'s <propref comp="ed" prop="substitution group affiliation"/>'s <propref comp="ed" prop="substitution group affiliation"/> is <local>C</local>, or . . .</p>
     </item>
     <item>
      <p>The set of all <propref comp="ctd" prop="derivation method"/>s
involved in the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivation</xtermref> of <local>D</local>'s <propref comp="ed" prop="type definition"/> from
<local>C</local>'s <propref comp="ed" prop="type definition"/> does not intersect with the union
of the blocking constraint, <local>C</local>'s <propref comp="ctd" prop="prohibited substitutions"/> (if <local>C</local>
is complex, otherwise the empty set) and the
<propref comp="ctd" prop="prohibited substitutions"/> (respectively the empty set) of any intermediate <propref comp="ed" prop="type definition"/>s
in the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivation</xtermref> of <local>D</local>'s <propref comp="ed" prop="type definition"/> from
<local>C</local>'s <propref comp="ed" prop="type definition"/>.</p>
     </item>
    </olist>
     </item>
    </olist>
    
   </p>
  </constraintnote>

<p dg="ww-p"><termdef id="key-validly-sub" term="validly substitutable">One
element declaration is <term>validly substitutable</term> for another
if together they satisfy constraint <specref ref="cos-equiv-derived-ok-rec"/>.</termdef> </p>

  <constraintnote id="cos-equiv-class" type="cos">
   <head>Substitution Group</head>
   <p><termdef id="key-eq" term="substitution group">Every element
declaration (call this <local>HEAD</local>)
in the <propref comp="s" prop="element declarations"/> of a schema defines a
<term>substitution group</term>, a subset of those <propref comp="s" prop="element declarations"/>, as follows:</termdef></p>
   <p>Define <local>P</local>, the potential substitution group for <local>HEAD</local>, as follows:</p>
   <olist>
     <item>
      <p>The element declaration itself is in <local>P</local>;</p>
     </item>
     <item>
      <p><local>P</local> is closed with respect to <propref comp="ed" prop="substitution group affiliation"/>, that
is, if any element declaration in the <propref comp="s" prop="element declarations"/> 
has a <propref comp="ed" prop="substitution group affiliation"/> in <local>P</local>, then that element is also in <local>P</local> itself.</p>
     </item>
    </olist>
   <p><local>HEAD</local>'s actual <termref def="key-eq">substitution
group</termref> is then the set consisting of each member of <local>P</local>
such that <olist role="andtest">
    <item>
     <p>Its <propref comp="ed" prop="abstract"/> is <pt>false</pt>.</p>
    </item>
    <item>
     <p>It is validly substitutable for <local>HEAD</local> subject to
<local>HEAD</local>'s <propref comp="ed" prop="disallowed substitutions"/> as the
blocking constraint, as defined in <specref ref="cos-equiv-derived-ok-rec"/>.</p>
    </item>
   </olist></p>
  </constraintnote>
    </div3>
   </div2>
   <div2 id="Complex_Type_Definitions">
    <head>Complex Type Definitions</head>
<p>Complex Type Definitions provide for:</p>
<ulist>
     <item><p>Constraining element information items by providing <specref ref="Attribute_Declaration"/>s governing the appearance and content of
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref></p></item>
     <item><p>Constraining element information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> to be empty,
or to conform to a specified element-only or mixed content model, or else
constraining the character information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> to conform to a
specified simple type definition.</p></item>
     <item dg="b2861cc-1"><p>Constraining <!--*
* material suppressed here by diff group b2861cc-1a *
*-->
elements and attributes <phrase dg="b2861cc-1a">to exist,
not to exist, or to have specified values,</phrase> with <specref ref="Assertion"/>s.</p></item>
     <item><p>Using the mechanisms of <specref ref="Type_Derivation"/> to <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derive</xtermref> a complex type from another simple or complex type.</p></item>
     <item>
<p>Specifying <termref def="gloss-sic">post-schema-validation infoset contributions</termref> for elements. </p>
</item>
     <item><p>Limiting the ability to <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derive</xtermref> additional types from a given complex type.</p></item>
     <item><p>Controlling the permission to substitute, in an instance, elements of a <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref>
type for elements declared in a content model to be of a given complex type.</p></item>
</ulist>
<issue id="RQ-36i" role="1.1" status="open">
<!--*
<p>
<loc href="&reqs;#wildcards" target="reqs"
>RQ-7 (wildcards)</loc>,
<loc href="&reqs;#local-references" target="reqs"
>RQ-36 (local-references)</loc>, 
<loc href="&reqs;#ElementDeclarationsConsistent" target="reqs"
>RQ-146 (ElementDeclarationsConsistent)</loc></p>
*-->
<p>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2857" target="reqs">Issue 2857 (RQ-7 wildcards)</loc>,
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2860" target="reqs">Issue 2860 (RQ-36 local references)</loc>, 
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2544" target="reqs">Issue 2544 (RQ-146 element declarations consistent)</loc></p>

  <p>Although extremely useful, wildcards have proved to interact in
unfortunate ways with the Unique Particle Attribution and Element Declarations
Consistent constraints, and this has limited their utility, particularly for
use in allowing for extension and anticipating subsequent versions.  The
interpretation of wildcards will be changed to address these problems, without
compromising backward compatibility.</p>
<!--*
  <resolution><p>As part of an overall reworking of the interpretation of local
declarations and of the Unique Particle Attribution and Element Declarations
Consistent constraints, we will change the interpretation of wildcards to
allow them to reference local declarations and subordinate them to explicit
declarations, thereby fixing the main conflicts.</p>
   <p>The so-called <loc href="http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004Apr/0091.html">landscape summary</loc> (W3C-member-only link) covers
this along with related issues.</p>
  </resolution>
*-->
	  </issue>
<note role="example">
 <eg xml:space="preserve">&lt;xs:complexType name="PurchaseOrderType"&gt;
  &lt;xs:sequence&gt;
   &lt;xs:element name="shipTo" type="USAddress"/&gt;
   &lt;xs:element name="billTo" type="USAddress"/&gt;
   &lt;xs:element ref="comment" minOccurs="0"/&gt;
   &lt;xs:element name="items"  type="Items"/&gt;
  &lt;/xs:sequence&gt;
  &lt;xs:attribute name="orderDate" type="xs:date"/&gt;
 &lt;/xs:complexType&gt;
</eg>
 <p>The XML representation of a complex type definition.</p>
</note>
<div3 id="Complex_Type_Definition_details">
 <head>The Complex Type Definition Schema Component</head>
 <p>A complex type definition schema component has the following
properties:</p>

<compdef name="Complex Type Definition" abbrev="ctd" showAKO="true"/>
<!--*
* material suppressed here by diff group ep01-part1 *
*-->
<microCompdef name="Content Type" abbrev="ct" dg="ep01"/>

<issue id="RQ-131i" role="1.1" status="open">
<!--* <p>
<loc href="&reqs;#scd-ordering-annotation" target="reqs"
>RQ-131 (scd-ordering-annotation)</loc>, 
<loc href="&reqs;#scd-lost-annotation" target="reqs"
>RQ-130 (scd-lost-annotation)</loc>, 
<loc href="&reqs;#annotation-psvi" target="reqs"
>RQ-19 (annotation-psvi)</loc></p>
*-->
<p>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2841" target="reqs">Issue 2841 (RQ-131 ordering of annotations)</loc>, 
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2840" target="reqs">Issue 2840 (RQ-130 lost annotations)</loc>, 
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2851" target="reqs">Issue 2851 (RQ-19 annotations in PSVI)</loc></p>
<p>Version 1.0 was inconsistent in providing for multiple sources of
annotation, particularly where components corresponded to multiple nested
elements in schema documents (e.g. Complex Type Definitions <emph>vis a
vis</emph> <code>xs:complexType</code>, <code>xs:complexContent</code> and
<code>xs:restriction</code>).  This will change so that all components can have
multiple annotations, and annotations will be handled consistently across all
kinds of components.</p>
<p>Also applies anywhere else {annotations}
plural appears — everywhere, in fact.</p>
<resolution>
<olist>
<item>
<p>All components have an {annotations} property;</p>
</item>
<item>
<p>It contains a sequence of annotations;</p>
</item>
<item>
<p>Namely all annotations "scoped" by this component, but not "scoped"
by any other component "further down".</p>
</item>
<item>
<p>The order of annotations within {annotations} is
implementation-determined.</p>
</item>
</olist>
<p>Note that when point 3 above mentions "annotations 'scoped' by . . ."
this means &lt;annotation&gt; elements <emph>and</emph> out-of-band attributes.</p>
<p>[<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004Mar/0169.html">Agendum 
4.1 SCD-related requirements</loc> (W3C-member-only link)]</p>
</resolution>
</issue>

<p>Complex type definitions are identified by their <propref comp="ctd" prop="name"/> and <propref comp="ctd" prop="target namespace"/>.  Except
for anonymous complex type definitions (those with no <propref comp="ctd" prop="name"/>), since
type definitions (i.e. both simple and complex type definitions taken together) <rfc2119>must</rfc2119> be uniquely identified within an <termref def="key-schema">XML
Schema</termref>, no complex type definition can have the same name as another
simple or complex type definition.  Complex type <propref comp="ctd" prop="name"/>s and <propref comp="ctd" prop="target namespace"/>s
are provided for reference from
instances (see <specref ref="xsi_type"/>), and for use in the XML
representation of schema components
(specifically in <eltref ref="element"/>).  See <specref ref="composition-schemaImport"/> for the use of component
identifiers when importing one schema into another.</p>
<note>
<p>The <propref comp="ctd" prop="name"/> of a complex type is not <emph>ipso
facto</emph> the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">(local) name</xpropref> of the
  element information items <termref def="key-vn">validated</termref> by that definition. The connection between a
  name and a type definition is described in <specref ref="cElement_Declarations"/>. </p>
</note>
   <p>As described in <specref ref="Type_Derivation"/>, each complex type is <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from a
<propref comp="ctd" prop="base type definition"/> which is itself either a <specref ref="Simple_Type_Definition"/> or a <specref ref="Complex_Type_Definition"/>.  <propref comp="ctd" prop="derivation method"/> specifies the means of <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivation</xtermref> as either <pt>extension</pt> or <pt>restriction</pt> (see <specref ref="Type_Derivation"/>).</p>

<p>A complex type with an empty specification for <propref comp="ctd" prop="final"/> can be used as a
<propref comp="ctd" prop="base type definition"/> for other types <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> by either of
extension or restriction; the explicit values <pt>extension</pt>, and <pt>restriction</pt> prevent further
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivations</xtermref> 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
<term>final</term>, because no
further <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivations</xtermref> are possible</termdef>.  Finality is <emph>not</emph>
inherited, that is, a type definition <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> by restriction from a type
definition which is final for extension is not itself, in the absence of any
explicit <code>final</code> attribute of its own, final for anything.</p>
<p dg="context-2338">The <propref comp="ctd" prop="context"/>
property is only relevant for anonymous type definitions, for which its value
is the component in which this type definition appears as the value of a property, e.g. <propref comp="ed" prop="type definition"/>.</p>
<p>Complex types for which <propref comp="ctd" prop="abstract"/> is <pt>true</pt> <rfc2119>must not</rfc2119> be used as the
<propref comp="ed" prop="type definition"/> for the <termref def="key-vn">validation</termref> of element information items.  It follows that they <rfc2119>must not</rfc2119> be referenced from an
<specref ref="xsi_type"/> attribute in an instance document.  Abstract complex types can be
used as <propref comp="ctd" prop="base type definition"/>s, or even as the <propref comp="ed" prop="type definition"/>s of element declarations, provided in every case a concrete <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> 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>

<p><propref comp="ctd" prop="attribute uses"/> are a set of attribute uses.  See <specref ref="cvc-complex-type"/>
and <specref ref="cvc-attribute"/> for details of attribute <termref def="key-vn">validation</termref>.</p>
<p><propref comp="ctd" prop="attribute wildcard"/>s provide a more flexible specification for <termref def="key-vn">validation</termref> of
attributes not explicitly included in <propref comp="ctd" prop="attribute uses"/>.
<!--*
* material suppressed here by diff group b2867-1 *
*-->
<!--*
* material suppressed here by diff group b2867-1 *
*-->
See <specref ref="cvc-complex-type"/><phrase dg="b2867-1">, <specref ref="Wildcard_details"/></phrase> and
<!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1"><specref ref="cvc-wildcard-name"/></phrase> for formal
details of attribute wildcard <termref def="key-vn">validation</termref>. </p>
<p><propref comp="ctd" prop="content type"/> determines the <termref def="key-vn">validation</termref> of <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of element information items.  Informally:
<ulist>
<item>
<p>A <propref comp="ctd" prop="content type"/> with <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="variety"/></phrase> <pt>empty</pt> <termref def="key-vn">validates</termref> elements
with no character or element information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>.</p>
</item>
<item>
<p>A <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">with <propref comp="ct" prop="variety"/> <pt>simple</pt></phrase> <termref def="key-vn">validates</termref>
elements with character-only <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref><phrase dg="ep01">using its <propref comp="ct" prop="simple type definition"/></phrase>.</p>
</item>
<item>
<p>A<!--*
* material suppressed here by diff group ep01 *
*--> <propref comp="ctd" prop="content type"/><phrase dg="ep01"> with <propref comp="ct" prop="variety"/> <pt>element-only</pt></phrase> <termref def="key-vn">validates</termref> elements with <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> that
conform to the <!--*
* material suppressed here by diff group ep01 *
*--><termref def="key-contentModel">content model</termref><phrase dg="ep01"> supplied by its <propref comp="ct" prop="particle"/></phrase>.</p>
</item>
<item>
<p>A<!--*
* material suppressed here by diff group ep01 *
*--> <propref comp="ctd" prop="content type"/><phrase dg="ep01"> with <propref comp="ct" prop="variety"/> <pt>mixed</pt></phrase> <termref def="key-vn">validates</termref> elements whose element <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> (i.e. specifically ignoring other <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> such as character information items)
conform to the <!--*
* material suppressed here by diff group ep01 *
*--><termref def="key-contentModel">content model</termref><phrase dg="ep01"> supplied by its <propref comp="ct" prop="particle"/></phrase>.</p>
</item></ulist>
</p>
<p><propref comp="ctd" prop="prohibited substitutions"/> determine
whether an element declaration appearing in a <termref def="key-contentModel">
content model</termref> is prevented from additionally
<termref def="key-vn">validating</termref> element items with an <specref ref="xsi_type"/> attribute that
identifies a complex type definition <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> by <pt>extension</pt> or
<pt>restriction</pt> from this definition, or element items in
a substitution group whose type definition is similarly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref>:
If <propref comp="ctd" prop="prohibited substitutions"/> is empty,
then all such substitutions are allowed, otherwise, the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivation</xtermref> method(s) it
names are disallowed.
</p>
<p dg="b2861cc-1"><propref comp="ctd" prop="assertions"/> constrain 
<!--*
* material suppressed here by diff group b2861cc-1a *
*--> 
elements and attributes
<phrase dg="b2861cc-1a">to exist, not to exist, or to 
have specified values</phrase>.
Though specified as a sequence, the order
among the assertions is not significant during assessment.
See <specref ref="cAssertions"/>.</p>
 <p>See <specref ref="cAnnotations"/> for information on the role of the
<propref comp="ctd" prop="annotations"/> property.</p>
</div3>
    <div3 id="declare-type">
<head>XML Representation of Complex Type Definitions</head>
<p>The XML representation for a complex type definition schema component is a
<eltref ref="complexType"/> element information item.</p>
 <p>The XML representation for complex type definitions with
a <!--*
* material suppressed here by diff group ep01 *
*--><propref comp="ctd" prop="content type"/><phrase dg="ep01">with <propref comp="ct" prop="variety"/> <pt>simple</pt></phrase> is significantly different
from that of those with other <propref comp="ctd" prop="content type"/>s, and this
is reflected in the presentation below, which displays first the elements
involved in the first case, then those for the second.  The property mapping is shown once for each case.</p>

<!--* <ednote diff="add" dg="b2867-1">
 <edtext>How to make <code>notNamespace</code> on <code>&lt;anyAttribute></code> show
  "list of (anyURI | (##targetNamespace | ##local))"?</edtext>
</ednote> *-->
<reprdef>
 <reprelt eltname="complexType" type="complexType"/>
 <p>Whichever alternative for the content of <eltref ref="complexType"/> is
chosen, the following property mappings apply:</p>
 <reprcomp abstract="Complex Type Definition" ref="Complex_Type_Definition_details">
  <propmap comp="ctd" prop="name">The <termref def="key-vv">actual value</termref> of the <code>name</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> if present, otherwise <termref def="key-null">absent</termref>.</propmap>
  <propmap comp="ctd" prop="target namespace">The <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the <eltref ref="schema"/> ancestor
element information item if present, otherwise <termref def="key-null">absent</termref>.</propmap>
<propmap comp="ctd" prop="abstract">The <termref def="key-vv">actual value</termref> of the <code>abstract</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <pt>false</pt>.</propmap>
<propmap comp="ctd" prop="prohibited substitutions">A set corresponding to the <termref def="key-vv">actual value</termref> of the
<code>block</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise on the <termref def="key-vv">actual value</termref> of the
<code>blockDefault</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the ancestor <eltref ref="schema"/> element
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
 <olist role="caseval">
  <item>
   <p role="if">the <local>EBV</local> is the empty string</p>
   <p role="then">the empty set;</p>
  </item>
  <item>
   <p role="if">the <local>EBV</local> is <code>#all</code></p>
   <p role="then"><code>{</code><pt>extension</pt>, <pt>restriction</pt><code>}</code>;</p>
  </item>
  <item>
   <p role="otherwise">a set with members drawn from the set above, each being present or
absent depending on whether the <termref def="key-vv">actual value</termref> (which is a list) contains an
equivalently named item.
   <note>
       <p>Although the <code>blockDefault</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <eltref ref="schema"/> <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> include values other than <pt>restriction</pt> or<pt>extension</pt>, those values are ignored in the determination of <propref comp="ctd" prop="prohibited substitutions"/> for complex type definitions (they <emph>are</emph> used elsewhere).</p>
      </note>
   </p>
  </item>
 </olist>
</propmap>
<propmap comp="ctd" prop="final">As for <propref comp="ctd" prop="prohibited substitutions"/> above, but using the
<code>final</code> and <code>finalDefault</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> in place of the
<code>block</code> and <code>blockDefault</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref>.</propmap>
 <propmap comp="ctd" prop="context" dg="context-2338">If the <code>name</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present, then <termref def="key-null"/>,
otherwise (the parent element information item will be <eltref ref="element"/>), the <compref ref="ed"/> corresponding to that parent information item.</propmap>
 <propmap comp="ctd" prop="assertions" dg="b2861cc-1">
 A sequence whose members are <compref name="Assertion" ref="as"/>s drawn from the following
 sources, in order:
 <olist>
  <item>
   <p><!--*
* material suppressed here by diff group b2861cc-1a *
*--><phrase dg="b2861cc-1a">The <propref comp="ctd" prop="assertions"/>
    of the <propref comp="ctd" prop="base type definition"/>.</phrase></p>
  </item>
  <!--*
* material suppressed here by diff group b2861cc-1g *
*-->
  <!--*
* material suppressed here by diff group b2861cc-1g *
*-->
  <item>
   <p><compref name="Assertion" ref="as"/>s corresponding to all the <eltref ref="assert"/> and <eltref ref="report"/>
    element information items among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, in order.
    <!--*
* material suppressed here by diff group b2861cc-1g *
*--></p>
  </item>
 </olist>
 </propmap>
  <propmap comp="ctd" prop="annotations">The annotations corresponding to the <eltref ref="annotation"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, in the <eltref ref="simpleContent"/> and
<eltref ref="complexContent"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, and in their <eltref ref="restriction" inside="simpleContent"/> and <eltref ref="extension" inside="simpleContent"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
</reprcomp>
<p>When the <eltref ref="simpleContent"/> alternative is chosen, the following
elements are relevant, and the remaining property mappings are as below.  Note that either
<eltref ref="restriction" inside="simpleContent"/> or <eltref ref="extension" inside="simpleContent"/> <rfc2119>must</rfc2119> be chosen as the
content of <eltref ref="simpleContent"/>.</p>
 <reprelt eltname="simpleContent"/>
 <reprelt eltname="restriction" type="simpleRestrictionType" local="simpleContent"/>
 <reprelt eltname="extension" type="simpleExtensionType" local="simpleContent"/> 
 <reprelt eltname="attributeGroup" type="attributeGroupRef" local="simpleContent"/>
 <reprelt eltname="anyAttribute"/>
 <reprcomp abstract="Complex Type Definition with simple content" ref="Complex_Type_Definition_details">
<propmap comp="ctd" prop="base type definition">The type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>
  <propmap comp="ctd" prop="derivation method">If the <eltref ref="restriction" inside="simpleContent"/> alternative
is chosen, then <pt>restriction</pt>, otherwise (the <eltref ref="extension" inside="simpleContent"/> alternative
is chosen) <pt>extension</pt>.</propmap>
<propmap comp="ctd" prop="attribute uses">A union of sets of attribute uses as follows 
 <olist>
  <item id="c-add1">
   <p>The set of attribute uses corresponding to the <eltref ref="attribute"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any.</p>
  </item>
  <item id="c-add2">
   <p>The <propref comp="agd" prop="attribute uses"/> of the
attribute groups <termref def="src-resolve">resolved</termref> to by the <termref def="key-vv">actual value</termref>s of the <code>ref</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the <eltref ref="attributeGroup" inside="simpleContent"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any.</p>
  </item>
  <item>
   <p>if the type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is a complex type definition, the
<propref comp="ctd" prop="attribute uses"/> of that type definition, unless
the <eltref ref="restriction" inside="simpleContent"/> alternative is chosen, in which case some members of
that type definition's <propref comp="ctd" prop="attribute uses"/> 
<!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><rfc2119>must not</rfc2119></phrase> 
be
included, namely those whose
<propref comp="au" prop="attribute declaration"/>'s
<propref comp="ad" prop="name"/> and <propref comp="ad" prop="target namespace"/> are the same as
<olist role="orval">
 <item>
  <p>the <propref comp="ad" prop="name"/> and <propref comp="ad" prop="target namespace"/> of the <propref comp="au" prop="attribute declaration"/> of an attribute use in the set per <clauseref ref="c-add1"/> or <clauseref ref="c-add2"/> above;</p>
 </item>
 <item>
  <p>what would have been the <propref comp="ad" prop="name"/> and <propref comp="ad" prop="target namespace"/> of the <propref comp="au" prop="attribute declaration"/> of an attribute use in the set per <clauseref ref="c-add1"/> above but for the <termref def="key-vv">actual value</termref> of the <code>use</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the relevant <eltref ref="attribute"/> among the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="restriction" inside="simpleContent"/> being <pt>prohibited</pt>.</p>
 </item>
</olist></p>
  </item>
 </olist>
</propmap>
<propmap comp="ctd" prop="attribute wildcard">
 <olist>
  <item>
   <p><termdef id="key-law" term="local wildcard" role="local">Let the <term>local wildcard</term> be defined as</termdef>
 <olist role="caseval">
     <item>
      <p role="if">there is an <eltref ref="anyAttribute"/> present</p>
      <p role="then">a wildcard based
on the <termref def="key-vv">actual value</termref>s of <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1">its</phrase> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> and the <eltref ref="annotation"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, exactly as for the wildcard
corresponding to an <eltref ref="any"/> element as set out in <specref ref="declare-openness"/>;</p>
     </item>
     <item>
      <p role="otherwise"><termref def="key-null">absent</termref>.</p>
     </item>
    </olist></p>
  </item>
  <item>
   <p><termdef id="key-eaw" term="complete wildcard" role="local">Let the <term>complete wildcard</term> be defined as</termdef>
 <olist role="caseval">
  <item>
   <p role="if">there are no <eltref ref="attributeGroup" inside="simpleContent"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> corresponding
to attribute groups with <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
 <propref comp="agd" prop="attribute wildcard"/>s</p>
   <p role="then">the <termref def="key-law">local wildcard</termref>.</p>
  </item>
  <item>
   <p role="if">there are one or more <eltref ref="attributeGroup" inside="simpleContent"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> corresponding
to attribute groups with <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
 <propref comp="agd" prop="attribute wildcard"/>s</p>
   <p role="then">
    <olist role="caseval">
     <item id="c-awi1">
      <p role="if">there is an <eltref ref="anyAttribute"/> present</p>
      <p role="then">a wildcard whose <propref comp="w" prop="process contents"/> and
<propref comp="w" prop="annotations"/> are those of the <termref def="key-law">local
wildcard</termref>, and whose <propref comp="w" prop="namespace constraint"/> is the intensional intersection of the <propref comp="w" prop="namespace constraint"/> of the <termref def="key-law">local wildcard</termref>
and of the <propref comp="w" prop="namespace constraint"/>s of all the <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
 <propref comp="agd" prop="attribute wildcard"/>s of the attribute groups corresponding to the <eltref ref="attributeGroup" inside="simpleContent"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, as defined in <specref ref="cos-aw-intersect"/>.</p>
     </item>
     <item id="c-awi2">
   <p role="if">there is no <eltref ref="anyAttribute"/> present</p>
      <p role="then">a wildcard whose properties are as follows:
       <glist>
        <gitem>
         <label><propref comp="w" prop="process contents"/></label>
         <def>
          <p>The <propref comp="w" prop="process contents"/> of the first <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
 <propref comp="agd" prop="attribute wildcard"/> of an attribute group among the
attribute groups corresponding to the <eltref ref="attributeGroup" inside="simpleContent"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>.</p>
         </def>
        </gitem>
        <gitem>
         <label><propref comp="w" prop="namespace constraint"/></label>
         <def>
          <p>The intensional intersection of the <propref comp="w" prop="namespace constraint"/>s of all the <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
 <propref comp="agd" prop="attribute wildcard"/>s of the attribute groups corresponding to the <eltref ref="attributeGroup" inside="simpleContent"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, as defined in <specref ref="cos-aw-intersect"/>.</p>
         </def>
        </gitem>
        <gitem>
         <label><propref comp="w" prop="annotations"/></label>
         <def><p><termref def="key-null">absent</termref>.</p>
         </def>
        </gitem>
       </glist>
      </p>
  </item>
    </olist>
   </p>
  </item>  
 </olist>
</p>
  </item>
  <item>
   <p>The value is then determined by
 <olist role="caseval">
<item>
      <p role="if">the <eltref ref="restriction" inside="simpleContent"/> alternative is chosen</p>
      <p role="then">the <termref def="key-eaw">complete wildcard</termref>;</p>
     </item>
  <item>
   <p role="if">the <eltref ref="extension" inside="simpleContent"/> alternative is chosen</p>
   <p role="then">
    <olist>
     <item>
      <p><termdef id="key-baw" term="base wildcard" role="local">let the <term>base
wildcard</term> be defined as</termdef>
       <olist role="caseval">
     <item>
      <p role="if">the type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is a complex type definition
with an <propref comp="ctd" prop="attribute wildcard"/></p>
      <p role="then">that <propref comp="ctd" prop="attribute wildcard"/>.</p>
     </item>
     <item>
      <p role="otherwise"><termref def="key-null">absent</termref>.</p>
     </item>
    </olist>
      </p>
     </item>
     <item>
      <p>The value is then determined by
    <olist role="caseval">
     <item>
      <p role="if">the <termref def="key-baw">base wildcard</termref> is <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
</p>
      <p role="then">
       <olist role="caseval">
        <item>
         <p role="if">the <termref def="key-eaw">complete wildcard</termref> is <termref def="key-null">absent</termref></p>
         <p role="then">the <termref def="key-baw">base wildcard</termref>.</p>
        </item>
        <item id="c-awu">
         <p role="otherwise">a wildcard whose <propref comp="w" prop="process contents"/> and
<propref comp="w" prop="annotations"/> are those of the <termref def="key-eaw">complete
wildcard</termref>, and whose <propref comp="w" prop="namespace constraint"/> is the
intensional union of the <propref comp="w" prop="namespace constraint"/> of the <termref def="key-eaw">complete wildcard</termref>
and of the <termref def="key-baw">base wildcard</termref>, as defined in <specref ref="cos-aw-union"/>.</p>
        </item>
       </olist>
      </p>
     </item>     
     <item>
      <p role="otherwise">(the <termref def="key-baw">base
wildcard</termref> is <termref def="key-null">absent</termref>) the <termref def="key-eaw">complete
wildcard</termref></p>
     </item>
    </olist></p>
     </item>
    </olist>
   </p>
  </item>
 </olist></p>
  </item>
 </olist>
</propmap>
<propmap comp="ctd" prop="content type">
 <phrase dg="ep01">A <compref name="Content Type" ref="ct"/> as follows:</phrase>
 <pvlist>
  <pvpair comp="ct" prop="variety" dg="ep01"><pt>simple</pt></pvpair>
  <pvpair comp="ct" prop="particle" dg="ep01"><termref def="key-null"/></pvpair>
  <pvpair comp="ct" prop="simple type definition"><olist role="caseval">
  <item><p role="if">the type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is a complex type definition whose own <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/> <pt>simple</pt></phrase> and the <eltref ref="restriction" inside="simpleContent"/> alternative is chosen</p>
   <p role="then">starting from either
         <olist>
          <item id="std1cl">
           <p>the simple type definition corresponding to the <eltref ref="simpleType"/> among
the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="restriction" inside="simpleContent"/> if there
is one;</p>
          </item>
          <item id="std2cl">
           <p>otherwise (<eltref ref="restriction" inside="simpleContent"/> has no <eltref ref="simpleType"/> among its
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>), the simple type definition which is the <phrase dg="ep01"><propref comp="ct" prop="simple type definition"/> of the </phrase><propref comp="ctd" prop="content type"/> of the type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></p>
          </item>
         </olist>
a simple type definition which restricts the simple type definition identified in
<clauseref ref="std1cl"/> or <clauseref ref="std2cl"/> with a
set of facet components corresponding to the appropriate element information
items among the <eltref ref="restriction" inside="simpleContent"/>'s
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> (i.e. those which specify facets, if any), as
defined in <specref ref="st-restrict-facets"/>;
   </p>
  </item>
  <item><p role="if">the type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is a complex type definition
whose own <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase>
<pt>mixed</pt> and <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="particle"/> a <compref name="Particle" ref="p"/></phrase> which
is <termref def="cd-emptiable">emptiable</termref>, as defined in <specref ref="cos-group-emptiable"/> and the <eltref ref="restriction" inside="simpleContent"/> alternative is chosen</p>
   <p role="then">starting from
         the simple type definition corresponding to the <eltref ref="simpleType"/> among
the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="restriction" inside="simpleContent"/> (which
<rfc2119>must</rfc2119> be present)
a simple type definition which restricts that simple type definition with a
set of facet components corresponding to the appropriate element information
items among the <eltref ref="restriction" inside="simpleContent"/>'s
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> (i.e. those which specify facets, if any), as
defined in <specref ref="st-restrict-facets"/>;
   </p>
  </item>
  <item><p role="if">the type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is a complex type definition
(whose own <propref comp="ctd" prop="content type"/> <rfc2119>must</rfc2119> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">have <propref comp="ct" prop="variety"/> <pt>simple</pt></phrase>, see below) and the <eltref ref="extension" inside="simpleContent"/> alternative is chosen</p>
   <p role="then">
the <phrase dg="ep01"><propref comp="ct" prop="simple type definition"/> of the </phrase><propref comp="ctd" prop="content type"/> of that complex type definition;</p>
  </item>
  <item>
   <p role="otherwise">(the type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is a simple type definition and
the <eltref ref="extension" inside="simpleContent"/> alternative is chosen), then
that simple type definition.</p>
  </item>
 </olist></pvpair>
 </pvlist>
 
</propmap>
</reprcomp>
<p>When the <eltref ref="complexContent"/> alternative is chosen, the
following 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
<eltref ref="restriction" inside="complexContent"/> or <eltref ref="extension" inside="complexContent"/> <rfc2119>must</rfc2119> be chosen as the
content of <eltref ref="complexContent"/>, but their content models
are different in this case from the case above when they occur as
children of
<eltref ref="simpleContent"/>.</p>
 <p>The property mappings below are <emph>also</emph> used in the case where
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 
<!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><rfc2119>must</rfc2119></phrase>
be modified as necessary.</p>
 <reprelt eltname="complexContent"/>
 <reprelt eltname="restriction" type="complexRestrictionType" local="complexContent"/>
 <reprelt eltname="extension" type="extensionType" local="complexContent"/>
 <reprcomp abstract="Complex Type Definition with complex content" ref="Complex_Type_Definition_details">
<propmap comp="ctd" prop="base type definition">The type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>
  <propmap comp="ctd" prop="derivation method">If the <eltref ref="restriction" inside="complexContent"/> alternative
is chosen, then <pt>restriction</pt>, otherwise (the <eltref ref="extension" inside="complexContent"/> alternative
is chosen) <pt>extension</pt>.</propmap>
<propmap comp="ctd" prop="attribute uses">A union of sets of attribute uses as follows: 
 <olist>
  <item id="c-ad1">
   <p>The set of attribute uses corresponding to the <eltref ref="attribute"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any.</p>
  </item>
  <item id="c-ad2">
   <p>The <propref comp="agd" prop="attribute uses"/> of the
attribute groups <termref def="src-resolve">resolved</termref> to by the <termref def="key-vv">actual value</termref>s of the <code>ref</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the <eltref ref="attributeGroup" inside="simpleContent"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any.</p>
  </item>
  <item>
   <p>The
<propref comp="ctd" prop="attribute uses"/> of the type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, unless
the <eltref ref="restriction" inside="complexContent"/> alternative
is chosen, in which case some members of
that type definition's <propref comp="ctd" prop="attribute uses"/> <rfc2119>must not</rfc2119> be
included, namely those whose
<propref comp="au" prop="attribute declaration"/>'s
<propref comp="ad" prop="name"/> and <propref comp="ad" prop="target namespace"/> are the same as
<olist role="orval">
 <item>
  <p>The <propref comp="ad" prop="name"/> and <propref comp="ad" prop="target namespace"/> of the <propref comp="au" prop="attribute declaration"/> of an attribute use in the set per <clauseref ref="c-ad1"/> or <clauseref ref="c-ad2"/> above;</p>
 </item>
 <item>
  <p>what would have been the <propref comp="ad" prop="name"/> and <propref comp="ad" prop="target namespace"/> of the <propref comp="au" prop="attribute declaration"/> of an attribute use in the set per <clauseref ref="c-ad1"/> above but for the <termref def="key-vv">actual value</termref> of the <code>use</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the relevant <eltref ref="attribute"/> among the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="restriction" inside="complexContent"/> being <pt>prohibited</pt>.</p>
 </item>
</olist></p>
  </item>
 </olist>
</propmap>
<propmap comp="ctd" prop="attribute wildcard">As above for the <eltref ref="simpleContent"/> alternative.</propmap>
<propmap comp="ctd" prop="content type">
 <olist>
  <item>
   <p><termdef id="key-efm" term="effective mixed" role="local">Let the
<term>effective mixed</term> be </termdef>
 <olist role="caseval">
       <item>
        <p role="if">the <code>mixed</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present on <eltref ref="complexContent"/></p>
        <p role="then">its <termref def="key-vv">actual value</termref>;</p>
       </item>
       <item>
        <p role="if">the <code>mixed</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present on
<eltref ref="complexType"/></p>
        <p role="then">its <termref def="key-vv">actual value</termref>;</p>
       </item>
       <item>
        <p role="otherwise"><code>false</code>.</p>
       </item>
      </olist></p>
  </item>
  <!--*
* material suppressed here by diff group all-2506-x *
*-->
 <item>
   <p>
<termdef id="key-exg" term="effective content" role="local">Let the <term>effective
content</term> be </termdef><olist role="caseval">
  <item id="c-cme"><p role="if"> 
<olist role="ortest" dg="all-2506-x">
 <item>
  <p>There is no <eltref ref="group"/>, <eltref ref="all"/>, <eltref ref="choice"/> or <eltref ref="sequence"/> among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>;</p>
 </item>
 <item>
           <p>There is an <eltref ref="all"/> or <eltref ref="sequence"/> among
the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> with no <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of its own excluding <eltref ref="annotation"/>;</p>
          </item>
 <item>
           <p>There is a <eltref ref="choice"/> among
the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> with no <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of its own excluding <eltref ref="annotation"/> whose <code>minOccurs</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> has the <termref def="key-vv">actual value</termref> <code>0</code>;</p>
          </item>
</olist>
<!--*
* material suppressed here by diff group all-2506-x *
*-->
</p>
   <p role="then">
    <olist role="caseval">
     <item>
      <p role="if">the <termref def="key-efm">effective mixed</termref> is <code>true</code></p>
      <p role="then">A particle whose properties are as follows:
       <glist>
        <gitem>
         <label><propref comp="p" prop="min occurs"/></label>
         <def>
          <p><code>1</code></p>
         </def>
        </gitem>
        <gitem>
         <label><propref comp="p" prop="max occurs"/></label>
         <def>
          <p><code>1</code></p>
         </def>
        </gitem>
        <gitem>
         <label><propref comp="p" prop="term"/></label>
         <def>
          <p>A model group whose <propref comp="mg" prop="compositor"/> is
<pt>sequence</pt> and whose <propref comp="mg" prop="particles"/> is empty.</p>
         </def>
        </gitem>
       </glist>.</p></item>
     <item>
     <p role="otherwise"><pt>empty</pt></p></item>
    </olist></p>
  </item>
<item>
<p role="otherwise"><phrase dg="all-2506-x">the particle corresponding to
the <eltref ref="all"/>, <eltref ref="choice"/>, <eltref ref="group"/> or
<eltref ref="sequence"/> among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>.</phrase><!--*
* material suppressed here by diff group all-2506-x *
*--></p>
</item>
   </olist></p>
  </item>
  <item>
   <p>
 Then the value of the property is
 <olist role="caseval">
  <item><p role="if">the <eltref ref="restriction" inside="complexContent"/> alternative is chosen</p>
  <p role="then">
   <olist role="caseval">
    <item>
     <p role="if">the <termref def="key-exg">effective content</termref> is
<pt>empty</pt> </p>
     <p role="then"><phrase dg="ep01">a <compref name="Content Type" ref="ct"/> as follows:</phrase>
      <pvlist>
       <pvpair comp="ct" prop="variety"><pt>empty</pt></pvpair>
       <pvpair comp="ct" prop="particle" dg="ep01"><termref def="key-null"/></pvpair>
       <pvpair comp="ct" prop="simple type definition" dg="ep01"><termref def="key-null"/></pvpair>
      </pvlist>
     </p>
    </item>
    <item id="c-ctrp">
   <p role="otherwise"><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">a <compref name="Content Type" ref="ct"/> as follows:</phrase> 
    <!--*
* material suppressed here by diff group ep01 *
*-->
    <pvlist>
     <pvpair comp="ct" prop="variety"><pt>mixed</pt> if the <termref def="key-efm">effective mixed</termref> is <code>true</code>, otherwise <pt>elementOnly</pt></pvpair>
       <pvpair comp="ct" prop="particle" dg="ep01">The <termref def="key-exg">effective content</termref></pvpair>
       <pvpair comp="ct" prop="simple type definition" dg="ep01"><termref def="key-null"/></pvpair>
    </pvlist>
   </p>
  </item>
   </olist>
  </p>
  </item>
  <item><p role="if">the <eltref ref="extension" inside="complexContent"/> alternative is chosen</p>
   <p role="then">
    <olist role="caseval">
        <item>
         <p role="if">the <termref def="key-exg">effective
content</termref> is <pt>empty</pt></p>
         <p role="then">the
<propref comp="ctd" prop="content type"/> of the type definition <termref def="src-resolve">resolved</termref> to
by the <termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></p>
        </item>
     <item>
<p role="if">the type definition <termref def="src-resolve">resolved</termref> to by the <termref def="key-vv">actual value</termref> of the
<code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> has a <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">with <propref comp="ct" prop="variety"/></phrase> <pt>empty</pt><phrase dg="all-2506-1">
or <pt>simple</pt></phrase></p>
<p role="then">a <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref name="Content Type" ref="ct"/></phrase>
as per <clauseref ref="c-ctrp"/> above;</p>
        </item>
     <item>
         <p role="otherwise">a <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref name="Content Type" ref="ct"/> as follows:</phrase>
          <pvlist>
           <pvpair comp="ct" prop="variety"><pt>mixed</pt> if the <termref def="key-efm">effective mixed</termref> is <code>true</code>, otherwise <pt>elementOnly</pt></pvpair>
           <pvpair comp="ct" prop="particle">a <compref name="Particle" ref="p"/> whose properties are as follows:
       <glist>
        <gitem>
         <label><propref comp="p" prop="min occurs"/></label>
         <def>
          <p><code>1</code></p>
         </def>
        </gitem>
        <gitem>
         <label><propref comp="p" prop="max occurs"/></label>
         <def>
          <p><code>1</code></p>
         </def>
        </gitem>
        <gitem>
         <label><propref comp="p" prop="term"/></label>
         <def>
<p dg="all-2506-x">A model group whose <propref comp="mg" prop="compositor"/> is <pt>sequence</pt> and whose <propref comp="mg" prop="particles"/> are the particle of the <propref comp="ctd" prop="content type"/> of the
type definition <termref def="src-resolve">resolved</termref> to by
the <termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> followed by the
<termref def="key-exg">effective content</termref>.</p>
<!--*
* material suppressed here by diff group all-2506-x *
*-->
</def>
</gitem>
</glist></pvpair>
<pvpair comp="ct" prop="simple type definition" dg="ep01"><termref def="key-null"/></pvpair>
</pvlist></p>
</item>
</olist>
</p>
</item>
</olist></p>
</item>
</olist>
</propmap>
</reprcomp>
</reprdef>
<note dg="b2861cc-1">
 <p>If the <propref comp="ctd" prop="base type definition"/> is a complex type definition,
  then the <propref comp="ctd" prop="assertions"/> always contain members of the
 <propref comp="ctd" prop="assertions"/> of the <propref comp="ctd" prop="base type definition"/>,
  no matter which alternatives are chosen in the XML representation,
  <eltref ref="simpleContent"/> or <eltref ref="complexContent"/>,
  <eltref ref="restriction" inside="simpleContent"/> or <eltref ref="extension" inside="simpleContent"/>.
 </p>
</note>
<note>
  <p>Aside from the simple coherence requirements enforced above, constraining
type definitions identified as restrictions to actually <emph>be</emph>
restrictions, that is, to <termref def="key-vn">validate</termref> a
subset of the items which are
<termref def="key-vn">validated</termref> by their base type definition, is enforced in <specref ref="coss-ct"/>.</p>
 </note>
     <note>
      <p>The <emph>only</emph> substantive function of the value <pt>prohibited</pt> for the
<code>use</code> attribute of an <eltref ref="attribute"/> is in establishing
the correspondence between a complex type defined by restriction and its XML
representation.  It serves to prevent
inheritance of an identically named attribute use from the <propref comp="ctd" prop="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>
     </note>
<p>Careful consideration of the above concrete syntax reveals that
a type definition need consist of no more than a name, i.e. that
 <code>&lt;complexType name="anyThing"/&gt;</code> is allowed.</p>
 <note role="example">
    <eg xml:space="preserve">&lt;xs:complexType name="length1"&gt;
 &lt;xs:simpleContent&gt;
  &lt;xs:extension base="xs:nonNegativeInteger"&gt;
   &lt;xs:attribute name="unit" type="xs:NMTOKEN"/&gt;
  &lt;/xs:extension&gt;
 &lt;/xs:simpleContent&gt;
&lt;/xs:complexType&gt;

&lt;xs:element name="width" type="length1"/&gt;

  &lt;width unit="cm"&gt;25&lt;/width&gt;

&lt;xs:complexType name="length2"&gt;
 &lt;xs:complexContent&gt;
  &lt;xs:restriction base="
     <phrase diff="nsq-del" dg="rq17">xs:anyType</phrase>
     <phrase diff="nsq-add" dg="rq17">xs:rootType</phrase>
     "&gt;
   &lt;xs:sequence&gt;
    &lt;xs:element name="size" type="xs:nonNegativeInteger"/&gt;
    &lt;xs:element name="unit" type="xs:NMTOKEN"/&gt;
   &lt;/xs:sequence&gt;
  &lt;/xs:restriction&gt;
 &lt;/xs:complexContent&gt;
&lt;/xs:complexType&gt;

&lt;xs:element name="depth" type="length2"/&gt;

  &lt;depth&gt;
   &lt;size&gt;25&lt;/size&gt;&lt;unit&gt;cm&lt;/unit&gt;
  &lt;/depth&gt;

&lt;xs:complexType name="length3"&gt;
 &lt;xs:sequence&gt;
  &lt;xs:element name="size" type="xs:nonNegativeInteger"/&gt;
  &lt;xs:element name="unit" type="xs:NMTOKEN"/&gt;
 &lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;
    </eg>
  <p>
    Three approaches to defining a type for length:  one with
character data content constrained by reference to
    a built-in datatype, and one attribute, the other two using two
elements.  <code>length3</code> is the abbreviated alternative to
<code>length2</code>:  they correspond to identical type definition components.
</p>
</note>
 
<note role="example">
   <eg xml:space="preserve">&lt;xs:complexType name="personName"&gt;
 &lt;xs:sequence&gt;
  &lt;xs:element name="title" minOccurs="0"/&gt;
  &lt;xs:element name="forename" minOccurs="0" maxOccurs="unbounded"/&gt;
  &lt;xs:element name="surname"/&gt;
 &lt;/xs:sequence&gt;
&lt;/xs:complexType&gt;

&lt;xs:complexType name="extendedName"&gt;
 &lt;xs:complexContent&gt;
  &lt;xs:extension base="personName"&gt;
   &lt;xs:sequence&gt;
    &lt;xs:element name="generation" minOccurs="0"/&gt;
   &lt;/xs:sequence&gt;
  &lt;/xs:extension&gt;
 &lt;/xs:complexContent&gt;
&lt;/xs:complexType&gt;

&lt;xs:element name="addressee" type="extendedName"/&gt;

  &lt;addressee&gt;
   &lt;forename&gt;Albert&lt;/forename&gt;
   &lt;forename&gt;Arnold&lt;/forename&gt;
   &lt;surname&gt;Gore&lt;/surname&gt;
   &lt;generation&gt;Jr&lt;/generation&gt;
  &lt;/addressee&gt;</eg>
   <p>A type definition for personal names, and a definition <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> by
extension which adds a single element; an element declaration referencing the
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> definition, and a <termref def="key-vn">valid</termref> instance thereof.</p>
  </note> 
<note role="example">
   <eg xml:space="preserve">&lt;xs:complexType name="simpleName"&gt;
 &lt;xs:complexContent&gt;
  &lt;xs:restriction base="personName"&gt;
   &lt;xs:sequence&gt;
    &lt;xs:element name="forename" minOccurs="1" maxOccurs="1"/&gt;
    &lt;xs:element name="surname"/&gt;
   &lt;/xs:sequence&gt;
  &lt;/xs:restriction&gt;
 &lt;/xs:complexContent&gt;
&lt;/xs:complexType&gt;

&lt;xs:element name="who" type="simpleName"/&gt;

   &lt;who&gt;
    &lt;forename&gt;Bill&lt;/forename&gt;
    &lt;surname&gt;Clinton&lt;/surname&gt;
   &lt;/who&gt;</eg>
   <p>A simplified type definition
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from the base type from the previous example by restriction, eliminating one optional daughter and
fixing another to occur exactly once; an element declared by reference to it,
and a <termref def="key-vn">valid</termref> instance thereof.</p>
  </note>
 <note role="example">
  <eg xml:space="preserve">&lt;xs:complexType name="paraType" mixed="true"&gt;
 &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
  &lt;xs:element ref="emph"/&gt;
  &lt;xs:element ref="strong"/&gt;
 &lt;/xs:choice&gt;
 &lt;xs:attribute name="version" type="xs:<!--*
* material suppressed here by diff group b1915bis *
*--><phrase dg="b1915bis">decimal</phrase>"/&gt;
&lt;/xs:complexType&gt;</eg>
  <p>A further illustration of the abbreviated form, with the
<code>mixed</code> attribute appearing on <code>complexType</code> itself.</p>
 </note>

 <!--*
* material suppressed here by diff group b2867-2 *
*-->
</div3>
    <div3>
      <head>Constraints on XML Representations of Complex Type Definitions</head>
      <constraintnote id="src-ct" type="src">
  <head>Complex Type Definition Representation OK</head>
  <p>In addition to the conditions imposed on <eltref ref="complexType"/> element
information items by the schema for schemas, 
   <olist role="and.apply">
    <item>
     <p>If the <eltref ref="complexContent"/> alternative is chosen, the type definition <termref def="src-resolve">resolved</termref> to
by the <termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> <rfc2119>must</rfc2119> be a complex type definition;</p>
    </item>
    <item>
     <p>If the <eltref ref="simpleContent"/> alternative is chosen, 
      <olist role="and">
       <item>
        <p>The type definition <termref def="src-resolve">resolved</termref> to
by the <termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase>
      <olist role="orval">
       <item>
        <p>a complex type
definition whose <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/> <pt>simple</pt></phrase>;</p>
       </item>
       <item id="cl-esc">
        <p>only if the
<eltref ref="restriction" inside="simpleContent"/> alternative is also chosen, a complex type
definition whose <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has
<propref comp="ct" prop="variety"/></phrase> <pt>mixed</pt> and
<!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="particle"/> a <compref name="Particle" ref="p"/></phrase>
which is
  <termref def="cd-emptiable">emptiable</termref>, as defined in <specref ref="cos-group-emptiable"/>;</p>
       </item>
       <item>
        <p>only if the
<eltref ref="extension" inside="simpleContent"/> alternative is also chosen, a simple type definition.</p>
       </item>
      </olist></p>
       </item>
       <item>
        <p>If <clauseref ref="cl-esc"/> above is satisfied, then there <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a
<eltref ref="simpleType"/> among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="restriction" inside="simpleContent"/>.</p>
       </item>
      </olist>
     </p>            
     <note>
      <p>Although not explicitly ruled out either here or in <specref ref="normative-schemaSchema"/>, specifying <code>&lt;xs:complexType . . .mixed='true'</code> when the <eltref ref="simpleContent"/> alternative is chosen has no effect on the corresponding component, and <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><rfc2119>should</rfc2119></phrase> be avoided.  This may be ruled out in a subsequent version of this specification.</p>
     </note>
    </item>
    <item>
     <p>The corresponding complex type definition component <rfc2119>must</rfc2119> satisfy the conditions set
out in <specref ref="coss-ct"/>;</p>
    </item>
    <!--*
* material suppressed here by diff group b2867-1 *
*-->
   </olist>
  </p>
 </constraintnote>
     </div3>
    <div3 id="formal-complex-type">
    <head>Complex Type Definition Validation Rules</head>
    <constraintnote type="cvc" id="cvc-complex-type">
     <head>Element Locally Valid (Complex Type)</head>
     <p>For an element information item to be locally <termref def="key-vn">valid</termref> with respect to a complex type definition
      <olist role="and">
       <!--* <item> ALV ALV ALV *-->
       <!--*
* material suppressed here by diff group rq17p *
*-->
       <item>
        <p>If <clauseref ref="c-nl"/> of <specref ref="cvc-elt"/> did not
apply, then <olist role="casetest">
         <item>
        <p role="if">the <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>empty</pt></p>
          <p role="then">the element
information item has no character or element information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>.</p>
       </item>
       <item id="c-sv2">
        <p role="if">the <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/> <pt>simple</pt></phrase></p>
        <p role="then">the element information item has no element
information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, and the <termref def="key-nv">normalized value</termref> of the element information
item is <termref def="key-vn">valid</termref> with respect to <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">the <propref comp="ctd" prop="content type"/>'s <propref comp="ct" prop="simple type definition"/></phrase> as defined by <specref ref="cvc-simple-type"/>.</p>
       </item>
       <item>
        <p role="if">the <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>element-only</pt></p>
        <p role="then">the
element information item has no character information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> other
than those whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.character">character code</xpropref> is defined as a <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-S">white space</xtermref>
in <bibref ref="ref-xml"/>.
<note dg="b1838">
<p>It is implementation-defined whether a schema processor supports
the definition of <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-S">white space</xnt>
from <bibref ref="ref-xml"/>, or that from <bibref ref="ref-xml-1.0"/>,
or both.</p>
</note>
</p>
       </item>
       <item>
        <p role="if">the <propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>element-only</pt> or
<pt>mixed</pt></p>
        <p role="then">the sequence of the element information item's element
information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, taken in order, is <termref def="key-vn">valid</termref> with
respect to the <propref comp="ctd" prop="content type"/>'s <phrase dg="ep01"><propref comp="ct" prop="particle"/></phrase>, as defined in <specref ref="cvc-particle"/>.</p>
       </item>
        </olist></p>
       </item>
       <item id="c-aam">
        <p>For each attribute information item in the element information
item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> 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>,
         <olist role="casetest">
          <item id="c-ctma">
           <p role="if">there is among the <propref comp="ctd" prop="attribute uses"/> an
attribute use with an <propref comp="au" prop="attribute declaration"/> whose
<propref comp="ad" prop="name"/> matches the attribute information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref> and whose <propref comp="ad" prop="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 comp="ad" prop="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>           
           <p role="then">the attribute information <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="key-vn">valid</termref> with respect to that attribute use as per <specref ref="cvc-au"/>.  In this case the <propref comp="au" prop="attribute declaration"/> 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>
          </item>
          <item id="c-avaw">
           <p role="otherwise">
            <olist role="andtest">
             <item>
              <p>There <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> an <propref comp="ctd" prop="attribute wildcard"/>.</p>
             </item>
             <item>
              <p>The
attribute information item <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="key-vn">valid</termref> with respect to it as defined in <specref ref="cvc-wildcard"/>.</p>
             </item>
            </olist>
           </p>
          </item>
         </olist>
        </p>
       </item>
       <item>
        <p>The <propref comp="au" prop="attribute declaration"/> of each attribute use in the <propref comp="ctd" prop="attribute uses"/> whose
<propref comp="au" prop="required"/> is <pt>true</pt> matches one of the attribute information items in the element information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> as per <clauseref ref="c-ctma"/> above.</p>
       </item>
       <item>
<!--* n.b. the typo correction in the next item has nothing to do with
bug 1913, except that the WG noticed it when we were approving 1913. *-->
              <p>Let <termdef id="key-ida" term="wild IDs" role="local">the <term>wild
IDs</term> be the set of all
attribute information item<phrase dg="derive-1913">s</phrase> 
to which <clauseref ref="c-avaw"/> applied and whose 
<termref def="key-vn">validation</termref> resulted in
a <termref def="key-dd">context-determined declaration</termref> of
<pt>mustFind</pt> or no <termref def="key-dd">context-determined
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 comp="ad" prop="type definition"/> is or is <!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> from <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref></termdef>. Then
               <olist role="andtest">
                <item>
                 <p>There <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> no more than one item in <termref def="key-ida">wild IDs</termref>.</p>
                </item>
                <item>
                 <p>If <termref def="key-ida">wild IDs</termref> is
non-empty, there <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are no</phrase> attribute
uses among the <propref comp="ctd" prop="attribute uses"/>
whose <propref comp="au" prop="attribute declaration"/>'s <propref comp="ad" prop="type definition"/> is or is <!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> from
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref>.</p>
                </item>
               </olist>
               <note>
                <p>This clause serves to ensure that even via attribute
wildcards no element has more than one attribute of type ID, and that even when
an element legitimately lacks a declared attribute of type ID, a
wildcard-validated attribute <rfc2119>must not</rfc2119> supply it.  That is, if an element has a
type whose attribute declarations include one of type ID, it either has that
attribute or no attribute of type ID.</p>
               </note>
              </p>
       </item>
       <item dg="b2861cc-1">
        <p>The element information item is <termref def="key-vn">valid</termref>
         with respect to each of the <propref comp="ctd" prop="assertions"/> as per <specref ref="cvc-assertion"/>.</p>
       </item>
      </olist>
     </p>
     <note>
      <p>When an <propref comp="ctd" prop="attribute wildcard"/> is present, this does
<emph>not</emph> introduce any ambiguity with respect to how attribute
information items for
which an attribute use is present amongst the <propref comp="ctd" prop="attribute uses"/> 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 comp="au" prop="attribute declaration"/>.  This follows from the details of <clauseref ref="c-aam"/>.</p>
     </note>
    </constraintnote>
    </div3>
     <div3>
     <head>Complex Type Definition Information Set Contributions</head>
     <constraintnote type="sic" id="sic-attrDefault">
     <head>Attribute Default Value</head>
     <p>For each attribute use in the <propref comp="ctd" prop="attribute uses"/> whose
<propref comp="au" prop="required"/> is <pt>false</pt> and whose
<propref comp="au" prop="value constraint"/> is not <termref def="key-null">absent</termref> but whose <propref comp="au" prop="attribute declaration"/> does not match one of the attribute
information items in the element information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> as
per <clauseref ref="c-ctma"/> of <specref ref="cvc-complex-type"/>
above, the <termref def="key-psvi">post-schema-validation infoset</termref> <phrase dg="opt.144">has</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> an attribute information item whose properties
are as below added to the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> of the element information
item.</p>
      <issue id="RQ-22i" role="1.1" status="open">
<!--*  <p><loc href="&reqs;#norm-default" target="reqs">RQ-22 (norm-default)</loc></p> *-->
       <p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2852" target="reqs">Issue 2852 (RQ-22 add normalized default)</loc></p>
       <p>Constructed default attribute information items in the PSVI did not have a [normalized
value] property, only a [schema normalized value], making them incompatible
with ordinary attribute infoitems.  On balance, it seems sensible to correct this.</p>
       <resolution><p>Add a [normalized value] property to the constructed attribute infoitem which arises when a default value is applied.</p></resolution>
      </issue>
      <glist>
       <gitem>
        <label><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">local name</xpropref></label>
        <def>
<p>The <propref comp="au" prop="attribute declaration"/>'s <propref comp="ad" prop="name"/>.</p>
        </def>
       </gitem>
       <gitem>
        <label><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">namespace name</xpropref></label>
        <def>
<p>The <propref comp="au" prop="attribute declaration"/>'s <propref comp="ad" prop="target namespace"/>.</p>
        </def>
       </gitem>
       <gitem>
        <label><propref ref="a-schema_normalized_value" role="psvi"/></label>
        <def>
         <p>The <!--*
* material suppressed here by diff group rq129 *
*--><termref def="key-evc">effective value constraint</termref><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="rq129">'s <propref comp="vc_a" prop="lexical form"/></phrase>.</p>
        </def>
       </gitem>
       <gitem>
        <label><propref ref="a-schema_default" role="psvi"/></label>
        <def>
         <p>The <!--*
* material suppressed here by diff group rq129 *
*--><termref def="key-evc">effective value constraint</termref><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="rq129">'s <propref comp="vc_a" prop="lexical form"/></phrase>.</p>
        </def>
       </gitem>
       <gitem>
        <label><propref ref="a-validation_context" role="psvi"/></label>
        <def><p>The nearest ancestor element information item with a
<propref role="psvi" ref="e-schema_information"/> property.</p></def>
       </gitem>
       <gitem>
        <label><propref ref="a-validity" role="psvi"/></label>
        <def>
         <p><pt>valid</pt>.</p>
        </def>
       </gitem>
       <gitem>
        <label><propref ref="a-validation_attempted" role="psvi"/></label>
        <def><p><pt>full</pt>.</p></def>
       </gitem>
       <gitem>
        <label><propref ref="a-schema_specified" role="psvi"/></label>
        <def><p><pt>schema</pt>.</p></def>
       </gitem>
      </glist>
      <p>The added items 
<!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><rfc2119>must</rfc2119></phrase> 
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>
    </constraintnote>
</div3>
 <div3 id="coss-ct">
  <head>Constraints on Complex Type Definition Schema Components</head>
  <p>All complex type definitions (see <specref ref="Complex_Type_Definitions"/>) <rfc2119>must</rfc2119> satisfy the following constraints.</p>
  <constraintnote type="cos" id="ct-props-correct">
   <head>Complex Type Definition Properties Correct</head>
   <olist role="And">
    <item>
     <p>The values of the properties of a complex type definition <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as described in
the property tableau in
<specref ref="Complex_Type_Definition_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
    </item>
    <item>
     <p>If the <propref comp="ctd" prop="base type definition"/> is a simple type
definition, the <propref comp="ctd" prop="derivation method"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <pt>extension</pt>.</p>
    </item>
    <item><p><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">There are no circular 
definitions, except for that of <pt>rootType</pt></phrase>.  That is, it <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> 
possible to reach the <phrase diff="nsq-del" dg="rq17"><termref def="ur-type-itself">ur-type 
definition</termref></phrase><phrase diff="nsq-add" dg="rq17">definition of 
<pt>rootType</pt></phrase> by repeatedly following the 
<propref comp="ctd" prop="base type definition"/>.</p></item>
    <item>
     <p><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">No two</phrase> 
distinct attribute declarations in the 
<propref comp="ctd" prop="attribute uses"/> <!--*
* material suppressed here by diff group modals *
*--> 
have identical <propref comp="ad" prop="name"/>s and 
<propref comp="ad" prop="target namespace"/>s.</p>
    </item>
    <item>
     <p><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">No two</phrase> 
distinct attribute declarations in the <propref comp="ctd" prop="attribute uses"/> 
<!--*
* material suppressed here by diff group modals *
*--> have 
<propref comp="ad" prop="type definition"/>s which are or are <!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> from 
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref>.</p>
    </item>
   </olist>
  </constraintnote>
  <constraintnote type="cos" id="cos-ct-extends">
     <head>Derivation Valid (Extension)</head>
     <p>If the <propref comp="ctd" prop="derivation method"/> is <pt>extension</pt>, <phrase dg="iff">then</phrase>
      <olist role="case">
       <item>
        <p role="if">the <propref comp="ctd" prop="base type definition"/> is a complex type
definition</p>
        <p role="then">
         <olist role="andtest">
          <item>
           <p>The <propref comp="ctd" prop="final"/> of the <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">does not</phrase> contain <pt>extension</pt>.</p>
          </item>
          <item id="c-cte">
           <p>Its <propref comp="ctd" prop="attribute uses"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a subset
of the <propref comp="ctd" prop="attribute uses"/> of the complex type
definition itself<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">.
That is</phrase>, for every attribute use in the
<propref comp="ctd" prop="attribute uses"/> of the
<propref comp="ctd" prop="base type definition"/>, 
there <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> an attribute use in the 
<propref comp="ctd" prop="attribute uses"/> of the complex
type definition itself whose <propref comp="au" prop="attribute declaration"/> 
has the same <propref comp="ad" prop="name"/>,
<propref comp="ad" prop="target namespace"/> and
<propref comp="ad" prop="type definition"/> as its attribute declaration.</p>
          </item>
          <item>
           <p>If it has an <propref comp="ctd" prop="attribute wildcard"/>, 
<phrase dg="modals">then</phrase> the complex type definition 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">also has</phrase>
one, and the base type definition's 
<propref comp="ctd" prop="attribute wildcard"/>'s 
<propref comp="w" prop="namespace constraint"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> 
a subset of the complex type definition's 
<propref comp="ctd" prop="attribute wildcard"/>'s 
<propref comp="w" prop="namespace constraint"/>, 
as defined by <specref ref="cos-ns-subset"/>.</p>
          </item>
          <item>
           <p>
            <olist role="Ortest">
             <item>
              <p>The <propref comp="ctd" prop="content type"/> of
the <propref comp="ctd" prop="base type definition"/> and the
<propref comp="ctd" prop="content type"/> of the complex type definition itself
<!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">both
have <propref comp="ct" prop="variety"/> <pt>simple</pt> and <propref comp="ct" prop="simple type definition"/></phrase> the
same simple type definition.</p>
             </item>
             <item><p>The
<propref comp="ctd" prop="content type"/> of both the <propref comp="ctd" prop="base type definition"/> and the complex type definition itself
<!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">have <propref comp="ct" prop="variety"/></phrase> <pt>empty</pt>.</p></item>
             <item>
              <olist role="Andtest">
               <item>
                <p>The
<propref comp="ctd" prop="content type"/> of the complex type
definition itself <!--*
* material suppressed here by diff group modals *
*--><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/> <pt>element-only</pt> or <pt>mixed</pt></phrase>.</p>
               </item>
               <item>
                <olist role="Ortest">
                 <item>
                  <p>The
<propref comp="ctd" prop="content type"/> of the <propref comp="ctd" prop="base type definition"/>
<!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>empty</pt>.</p>
                 </item>
                 <item>
                  <p>
                   <olist role="Andtest">
                    <item>
                     <p>Both
<propref comp="ctd" prop="content type"/>s <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">have <propref comp="ct" prop="variety"/></phrase> <pt>mixed</pt> or both <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">have <propref comp="ct" prop="variety"/></phrase>
<pt>element-only</pt>.</p>
                    </item>
                    <item>
                     <p>The <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="particle"/> of the <propref comp="ctd" prop="content type"/></phrase> of the complex type
definition <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a <termref def="cd-model-extension">valid
extension</termref> of the <propref comp="ctd" prop="base type definition"/>'s
<!--*
* material suppressed here by diff group ep01 *
*--><propref comp="ctd" prop="content type"/>'s <propref comp="ct" prop="particle"/>,
as defined in <specref ref="cos-particle-extend"/>.</p>
                    </item>
                   </olist>
                  </p>
                  </item>
                </olist>
               </item>
              </olist>
             </item>
            </olist>
           </p>
           </item>
          <item>
           <p>It <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is in principle</phrase> possible 
to <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derive</xtermref> the complex type
definition in two steps, the first an extension and the
second a restriction (possibly vacuous), from that type definition among its
ancestors whose <propref comp="ctd" prop="base type definition"/> is the <termref def="ur-type-itself">ur-type definition</termref>.</p>
           <note>
            <p>This requirement ensures that nothing removed by a restriction
is subsequently added back by an extension.  It is trivial to check if the
extension in question is the only extension in its <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivation</xtermref>, or if there are
no restrictions bar the first from the <termref def="ur-type-itself">ur-type
definition</termref>.</p>
            <p>Constructing the intermediate type definition to check this
constraint is straightforward:  simply re-order the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivation</xtermref> to put all the
extension steps first, then collapse them into a single extension.  If the
resulting definition can be the basis for a valid restriction to the desired
definition, the constraint is satisfied.</p>
           </note>
          </item>
          <item dg="b2861cc-1">
           <p>The <propref comp="ctd" prop="assertions"/> of
            the <propref comp="ctd" prop="base type definition"/> is a prefix of
            the <propref comp="ctd" prop="assertions"/> of the complex type definition itself.</p>
          </item>
          </olist>
        </p>
       </item>
       <item>
        <p role="if">the <propref comp="ctd" prop="base type definition"/> is a simple type
definition</p>
        <p role="then">
         <olist role="andtest">
         <item>
          <p>The <propref comp="ctd" prop="content type"/><phrase dg="ep01">'s <propref comp="ct" prop="variety"/> is <pt>simple</pt> and its  <propref comp="ct" prop="simple type definition"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> the same simple type
definition.</p>
         </item>
         <item>
           <p>The <propref comp="std" prop="final"/> of the <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">does not</phrase> contain <pt>extension</pt>.</p>
          </item>
        </olist>
        </p>        
       </item>
      </olist>
      <!--*
* material suppressed here by diff group iff *
*-->.
     </p>
    </constraintnote>

<p dg="iff"><termdef id="cd-ct-extension" term="valid extension">
A complex type <local>T</local> is a <term>valid extension</term> of its 
<propref comp="ctd" prop="base type definition"/> if and only if <local>T</local>
has a <propref comp="ctd" prop="derivation method"/> of <pt>extension</pt> and
satisfies the constraint <specref ref="cos-ct-extends"/></termdef>.</p>

<constraintnote type="cos" id="derivation-ok-restriction">
<head>Derivation Valid (Restriction, Complex)</head>
<p>If the <propref comp="ctd" prop="derivation method"/> is <pt>restriction</pt>
<olist role="and">
<item>
<!--* MSM begins a long campaign to eliminate places that seem to imply
    * modal logic must be used.  It suffices, here, that the base type
    * definition lack 'restriction' as an element of its final set.
    * It need not be logically necessary, factuality suffices. 
    *-->
<p>The <propref comp="ctd" prop="base type definition"/> 
<!--* !!! rq17 and modals both want this baby changed !!! *-->
<!--* !!! Since rq17 has already gone out, MSM changed 
    * the diff group to modals, so as to include it also
    * in the modals proposal.
    *-->
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> 
a complex type definition whose <propref comp="ctd" prop="final"/> does not 
contain <pt>restriction</pt>.</p>
</item>
<item diff="nsq-del" id="c-rad" dg="rq17">
<p>For each attribute use (call this <local>R</local>) in the <propref comp="ctd" prop="attribute uses"/>
<olist role="casetest">
<item>
<p role="if">there is an attribute use in the
<propref comp="ctd" prop="attribute uses"/> of the <propref comp="ctd" prop="base type definition"/> (call this <local>B</local>) whose <propref comp="au" prop="attribute declaration"/> has the same <propref comp="ad" prop="name"/> and <propref comp="ad" prop="target namespace"/></p>
<p role="then">
<olist role="andtest">
<item>
<p><olist role="ortest">
<item>
<p><local>B</local>'s <propref comp="au" prop="required"/> is <pt>false</pt>.</p>
</item>
<item>
<p><local>R</local>'s <propref comp="au" prop="required"/> is <pt>true</pt>.</p>
</item>
</olist></p>
</item>
<item>
<p><local>R</local>'s <propref comp="au" prop="attribute declaration"/>'s <propref comp="ad" prop="type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase>
validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from <local>B</local>'s <propref comp="ad" prop="type definition"/> given the empty set as defined in
<specref ref="cos-st-derived-ok"/>.</p>
</item>
<item>
<p><termdef id="del-key-evc" term="effective base value constraint" role="local">Let the
<term>effective value constraint</term> of an attribute use be
its <propref comp="au" prop="value constraint"/>, if present, otherwise
its <propref comp="au" prop="attribute declaration"/>'s <propref comp="ad" prop="value constraint"/>
</termdef>.  Then <olist role="ortest">
<item>
<p><local>B</local>'s <termref def="key-evc">effective value
constraint</termref> is <termref def="key-null">absent</termref> or<phrase dg="ep01"> has <propref comp="vc_a" prop="variety"/></phrase> <pt>default</pt>.</p>
</item>
<item>
<p><local>R</local>'s <termref def="key-evc">effective value
constraint</termref> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="vc_a" prop="variety"/></phrase>
<pt>fixed</pt> <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129">and</phrase> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="vc_a" prop="value"/> identical to</phrase><!--*
* material suppressed here by diff group rq129 *
*--> <local>B</local>'s.</p>
</item>
</olist>
</p>
</item>
</olist>
</p>
</item>
<item>
<p role="otherwise">the <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> an <propref comp="ctd" prop="attribute wildcard"/> and
 the <phrase dg="b2867-1">(</phrase><propref comp="ad" prop="target namespace"/><phrase dg="b2867-1">, <propref comp="ad" prop="name"/>) pair</phrase> of <!--*
* material suppressed here by diff group modals *
*--><local>R</local>'s <propref comp="au" prop="attribute declaration"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="key-vn">valid</termref> with respect to that wildcard, as defined
in <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1"><specref ref="cvc-wildcard-name"/></phrase>.</p>
</item>
</olist>
</p>
</item>
<item diff="nsq-del" id="c-rad2" dg="rq17">
<p>For each attribute use in the <propref comp="ctd" prop="attribute uses"/> of
the <propref comp="ctd" prop="base type definition"/> whose <propref comp="au" prop="required"/> is
<pt>true</pt>, there <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> an attribute use with an <propref comp="au" prop="attribute declaration"/> with the same <propref comp="ad" prop="name"/> and <propref comp="ad" prop="target namespace"/> as its <propref comp="au" prop="attribute declaration"/> in the
<propref comp="ctd" prop="attribute uses"/> of the complex type definition
itself whose <propref comp="au" prop="required"/> is
<pt>true</pt>.</p>
</item>
<item diff="nsq-del" id="c-raw" dg="rq17">
<p>If there is an <propref comp="ctd" prop="attribute wildcard"/>, 
<olist role="andtest">
<item>
<p>The
<propref comp="ctd" prop="base type definition"/> 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">also
has</phrase> one.</p>
</item>
<item>
<p>The complex
type definition's <propref comp="ctd" prop="attribute wildcard"/>'s <propref comp="w" prop="namespace constraint"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a subset of the <propref comp="ctd" prop="base type definition"/>'s <propref comp="ctd" prop="attribute wildcard"/>'s <propref comp="w" prop="namespace constraint"/>, as defined by <specref ref="cos-ns-subset"/>.</p>
</item>
<item>
<p>Unless the <propref comp="ctd" prop="base type definition"/> is the <termref def="ur-type-itself">ur-type definition</termref>, the complex
type definition's <propref comp="ctd" prop="attribute wildcard"/>'s <propref comp="w" prop="process contents"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> identical
to or stronger than the <propref comp="ctd" prop="base type definition"/>'s <propref comp="ctd" prop="attribute wildcard"/>'s <propref comp="w" prop="process contents"/>, where
<pt>strict</pt> is stronger than <pt>lax</pt> is stronger than <pt>skip</pt>.</p>
</item>
</olist>
</p>
</item>
<item diff="nsq-del" dg="rq17">
<olist role="Ortest">
<item>
<p>The <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> the <termref def="ur-type-itself">ur-type definition</termref>.</p>
</item>
<item>
<olist role="Andtest">
<item><p>The <propref comp="ctd" prop="content type"/> of the complex type definition
<!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/> <pt>simple</pt></phrase></p></item>
<item><olist role="Ortest">
<item>
<p>The <phrase dg="ep01"><propref comp="ct" prop="simple type definition"/> of the</phrase><propref comp="ctd" prop="content type"/> of the <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a simple type
definition from which
the <propref comp="ctd" prop="content type"/><phrase dg="ep01">'s <propref comp="ct" prop="simple type definition"/></phrase> is  validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> given the empty set as defined in
<specref ref="cos-st-derived-ok"/>.</p>
</item>
<item>
<p>The <propref comp="ctd" prop="base type definition"/><phrase dg="ep01">'s <propref comp="ctd" prop="content type"/> has <propref comp="ct" prop="variety"/></phrase> <!--*
* material suppressed here by diff group ep01 *
*--><pt>mixed</pt>
and <!--*
* material suppressed here by diff group modals *
*--><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="particle"/> a <compref ref="p"/></phrase> which is <termref def="cd-emptiable">emptiable</termref> as defined in <specref ref="cos-group-emptiable"/>.</p>
</item>
</olist></item>
</olist>
</item>
<item>
<olist role="Andtest">
<item><p>The <propref comp="ctd" prop="content type"/> of the complex type itself
<!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>empty</pt>
</p></item>
<item><olist role="Ortest">
<item>
<p>The <propref comp="ctd" prop="content type"/> of the <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">also has <propref comp="ct" prop="variety"/></phrase></phrase>
<pt>empty</pt>.</p>
</item>
<item>
<p>The <propref comp="ctd" prop="content type"/> of the <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>elementOnly</pt>
or <pt>mixed</pt> and 
<!--*
* material suppressed here by diff group modals *
*--><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="particle"/> a <compref ref="p"/></phrase> which is <termref def="cd-emptiable">emptiable</termref> as defined in <specref ref="cos-group-emptiable"/>.</p>
</item>
</olist></item>
</olist>
</item>
<item>
<olist role="Andtest">
<item>

<olist role="Ortest">
<item><p>The <propref comp="ctd" prop="content type"/> of the complex type
definition itself <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>element-only</pt><phrase dg="rq17p"> and the <propref comp="ctd" prop="content type"/> of the <propref comp="ctd" prop="base type definition"/> does not have <propref comp="ct" prop="variety"/> <pt>simple</pt>.</phrase></p></item>
<item><p>The <propref comp="ctd" prop="content type"/> of the complex
type definition itself and of the
<propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">have <propref comp="ct" prop="variety"/></phrase> <pt>mixed</pt>.</p></item>

</olist></item>
<!--*
* material suppressed here by diff group rq17p *
*-->
 <item dg="rq17p">
  <p>The <propref comp="ctd" prop="content type"/> of the complex type definition itself
<termref def="pt-actual-restriction">restricts</termref> the <propref comp="ctd" prop="content type"/> of the <propref comp="ctd" prop="base type definition"/> as defined in <specref ref="cos-content-act-restrict"/>.</p>
 </item>
</olist>
</item>         
</olist>
<note>
<p>Attempts to <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derive</xtermref> complex type definitions whose 
<propref comp="ctd" prop="content type"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has 
<propref comp="ct" prop="variety"/></phrase> <pt>element-only</pt> by restricting
a <propref comp="ctd" prop="base type definition"/> whose 
<propref comp="ctd" prop="content type"/>
<!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has 
<propref comp="ct" prop="variety"/></phrase> <pt>empty</pt> are not ruled out by this 
clause.  <!--*
* material suppressed here by diff group rq17p *
*-->
<phrase dg="rq17p">For purposes of checking this constraint, they
are treated as attempts to restrict the empty sequence.</phrase></p>
 <!--* <ednote diff="add" dg="rq17p">
  <edtext>As discussed in the past, this approach allows a very wide range of
unsatisfiable content models to 'restrict' an <pt>empty</pt> model; we don't
<emph>have</emph> to do this.  WG feedback solicited.</edtext>
 </ednote> *-->
</note>
</item>
<item diff="nsq-add" dg="rq17"><p>The complex type definition
<termref def="cd-actual-restriction">restricts</termref> 
the <propref comp="ctd" prop="base type definition"/> as 
defined in <specref ref="cos-ct-restrict"/>.</p></item>
 <item dg="b2861cc-1">
  <p>The <propref comp="ctd" prop="assertions"/> of
   the <propref comp="ctd" prop="base type definition"/> is a prefix of
   the <propref comp="ctd" prop="assertions"/> of the complex type definition itself.</p>
 </item>
</olist>
<!--*
* material suppressed here by diff group rq17p *
*-->
<termdef id="cd-ct-restriction" term="valid restriction" dg="rq17p">
A complex type definition with <propref comp="ctd" prop="derivation method"/> 
<pt>restriction</pt> is a <term>valid restriction</term> of its
<propref comp="ctd" prop="base type definition"/> if and only if the
constraint <specref ref="derivation-ok-restriction"/> is satisfied</termdef>.
</p>
<!--* The added condition 'with {derivation method{ restriction' seems 
    * to be required to avoid extensions, for which the constraint 
    * vacuously holds, being valid restrictions of their base. 
    *-->
</constraintnote>

<note diff="nsq-add" dg="rq17">
  <p>In <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xmlschema-1/#key-typeRestriction">the 
definition of <phrase role="local">restriction</phrase> in version 1.0 of this
specification</xspecref>, it says
   <display><quote>Members of a type, A, whose definition is a restriction of
the definition of another type, B, are always members of type B as well.</quote></display>
   However no definition of membership in a type was provided, and this
statement accordingly lacked force.  We can now restate the intended sense of
'restriction' as follows:</p>
</note>

<p diff="nsq-add" dg="rq17">A type definition <local>R</local> is a
valid
<termref def="key-typeRestriction">restriction</termref> of another
type definition <local>B</local> if and only if:
<olist role="and.mxm">
<item><p>All element information items which are 
<termref def="dt-avalid">abstractly valid</termref> against
<local>R</local> are <termref def="dt-avalid">abstractly valid</termref> 
against <local>B</local>.</p></item>
<item><p>When type definitions are assigned to children or attributes
of an element information item in the PSVI by both <local>R</local>
and <local>B</local>, those assigned by <local>R</local> are identical
to or derived by one or more restriction or subsetting steps from the corresponding 
ones assigned by <local>B</local>.</p></item>
<item><p>When element declarations are assigned to children or
attributes of an element information item in the PSVI by both
<local>R</local> and <local>B</local>, the corresponding ones assigned
by <local>R</local> appeal to at least the same identity
constraints, value constraints and disallowed substitutions as
those assigned by <local>B</local>, and may appeal to stronger 
ones.</p>
</item>
<item><p>Either <local>B</local> is the base type definition
of <local>R</local>, or else the base type definition of <local>R</local>
is a restriction of <local>B</local>.</p></item>
</olist></p>

<note diff="nsq-add" dg="rq17">
<p>It will be noted that valid restriction involves both a subset
relation on the set of elements valid against <local>R</local> and
those valid against <local>B</local>, and an derivation relation,
explicit in the type hierarchy, between the types assigned to
attributes and child elements by <local>R</local> and those assigned
to the same attributes and children by <local>B</local>.</p>
</note>

<!--* <ednote diff="add" dg="rq17">
<edtext>The term <quote>in-principle valid</quote> (used in text
briefly discussed by the WG in Brisbane) has been replaced above with
<quote>abstractly valid</quote>.  The WG 
may wish to express a preference for one term or the other (or for some
third term); the editors have not achieved consensus (or, for that 
matter, conviction).</edtext>
</ednote> *-->


<!--* HST is very uneasy with this definition, as it only works if the
	  assessment rules _require_ you to carry on with recursive
	  assessment after finding an error, but they don't -->
<!--* Touch&eacute;.  I still don't like the subjunctive, but 
    * it's currently the best we've got.
    *-->
<p diff="nsq-add" dg="rq17">
<termdef id="dt-avalid" term="abstractly valid">An attribute or 
element information item <local>I</local> is <term>abstractly valid</term>
with respect to a simple or complex type definition <local>D</local>
if and only if schema-validity assessment of <local>I</local> with
respect to <local>D</local> (as defined by <specref ref="cvc-assess-elt"/>
or <specref ref="cvc-assess-attr"/>) either results in a 
<xpropref role="psviAnon">validity</xpropref> property of <pt>valid</pt>, or 
would result in <xpropref role="psviAnon">validity</xpropref> of <pt>valid</pt>
if constraints on the abstractness of type definitions and element 
declarations were ignored</termdef>.</p>
<!--* 
results in errors raised by violations of constraints on the 
abstractness of type definitions, element declarations, or
attribute declarations, but no other errors.</termdef></p>
*-->

<!--* MSM is uneasy with the word 'actually' here, since it seems to 
    * want the constraint to be one that forbids vacuous restriction.
    * hmmm.  After consideration, he just deletes the 'actually'.
    *-->
<!--*   <p diff="add" dg="rq17">In practice the above definition cannot 
be directly understood as a Constraint on Components.  The following 
constraint is the operationally normative statement.</p> *-->

<!-- HST is not at all happy with an appeal to empty types as the
	  basis for including 'actually restricts'.  It has the same
	  'problem', so arguing that we use it to avoid the 'problem'
	  makes no sense.  About that which we can say nothing,
	  thereof we should remain silent. -->
<!--
For a variety of reasons, the description of
restriction just given is not suitable as a Constraint on Components.
In particular, if no elements at all are valid with respect to a type
<local>R</local>, then <local>R</local> satisfies the first constraint
for <emph>any possible</emph> base type <local>B</local>. It is not
necessarily easy, however, to detect type definitions which accept no
elements, however, and so the following constraint is the
operationally normative statement of valid restriction.-->

<p diff="nsq-add" dg="rq17">In practice, it is difficult to enforce
the definition above directly as a Constraint on Components, owing
to a number of corner cases which are difficult to detect or describe
concisely.
The following constraint is the operationally normative statement.</p> 

  <constraintnote diff="nsq-add" id="cos-ct-restrict" type="cos" dg="rq17">
   <head>Complex type definition actually restricts</head>
   <p><termdef id="cd-actual-restriction" term="actually restricts">A
complex type definition <local>R</local> (for <quote>restriction</quote>)
<term>actually
restricts</term> another type definition <local>B</local> (for
<quote>base</quote>) if and only if</termdef>
    <olist role="andtest">
     <item><p>Every element information item which is 
<termref def="loc-locallyValid">locally valid</termref> 
with respect to <local>R</local> is also 
<termref def="loc-locallyValid">locally valid</termref> 
with respect to <local>B</local>.</p></item>
     <item><p>If <local>R</local> and <local>B</local> have
<pt>elementOnly</pt> or <pt>mixed</pt> <phrase dg="ep01">as the
<propref comp="ct" prop="variety"/> of their </phrase><propref comp="ctd" prop="content type"/>s, then for all element information items <local>E</local> which are 
<termref def="loc-locallyValid">locally valid</termref> 
with respect to <local>R</local>, for all
        children <local>C</local> of <local>E</local>,
            <olist role="ortest">
             <item><p><local>Test[E,PR]</local> is not defined for <local>C</local>.</p></item>
             <item><olist role="andtest">
<item><p><local>Test[E,PB]</local> and <local>Test[E,PR]</local> are both defined for <local>C</local></p></item>
             <item><p><local>Test[E,PB]</local>(<local>C</local>) subsumes <local>Test[E,PR]</local>(<local>C</local>).</p></item>
</olist></item>             
            </olist>where <local>PR</local> is <local>R</local>'s <propref comp="ctd" prop="content type"/><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">'s <propref comp="ct" prop="particle"/></phrase> and <local>PB</local> is <local>B</local>'s <propref comp="ctd" prop="content type"/><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">'s <propref comp="ct" prop="particle"/></phrase>.
</p></item>
    </olist>
   </p>
   <p><termdef role="local" id="loc-locallyValid" term="locally valid">An 
element information item is <term>locally valid</term> with respect 
to a complex type definition if and only if it satisfies all but the last
clause of
<specref ref="cvc-complex-type"/> with respect to that definition</termdef>.</p>

<!--* 
   <p><termdef role="local" id="loc-locallyValid" term="abstractly locally valid">An 
element information item is <term>abstractly locally valid</term> with respect 
to a complex type definition if and only if it satisfies clauses 2, 3 and 4 of 
<specref ref="cvc-complex-type"/> with respect to that definition</termdef>.</p>
*-->
<!--* MSM is not happy with the wording of the following, but does not
    * have the energy to try to rewrite it now.  
    *-->
   <p>When the child sequence of an element information item <local>E</local> is 
<termref def="loc-locallyValid">locally valid</termref>
   against a type definition <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">whose</phrase> 
<propref comp="ctd" prop="content type"/><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">'s <propref comp="ct" prop="particle"/> is</phrase> <local>P</local> 
there is a (partial) functional mapping from
the element information items in the child sequence to tests, where tests
are either Element
   Declarations, <termref def="key-urType">the ur-type</termref> or
<pt>empty</pt>, arising as follows:
    <glist>
     <gitem>
      <label>Element Declarations</label>
      <def>
       <p>Either explicitly present, or successfully located as a result of a
<pt>strict</pt> or <pt>lax</pt> Wildcard.</p>
      </def>
     </gitem>
     <gitem>
      <label><termref def="key-urType">the ur-type</termref></label>
      <def>
       <p>An undischarged <pt>lax</pt> Wildcard.</p>
      </def>
     </gitem>
     <gitem>
      <label><pt>empty</pt></label>
      <def>
       <p>a <pt>skip</pt> Wildcard.</p>
      </def>
     </gitem>
     <gitem>
      <label>(failure to map)</label>
      <def>
       <p>An undischarged <pt>strict</pt> Wildcard.</p>
      </def>
     </gitem>
    </glist>
    <termdef role="local" id="loc-Test" term="Test">Call this mapping <term>Test[E,P]</term>.</termdef></p>
   <p><termdef role="local" id="loc-testSub" term="subsumes">A test
<local>G</local> (for general) <term>subsumes</term> another test
<local>S</local> (for specific) if and only if </termdef>
    <olist role="ortest">
     <item>
      <p><local>G</local> is <pt>empty</pt>.</p>
     </item>
     <item>
      <p><local>G</local> is <termref def="key-urType">the ur-type</termref>
and <local>S</local> is not <pt>empty</pt>.</p>
     </item>
     <item>
      <p><local>G</local> and <local>S</local> are both Element Declarations
and
       <olist role="andtest">
        <item>
         <p>Either <local>G</local> has <propref comp="ed" prop="nillable"/> <pt>true</pt> or <local>S</local> has <propref comp="ed" prop="nillable"/> <pt>false</pt>.</p>
        </item>
        <item>
         <p>Either <local>G</local> has no <propref comp="ed" prop="value constraint"/>, or it is not <pt>fixed</pt>,
      or <local>S</local> has a <pt>fixed</pt> <propref comp="ed" prop="value constraint"/> with the same value.</p>
        </item>
        <item>
         <p><local>S</local>'s <propref comp="ed" prop="identity-constraint definitions"/> are a superset of <local>G</local>'s.</p>
        </item>
        <item>
         <p><local>S</local> disallows a superset of the substitutions that <local>G</local> does.</p>
        </item>
        <item>
         <p><local>S</local>'s <propref comp="ed" prop="type definition"/> is validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> given
{<pt>extension</pt>, <pt>list</pt>, <pt>union</pt>} from <local>G</local>'s <propref comp="ed" prop="type definition"/> as defined by
<specref ref="cos-ct-derived-ok"/> or <specref ref="cos-st-derived-ok"/>, as appropriate.</p>
        </item>
       </olist>
      </p>
     </item>
    </olist>
   </p>
   <note>
    <p><specref ref="subsumptionCheck"/> provides guidance to
implementors on how to implement this constraint.</p>
   </note>
  </constraintnote>
  
  <constraintnote id="cos-content-act-restrict" type="cos" dg="rq17p">
   <head>Content type restricts</head>
   <note>
    <p><specref ref="subsumptionCheckP"/> provides guidance to
implementors on how to implement this constraint.</p>
   </note>
   <p><termdef id="pt-actual-restriction" term="restricts">A
<compref ref="ct"/> <local>RCT</local> (for <quote>restriction</quote>)
<term>restricts</term> another <compref ref="ct"/> <local>BCT</local> (for
<quote>base</quote>) if and only if</termdef>
    <olist role="case">
     <item>
      <p role="if"><local>BCT</local>'s <propref comp="ct" prop="variety"/> is <pt>empty</pt></p>
      <p role="then">either there is no sequence of element information items which is <termref def="loc-locallyValid-seq">locally valid</termref> 
with respect to <local>RCT</local>'s <propref comp="ct" prop="particle"/>, or only the empty sequence is.</p>
     </item>
     <item>
      <p role="otherwise">Using the name <local>R</local> for
<local>RCT</local>'s <propref comp="ct" prop="particle"/> and <local>B</local>
for <local>BCT</local>'s <propref comp="ct" prop="particle"/>,
       <olist role="andtest">
     <item>
      <p>Every sequence of element information items which is 
<termref def="loc-locallyValid-seq">locally valid</termref> 
with respect to <local>R</local> is also <termref def="loc-locallyValid-seq">locally valid</termref> 
with respect to <local>B</local>.</p>
     </item>
     <item>
      <p>For all sequences of element information items <local>ES</local> which are 
<termref def="loc-locallyValid-seq">locally valid</termref> 
with respect to <local>R</local>, for all
        elements <local>E</local> in <local>ES</local>,
       <!--*
* material suppressed here by diff group rq146-1 *
*-->.
            <olist role="ortest" dg="rq146-1">
             <item><p><termref def="loc-TestP">Test[ES,R]</termref> is not defined for <local>E</local>.</p></item>
             <item><olist role="Andtest">
<item><p><termref def="loc-TestP">Test[ES,B]</termref> and <termref def="loc-TestP">Test[ES,R]</termref> are both defined for <local>E</local></p></item>
             <item><p><termref def="loc-TestP">Test[ES,B]</termref>(<local>E</local>) <termref def="loc-testSubP">subsumes</termref> <termref def="loc-TestP">Test[ES,R]</termref>(<local>E</local>).</p></item>
</olist></item>             
            </olist></p>
     </item>
    </olist></p>
     </item>
    </olist>    
   </p>
   <p><termdef role="local" id="loc-locallyValid-seq" term="locally valid">A
sequence of 
element information items is <term>locally valid</term> with respect 
to a <compref ref="p"/> if and only if it satisfies
<specref ref="cvc-particle"/> with respect to that <compref ref="p"/></termdef>.</p>

   <p dg="rq146">When a sequence of an element information items <local>ES</local> is 
<termref def="loc-locallyValid">locally valid</termref>
   with respect to a <compref ref="p"/> <local>P</local> 
there is a (partial) functional mapping from
the element information items in the sequence to tests, where tests
are either <compref ref="ed"/>s, <termref def="key-urType">the ur-type</termref> or
<pt>empty</pt>, arising as follows:
    <glist>
     <gitem>
      <label>Element Declarations</label>
      <def>
       <p>Either explicitly present, or successfully located as a result of a
<pt>strict</pt> or <pt>lax</pt> Wildcard.</p>
      </def>
     </gitem>
     <gitem>
      <label><termref def="key-urType">the ur-type</termref></label>
      <def>
       <p>An undischarged <pt>lax</pt> Wildcard.</p>
      </def>
     </gitem>
     <gitem>
      <label><pt>empty</pt></label>
      <def>
       <p>a <pt>skip</pt> Wildcard.</p>
      </def>
     </gitem>
     <gitem>
      <label>(failure to map)</label>
      <def>
       <p>An undischarged <pt>strict</pt> Wildcard.</p>
      </def>
     </gitem>
    </glist>
    <termdef role="local" id="loc-TestP" term="Test">Call this mapping <term>Test[ES,P]</term>.</termdef></p>
   <p><termdef role="local" id="loc-testSubP" term="subsumes">A test
<local>G</local> (for general) <term>subsumes</term> another test
<local>S</local> (for specific) if and only if </termdef>
    <olist role="ortest">
     <item>
      <p><local>G</local> is <phrase dg="rq146-1"><pt>empty</pt></phrase><!--*
* material suppressed here by diff group rq146-1 *
*-->.</p>
     </item>
     <item>
      <p><local>G</local> is <phrase dg="rq146-1"><termref def="key-urType">the ur-type</termref></phrase><!--*
* material suppressed here by diff group rq146-1 *
*-->
and <local>S</local> is not <phrase dg="rq146-1"><pt>empty</pt></phrase><!--*
* material suppressed here by diff group rq146-1 *
*-->.</p>
     </item>
     <!--*
* material suppressed here by diff group rq146-1 *
*-->
     <item>
      <p><local>G</local> and <local>S</local> are both Element Declarations
and
       <olist role="andtest">
        <item>
         <p>Either <local>G</local> has <propref comp="ed" prop="nillable"/> <pt>true</pt> or <local>S</local> has <propref comp="ed" prop="nillable"/> <pt>false</pt>.</p>
        </item>
        <item>
         <p>Either <local>G</local> has no <propref comp="ed" prop="value constraint"/>, or it is not <pt>fixed</pt>,
      or <local>S</local> has a <pt>fixed</pt> <propref comp="ed" prop="value constraint"/> with the same value.</p>
        </item>
        <item>
         <p><local>S</local>'s <propref comp="ed" prop="identity-constraint definitions"/> are a superset of <local>G</local>'s.</p>
        </item>
        <item>
         <p><local>S</local> disallows a superset of the substitutions that <local>G</local> does.</p>
        </item>
        <item>
         <p><local>S</local>'s <propref comp="ed" prop="type definition"/> is validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> given
{<pt>extension</pt>, <pt>list</pt>, <pt>union</pt>} from <local>G</local>'s <propref comp="ed" prop="type definition"/> as defined by
<specref ref="cos-ct-derived-ok"/> or <specref ref="cos-st-derived-ok"/>, as appropriate.</p>
        </item>
       </olist>
      </p>
     </item>
    </olist>
   </p>
  </constraintnote>

<!--* <ednote diff="add" dg="rq17">
<edtext>The editors have not found a term better than <quote>actually
restrict</quote> for use in the definition just given, but have not
yet learned to believe that there is none.  If the WG has suggestions,
the editors would be glad to hear a plausible alternative.</edtext>
</ednote> *-->

<!--* <ednote diff="add" dg="rq146-1">
<edtext>For technical reasons, the following inquiry is tagged
as a Note instead of an Editorial Note.  But it is not intended
that this Note should be part of the final text of the spec.</edtext>
</ednote> 
  <note diff="add" dg="rq146-1">
   <p>The above rule makes the following an invalid derivation.
    This example was allowed by 1.0 spec. Is this intended?
<eg xml:space="preserve">&lt;xs:complexType name="base">
 &lt;xs:sequence>
  &lt;any processContents="strict"/>
 &lt;/xs:sequence>
&lt;/xs:complexType>

&lt;xs:complexType name="derived">
 &lt;xs:complexContent>
  &lt;xs:restriction base="base">
   &lt;xs:sequence>
    &lt;element name="e" type="xs:int"/>
   &lt;/xs:sequence>
  &lt;/xs:restriction>
 &lt;/xs:complexContent>
&lt;/xs:complexType></eg>
    The reason it's ruled out is because derived allows <code>&lt;e>123&lt;/e></code>
    while the base doesn't. But if we change the type of the local "e" to
    an abstract type, then all valid instances of derived are also valid instances
    of base, but we still mark it as an invalid derivation. Again, intended?
</p>
<p>[End of pseudo-note.]</p>
</note>
*-->
  <note>
   <p>To restrict a complex type definition with a simple base type definition
to <pt>empty</pt>, use a simple type definition with a <pt>fixed</pt> value of
the empty string: this preserves the type information.</p>
  </note>

  <!--*
* material suppressed here by diff group b2867-2 *
*-->

<p>The following constraint defines a relation appealed to elsewhere
in this specification.</p>
<constraintnote id="cos-ct-derived-ok" type="cos">
<head>Type Derivation OK (Complex)</head>
<p>For a complex type definition (call it <local>D</local>, for
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref>) to be validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from a type definition (call this
<local>B</local>, for base) given a subset of {<pt>extension</pt>,
<pt>restriction</pt>}
<olist role="and">
<item>
<p>If <local>B</local> and <local>D</local> are not the same type
definition, then the <propref comp="ctd" prop="derivation method"/> of
<local>D</local> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is not</phrase>
in the subset.</p>
</item>
<item>      
<p>
<olist role="Ortest">
<item id="c-tid">
<p><local>B</local> and <local>D</local> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> the same type
definition.</p>
</item>
<item>
<p><local>B</local> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <local>D</local>'s <propref comp="ctd" prop="base type definition"/>.</p>
</item>
<item>
<p>
<olist role="Andtest">
<item>
<p><local>D</local>'s <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is not</phrase> the <termref def="ur-type-itself">ur-type
definition</termref>.</p>
</item>
<item>
<p>
<olist role="Casetest">
<item>
<p role="if"><local>D</local>'s <propref comp="ctd" prop="base type definition"/> is complex</p>
<p role="then">it <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from <local>B</local>
given the subset as defined by this constraint.</p>
</item>
<item>
<p role="if"><local>D</local>'s <propref comp="ctd" prop="base type definition"/> is simple</p>
<p role="then">it <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from <local>B</local>
given the subset as defined in <specref ref="cos-st-derived-ok"/>.</p>
</item>
</olist>
</p>
</item>
</olist>
</p>
</item>
</olist>
</p>
</item>
</olist>
</p>
</constraintnote>
  <note>
   <p>This constraint is used to check that when someone uses a type in a
context where another type was expected (either via <code>xsi:type</code> or
substitution groups), that the type used is actually <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from the expected
type, and that that <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivation</xtermref> does not involve a form of <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivation</xtermref> which was
ruled out by the expected type.</p>
  </note>
  <note id="no-identity">
   <p>The wording of <clauseref ref="c-tid"/> above appeals to a notion of component identity which
is only incompletely defined by this version of this specification.
In some cases, the wording of this specification does make clear the
rules for component identity.  These cases include:
    <ulist>
     <item>
      <p>When they are both top-level components with the same component type,
namespace name, and local name;</p>
     </item>
     <item>
      <p>When they are necessarily the same type definition (for example, when
the two types definitions in question are the type definitions associated with
two attribute or element declarations, which are discovered to be the same
declaration);</p>
     </item>
     <item>
      <p>When they are the same by construction (for example, when an element's
type definition defaults to being the same type definition as that of its
substitution-group head or when a complex type definition inherits an attribute
declaration from its base type definition).</p>
     </item>
    </ulist>
   </p>
   <p>In other cases <!--*
* material suppressed here by diff group ep08a *
*--> 
<phrase dg="modals">it is possible
that</phrase> conforming implementations <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">will</phrase>
disagree as to whether components are identical.</p>
  </note>
 </div3>

    <div3>
     <head>Built-in Complex Type <phrase diff="nsq-del" dg="rq17">Definition</phrase><phrase diff="nsq-add" dg="rq17">Definitions</phrase></head>
     <p diff="nsq-add" dg="rq17">There is a <compref ref="ctd"/> corresponding to the root of the type
hierarchy present in every schema by definition:</p>
     <schemaComp diff="nsq-add" id="ur-type-itself" dg="rq17">
     <head>Complex Type Definition of the root of the type hierarchy (the ur-type)</head>
     <pvlist>
      <pvpair comp="ctd" prop="name">rootType</pvpair>
      <pvpair comp="ctd" prop="target namespace">http://www.w3.org/2001/XMLSchema</pvpair>
      <pvpair comp="ctd" prop="base type definition">Itself</pvpair>
      <pvpair comp="ctd" prop="derivation method"><pt>restriction</pt></pvpair>
      <pvpair comp="ctd" prop="content type">A <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref ref="ct"/> as follows:</phrase>
       <pvlist>
        <pvpair comp="ct" prop="variety"><pt>mixed</pt></pvpair>        
        <pvpair comp="ct" prop="simple type definition"><termref def="key-null"/></pvpair>
        <pvpair comp="ct" prop="particle">a
<compref ref="p"/> with the <phrase diff="nsq-del" dg="rq129ter">following properties: 
</phrase><phrase dg="rq129ter">properties shown below in 
       <specref ref="rootType-outer-particle"/>.</phrase>
       <pvlist diff="nsq-del" dg="rq129ter">
        <pvpair comp="p" prop="min occurs">1</pvpair>
        <pvpair comp="p" prop="max occurs">1</pvpair>
        <pvpair comp="p" prop="term">a model group with
the following properties:
         <pvlist>
          <pvpair comp="mg" prop="compositor"><pt>sequence</pt></pvpair>
          <pvpair comp="mg" prop="particles">
           a list containing one particle with the following properties:
           <pvlist>
            <pvpair comp="p" prop="min occurs">0</pvpair>
            <pvpair comp="p" prop="max occurs"><pt>unbounded</pt></pvpair>
            <pvpair comp="p" prop="term">a wildcard with the following properties:
             <pvlist>
              <pvpair comp="w" prop="namespace constraint"><!--*
* material suppressed here by diff group b2867-1 *
*-->
               <phrase dg="b2867-1">A <compref ref="nc"/> with the following properties:</phrase>
               <pvlist dg="b2867-1">
                <pvpair comp="nc" prop="variety"><pt>any</pt></pvpair>        
                <pvpair comp="nc" prop="namespaces">The empty set</pvpair>
                <pvpair comp="nc" prop="disallowed names">The empty set</pvpair>
               </pvlist>
              </pvpair>
              <pvpair comp="w" prop="process contents"><pt>skip</pt></pvpair>
             </pvlist>
            </pvpair>
           </pvlist>
           </pvpair>
         </pvlist>
        </pvpair>
       </pvlist></pvpair>
       </pvlist>
      </pvpair>
      <pvpair comp="ctd" prop="attribute uses">The empty set</pvpair>
        <pvpair comp="ctd" prop="attribute wildcard">
        a wildcard with the following properties::
             <pvlist>
              <pvpair comp="w" prop="namespace constraint"><!--*
* material suppressed here by diff group b2867-1 *
*-->
               <phrase dg="b2867-1">A <compref ref="nc"/> with the following properties:</phrase>
               <pvlist dg="b2867-1">
                <pvpair comp="nc" prop="variety"><pt>any</pt></pvpair>        
                <pvpair comp="nc" prop="namespaces">The empty set</pvpair>
                <pvpair comp="nc" prop="disallowed names">The empty set</pvpair>
               </pvlist>
              </pvpair>
              <pvpair comp="w" prop="process contents"><pt>skip</pt></pvpair>
             </pvlist></pvpair>
        <pvpair comp="ctd" prop="final">The empty set</pvpair>
      <pvpair dg="context-2338" comp="ctd" prop="context"><termref def="key-null"/></pvpair>
        <pvpair comp="ctd" prop="prohibited substitutions">The empty set</pvpair>
        <pvpair comp="ctd" prop="assertions" dg="b2861cc-1">The empty sequence</pvpair>
        <pvpair comp="ctd" prop="abstract"><pt>false</pt></pvpair>
     </pvlist>
    </schemaComp>
<p diff="nsq-add" dg="rq129ter">
The outer particle of <pt>rootType</pt> contains a simple sequence:
</p>
<schemaComp diff="nsq-add" id="rootType-outer-particle" dg="rq129ter">
<head>Outer particle for rootType</head>
  <pvlist>
    <pvpair comp="p" prop="min occurs">1</pvpair>
    <pvpair comp="p" prop="max occurs">1</pvpair>
    <pvpair comp="p" prop="term">a model group with
the following properties:
      <pvlist>
        <pvpair comp="mg" prop="compositor"><pt>sequence</pt></pvpair>
        <pvpair comp="mg" prop="particles">
           a list containing one particle with the properties shown
           below in <specref ref="rootType-inner-particle"/>.
        </pvpair>
      </pvlist>
    </pvpair>
  </pvlist>
</schemaComp>
<p diff="nsq-add" dg="rq129ter">
The inner particle of <pt>rootType</pt> contains a <pt>skip</pt> wildcard:
</p>
<schemaComp diff="nsq-add" id="rootType-inner-particle" dg="rq129ter">
<head>Inner particle for rootType</head>
  <pvlist>
    <pvpair comp="p" prop="min occurs">0</pvpair>
    <pvpair comp="p" prop="max occurs"><pt>unbounded</pt></pvpair>
    <pvpair comp="p" prop="term">a wildcard with the following properties:
      <pvlist>
       <pvpair comp="w" prop="namespace constraint"><!--*
* material suppressed here by diff group b2867-1 *
*-->
        <phrase dg="b2867-1">A <compref ref="nc"/> with the following properties:</phrase>
        <pvlist dg="b2867-1">
         <pvpair comp="nc" prop="variety"><pt>any</pt></pvpair>        
         <pvpair comp="nc" prop="namespaces">The empty set</pvpair>
         <pvpair comp="nc" prop="disallowed names">The empty set</pvpair>
        </pvlist>
       </pvpair>
        <pvpair comp="w" prop="process contents"><pt>skip</pt></pvpair>
      </pvlist>
    </pvpair>
  </pvlist>
</schemaComp>

    <p diff="nsq-add" dg="rq17">The <code>mixed</code> content specification together with the
<pt>skip</pt> wildcard  and attribute specification produce the defining
property for the root of the type hierarchy, namely that <emph>every</emph>  type
definition is (eventually) a restriction
of it:  its permissions and requirements are
the least restrictive possible.</p>

    <p>There is <phrase diff="nsq-add" dg="rq17">also </phrase>a complex
type definition <phrase diff="nsq-del" dg="rq17">nearly equivalent to the
<termref def="key-urType">ur-type definition</termref></phrase><phrase diff="nsq-add" dg="rq17">for <termref def="key-anyType">anyType</termref></phrase> present in every schema
by definition.  It has the following properties:</p>

<!--* WARNING!!! The following schema-component definition occurs twice
    * in order to avoid IDREF validity problems when generating status quo text
    * without RQ-17.  If you edit, be sure you edit the right one!
    * N.B. After RQ-17 is adopted, we may wish to suppress the older
    * version. *-->
<!--* Edit this copy with id=any-type-itself if you are working in 
    * a world where RQ17 is adopted *-->
    <schemaComp diff="nsq-add" id="any-type-itself" dg="rq17">
     <head>Complex Type Definition of anyType</head>
     <pvlist>
      <pvpair comp="ctd" prop="name">anyType</pvpair>
      <pvpair comp="ctd" prop="target namespace">http://www.w3.org/2001/XMLSchema</pvpair>
      <pvpair comp="ctd" prop="base type definition">The built-in <termref def="ur-type-itself">root type definition</termref></pvpair>
      <pvpair comp="ctd" prop="derivation method"><pt>restriction</pt></pvpair>
      <pvpair comp="ctd" prop="content type">A <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref ref="ct"/> as follows:</phrase>
       <pvlist>
        <pvpair comp="ct" prop="variety"><pt>mixed</pt></pvpair>
        <pvpair comp="ct" prop="particle">a
<compref ref="p"/> with the <!--*
* material suppressed here by diff group rq129bis *
*-->properties<phrase dg="rq129bis"> shown
         below in <specref ref="anyType-outer-particle"/>.</phrase><!--*
* material suppressed here by diff group rq129bis *
*-->
       <!--*
* material suppressed here by diff group rq129bis *
*--></pvpair>
        <pvpair comp="ct" prop="simple type definition"><termref def="key-null"/></pvpair>
       </pvlist>
      </pvpair>
      <pvpair comp="ctd" prop="attribute uses">The empty set</pvpair>
        <pvpair comp="ctd" prop="attribute wildcard">
        a wildcard with the following properties::
             <pvlist>
              <pvpair comp="w" prop="namespace constraint"><!--*
* material suppressed here by diff group b2867-1 *
*-->
               <phrase dg="b2867-1">A <compref ref="nc"/> with the following properties:</phrase>
               <pvlist dg="b2867-1">
                <pvpair comp="nc" prop="variety"><pt>any</pt></pvpair>        
                <pvpair comp="nc" prop="namespaces">The empty set</pvpair>
                <pvpair comp="nc" prop="disallowed names">The empty set</pvpair>
               </pvlist>
              </pvpair>
              <pvpair comp="w" prop="process contents"><pt>lax</pt></pvpair>
             </pvlist></pvpair>
        <pvpair comp="ctd" prop="final">The empty set</pvpair>
      <pvpair dg="context-2338" comp="ctd" prop="context"><termref def="key-null"/></pvpair>
        <pvpair comp="ctd" prop="prohibited substitutions">The empty set</pvpair>
        <pvpair comp="ctd" prop="assertions" dg="b2861cc-1">The empty sequence</pvpair>
        <pvpair comp="ctd" prop="abstract"><pt>false</pt></pvpair>
     </pvlist>
    </schemaComp>

<!--* Edit this copy with del-ur-type-itself if you are working in a world 
    * where RQ17 has been rejected *-->
    <!--*
* material suppressed here by diff group rq17aux *
*-->

<p dg="rq129bis">
The outer particle of <termref def="key-anyType">anyType</termref> contains a sequence with a single term:
</p>
<schemaComp id="anyType-outer-particle" dg="rq129bis">
<head>Outer Particle for Content Type of anyType</head>
       <pvlist>
        <pvpair comp="p" prop="min occurs">1</pvpair>
        <pvpair comp="p" prop="max occurs">1</pvpair>
        <pvpair comp="p" prop="term">a model group with
the following properties:
         <pvlist>
          <pvpair comp="mg" prop="compositor"><pt>sequence</pt></pvpair>
          <pvpair comp="mg" prop="particles">
           a list containing one particle with the properties shown
           below in <specref ref="anyType-inner-particle"/>.
           </pvpair>
         </pvlist>
        </pvpair>
       </pvlist>
</schemaComp>
<p dg="rq129bis">
The inner particle of <termref def="key-anyType">anyType</termref> contains a wildcard which matches any element:
</p>
<schemaComp id="anyType-inner-particle" dg="rq129bis">
<head>Inner Particle for Content Type of anyType</head>
  <pvlist>
    <pvpair comp="p" prop="min occurs">0</pvpair>
    <pvpair comp="p" prop="max occurs"><pt>unbounded</pt></pvpair>
    <pvpair comp="p" prop="term">a wildcard with the following properties:
      <pvlist>
       <pvpair comp="w" prop="namespace constraint"><!--*
* material suppressed here by diff group b2867-1 *
*-->
        <phrase dg="b2867-1">A <compref ref="nc"/> with the following properties:</phrase>
        <pvlist dg="b2867-1">
         <pvpair comp="nc" prop="variety"><pt>any</pt></pvpair>        
         <pvpair comp="nc" prop="namespaces">The empty set</pvpair>
         <pvpair comp="nc" prop="disallowed names">The empty set</pvpair>
        </pvlist>
       </pvpair>
        <pvpair comp="w" prop="process contents"><pt>lax</pt></pvpair>
      </pvlist>
    </pvpair>
  </pvlist>
</schemaComp>

     <note><p>This specification does not provide an inventory of built-in complex
type definitions for use in user schemas.  A preliminary library of complex type
definitions is available which includes both mathematical (e.g.
<code>rational</code>) and utility (e.g. <code>array</code>) type definitions. 
In particular, there is a <code>text</code> type definition which is recommended for use
as the type definition in element declarations intended for general text
content, as it makes sensible provision for various aspects of
internationalization.  For more details, see the schema document for the type
library at its namespace name: <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/2001/03/XMLSchema/TypeLibrary.xsd">http://www.w3.org/2001/03/XMLSchema/TypeLibrary.xsd</loc>.</p></note>
    </div3>
   </div2>
   <div2 id="cAttributeUse">
    <head>AttributeUses</head>
    <p>An attribute use is a utility component which controls the occurrence and
defaulting behavior of attribute declarations.  It plays the same role for
attribute declarations in complex types that particles play for element declarations.</p>
    <note role="example">
     <eg xml:space="preserve">&lt;xs:complexType&gt;
 . . .
 &lt;xs:attribute ref="xml:lang" use="required"/&gt;
 &lt;xs:attribute ref="xml:space" default="preserve"/&gt;
 &lt;xs:attribute name="version" type="xs:<!--*
* material suppressed here by diff group b1915bis *
*--><phrase dg="b1915bis">decimal</phrase>" fixed="1.0"/&gt;
&lt;/xs:complexType&gt;
     </eg>
     <p>XML representations which all involve attribute uses, illustrating some of
the possibilities for controlling occurrence.</p>
    </note>
    <div3 id="AU_details">
     <head>The Attribute Use Schema Component</head>
<p>The attribute use schema component has the following properties:</p>

  <compdef name="Attribute Use" abbrev="au" showAKO="true"/>
     <microCompdef name="Value Constraint" abbrev="vc_au" dg="ep01"/>
     <p><propref comp="au" prop="required"/> determines whether this use of an attribute
declaration requires an appropriate attribute information item to be present, or
merely allows it.</p>
     <p><propref comp="au" prop="attribute declaration"/> provides the attribute declaration itself,
which will in turn determine the simple type definition used.</p>
     <p><propref comp="au" prop="value constraint"/> allows for local specification of a
default or fixed value.  This <rfc2119>must</rfc2119> be consistent with that of the <propref comp="au" prop="attribute declaration"/>, in that if the <propref comp="au" prop="attribute declaration"/> specifies a fixed value, the only allowed <propref comp="au" prop="value constraint"/> is the same fixed value.</p>
    </div3>
    <div3>
     <head>XML Representation of Attribute Use Components</head>
     <p>Attribute uses correspond to all uses of <eltref ref="attribute"/> which
allow a <code>use</code> attribute.  These in turn correspond to
<emph>two</emph> components in each case, an attribute use and its <propref comp="au" prop="attribute declaration"/> (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>
    </div3>
    <div3>
     <head>Constraints on XML Representations of Attribute Uses</head>
     <p>None as such.</p>
    </div3>
    <div3>
     <head>Attribute Use Validation Rules</head>
<constraintnote type="cvc" id="cvc-au">
 <head>Attribute Locally Valid (Use)</head>
 <p>The item's <termref def="key-vv">actual value</termref> 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">matches</phrase>
 the <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="vc_a" prop="value"/></phrase> of the <propref comp="ad" prop="value constraint"/>, if it is
present and <phrase dg="ep01">its <propref comp="vc_a" prop="variety"/> is </phrase><pt>fixed</pt>.</p>
 <p>For an attribute information item to be<termref def="key-vn">valid</termref> with respect to an attribute use its <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129"><termref def="key-vv">actual value</termref></phrase> <rfc2119>must</rfc2119> <!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129">be identical to the <propref comp="vc_a" prop="value"/></phrase> of the attribute use's <propref comp="au" prop="value constraint"/><!--*
* material suppressed here by diff group rq129 *
*-->, if it is present and 
  <phrase dg="ep01">has <propref comp="vc_a" prop="variety"/> </phrase><pt>fixed</pt>.</p>
</constraintnote>
    </div3>
    <div3>
     <head>Attribute Use Information Set Contributions</head>
     <p>None as such.</p>
    </div3>
    <div3 id="coss-attruse">
     <head>Constraints on Attribute Use Schema Components</head>
  <p>All attribute uses (see <specref ref="cAttributeUse"/>) <rfc2119>must</rfc2119> satisfy the following constraints.</p>
<constraintnote type="cos" id="au-props-correct">
<head>Attribute Use Correct</head>
<olist role="And">
<item>
<p>The values of the properties of an attribute use <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as
described in the property tableau in
<specref ref="AU_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
</item>
 <item dg="rq129">
  <p>If the <propref comp="au" prop="value constraint"/> is not <termref def="key-null"/>, then it is a valid default with
respect to the <propref comp="au" prop="attribute declaration"/>'s <propref comp="ad" prop="type definition"/> as defined in <specref ref="cos-valid-simple-default"/>.</p>
 </item>
<item>
<p>If the <propref comp="au" prop="attribute declaration"/> has a
<!--*
* material suppressed here by diff group ep01 *
*--><propref comp="ad" prop="value constraint"/><phrase dg="ep01"> with <propref comp="vc_a" prop="variety"/> <pt>fixed</pt></phrase><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"> and</phrase>
the attribute use itself has a <propref comp="au" prop="value constraint"/>, <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">then the 
<propref comp="au" prop="value constraint"/> on the attribute
use<!--*
* material suppressed here by diff group ep01 *
*--> also</phrase><phrase dg="ep01"> has <propref comp="vc_au" prop="variety"/></phrase>
<pt>fixed</pt> and its <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="vc_au" prop="value"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><!--*
* material suppressed here by diff group rq129 *
*--><phrase dg="rq129"> is identical to the <propref comp="vc_a" prop="value"/></phrase> 
of the <propref comp="au" prop="attribute declaration"/>'s
<propref comp="ad" prop="value constraint"/>.</p>
</item>
</olist>
</constraintnote> 
    </div3>
   </div2>
   <div2 id="cAttribute_Group_Definitions">
    <head>Attribute Group Definitions</head>
<p>A schema can name a group of attribute declarations <!--*
* material suppressed here by diff group b2861cc-1g *
*-->so that they <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be incorporated as a
group into complex type definitions.</p>
<p>
Attribute group definitions do not participate in <termref def="key-vn">validation</termref> as such, but the
<propref comp="ctd" prop="attribute uses"/><phrase dg="b2861cc-1g"> and</phrase><!--*
* material suppressed here by diff group b2861cc-1g *
*--> <propref comp="ctd" prop="attribute wildcard"/>
<!--*
* material suppressed here by diff group b2861cc-1g *
*-->of one or
more complex type definitions <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be constructed in whole or part by reference
to an attribute group.  Thus, attribute group definitions provide a
replacement for some uses of XML's
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml/#dt-PE">parameter entity</xspecref> facility.
Attribute group definitions are provided primarily for reference from the XML
representation of schema components
(see <eltref ref="complexType"/> and <eltref ref="attributeGroup" inside="simpleContent"/>).
</p>
    <note role="example">
<eg xml:space="preserve">&lt;xs:attributeGroup name="myAttrGroup"&gt;
    &lt;xs:attribute . . ./&gt;
    . . .
&lt;/xs:attributeGroup&gt;

&lt;xs:complexType name="myelement"&gt;
    . . .
    &lt;xs:attributeGroup ref="myAttrGroup"/&gt;
&lt;/xs:complexType&gt;
</eg>
<p>XML representations for attribute group definitions. The effect is as if the attribute
declarations in the group were present in the type definition.</p>
</note>
    <div3 id="Attribute_Group_Definition_details">
     <head>The Attribute Group Definition Schema Component</head>
    <p>The attribute group definition schema component has the
following properties:</p>

  <compdef name="Attribute Group Definition" abbrev="agd" showAKO="true"/>

  <p>Attribute groups are identified by their <propref comp="agd" prop="name"/> and <propref comp="agd" prop="target namespace"/>; attribute group identities <rfc2119>must</rfc2119> be unique within an <termref def="key-schema">XML Schema</termref>.  See <specref ref="composition-schemaImport"/> for the use of component
identifiers when importing one schema into another.</p>
<p><propref comp="agd" prop="attribute uses"/> is a set attribute uses, allowing
for local specification of occurrence and default or fixed values.</p>
<p><propref comp="agd" prop="attribute wildcard"/> provides for an attribute wildcard to be included in an
attribute group.
See above under <specref ref="Complex_Type_Definitions"/> for the
interpretation of
attribute wildcards during <termref def="key-vn">validation</termref>.</p>
<!--*
* material suppressed here by diff group b2861cc-1g *
*-->
     <p>See <specref ref="cAnnotations"/> for information on the role of the
<propref comp="agd" prop="annotations"/> property.</p>
    </div3>
    <div3 id="declare-attributeGroup">
<head>XML Representation of Attribute Group Definition Schema Components</head>
<p>The XML representation for an attribute group definition schema component is an
<eltref ref="attributeGroup"/> element information item.
 <phrase dg="b2861cc-1g">It provides for
naming a group of attribute declarations and an attribute wildcard for use by reference in the XML representation of
  complex type definitions and other attribute group definitions. </phrase>
<!--* uh, why bother to delete that? *-->
 The correspondences between the
properties of the information item and
properties of the component it corresponds to are as follows:</p>


 <reprdef>
 <reprelt eltname="attributeGroup" type="attributeGroup"/>
  <p>When an <eltref ref="attributeGroup"/> appears as a daughter of
<eltref ref="schema"/> or <eltref ref="redefine"/>, it corresponds to an attribute group definition as
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>
 <reprcomp abstract="Attribute Group Definition" ref="Attribute_Group_Definition_details">
  <propmap comp="agd" prop="name">The <termref def="key-vv">actual value</termref> of the <code>name</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>
  <propmap comp="agd" prop="target namespace">The <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the parent <code>schema</code>
element information item.</propmap>
  <propmap comp="agd" prop="attribute uses">The union of the set of attribute uses corresponding to the <eltref ref="attribute"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, with the <propref comp="agd" prop="attribute uses"/> of the
attribute groups <termref def="src-resolve">resolved</termref> to by the <termref def="key-vv">actual value</termref>s of the <code>ref</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the <eltref ref="attributeGroup" inside="simpleContent"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any.</propmap>
<propmap comp="agd" prop="attribute wildcard">As for the <termref def="key-eaw">complete wildcard</termref> as described in <specref ref="declare-type"/>.</propmap>
 <!--*
* material suppressed here by diff group b2861cc-1g *
*-->
<propmap comp="agd" prop="annotations">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
</reprcomp></reprdef>
 <p>The example above illustrates a pattern which
recurs in the XML representation of schemas:  The same element, in this case <code>attributeGroup</code>, serves both to
define and to incorporate by reference.  In the first case the
<code>name</code> attribute is required, in the second the <code>ref</code>
attribute is required, and the element <rfc2119>must</rfc2119> be empty.  These two are mutually exclusive, and also conditioned
by context:  the defining form, with a <code>name</code>, <rfc2119>must</rfc2119> occur at the top
level of a schema, whereas the referring form, with a <code>ref</code>, <rfc2119>must</rfc2119>
occur within a complex type definition or an attribute group definition.</p>
 </div3>
    <div3>
     <head>Constraints on XML Representations of Attribute Group Definitions</head>
<constraintnote id="src-attribute_group" type="src">
<head>Attribute Group Definition Representation OK</head>
<p>In addition to the conditions imposed on <eltref ref="attributeGroup"/> element
information items by the schema for schemas,
<olist role="and.apply">
<item>
<p>The corresponding attribute group definition, if any, <rfc2119>must</rfc2119>
satisfy the conditions set out in <specref ref="coss-attrGroup"/>.</p>
</item>
<item>
<!--*
* material suppressed here by diff group b2867-1 *
*-->
</item>
<item>
<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 <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if
any, there <rfc2119>must not</rfc2119> be an <eltref ref="attributeGroup" inside="simpleContent"/> with <code>ref</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> which resolves to the component corresponding to this
<eltref ref="attributeGroup"/>.  Indirect circularity is also ruled
out.  That is, when  <specref ref="src-resolve"/> is applied to a
<termref def="gloss-QName">QName</termref> arising from any <eltref ref="attributeGroup" inside="simpleContent"/>s with a <code>ref</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, it <rfc2119>must not</rfc2119> be the case that a
<termref def="gloss-QName">QName</termref> is encountered at any depth
which resolves to the component corresponding to this <eltref ref="attributeGroup"/>.</p>
</item>
</olist>
</p>
</constraintnote>
    </div3>
    <div3>
     <head>Attribute Group Definition Validation Rules</head>
     <p>None as such.</p>
    </div3>
    <div3>
     <head>Attribute Group Definition Information Set
Contributions</head>
     <p>None as such.</p>
    </div3>
    <div3 id="coss-attrGroup">
     <head>Constraints on Attribute Group Definition Schema Components</head>
<p>All attribute group definitions (see <specref ref="cAttribute_Group_Definitions"/>) <rfc2119>must</rfc2119> satisfy the following constraint.</p>
<constraintnote type="cos" id="ag-props-correct">
<head>Attribute Group Definition Properties Correct</head>
<olist role="And">
<item>
<p>The values of the properties of an attribute group definition
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as described in the property tableau in
<specref ref="Attribute_Group_Definition_details"/>, modulo the impact
of <specref ref="conformance-missing"/>;</p>
</item>
<item>
<p><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">No two</phrase> distinct members of the <propref comp="agd" prop="attribute uses"/> <!--*
* material suppressed here by diff group modals *
*--> have
<propref comp="au" prop="attribute declaration"/>s both of whose
<propref comp="ad" prop="name"/>s match and whose <propref comp="ad" prop="target namespace"/>s are identical.</p>
</item>
<item>
<p><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">No two</phrase> 
distinct members of the <propref comp="agd" prop="attribute uses"/> 
<!--*
* material suppressed here by diff group modals *
*--> have <propref comp="au" prop="attribute declaration"/>s both of whose <propref comp="ad" prop="type definition"/>s are or are
<!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> from <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref>.</p>
</item>
</olist>
</constraintnote>
    </div3>
   </div2>
   <div2 id="cModel_Group_Definitions">
    <head>Model Group Definitions</head>
<p>A model group definition associates a name and optional annotations with
 a <compref ref="mg"/><!--*
* material suppressed here by diff group b2861cc-1g *
*-->.
By reference to the name, the entire model group can be incorporated by reference into
 a <propref comp="p" prop="term"/><!--*
* material suppressed here by diff group b2861cc-1g *
*-->.</p>
<p>
Model group definitions are provided
primarily for reference from the <specref ref="declare-type"/> (see <eltref ref="complexType"/>
and <eltref ref="group"/>).  Thus, model group definitions provide a
replacement for some uses of XML's
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml/#dt-PE">parameter entity</xspecref> facility.
</p>
    <note role="example">
<eg xml:space="preserve">&lt;xs:group name="myModelGroup"&gt;
 &lt;xs:sequence&gt;
  &lt;xs:element ref="someThing"/&gt;
  . . .
 &lt;/xs:sequence&gt;
&lt;/xs:group&gt;

&lt;xs:complexType name="trivial"&gt;
 &lt;xs:group ref="myModelGroup"/&gt;
 &lt;xs:attribute .../&gt;
&lt;/xs:complexType&gt;

&lt;xs:complexType name="moreSo"&gt;
 &lt;xs:choice&gt;
  &lt;xs:element ref="anotherThing"/&gt;
  &lt;xs:group ref="myModelGroup"/&gt;
 &lt;/xs:choice&gt;
 &lt;xs:attribute .../&gt;
&lt;/xs:complexType&gt;</eg>
<p>A minimal model group is defined and used by reference, first as the whole
content model, then as one alternative in a choice. </p>
</note>
    <div3 id="Model_Group_Definition_details">
     <head>The Model Group Definition Schema Component</head>
    <p>The model group definition schema component has the following
properties:</p>

  <compdef name="Model Group Definition" abbrev="mgd" showAKO="true"/>

<p>Model group definitions are identified by their <propref comp="mgd" prop="name"/> and <propref comp="mgd" prop="target namespace"/>; model group identities <rfc2119>must</rfc2119> be unique within an <termref def="key-schema">XML Schema</termref>.  See <specref ref="composition-schemaImport"/> for the use of component
identifiers when importing one schema into another.</p>
<p>Model group definitions <emph>per se</emph> do not participate in <termref def="key-vn">validation</termref>, but the <propref comp="p" prop="term"/> of
a particle <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> correspond in whole or in part
to a model group from a model group definition<!--*
* material suppressed here by diff group b2861cc-1g *
*-->.</p>
<p><phrase dg="b2861cc-1g"><propref comp="mgd" prop="model group"/> is the <compref ref="mg"/> for which the model group definition provides a name.</phrase></p>
<!--*
* material suppressed here by diff group b2861cc-1g *
*-->
<p>See <specref ref="cAnnotations"/> for information on the role of the
<propref comp="mgd" prop="annotations"/> property.</p>
    </div3>
<div3 id="declare-namedModelGroup">
<head>XML Representation of Model Group Definition Schema Components</head>
 <p>The XML representation for a model group definition schema component is a
<eltref ref="group"/> element information item.
<phrase dg="b2861cc-1g">It provides for
naming a model group for use by reference in the XML representation of
complex type definitions and model groups. </phrase>The correspondences between the
properties of the information item and
properties of the component it corresponds to are as follows:</p>

<reprdef>
 <reprelt eltname="group" type="realGroup"/> 
 <p>If there is a <code>name</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> (in which case the
item will have <eltref ref="schema"/> or <eltref ref="redefine"/> as parent), then the item corresponds to
a model group definition component with properties as follows:</p>
 <reprcomp abstract="Model Group Definition" ref="Model_Group_Definition_details">
<propmap comp="mgd" prop="name">The <termref def="key-vv">actual value</termref> of the
<code>name</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>

  <propmap comp="mgd" prop="target namespace">The <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the parent <code>schema</code>
element information item.</propmap>
<propmap comp="mgd" prop="model group">A model group which is the <propref comp="p" prop="term"/> of a
particle corresponding to the <eltref ref="all"/>, <eltref ref="choice"/> or
<eltref ref="sequence"/> among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> (there <rfc2119>must</rfc2119> be one).</propmap>
<!--*
* material suppressed here by diff group b2861cc-1g *
*-->
<propmap comp="mgd" prop="annotations">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
</reprcomp>
 <p>Otherwise, the item will have a <code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>,
in which case it corresponds to a particle component with properties as follows (unless <code>minOccurs=maxOccurs=0</code>, in which case the item
corresponds to no component at all):</p>
 <reprcomp abstract="Particle" ref="Particle">
  <propmap comp="p" prop="min occurs">The <termref def="key-vv">actual value</termref> of the <code>minOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <code>1</code>.</propmap>
  <propmap comp="p" prop="max occurs"><pt>unbounded</pt>, if the <code>maxOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> equals <pt>unbounded</pt>, otherwise the <termref def="key-vv">actual value</termref> of the <code>maxOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <code>1</code>.</propmap>
  <propmap comp="p" prop="term">The <propref comp="mgd" prop="model group"/> of the
model group definition <termref def="src-resolve">resolved</termref> to by the <termref def="key-vv">actual value</termref> of the <code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>
  </reprcomp>
</reprdef>
 <p>The name of this section is slightly misleading, in that the second, un-named,
case above (with a
<code>ref</code> and no <code>name</code>) is not really a named model
group at all, but a reference to one.  Also note that in the first (named)
case above no reference is made to <code>minOccurs</code> or
<code>maxOccurs</code>: this is because the schema for schemas does not allow
them on the child of <eltref ref="group"/> when it is named.  This in turn is
because the <propref comp="p" prop="min occurs"/> and <propref comp="p" prop="max occurs"/> of
the particles which <emph>refer</emph> to the definition are what count.</p>
 <p>Given the constraints on its appearance in content models, an
<eltref ref="all"/> 
<!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><rfc2119>must</rfc2119></phrase> 
only occur as the only item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of a named model group definition or a content model: see <specref ref="coss-modelGroup"/>.</p>
</div3>
    <div3>
     <head>Constraints on XML Representations of Model Group Definitions</head>
<constraintnote id="src-model_group_defn" type="src">
  <head>Model Group Definition Representation OK</head>
  <p>In addition to the conditions imposed on <eltref ref="group"/> element
information items by the schema for schemas, the corresponding model group definition, if any, <rfc2119>must</rfc2119> satisfy the conditions set
out in <specref ref="coss-modelGroup"/>.
  </p>
 </constraintnote>
    </div3>
    <div3>
     <head>Model Group Definition Validation Rules</head>
     <p>None as such.</p>
    </div3>
    <div3>
     <head>Model Group Definition Information Set Contributions</head>
     <p>None as such.</p>
    </div3>
    <div3 id="coss-groupDef">
     <head>Constraints on Model Group Definition Schema Components</head>
  <p>All model group definitions (see <specref ref="cModel_Group_Definitions"/>) <rfc2119>must</rfc2119> satisfy the following constraint.</p>
  <constraintnote type="cos" id="mgd-props-correct">
   <head>Model Group Definition Properties Correct</head>
   <p>The values of the properties of a model group definition <rfc2119>must</rfc2119> be as described in
the property tableau in
<specref ref="Model_Group_Definition_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  </constraintnote>
 
    </div3>
   </div2>
   <div2 id="Model_Groups">
    <head>Model Groups</head>
    <p>When the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of element information items are not constrained
to be <pt>empty</pt> or by reference to a simple type definition
(<specref ref="Simple_Type_Definitions"/>), the sequence of element
information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> content <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be specified in
more detail with a model group.  Because the <propref comp="p" prop="term"/> 
property of a particle can be a
model group, and model groups contain particles, model groups can indirectly 
contain other model groups; the grammar for content models
is therefore recursive.<phrase dg="ww-1">
<termdef id="key-contain-dgp" term="directly contains">A model group 
<term>directly contains</term> the particles in the value of its
<propref comp="mg" prop="particles"/> property.</termdef>
<termdef id="key-contain-igx" term="indirectly contains">A model group 
<term>indirectly contains</term> the particles, groups, wildcards, and
element declarations which are <termref def="key-contain-xpx">contained</termref> 
by the particles it
<termref def="key-contain-dgp"/>.</termdef>
<termdef id="key-contain-xgx" term="contains">A model group 
<term>contains</term> the components which it either
<termref def="key-contain-dgp"/>
or <termref def="key-contain-igx"/>.</termdef></phrase>
</p>
    <note role="example">
<eg xml:space="preserve">&lt;xs:all&gt;
 &lt;xs:element ref="cats"/&gt;
 &lt;xs:element ref="dogs"/&gt;
&lt;/xs:all&gt;

&lt;xs:sequence&gt;
 &lt;xs:choice&gt;
  &lt;xs:element ref="left"/&gt;
  &lt;xs:element ref="right"/&gt;
 &lt;/xs:choice&gt;
 &lt;xs:element ref="landmark"/&gt;
&lt;/xs:sequence&gt;
</eg>
<p>XML representations for the three kinds of model group, the third nested
inside the second.</p>
</note>
    <div3 id="Model_Group_details">
     <head>The Model Group Schema Component</head>
    <p>The model group schema component has the following
properties:</p>

<compdef name="Model Group" abbrev="mg" showAKO="true"/>
<p>specifies a sequential (<pt>sequence</pt>),
disjunctive (<pt>choice</pt>) or conjunctive (<pt>all</pt>) interpretation of
the <propref comp="mg" prop="particles"/>.  This in turn 
determines whether the element
information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> <termref def="key-vn">validated</termref> by the model group <rfc2119>must</rfc2119>:
<ulist>
<item><p>(<pt>sequence</pt>) correspond, in order, to the specified <propref comp="mg" prop="particles"/>;</p>
</item>
<item><p>(<pt>choice</pt>) corresponded to exactly one of the specified <propref comp="mg" prop="particles"/>;</p>
</item>
<item><p>(<pt>all</pt>) contain all and only exactly zero or one of each
element specified in <propref comp="mg" prop="particles"/>.  The elements can occur in any
order.  In this case, to reduce implementation complexity, <propref comp="mg" prop="particles"/> is restricted to contain local and top-level element
declarations only, with <propref comp="p" prop="min occurs"/><code>=0</code> or
<code>1</code>, <propref comp="p" prop="max occurs"/><code>=1</code>.</p>
</item>
</ulist></p>
    <p>When two or more particles contained directly or indirectly in the
<propref comp="mg" prop="particles"/> of a model group have identically named
element declarations as their 
<propref comp="p" prop="term"/>, the type definitions of those declarations <rfc2119>must</rfc2119> be the
same.  By 'indirectly' is meant particles within the <propref comp="mg" prop="particles"/>
of a group which is itself the <propref comp="p" prop="term"/> of a directly contained
particle, and so on recursively.</p>
<p>See <specref ref="cAnnotations"/> for information on the role of the
<propref comp="mg" prop="annotations"/> property.</p>
    </div3>
<div3 id="declare-contentModel">
<head>XML Representation of Model Group Schema Components</head>
<p>The XML representation for a model group schema component is
either an
<eltref ref="all"/>, a <eltref ref="choice"/> or a <eltref ref="sequence"/>
element information item.    The correspondences between the
properties of those information items and
properties of the component they correspond to are as follows:</p>
<reprdef>
 <reprelt eltname="all"/>
 <reprelt eltname="choice"/>
 <reprelt eltname="sequence"/>  
 <p>Each of the above items corresponds to a particle containing a model
group, with properties as follows (unless <code>minOccurs=maxOccurs=0</code>, in which case the item
corresponds to no component at all):</p>
<reprcomp abstract="Particle" ref="Particle_details">
<propmap comp="p" prop="min occurs">The <termref def="key-vv">actual value</termref> of the <code>minOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <code>1</code>.</propmap>
  <propmap comp="p" prop="max occurs"><pt>unbounded</pt>, if the <code>maxOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> equals <pt>unbounded</pt>, otherwise the <termref def="key-vv">actual value</termref> of the <code>maxOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <code>1</code>.</propmap>
<propmap comp="p" prop="term">A model group as given below:</propmap>
</reprcomp>
<reprcomp abstract="Model Group" ref="Model_Group_details">
<propmap comp="mg" prop="compositor">One of <pt>all</pt>, <pt>choice</pt>,
<pt>sequence</pt> depending on the element information item.</propmap>
<propmap comp="mg" prop="particles">A sequence of particles
corresponding to all the <eltref ref="all"/>, <eltref ref="choice"/>,
<eltref ref="sequence"/>, <eltref ref="any"/>,
<eltref ref="group"/> or <eltref ref="element"/> items among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>,
in order.</propmap>

<!--*
* material suppressed here by diff group b2861cc-1p *
*-->

<propmap comp="mg" prop="annotations">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
</reprcomp>
</reprdef>
</div3>
    <div3>
     <head>Constraints on XML Representations of Model Groups</head>
  <constraintnote type="src" id="src-model_group">
   <head>Model Group Representation OK</head>
   <p>In addition to the conditions imposed on <eltref ref="all"/>, <eltref ref="choice"/> and <eltref ref="sequence"/> element
information items by the schema for schemas, the corresponding particle and model group <rfc2119>must</rfc2119> satisfy the conditions set
out in <specref ref="coss-modelGroup"/> and <specref ref="coss-particle"/>.   
   </p>
  </constraintnote>
    </div3>
    <div3>
     <head>Model Group Validation Rules</head>

<p dg="ww-LM">In order to define the validation rules for model
groups clearly, it will be useful to define some basic terminology;
this is done in the next two sections, before the validation rules
themselves are formulated.</p>

<div4 id="group-recognition" dg="ww-LM">
<head>Language Recognition by Groups</head>

<!--* <ednote>
<edtext>Need crisper section title.</edtext>
</ednote> *-->

<p dg="ww-LM">Each model group <var>M</var> denotes a language
<var>L</var>(<var>M</var>), whose members are the sequences of element information items
<termref def="key-accept">accepted</termref> by <var>M</var>.</p>

<p dg="ww">Within <var>L</var>(<var>M</var>) a smaller language <var>V</var>(<var>M</var>) can be
identified, which is of particular importance for schema-validity
assessment.  The difference between the two languages is that
<var>V</var>(<var>M</var>) enforces some constraints which are ignored in the definition
of <var>L</var>(<var>M</var>).
Informally <var>L</var>(<var>M</var>) is the set of sequences which are accepted by a model
group if no account is taken of the schema component
constraint <specref ref="cos-nonambig"/> or the related provisions 
in the validation rules which specify how to choose a unique <termref def="key-path"/> 
in a non-deterministic content model. By contrast, <var>V</var>(<var>M</var>) takes
account of those constraints and includes only the sequences which are
<termref def="key-lvip"/> against <var>M</var>.  For all model groups <var>M</var>, <var>V</var>(<var>M</var>) is a
subset of <var>L</var>(<var>M</var>).  <var>L</var>(<var>M</var>) and related concepts are described in this
section; <var>V</var>(<var>M</var>) is described in the next section, <specref ref="group-validation"/>.
</p>

<p dg="ww-p">
<termdef id="key-path" term="path">When a sequence <var>S</var> of element information
items is checked against a model group <var>M</var>, the sequence of 
<!--*
* material suppressed here by diff group ww-1 *
*--><phrase dg="ww-1"><termref def="key-basic-particle">basic particles</termref></phrase> 
which the items of <var>S</var> match, in order, is a
<term>path</term> of <var>S</var> in <var>M</var>.  For a given <var>S</var> and <var>P</var>, the
path of <var>S</var> in <var>P</var> is not necessarily unique.
Detailed rules for the matching, and thus for the construction of
paths, are given in <specref ref="group-recognition"/> and <specref ref="particle-validation"/>.
</termdef>
Not every sequence has a path in every content model<!--*
* material suppressed here by diff group ww-1 *
*--><phrase dg="ww-1">, but every
sequence accepted by the content model does have a path.
<termdef id="key-complete-path" term="complete path">For
a content model <var>M</var> and a sequence <var>S</var> in <var>L</var>(<var>M</var>), the path
of <var>S</var> in <var>M</var> is a <term>complete path</term>; prefixes of
complete paths which are themselves not complete paths
are <term>incomplete paths</term>.</termdef></phrase>  
<!--* every sequence accepted by the content model, and every prefix
of such a sequence, has a path, as do some other sequences.   *-->
For example, in the content model </p>
<eg xml:space="preserve">   &lt;xsd:sequence&gt;
    &lt;xsd:element name="a"/&gt;
    &lt;xsd:element name="b"/&gt;
    &lt;xsd:element name="c"/&gt;
   &lt;/xsd:sequence&gt;</eg>
<p>the sequences (<code>&lt;a/&gt;&lt;b/&gt;&lt;c/&gt;</code>)
and (<code>&lt;a/&gt;&lt;b/&gt;</code>) have <termref def="key-path">paths</termref><phrase dg="ww-1">
(the first a <termref def="key-complete-path"/> and the second
an <termref def="key-complete-path">incomplete path</termref>)</phrase>,
but the sequences (<code>&lt;a/&gt;&lt;b/&gt;&lt;c/&gt;&lt;d/&gt;</code>) and
(<code>&lt;a/&gt;&lt;x/&gt;</code>) do not<phrase dg="ww-1"> 
have paths</phrase>.</p>
<note dg="ww-1">
<p>It is possible, but unusual, for a content model to
have some paths which are neither complete paths, nor
prefixes of complete paths.  For example, the content model
<eg xml:space="preserve">   &lt;xsd:sequence&gt;
    &lt;xsd:element name="a"/&gt;
    &lt;xsd:element name="b"/&gt;
    &lt;xsd:choice/&gt;
   &lt;/xsd:sequence&gt;</eg>
accepts no sequences because the empty <el>choice</el> recognizes
no input sequences.  But the sequences (<code>&lt;/a&gt;</code>)
and (<code>&lt;/a&gt;&lt;b/&gt;</code>) have paths in the content
model.</p>
</note>
<p dg="ww-LM">The definitions of <var>L</var>(<var>M</var>)<phrase dg="ww-p"> and <termref def="key-path">paths</termref> in <var>M</var></phrase>, when <var>M</var> is a <termref def="key-basic-term"/> or
a <termref def="key-basic-particle"/>, are <!--*
* material suppressed here by diff group ww-1 *
*--><phrase dg="ww-1">given</phrase> in
<specref ref="particle-validation"/>.  The definitions for groups are
given below.
</p>

<!--* <ednote>
<edtext>Actually, the information about &V.M; has in this version
been added to this section, not to the next.  The editors need
to decide, before sending this proposal to the WG, whether (1) to
leave the material on &V.M; for different group types where it is,
and change the sentence in the preceding paragraph, or (2) to
create subsections for Sequences, Choices, and All-Groups in
the next section, analogous to those in this section 9but
talking about &V.M; instead of &L.M;.</edtext>
</ednote> *-->

<div5>
<head>Sequences</head>

<p dg="ww-LM">This section defines <var>L</var>(<var>M</var>)<phrase dg="ww">,</phrase><!--*
* material suppressed here by diff group ww *
*--> the set of
<termref def="key-path">paths</termref> in <var>M</var><phrase dg="ww">, and <var>V</var>(<var>M</var>)</phrase>, if <var>M</var>
is a sequence group.</p>

<p dg="ww-LM">If <var>M</var> is a <compref ref="mg"/>,
and the <propref comp="mg" prop="compositor"/> of <var>M</var> is <pt>sequence</pt>, 
and the <propref comp="mg" prop="particles"/> of <var>M</var> is the sequence <var>P</var><sub>1</sub>, <var>P</var><sub>2</sub>, ...,
<var>P</var><sub><phrase><var>n</var></phrase></sub>, then <var>L</var>(<var>M</var>) is the set of sequences <var>S</var> = <var>S</var><sub>1</sub> + <var>S</var><sub>2</sub> + ... +
<var>S</var><sub><phrase><var>n</var></phrase></sub> (taking <quote>+</quote> as the concatenation operator), where
<var>S</var><sub><phrase><var>i</var></phrase></sub> is in <var>L</var>(<var>P</var><sub><phrase><var>i</var></phrase></sub>) for 0 &lt; <var>i</var> ≤ <var>n</var>.
The sequence of sequences <var>S</var><sub>1</sub>, <var>S</var><sub>2</sub>, ..., <var>S</var><sub><phrase><var>n</var></phrase></sub> is a <termref def="key-partition"/> of
<var>S</var>.
Less formally, when <var>M</var> is a sequence of <var>P</var><sub>1</sub>, <var>P</var><sub>2</sub>, ... <var>P</var><sub><phrase><var>n</var></phrase></sub>, then
<var>L</var>(<var>M</var>) is the set of sequences formed by taking one sequence which is
accepted by <var>P</var><sub>1</sub>, then one accepted by <var>P</var><sub>2</sub>, and so on, up through
<var>P</var><sub><phrase><var>n</var></phrase></sub>, and then concatenating them together in order.</p>

<p dg="ww-LM"><termdef id="key-partition" term="partition">A
<term>partition</term> of a sequence is a sequence of sub-sequences,
some or all of which <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be empty, such that concatenating all
the sub-sequences yields the original sequence</termdef>.</p>

<p dg="ww-p">When <var>M</var> is a sequence group
and <var>S</var> is a sequence of input items, the set of <termref def="key-path">paths</termref> of <var>S</var> 
in <var>M</var> is the set of all
paths <var>Q</var> = <var>Q</var><sub>1</sub> + <var>Q</var><sub>2</sub> + ... + <var>Q</var><sub><phrase><var>j</var></phrase></sub>, where<ulist>
<item>
<p><var>j</var> ≤ <var>n</var>, and</p>
</item>
<item>
<p><var>S</var> = <var>S</var><sub>1</sub> + <var>S</var><sub>2</sub> + ... + <var>S</var><sub><phrase><var>j</var></phrase></sub> (i.e. <var>S</var><sub>1</sub>, <var>S</var><sub>2</sub>, ..., <var>S</var><sub><phrase><var>j</var></phrase></sub> is
a <termref def="key-partition"/> of <var>S</var>), and</p>
</item>
<item>
<p><var>S</var><sub><phrase><var>i</var></phrase></sub> is in <var>L</var>(<var>P</var><sub><phrase><var>i</var></phrase></sub>) for 0 &lt; <var>i</var> &lt; <var>j</var>, and</p>
</item>
<item>
<p><var>Q</var><sub><phrase><var>i</var></phrase></sub> is a <termref def="key-path"/> of <var>S</var><sub><phrase><var>i</var></phrase></sub> in <var>P</var><sub><phrase><var>i</var></phrase></sub> for 0 &lt; <var>i</var> ≤ <var>j</var>.</p>
</item>
</ulist>
</p>

<note dg="ww-p">
<p>
By this definition, some sequences which do not satisfy the
entire content model nevertheless have <termref def="key-path">paths</termref> in a content model.
For example, given the content model <var>P</var>
</p>
<eg xml:space="preserve">   &lt;xsd:sequence&gt;
    &lt;xsd:element name="a"/&gt;
    &lt;xsd:element name="b"/&gt;
    &lt;xsd:element name="c"/&gt;
   &lt;/xsd:sequence&gt;</eg>

<p>and an input sequence <var>S</var></p>

<eg xml:space="preserve">&lt;a/&gt;&lt;b/&gt;</eg>
<p>where <var>n</var> = 3, <var>j</var> = 2, then 
<var>S</var><sub>1</sub> is (<code>&lt;a/&gt;</code>),
<var>S</var><sub>2</sub> is (<code>&lt;b/&gt;</code>),
and
<var>S</var> has a <termref def="key-path"/> in <var>P</var>, even though <var>S</var> is not in
<var>L</var>(<var>P</var>).  The <termref def="key-path"/> has two items, first the <compref ref="p"/>
for the <el>a</el> element, then the <compref ref="p"/> for the
<el>b</el> element.</p>
</note>

<p dg="ww">When <var>M</var> is a sequence group,
the set <var>V</var>(<var>M</var>) (the set of sequences 
<termref def="key-lvip"/> against <var>M</var>) is the set of sequences <var>S</var> which
are in <var>L</var>(<var>M</var>) and which have a <termref def="key-vpath"/> in <var>M</var>.
Informally, <var>V</var>(<var>M</var>) contains those sequences which are
accepted by <var>M</var> and for which no element information item
is ever <termref def="key-att-to"/> a <termref def="key-wp"/> if it can, in
context, instead be <termref def="key-att-to"/> an <termref def="key-ep"/>.
There will invariably be a <termref def="key-partition"/> of <var>S</var> whose
members are <termref def="key-lvip"/> against the sub-sequences
of <var>P</var>.
</p>
<note dg="ww">
<p>For sequences with more than one <termref def="key-path"/> in <var>M</var>,
the <termref def="key-att-to">attributions</termref> of
the <termref def="key-vpath"/> are used in validation and for determining
the contents of the <termref def="key-psvi">post-schema-validation infoset</termref>.  For example, if <var>M</var> is
<eg xml:space="preserve">
  &lt;xsd:sequence&gt;
   &lt;xsd:any minOccurs="0"/&gt;
   &lt;xsd:element name="a" minOccurs="0"/&gt;
  &lt;/xsd:sequence&gt;</eg>
then the sequence (<code>&lt;a/&gt;</code>) has two <termref def="key-path">paths</termref>
in <var>M</var>, one containing just the <termref def="key-wp"/> and the other
containing just the <termref def="key-ep"/>.  It is the latter
which is a <termref def="key-vpath"/> and which determines which 
<compref ref="p"/> the item in the input is <termref def="key-att-to"/>.
</p>
</note>
<note dg="ww">
<p>There are model groups for which some members of
<var>L</var>(<var>M</var>) are not in <var>V</var>(<var>M</var>).  For example, if <var>M</var> is
<eg xml:space="preserve">
  &lt;xsd:sequence&gt;
   &lt;xsd:any minOccurs="0"/&gt;
   &lt;xsd:element name="a"/&gt;
  &lt;/xsd:sequence&gt;</eg>
then the sequence (<code>&lt;a/&gt;&lt;a/&gt;</code>) is in <var>L</var>(<var>M</var>), but not
in <var>V</var>(<var>M</var>), because the validation rules require that the first 
<el>a</el> be <termref def="key-att-to"/> the <termref def="key-wp"/>.
In a <termref def="key-vpath"/> the initial <el>a</el> will invariably be
<termref def="key-att-to"/> the <termref def="key-ep"/>, and so no sequence
with an initial <el>a</el> can be <termref def="key-lvip"/> against
this model group.</p>
</note>
</div5>

<div5>
<head>Choices</head>

<p dg="ww-LM">This section defines <var>L</var>(<var>M</var>)<phrase dg="ww">,</phrase><!--*
* material suppressed here by diff group ww *
*--> the set of
<termref def="key-path">paths</termref> in <var>M</var><phrase dg="ww">, and <var>V</var>(<var>M</var>)</phrase>, if <var>M</var>
is a choice group.</p>

<p dg="ww-LM">When the <propref comp="mg" prop="compositor"/> of <var>M</var> is <pt>choice</pt>, and the <propref comp="mg" prop="particles"/> of <var>M</var> is the sequence <var>P</var><sub>1</sub>, <var>P</var><sub>2</sub>, ..., <var>P</var><sub><phrase><var>n</var></phrase></sub>,
then 
<var>L</var>(<var>M</var>) is
<var>L</var>(<var>P</var><sub>1</sub>) ∪ <var>L</var>(<var>P</var><sub>2</sub>) ∪ ... ∪ <var>L</var>(<var>P</var><sub><phrase><var>n</var></phrase></sub>)<phrase dg="ww-p">,
and the set of <termref def="key-path">paths</termref> of <var>S</var> in <var>P</var> is the set
<var>Q</var> = <var>Q</var><sub>1</sub> ∪ <var>Q</var><sub>2</sub> ∪ ... ∪ <var>Q</var><sub><phrase><var>n</var></phrase></sub>, where
<var>Q</var><sub><phrase><var>i</var></phrase></sub> is the set of <termref def="key-path">paths</termref> of <var>S</var> in <var>P</var><sub><phrase><var>i</var></phrase></sub>, for
0 &lt; <var>i</var> ≤ <var>n</var></phrase>.
Less formally, when <var>M</var> is a choice of <var>P</var><sub>1</sub>, <var>P</var><sub>2</sub>, ... <var>P</var><sub><phrase><var>n</var></phrase></sub>, then
<var>L</var>(<var>M</var>) contains any sequence accepted by any of the particles <var>P</var><sub>1</sub>, <var>P</var><sub>2</sub>, ... <var>P</var><sub><phrase><var>n</var></phrase></sub><phrase dg="ww-p">,
and any <termref def="key-path"/> of <var>S</var> in any of the particles <var>P</var><sub>1</sub>, <var>P</var><sub>2</sub>, ... <var>P</var><sub><phrase><var>n</var></phrase></sub>
is a <termref def="key-path"/> of <var>S</var> in <var>P</var></phrase>.
</p>
<!--* <p>For example ...</p> *-->

<p dg="ww">The set <var>V</var>(<var>M</var>) (the set of sequences 
<termref def="key-lvip"/> against <var>M</var>) is the set of sequences <var>S</var> which
are in <var>L</var>(<var>M</var>) and which have a <termref def="key-vpath"/> in <var>M</var>.
In effect, this means that if one of the choices in <var>M</var>
<termref def="key-att-to">attributed</termref> an initial element information item to
a <termref def="key-wp"/>, and another <termref def="key-att-to">attributed</termref> the same
item to an <termref def="key-ep"/>, then the latter choice is used
for validation.</p>
<note dg="ww">
<p>For example, if <var>M</var> is
<eg xml:space="preserve">
  &lt;xsd:choice&gt;
   &lt;xsd:any/&gt;
   &lt;xsd:element name="a"/&gt;
  &lt;/xsd:choice&gt;</eg>
then the <termref def="key-vpath"/> for the sequence (<code>&lt;a/&gt;</code>)
contains just the <termref def="key-ep"/> and it is to the
<termref def="key-ep"/> that the input element will be
<termref def="key-att-to">attributed</termref>; the alternate <termref def="key-path"/>
containing just the <termref def="key-wp"/> is not relevant for
validation as defined in this specification.
</p>
</note>
</div5>

<div5>
<head>All-groups</head>

<p dg="ww-LM">This section defines <var>L</var>(<var>M</var>)<phrase dg="ww">,</phrase><!--*
* material suppressed here by diff group ww *
*--> the set of
<termref def="key-path">paths</termref> in <var>M</var><phrase dg="ww">, and <var>V</var>(<var>M</var>)</phrase>, if <var>M</var>
is an all-group.</p>

<p dg="ww-LM">When the <propref comp="mg" prop="compositor"/> of <var>M</var> is <pt>all</pt>, and the <propref comp="mg" prop="particles"/> of <var>M</var> is the sequence <var>P</var><sub>1</sub>, <var>P</var><sub>2</sub>, ..., <var>P</var><sub><phrase><var>n</var></phrase></sub>,
then 
<var>L</var>(<var>M</var>) is the set of sequences
<var>S</var> = <var>S</var><sub>1</sub> × <var>S</var><sub>2</sub> × ... × <var>S</var><sub><phrase><var>n</var></phrase></sub>
(taking <quote>×</quote> as the interleave operator),
where
for 0 &lt; <var>i</var> ≤ <var>n</var>, <var>S</var><sub><phrase><var>i</var></phrase></sub> is in <var>L</var>(<var>P</var><sub><phrase><var>i</var></phrase></sub>).
The set of sequences
{<var>S</var><sub>1</sub>, <var>S</var><sub>2</sub>, ..., <var>S</var><sub><phrase><var>n</var></phrase></sub>} is a <termref def="key-grouping"/> of <var>S</var>.
<phrase dg="ww-p">The set of <termref def="key-path">paths</termref> of <var>S</var> in <var>P</var> is
the set of all <termref def="key-path">paths</termref>
<var>Q</var> = <var>Q</var><sub>1</sub> × <var>Q</var><sub>2</sub> × ... × <var>Q</var><sub><phrase><var>n</var></phrase></sub>,
where <var>Q</var><sub><phrase><var>i</var></phrase></sub> is a <termref def="key-path"/> of <var>S</var><sub><phrase><var>i</var></phrase></sub> in <var>P</var><sub><phrase><var>i</var></phrase></sub>, 
for 0 &lt; <var>i</var> ≤ <var>n</var>.</phrase>
</p>
<p>
Less formally, when <var>M</var> is an <pt>all</pt>-group of <var>P</var><sub>1</sub>, <var>P</var><sub>2</sub>, ... <var>P</var><sub><phrase><var>n</var></phrase></sub>, then
<var>L</var>(<var>M</var>) is the set of sequences formed by taking one sequence which
is accepted by <var>P</var><sub>1</sub>, 
then one accepted by <var>P</var><sub>2</sub>,
and so on, up through <var>P</var><sub><phrase><var>n</var></phrase></sub>, and then interleaving them
together.  Equivalently, <var>L</var>(<var>M</var>) is the set of sequences <var>S</var>
such that the set {<var>S</var><sub>1</sub>, <var>S</var><sub>2</sub>, ..., <var>S</var><sub><phrase><var>n</var></phrase></sub>} is a 
<termref def="key-grouping"/> of <var>S</var>, and 
for 0 &lt; <var>i</var> ≤ <var>n</var>, <var>S</var><sub><phrase><var>i</var></phrase></sub> is in <var>L</var>(<var>P</var><sub><phrase><var>i</var></phrase></sub>).
</p>

<p dg="ww-LM"><termdef id="key-grouping" term="grouping">A
<term>grouping</term> of a sequence is a set of sub-sequences, some or
all of which may be empty, such that each member of the original
sequence appears once and only once in one of the sub-sequences and
all members of all sub-sequences are in the original
sequence.</termdef> </p>
<!--* <ednote diff="add" dg="ww-LM">
<edtext>Does the interleave operator require more elaborate
definition?</edtext>
</ednote> *-->

<p>For example, given the content model <var>P</var>
<eg xml:space="preserve">  &lt;xsd:all&gt;
   &lt;xsd:element name="a" minOccurs="0" maxOccurs="5"&gt;
   &lt;xsd:element name="b" minOccurs="1" maxOccurs="1"&gt;
   &lt;xsd:element name="c" minOccurs="0" maxOccurs="5"&gt;
   &lt;/xsd:element&gt;
  &lt;/xsd:all&gt;</eg>
and an input sequence <var>S</var> <eg xml:space="preserve">&lt;a/&gt;&lt;b/&gt;&lt;a/&gt;</eg>
where <var>n</var> = 3, then 
<var>S</var><sub>1</sub> is (<code>&lt;a/&gt;&lt;a/&gt;</code>),
<var>S</var><sub>2</sub> is (<code>&lt;b/&gt;</code>)<phrase dg="ww-p">,
and the <termref def="key-path"/> of
<var>S</var> in <var>P</var> is the sequence containing first the <compref ref="p"/>
for the <el>a</el> element, then the <compref ref="p"/> for the
<el>b</el> element, then once more the 
<compref ref="p"/> for the <el>a</el> element.</phrase>
</p>

<p dg="ww">The set <var>V</var>(<var>M</var>) (the set of sequences 
<termref def="key-lvip"/> against <var>M</var>) is the set of sequences <var>S</var> which
are in <var>L</var>(<var>M</var>) and which have a <termref def="key-vpath"/> in <var>M</var>.
In effect, this means that if one of the <compref ref="p" name="Particles"/> in <var>M</var>
<termref def="key-att-to">attributed</termref> an element information item to
a <termref def="key-wp"/>, and a <termref def="key-compete">competing</termref> <compref ref="p"/>
<termref def="key-att-to">attributed</termref> the same item to an <termref def="key-ep"/>, then the
<termref def="key-ep"/> is used for validation.</p>
<note dg="ww">
<p>For example, if <var>M</var> is
<eg xml:space="preserve">
  &lt;xsd:all&gt;
   &lt;xsd:any/&gt;
   &lt;xsd:element name="a"/&gt;
  &lt;/xsd:all&gt;</eg>
then <var>M</var> accepts sequences of length two, containing
one <el>a</el> element and one other element.
</p>
<p>
The other element can be anything at all, including a second
<el>a</el> element. After the first <el>a</el>
the <termref def="key-ep"/> accepts no more elements
and so no longer <termref def="key-compete">competes</termref> with the <termref def="key-wp"/>.
So if the sequence (<code>&lt;a/&gt;&lt;a/&gt;</code>)
is checked against <var>M</var>, in the <termref def="key-vpath"/> the
first <el>a</el> element will be <termref def="key-att-to"/>
the <termref def="key-ep"/> and the second to the 
<termref def="key-wp"/>.
</p>

<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->
</note>

<!--*
* material suppressed here by diff group b2867-2 *
*-->

</div5>

<div5 dg="ww-p">
<head>Multiple Paths in Groups</head>

<p>It is possible for a given sequence of element information items
to have multiple <termref def="key-path">paths</termref> in a given model group <var>M</var>; this is
the case, for example, when <var>M</var> is ambiguous, as for example</p>
<eg xml:space="preserve">  &lt;xsd:choice&gt;
   &lt;xsd:sequence&gt;
    &lt;xsd:element ref="my:a" maxOccurs="unbounded"/&gt;
    &lt;xsd:element ref="my:b"/&gt;
   &lt;/xsd:sequence&gt;
   &lt;xsd:sequence&gt;
    &lt;xsd:element ref="my:a"/&gt;
    &lt;xsd:element ref="my:b" maxOccurs="unbounded"/&gt;
   &lt;/xsd:sequence&gt;
  &lt;/xsd:choice&gt;</eg>
<p>which can match the sequence (<code>&lt;a/&gt;&lt;b/&gt;</code>)
in more than one way.
It may also be the case with unambiguous model groups, if
they do not correspond to a <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#determinism">deterministic</xspecref>
expression (as it is termed in <bibref ref="ref-xml"/>).
<!--* or a <quote>1-unambiguous</quote> expression, as it
is defined by <bibref ref="ABK-DW"/>. *-->
For example,</p> <eg xml:space="preserve">  &lt;xsd:sequence&gt;
   &lt;xsd:element name="a" minOccurs="0"/&gt;
   &lt;xsd:element name="a"/&gt;
  &lt;/xsd:sequence&gt;</eg>

<note>
<p>Because these model groups do not obey the
constraint <specref ref="cos-nonambig"/>, they cannot
appear in a valid schema.</p>
</note>
<!--*
* material suppressed here by diff group ww-1 *
*-->
<!--* <ednote>
<edtext>Add reference to Br&uuml;ggemann-Klein and Wood for
definition of 1-unambiguity.</edtext>
</ednote> *-->


</div5>
</div4>

<div4 id="group-validation" dg="ww-p">
<head><!--*
* material suppressed here by diff group ww *
*--><phrase dg="ww">Principles of Validation against Groups</phrase></head>

<p dg="ww">As noted above, each model group <var>M</var> denotes a
language <var>L</var>(<var>M</var>), whose members are sequences of element information
items.  Each member of <var>L</var>(<var>M</var>) has one or more <termref def="key-path">paths</termref> in <var>M</var>, as do
other sequences of element information items.</p>

<p dg="ww">By imposing conditions on <termref def="key-path">paths</termref> in a model group <var>M</var>
it is possible to identify a set of <termref def="key-vpath">validation-paths</termref> in <var>M</var>,
such that if <var>M</var> is a <!--*
* material suppressed here by diff group ww-1 *
*--> 
model group<phrase dg="ww-1"> which obeys the
<specref ref="cos-nonambig"/> constraint</phrase>, then 
any sequence <var>S</var> has at most one <termref def="key-vpath"/> in <var>M</var>.
The language <var>V</var>(<var>M</var>) can then be defined as the set of
sequences which have <termref def="key-vpath">validation-paths</termref> in <var>M</var>.</p>

<p dg="ww-p"><termdef id="key-compete" term="compete">Two
<compref name="Particles" ref="p"/> <var>P</var><sub>1</sub> and <var>P</var><sub>2</sub> contained in some <compref ref="p"/> <var>P</var>
<term>compete</term> with each other if and only if some sequence <var>S</var>
of element information items has two <termref def="key-path">paths</termref> in <var>P</var> which are
identical except that one path has <var>P</var><sub>1</sub> as its last item and the other
has <var>P</var><sub>2</sub>.</termdef></p>
<p dg="ww-p">For example, in the content model</p>
<eg xml:space="preserve">  &lt;xsd:sequence&gt;
   &lt;xsd:element name="a"/&gt;
   &lt;xsd:choice&gt;
    &lt;xsd:element name="b"/&gt;
    &lt;xsd:any/&gt;
   &lt;/xsd:choice&gt;
  &lt;/xsd:sequence&gt;</eg>
<p>the sequence (<code>&lt;a/&gt;&lt;b/&gt;</code>) has two paths,
one (<var>Q</var><sub>1</sub>) consisting of the <compref ref="p"/> whose <propref comp="p" prop="term"/> is
the declaration for <el>a</el> followed by the 
<compref ref="p"/> whose <propref comp="p" prop="term"/> is
the declaration for <el>b</el>, and
a second (<var>Q</var><sub>2</sub>) consisting of the <compref ref="p"/> whose <propref comp="p" prop="term"/> is
the declaration for <el>a</el> followed by the 
<compref ref="p"/> whose <propref comp="p" prop="term"/> is
the wildcard.  The sequences <var>Q</var><sub>1</sub> and <var>Q</var><sub>2</sub> are 
identical except for their last items, and so the
two <compref name="Particles" ref="p"/> which are the last items of <var>Q</var><sub>1</sub> and 
<var>Q</var><sub>2</sub> are said to <termref def="key-compete"/> with each other.
</p>
<p dg="ww-p">By contrast, in the content model
<eg xml:space="preserve">
  &lt;xsd:choice&gt;
   &lt;xsd:sequence&gt;
    &lt;xsd:element name="a"/&gt;
    &lt;xsd:element name="b"/&gt;
   &lt;/xsd:sequence&gt;
   &lt;xsd:sequence&gt;
    &lt;xsd:element name="c"/&gt;
    &lt;xsd:any/&gt;
   &lt;/xsd:sequence&gt;
  &lt;/xsd:choice&gt;</eg>
the <compref name="Particles" ref="p"/> for <el>b</el> and the 
wildcard do not compete, because there is no
pair of <termref def="key-path">paths</termref> in <var>P</var> which differ only in one 
having the <termref def="key-ep"/> for <el>b</el> and
the other having the <termref def="key-wp"/>.
</p>

<p dg="ww"><termdef id="key-competing-paths" term="competing paths">Two
(or more) <termref def="key-path">paths</termref> of a sequence <var>S</var> in a <compref ref="p"/> <var>P</var>
are <term>competing paths</term> if and only if
they are identical except for their final items, which 
differ.</termdef></p>

<!--*
* material suppressed here by diff group ww-geniza *
*-->

<!--* <ednote diff="add" dg="ww-geniza">
<edtext>Does the notion of prefix of a sequence need
formal definition?</edtext>
</ednote> *-->

<!--*
* material suppressed here by diff group ww-geniza *
*-->

<!--*
* material suppressed here by diff group ww-geniza *
*-->

<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->

<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->

<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->

<p dg="ww-1"><termdef id="key-vpath" term="validation-path">For any sequence <var>S</var> of element
information items and any particle <var>P</var>, a <termref def="key-path"/> of <var>S</var> in <var>P</var>
is a <term>validation-path</term> if and only if for each
prefix of the <termref def="key-path"/> which ends with a <termref def="key-wp"/>, the
corresponding prefix of <var>S</var> has no <termref def="key-competing-paths">competing path</termref> which
ends with an <termref def="key-ep"/>.
</termdef></p>

<note dg="ww">
<p>It is a consequence of the definition of <termref def="key-vpath"/> that for
any content model <var>M</var> which obeys constraint
<specref ref="cos-nonambig"/> and for any sequence <var>S</var> of
element information items, <var>S</var> has at most one
<termref def="key-vpath"/> in <var>M</var>.
</p>
</note>

<p dg="ww"><termdef id="key-lvip" term="locally valid">A sequence <var>S</var> of
element information items is <term>locally valid</term> against
a particle <var>P</var> if and only if 
<var>S</var> has a <termref def="key-vpath"/> in <var>P</var>.  The set of all such 
sequences is written <var>V</var>(<var>P</var>).</termdef></p>

</div4>
<div4>
<head>Validation Rules</head>

<!--*
* material suppressed here by diff group ww-LM *
*-->

<constraintnote type="cvc" id="cvc-model-group" dg="ww-LM">
 <head>Element Sequence Valid</head>

<p>For a sequence <var>S</var> (possibly empty) of element information items to be
locally <termref def="key-vn">valid</termref> with respect to
a model group <var>M</var>, <var>S</var> <rfc2119>must</rfc2119> be in <!--*
* material suppressed here by diff group ww-1 *
*--><phrase dg="ww-1"><var>V</var>(<var>M</var>)</phrase>.
</p>

<note>
<p>It is possible to define groups whose <propref comp="mg" prop="particles"/> 
is empty.  When a <pt>choice</pt>-group <var>M</var> has an empty
<propref comp="mg" prop="particles"/> property, then
<var>L</var>(<var>M</var>) is the empty set.
When <var>M</var> is a <pt>sequence</pt>- or <pt>all</pt>-group with an empty
<propref comp="mg" prop="particles"/> property, then
<var>L</var>(<var>M</var>) is the set containing the empty (zero-length) sequence.
</p>
</note>
</constraintnote>
<!--* !!! Revise the following note to remove the note of sanctimony
and ignorance. *-->
    <!--*
* material suppressed here by diff group ww-1 *
*-->
</div4>
    </div3>
    <div3>
     <head>Model Group Information Set Contributions</head>
     <p>None as such.</p>
    </div3>
    <div3 id="coss-modelGroup">
     <head>Constraints on Model Group Schema Components</head>
  <p>All model groups (see <specref ref="Model_Groups"/>) <rfc2119>must</rfc2119> satisfy the following constraints.</p>
  <constraintnote type="cos" id="mg-props-correct">
   <head>Model Group Correct</head>
   <olist role="And">
    <item><p>The values of the properties of a model group <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as described in
the property tableau in
<specref ref="Model_Group_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p></item>
    <item><p><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">There are no circular groups.</phrase>  
That is, within the <propref comp="mg" prop="particles"/> of a group there 
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is no 
particle at any depth</phrase> whose <propref comp="p" prop="term"/> is the
group itself.</p></item>
   </olist>   
  </constraintnote>
  <constraintnote type="cos" id="cos-all-limited">
   <head>All Group Limited</head>
   <p>When a model group has <propref comp="mg" prop="compositor"/> <pt>all</pt>, then
    <olist role="and">
     <item>
<p>It appears only as the value of one or both of the following properties:</p>
<olist>
     <item>
      <p>the <propref comp="mgd" prop="model group"/> property of a model group definition.</p>
     </item>
     <item>
      <p>the
<propref comp="p" prop="term"/> property of a <compref ref="p"/> with <propref comp="p" prop="max occurs"/><code>=1</code>which is <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">the <propref comp="ct" prop="particle"/> of</phrase> the <propref comp="ctd" prop="content type"/> of a
complex type definition.</p>
     </item>
    </olist>
     </item>
     <!--*
* material suppressed here by diff group all-2506-1 *
*-->
    </olist> 
<!--* 
<phrase diff="add" dg="all-2506-1">It 
&must; appear only as the value of one or both of the following properties:</phrase>
<olist diff="add" dg="all-2506-1">
     <item>
      <p>the <propref comp="mgd" prop="model group"/> property of a model group definition.</p>
     </item>
     <item>
      <p>the
<propref comp="p" prop="term"/> property of a &particle0; with <propref comp="p" prop="max occurs"/><code>=1</code>which is <phrase diff="del" dg="ep01">part of a pair which constitutes</phrase><phrase diff="add" dg="ep01">the <propref comp="ct" prop="particle"/> of</phrase> the <propref comp="ctd" prop="content type"/> of a
complex type definition.</p>
     </item>
    </olist>
*-->
   </p>
  </constraintnote>
<constraintnote type="cos" id="cos-element-consistent">
<head>Element Declarations Consistent</head>
<issue id="RQ-146i" role="1.1" status="open">
<!--* <p><loc href="&reqs;#ElementDeclarationsConsistent" target="reqs">RQ-146 (ElementDeclarationsConsistent)</loc></p> *-->
<p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2544" target="reqs">Issue 2544 (RQ-146 element declarations consistent)</loc></p>
<p>Some corner cases, e.g. involving 'skip' wildcards, have emerged with
respect to this constraint.  It will be restated at a higher level of
abstraction, in terms of desired outcome.  See also <specref ref="RQ-36i"/>.</p>
<resolution>
<p>This constraint will be restated in terms of intended outcome, i.e.
that (modulo the impact of xsi:type) validation of an EII with a type
definition will always assign the same type definitions to elements or
attributes of the same name.</p>
</resolution>
</issue>
<p>If the <propref comp="mg" prop="particles"/> contains, either
directly, indirectly (that is, within the <propref comp="mg" prop="particles"/> of a
contained model group, recursively) or <termref def="key-impl-cont">implicitly</termref> two or more element
declaration particles with the same <propref comp="ed" prop="name"/> and
<propref comp="ed" prop="target namespace"/>, then all their type
definitions <rfc2119>must</rfc2119> be the same top-level definition, that is,
<olist role="and">
<item>
<p>all their <propref comp="ed" prop="type definition"/>s <!--*
* material suppressed here by diff group modals *
*--> have a <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><termref def="key-null">non-absent</termref></phrase>
 <propref comp="ctd" prop="name"/>.</p>
</item>
<item>
<p>all their
<propref comp="ed" prop="type definition"/>s <!--*
* material suppressed here by diff group modals *
*--> have the same
<propref comp="ctd" prop="name"/>.</p>
</item>
<item>
<p>all their
<propref comp="ed" prop="type definition"/>s <!--*
* material suppressed here by diff group modals *
*--> have the same
<propref comp="ctd" prop="target namespace"/>.</p>
</item>
</olist>
</p>
<p><termdef id="key-impl-cont" term="implicitly contains">A list
of particles <term>implicitly contains</term> an element declaration if<phrase dg="iff"> and only if</phrase> a
member of the list contains that
element declaration in its <termref def="key-eq">substitution group</termref></termdef>.</p>
</constraintnote>

<p dg="ww-p">
<termdef id="key-att-to" term="attributed to">
The <term>attributions</term> of a sequence <var>S</var> of element information items,
when <var>S</var> is checked against a particle <var>P</var>, 
are the <termref def="key-ep">element</termref> or 
<termref def="key-wp">wildcard particles</termref> in <var>P</var> with which the items in <var>S</var> are matched.
It is the sequence of these
<compref name="Particles" ref="p"/> which forms the <termref def="key-path"/> of <var>S</var> in <var>P</var>.
<phrase dg="ww">When <compref ref="p"/> is
non-deterministic, then each element information 
item in <var>S</var> is <term>attributed to</term> to
the <compref ref="p"/> it matches up with in the unique <termref def="key-vpath"/>,
not to any other <compref ref="p"/>.</phrase>
</termdef>
Element information items
are attributed to <termref def="key-ep">element particles</termref> 
only when the element's <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2004/REC-xml-names11-20040204/#dt-expname">expanded name</xspecref> <termref def="key-e-d-match">matches</termref>
the <propref comp="p" prop="term"/> of the <compref ref="p"/>,
and to <termref def="key-wp">wildcard particles</termref> only then the element's
namespace <termref def="key-wc-match">matches</termref> the 
<compref ref="w"/>.  In addition, the <termref def="key-att-to">attribution</termref>
of element information items to <compref ref="p" name="Particles"/> must
respect the structure (sequence, choice,
<propref comp="p" prop="min occurs"/> and <propref comp="p" prop="max occurs"/>, etc.) of the <compref ref="p"/> 
and of <compref ref="p" name="Particles"/> nested within its <propref comp="p" prop="term"/>.
The rules are given in more detail in 
<specref ref="group-recognition"/> and 
<specref ref="particle-recognition"/>,
and in Validation Rule <specref ref="cvc-accept"/>.
</p>

<p dg="ww-p">
<termdef id="key-ep" term="element particle">
An <term>element particle</term> is a <compref ref="p"/> whose <propref comp="p" prop="term"/> is an <compref ref="ed"/>.
</termdef>
<termdef id="key-wp" term="wildcard particle">
A <term>wildcard particle</term> is a <compref ref="p"/> whose <propref comp="p" prop="term"/> is a <compref ref="w"/>.
</termdef>
</p>



<constraintnote type="cos" id="cos-nonambig">
<head>Unique Particle Attribution</head>
<!--*
* material suppressed here by diff group ww-p *
*-->

<p dg="ww-p">A content model <rfc2119>must not</rfc2119> contain two
<!--*
* material suppressed here by diff group ww *
*--><phrase dg="ww"><termref def="key-ep">element particles</termref></phrase> which <termref def="key-compete"/> with each other<phrase dg="ww">, nor two
<termref def="key-wp">wildcard particles</termref> which <termref def="key-compete"/> with each other</phrase>.</p>



<note dg="ww">
<p>Content models in which an <termref def="key-ep"/> and a <termref def="key-wp"/>
<termref def="key-compete"/> with each other are <emph>not</emph> prohibited.
In such cases, the <compref ref="ed"/> is chosen; 
see <!--*
* material suppressed here by diff group ww-1 *
*--><phrase dg="ww-1">the definitions of
<termref def="key-att-to">attribution</termref>
and <termref def="key-vpath"/></phrase>.
</p>
</note>

<!--* <ednote diff="add" dg="ww">
<edtext>Check cross reference in preceding note to make sure it
goes to the right place.</edtext>
</ednote> *-->

<!--* <p diff="add" dg="ww-x">Unique determination is <emph>not</emph>
compromised for the purposes of this constraint when a given item
might match either a <compref ref="w"/> or an <compref
ref="ed"/>. <specref ref="cvc-particle"/> resolves such choices in
favor of the <compref ref="ed"/>.</p> *-->
<!--*
* material suppressed here by diff group ww-geniza *
*-->

<note>
<p>This constraint reconstructs for XML Schema the equivalent
constraints of <bibref ref="ref-xml"/> and SGML.  <!--*
* material suppressed here by diff group ww-p *
*--><phrase dg="ww-p">See</phrase> 
<specref ref="non-ambig"/> for further
discussion.</p>
<!--* <ednote diff="add" dg="ww-p">
<edtext>What does the following paragraph mean?
<phrase diff="add" dg="ww-1">[Keep it anyway.]</phrase></edtext>
</ednote> *-->
<p>Since this constraint is expressed at the component level, it
applies to content models whose origins (e.g. via type <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivation</xtermref> and
references to named model groups) are no longer evident.  So particles at
different points in the content model are always distinct from one another,
even if they originated from the same named model group.</p>
   </note>

</constraintnote>

<!--* <ednote diff="add" dg="ww-p">
<edtext>Is the notion of a content model <quote>containing</quote> a
&particle0; clear enough to count as a primitive notion, or should we
define it?</edtext>
</ednote> *-->

<!--*
* material suppressed here by diff group ww-geniza *
*--><!--* temporary duplicate *-->

<note dg="ww"> 
<p>It is a consequence of <specref ref="cos-nonambig"/>, together with
the definition of <termref def="key-vpath"/>, that any sequence <var>S</var> of element
information items has at most one <termref def="key-vpath"/> in any particle <var>P</var>.
This means in turn that each item in <var>S</var> is attributed to at most one particle in <var>P</var>.
No item can match more than one <compref ref="w"/>
or more than one <compref ref="ed"/> (because no two <termref def="key-wp">wildcard particles</termref>
and no two <termref def="key-ep">element particles</termref> <rfc2119>may</rfc2119> <termref def="key-compete"/>), and if an item matches
both a <termref def="key-wp"/> and an <termref def="key-ep"/>, it is <termref def="key-att-to">attributed</termref> by
the rules for <termref def="key-vpath">validation-paths</termref> to the <termref def="key-ep"/>.</p>
</note>


  <note>
<!--* <ednote diff="add" dg="ww-p">
<edtext>What does the following paragraph mean?</edtext>
</ednote> *-->
    <p>Because locally-scoped element declarations <phrase dg="may">may or may not</phrase><!--*
* material suppressed here by diff group may *
*--> have a
<propref comp="ed" prop="target namespace"/>, the scope of
declarations is <emph>not</emph> relevant to enforcing either 
<!--*
* material suppressed here by diff group ww-p *
*--><phrase dg="ww-p">the
<specref ref="cos-nonambig"/> constraint or the 
<specref ref="cos-element-consistent"/> constraint</phrase>.</p>
   </note>


<!--* <ednote diff="add" dg="ww">
<edtext>For technical reasons, the following inquiry is tagged
as a Note instead of an Editorial Note.  But it is not intended
that this Note should be part of the final text of the spec.</edtext>
</ednote>
<note diff="add" dg="ww">
<p>The definition of <specref ref="cos-nonambig"/> just given
applies not to all sequences in &L.P; but to all sequences
which have &paths; in &P;.  This is necessary to ensure that
the content model
<eg><![CDATA[  <xsd:choice>
   <xsd:element ref="my:a"/>
   <xsd:sequence>
    <xsd:any/>
    <xsd:element ref="my:b"/>>
   </xsd:sequence>
  </xsd:choice>]]></eg>
is not accepted.  (Every sequence in &L.P;, has exactly
one &path; in &P;; if the sequence is of length 2, 
the &path; goes through the 
wildcard; if the sequences is of length 1, it goes
through the reference to <el>my:a</el>.</p>
<p>The Working Group should be certain that it accepts this
choice.</p>
<p>What may not be strictly necessary is the extension of the rule
to cover <emph>all</emph> sequences of
element information items instead of only the prefixes of
sequences in &L.P;.  The consequence of this choice is that
content models like
<eg><![CDATA[  <xsd:choice>
   <xsd:sequence>
    <xsd:element ref="my:a" minOccurs="0"/>
    <xsd:element ref="my:a"/>
    <xsd:choice/>< ! - - *  for empty choice, L(P) = {} * - - >
   </xsd:sequence>
   <xsd:sequence>
    <xsd:element ref="my:b"/>
    <xsd:element ref="my:b"/>
   </xsd:sequence>
  </xsd:choice>]]></eg>
or equivalently 
<eg>((a?, a, &emptyset;) | (b, b))</eg>
are not legal, despite the fact that the 
non-determinism is in a branch of the choice which 
recognizes no sequences at all.</p>
<p>The Working Group should be certain that it accepts this
choice in defining UPA.</p>
<p>Finally, the WG should note that some content models
for which the natural automaton is non-deterministic will
be accepted by this definition of <specref ref="cos-nonambig"/>.
For example:
<eg><![CDATA[  <xsd:choice>
   <xsd:sequence>
    <xsd:choice/>< ! - - * for empty choice, L(P) = {} * - - >
    <xsd:element ref="my:a" minOccurs="0"/>
    <xsd:element ref="my:a"/>
   </xsd:sequence>
   <xsd:sequence>
    <xsd:element ref="my:b"/>
    <xsd:element ref="my:b"/>
   </xsd:sequence>
  </xsd:choice>]]></eg>
or equivalently 
<eg>((&emptyset;, a?, a) | (b, b))</eg>
Because the apparent non-determinism follows a construct
which matches the empty set, it cannot be on the &path;
of any sequence, and so does not violate the constraint.
(For the same reason, it does not violate the <specref ref="cos-nonambig"/> constraint
as specified in XSD 1.0, either.)</p>
<p>The Working Group should be certain that it 
accepts this fact.</p>
<p>Alternative methods of defining the constraint are possible:
we could define a mapping from content models to automata
and define the constraint with reference to the standard
automaton.  This would require a good deal of infrastructure;
it would also require us to introduce the notion of
marking and unmarking the content model.
We could also define the constraint in terms of derivatives;
again, marking and unmarking would be required.</p>
</note>
*-->

  <p>The following constraints define relations appealed to elsewhere in this specification.</p>
  <constraintnote type="cos" id="cos-seq-range">
   <head>Effective Total Range (<pt>all</pt> and <pt>sequence</pt>)</head>
   <p>The effective total range of a particle whose <propref comp="p" prop="term"/> is a group whose <propref comp="mg" prop="compositor"/> is
<pt>all</pt> or <pt>sequence</pt> is a pair of minimum and maximum, as follows: </p>
   <glist>
    <gitem>
     <label>minimum</label>
     <def>
      <p>The product of the particle's <propref comp="p" prop="min occurs"/> and the
sum of the <propref comp="p" prop="min occurs"/> of every wildcard or element
declaration particle in the group's <propref comp="mg" prop="particles"/> and the minimum
part of the effective total range of each of the group particles in the group's <propref comp="mg" prop="particles"/> (or <code>0</code> if there are no <propref comp="mg" prop="particles"/>).</p>
     </def>
    </gitem>
    <gitem>
     <label>maximum</label>
     <def>
      <p><pt>unbounded</pt> if the <propref comp="p" prop="max occurs"/> of any wildcard or element
declaration particle in the group's <propref comp="mg" prop="particles"/> or the maximum
part of the effective total range of any of the group particles in the group's
<propref comp="mg" prop="particles"/> is <pt>unbounded</pt>, or if any of those is non-zero
and the <propref comp="p" prop="max occurs"/> of the particle itself is <pt>unbounded</pt>,
otherwise the product of the particle's <propref comp="p" prop="max occurs"/> and the
sum of the <propref comp="p" prop="max occurs"/> of every wildcard or element
declaration particle in the group's <propref comp="mg" prop="particles"/> and the maximum
part of the effective total range of each of the group particles in the group's <propref comp="mg" prop="particles"/> (or <code>0</code> if there are no <propref comp="mg" prop="particles"/>).</p>
     </def>
    </gitem>
   </glist>
  </constraintnote>
  <constraintnote type="cos" id="cos-choice-range">
   <head>Effective Total Range (<pt>choice</pt>)</head>
   <p>The effective total range of a particle whose <propref comp="p" prop="term"/> is a group whose <propref comp="mg" prop="compositor"/> is
<pt>choice</pt> is a pair of minimum and maximum, as follows:</p>
   <glist>
    <gitem>
     <label>minimum</label>
     <def>
      <p>The product of the particle's <propref comp="p" prop="min occurs"/> and the
minimum of the <propref comp="p" prop="min occurs"/> of every wildcard or element
declaration particle in the group's <propref comp="mg" prop="particles"/> and the minimum
part of the effective total range of each of the group particles in the group's <propref comp="mg" prop="particles"/> (or <code>0</code> if there are no <propref comp="mg" prop="particles"/>).</p>
     </def>
    </gitem>
    <gitem>
     <label>maximum</label>
     <def>
      <p><pt>unbounded</pt> if the <propref comp="p" prop="max occurs"/> of any wildcard or element
declaration particle in the group's <propref comp="mg" prop="particles"/> or the maximum
part of the effective total range of any of the group particles in the group's
<propref comp="mg" prop="particles"/> is <pt>unbounded</pt>, or if any of those is non-zero
and the <propref comp="p" prop="max occurs"/> of the particle itself is <pt>unbounded</pt>,
otherwise the product of the particle's <propref comp="p" prop="max occurs"/> and the
maximum of the <propref comp="p" prop="max occurs"/> of every wildcard or element
declaration particle in the group's <propref comp="mg" prop="particles"/> and the maximum
part of the effective total range of each of the group particles in the group's <propref comp="mg" prop="particles"/> (or <code>0</code> if there are no <propref comp="mg" prop="particles"/>).</p>
     </def>
    </gitem>
   </glist>
  </constraintnote>
    </div3>
   </div2>
   <div2 id="cParticles">
    <head>Particles</head>
    <p>As described in <specref ref="Model_Groups"/>, particles contribute 
to the definition
of content models.</p>
<p dg="ww-p">When an element is validated against a complex type, 
its sequence of child elements is checked against the content model of
the complex type and the children are <termref def="key-att-to"/> to
<compref name="Particles" ref="p"/> of the content model.
The attribution of items to <compref name="Particles" ref="p"/>
partially determines the calculation of the items' 
<termref def="key-dd">context-determined 
declarations</termref>:
When an element information item is <termref def="key-att-to"/> an
<termref def="key-ep"/>, that <compref ref="p"/>'s <compref ref="ed"/>,
or an <compref ref="ed"/> <termref def="key-validly-sub"/> for it,
becomes
the item's <termref def="key-dd">context-determined 
declaration</termref>; when the item is <termref def="key-att-to"/> a
<termref def="key-wp"/>, the <termref def="key-dd">context-determined 
declaration</termref> depends on the variety of the wildcard.
</p>
    <note role="example">
     <eg xml:space="preserve">&lt;xs:element ref="egg" minOccurs="12" maxOccurs="12"/&gt;

&lt;xs:group ref="omelette" minOccurs="0"/&gt;

&lt;xs:any maxOccurs="unbounded"/&gt;
     </eg>
     <p>XML representations which all involve particles, illustrating some of
the possibilities for controlling occurrence.</p>
    </note>
    <div3 id="Particle_details">
     <head>The Particle Schema Component</head>
<p>The particle schema component has the following properties:</p>

  <compdef name="Particle" abbrev="p" showAKO="true"/>
<p>In general, multiple element
information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, possibly with intervening character <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> if the content type
is <pt>mixed</pt>, can be <termref def="key-vn">validated</termref> with
respect to a single particle.  When the <propref comp="p" prop="term"/> is an element
declaration or wildcard, <propref comp="p" prop="min occurs"/> determines the minimum number of such element <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> that can occur.  The number of such children <rfc2119>must</rfc2119> be greater than or equal to <propref comp="p" prop="min occurs"/>.  If <propref comp="p" prop="min occurs"/> is <pt>0</pt>, then occurrence of such children is optional.</p>
<p>Again, when the <propref comp="p" prop="term"/> is an element
declaration or wildcard, the number of such element <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> <rfc2119>must</rfc2119> be less than or equal to any numeric specification of
<propref comp="p" prop="max occurs"/>; if <propref comp="p" prop="max occurs"/> is <pt>unbounded</pt>, then there is no
upper bound on the number of such children.</p>
     <p>When the <propref comp="p" prop="term"/> is a model group, the permitted
occurrence range is determined by a combination of <propref comp="p" prop="min occurs"/> and <propref comp="p" prop="max occurs"/> and the occurrence ranges of the <propref comp="p" prop="term"/>'s <propref comp="mg" prop="particles"/>.</p>
<p dg="ww-1">
<termdef id="key-contain-dpt" term="directly contains">A particle
<term>directly contains</term> the component which is the value of its
<propref comp="p" prop="term"/> property.</termdef>
<termdef id="key-contain-ipx" term="indirectly contains">A particle 
<term>indirectly contains</term> the particles, groups, wildcards, and
element declarations which are contained by the value of its
<propref comp="p" prop="term"/> property.</termdef>
<termdef id="key-contain-xpx" term="contains">A particle 
<term>contains</term> the components which it either
<termref def="key-contain-dpt"/>
or <termref def="key-contain-ipx"/>.</termdef>
</p>
    </div3>
    <div3>
     <head>XML Representation of Particle Components</head>
     <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
<emph>two</emph> components in each case, a particle and its <propref comp="p" prop="term"/>.  The appropriate mapping is described in <specref ref="declare-element"/>, <specref ref="declare-contentModel"/> and <specref ref="declare-openness"/> respectively.</p>
    </div3>
    <div3>
     <head>Constraints on XML Representations of Particles</head>
     <p>None as such.</p>
    </div3>
    <div3>
     <head>Particle Validation Rules</head>
<div4 id="particle-validation" dg="ww-LM">
<head>Principles of Validation against Particles</head>
<!--* 
<div4 id="particle-recognition" diff="add" dg="ww-x">
<head>Languages Recognized by Particles, Paths in Particles</head>
*-->
<p>Every particle <var>P</var> <termref def="key-accept">recognizes</termref> some language <var>L</var>(<var>P</var>).
<phrase dg="ww-1">When <propref comp="p" prop="min occurs"/> and <propref comp="p" prop="max occurs"/> of <var>P</var> are
both 1, <var>L</var>(<var>P</var>) is the language of <var>P</var>'s <propref comp="p" prop="term"/>.  The
following section (<specref ref="particle-recognition"/>)
describes how more complicated counts are handled.</phrase></p>
<div5 id="particle-recognition">
<head>Language Recognition for Repetitions</head>
<p>When <propref comp="p" prop="min occurs"/> of <var>P</var> = <propref comp="p" prop="max occurs"/> of <var>P</var> = <var>n</var>, 
and <var>T</var> is the <propref comp="p" prop="term"/> of <var>P</var>, 
then <var>L</var>(<var>P</var>) is the set  of sequences <var>S</var> = <var>S</var><sub>1</sub><!--*
* material suppressed here by diff group ww-1 *
*--> + <var>S</var><sub>2</sub> + ... + <var>S</var><sub><phrase><var>n</var></phrase></sub><!--*
* material suppressed here by diff group ww-1 *
*--><phrase dg="ww-1">such that <var>S</var><sub><phrase><var>i</var></phrase></sub> is in <var>L</var>(<var>T</var>) for 0 &lt; <var>i</var> ≤ <var>n</var>.</phrase>
<phrase dg="ww-1">Less formally: <var>L</var>(<var>P</var>) is </phrase>
the
set of sequences which have <termref def="key-partition">partitions</termref> into <var>n</var> sub-sequences
<!--*
* material suppressed here by diff group ww-1 *
*--><phrase dg="ww-1">for which each of the <var>n</var> subsequences
is in the language accepted by the <propref comp="p" prop="term"/> of <var>P</var></phrase>.
</p>
<!--*
<p>When &p.min; = &j; and &p.max; is <pt>unbounded</pt>,
and &P1; is the &p.term; of &P;, 
then &L.P; is the set  of sequences &S; = &S1;, + &S2; + ... + &Sn;, i.e. the
set of sequences which have &partitions; into &n; sub-sequences
such that &n; &ge; &j;
and &Si; is in &P1; for 0 &lt; &i; &le; &n;.</p>
*-->
<p>When <propref comp="p" prop="min occurs"/> = <var>j</var> and <propref comp="p" prop="max occurs"/> = <var>k</var>,
and <var>T</var> is the <propref comp="p" prop="term"/> of <var>P</var>, 
then <var>L</var>(<var>P</var>) is the set  of sequences <var>S</var> = <var>S</var><sub>1</sub>, + <var>S</var><sub>2</sub> + ... + <var>S</var><sub><phrase><var>n</var></phrase></sub>, i.e. the
set of sequences which have <termref def="key-partition">partitions</termref> into <var>n</var> sub-sequences
such that <var>n</var> ≥ <var>j</var> and <var>n</var> ≤ <var>k</var> (or <var>k</var> is <pt>unbounded</pt>)
and <var>S</var><sub><phrase><var>i</var></phrase></sub> is in <var>L</var>(<var>T</var>) for 0 &lt; <var>i</var> ≤ <var>n</var>.</p>
<p>When <propref comp="p" prop="min occurs"/> = 0, then <var>L</var>(<var>P</var>) also includes the empty sequence.</p>
<p dg="ww-p">If (1) <compref ref="p"/> <var>P</var> has
<propref comp="p" prop="min occurs"/> = <var>j</var>, <propref comp="p" prop="max occurs"/> = <var>k</var>, and <propref comp="p" prop="term"/> = <var>T</var>, 
and (2) <var>S</var> is a sequence of element information items
such that <var>S</var> = <var>S</var><sub>1</sub> + <var>S</var><sub>2</sub> + ... + <var>S</var><sub><phrase><var>n</var></phrase></sub> (i.e. <var>S</var><sub>1</sub>, <var>S</var><sub>2</sub>, ..., <var>S</var><sub><phrase><var>n</var></phrase></sub> is
a <termref def="key-partition"/> of <var>S</var>), 
and (3) <var>n</var> ≤ <var>k</var> (or <var>k</var> is <pt>unbounded</pt>), 
and (4) <var>S</var><sub><phrase><var>i</var></phrase></sub> is in <var>L</var>(<var>T</var>) for 0 &lt; <var>i</var> &lt; <var>n</var>, 
then:
<ulist>
<item><p>If <var>T</var> is a model group, 
then the set of <termref def="key-path">paths</termref> of <var>S</var> in <var>P</var> is the set of all <termref def="key-path">paths</termref> <var>Q</var> such that
<var>Q</var> = <var>Q</var><sub>1</sub> + <var>Q</var><sub>2</sub> + ... + <var>Q</var><sub><phrase><var>n</var></phrase></sub>, where
<var>Q</var><sub><phrase><var>i</var></phrase></sub> is a <termref def="key-path"/> of <var>S</var><sub><phrase><var>i</var></phrase></sub> in <var>T</var> for 0 &lt; <var>i</var> ≤ <var>n</var>.
(For the definition of <termref def="key-path">paths</termref> in model groups,
see <specref ref="group-recognition"/>.)
</p></item>
<item>
<p>
If <var>T</var> is a <termref def="key-basic-term"/>, then the (sole) <termref def="key-path"/> of <var>S</var> in <var>P</var>
is a sequence of <var>n</var> occurrences of <var>P</var><!--*
* material suppressed here by diff group ww-1 *
*--><phrase dg="ww-1">.</phrase>
</p>
</item>
</ulist>
<note><p>
Informally:  the path of an input sequence <var>S</var> in a 
particle <var>P</var> may go through the <termref def="key-basic-particle">basic particles</termref> in
<var>P</var> as many times as is allowed by the <propref comp="p" prop="max occurs"/> of <var>P</var>.
If the path goes through <var>P</var> more than once, each
time before the last one must correspond to a sequence
accepted by the <propref comp="p" prop="term"/> of <var>P</var>; because the last 
iteration<phrase dg="ww-1"> in the path</phrase>
may not be complete, it need not be accepted by the
<propref comp="p" prop="term"/>.</p></note>
</p>
</div5>
<div5>
<head>Validation of Basic Terms</head>
<p>When the <propref comp="p" prop="term"/> of a <compref ref="p"/> <var>P</var> is an <compref ref="ed"/> <var>D</var>,
then <var>L</var>(<var>P</var>) is the set of all sequences of length 1 whose sole member
is an element information item which <termref def="key-e-d-match">matches</termref> <var>D</var>.
<termdef id="key-e-d-match" term="match">An element information item <var>E</var>
<term>matches</term> an <compref ref="ed"/> <var>D</var> if and only if:
<ulist>
<item>
<p>either the expanded name of <var>E</var> <termref def="key-en-match">matches</termref> the
<propref comp="ed" prop="name"/> and <propref comp="ed" prop="target namespace"/> 
of <var>D</var>,</p>
</item>
<item>
<p>or the expanded name of <var>E</var> resolves to an element
declaration <var>D</var><sub>2</sub> which is substitutable for <var>D</var>.</p>
</item>
</ulist>
</termdef>
</p>
<p><termdef id="key-en-match" term="match">An 
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2004/REC-xml-names11-20040204/#dt-expname">expanded name</xspecref> <var>E</var> <term>matches</term> an
<termref def="gloss-NCName">NCName</termref> <var>N</var> and
a namespace name <var>NS</var> if and only if all of the following
are true:
<ulist>
<item>
<p>The local name of <var>E</var> is identical to <var>N</var>.</p>
</item>
<item>
<p>Either the namespace name of <var>E</var> is identical to <var>NS</var>,
or else <var>E</var> has no namespace name (<var>E</var> is an unqualified
name) and <var>NS</var> is <termref def="key-null">absent</termref>.</p>
</item>
</ulist>
</termdef></p>
<!--* <ednote>
<edtext>There is probably a better location for this definition
of matching between an expanded name and an NCName, namespace-name
pair.</edtext>
</ednote> *-->
<p>When the <propref comp="p" prop="term"/> of a <compref ref="p"/> <var>P</var> is a <compref ref="w"/> <var>W</var>,
then <var>L</var>(<var>P</var>) is the set of all sequences of length 1 whose sole member
is an element information item <var>E</var> which <termref def="key-e-d-match">matches</termref> <var>W</var>.
<termdef id="key-wc-match" term="match">An element information item <var>E</var>
<term>matches</term> a <compref ref="w"/> <var>W</var> 
(or a <termref def="key-wp"/> whose <propref comp="p" prop="term"/> is <var>W</var>)
if and only if <var>W</var> allows the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace
name</xpropref> of <var>E</var>, as defined in the validation rule
<specref ref="cvc-wildcard-namespace"/>.
</termdef>
</p>
<p><termdef id="key-ns-match" term="match">Two namespace
names <var>N</var><sub>1</sub> and <var>N</var><sub>2</sub> are said to <term>match</term> 
if and only if they are identical or both are <termref def="key-null">absent</termref>.
</termdef></p>
<p>For principles of validation when the <propref comp="p" prop="term"/> is a model group
instead of a <termref def="key-basic-particle"/>, see
<specref ref="group-recognition"/><phrase dg="ww"> and
<specref ref="group-validation"/></phrase>.</p>
</div5>
</div4>

<div4>
<head>Validation Rules</head>

<constraintnote type="cvc" id="cvc-particle">
<head>Element Sequence Locally Valid (Particle)</head>
<p>For a sequence (possibly empty) of element information items to be
locally <termref def="key-vn">valid</termref> with respect to a
<compref ref="p"/>
 <olist role="and">
  <item><p>The sequence must be accepted by the <compref ref="p"/>, as defined
in <specref ref="cvc-accept"/>.</p></item>
  <!--*
* material suppressed here by diff group rq146 *
*-->
 </olist>
<!--*
* material suppressed here by diff group rq146-1 *
*-->
<!--*
* material suppressed here by diff group rq146-1 *
*-->
<!--*
* material suppressed here by diff group rq146-1 *
*-->
</p>
</constraintnote>

     <constraintnote type="cvc" id="cvc-accept">
      <head>Element Sequence Accepted (Particle)</head>
      <!--*
* material suppressed here by diff group rq146 *
*-->
      <olist role="case">
<item id="c-pw">
<p role="if">the <propref comp="p" prop="term"/> is a wildcard</p>
<p role="then">
<olist role="andtest">
<item>
<p>The length of the sequence <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> greater than or equal to the
<propref comp="p" prop="min occurs"/>.</p>
</item>
<item>
<p>If <propref comp="p" prop="max occurs"/> is a number, the length of
the sequence <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> less than or equal to the <propref comp="p" prop="max occurs"/>.</p>
</item>
<item>
<p>Each element information item in the sequence <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="key-vn">valid</termref> with respect to the wildcard as defined
by <specref ref="cvc-wildcard"/>.</p>
</item>
</olist>
<phrase dg="ww-p">In this case, each element information item
in the sequence is <termref def="key-att-to">attributed to</termref>
the particle.</phrase></p>
</item>
<item id="c-cdde">
<p role="if">the <propref comp="p" prop="term"/> is an element
declaration</p>
<p role="then">
<olist role="andtest">
<item>
<p>The length of the sequence <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> greater than or equal to the
<propref comp="p" prop="min occurs"/>.</p>
</item>
<item>
<p>If <propref comp="p" prop="max occurs"/> is a number, the length of
the sequence <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> less than or equal to the <propref comp="p" prop="max occurs"/>.</p>
</item>
<item>
<p>For each element information item in the sequence
<olist role="ortest">
<item>
<p>The element declaration is local (i.e. its
<propref comp="ed" prop="scope"/><phrase dg="ep01">'s <propref comp="sc_e" prop="variety"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is not</phrase> <pt>global</pt>),
<!--*
* material suppressed here by diff group rq17p *
*-->the element information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace
name</xpropref> is identical to the element declaration's <propref comp="ed" prop="target namespace"/> (where an <termref def="key-null">absent</termref> <propref comp="ed" prop="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 item's
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">local
name</xpropref> matches the element declaration's <propref comp="ed" prop="name"/>.</p>
<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>
</item>
<item>
<p>The element declaration is top-level (i.e. its
<propref comp="ed" prop="scope"/><phrase dg="ep01">'s <propref comp="sc_e" prop="variety"/></phrase> is <pt>global</pt>), <!--*
* material suppressed here by diff group rq17p *
*-->the element information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace
name</xpropref> is identical to the element declaration's <propref comp="ed" prop="target namespace"/> (where an <termref def="key-null">absent</termref> <propref comp="ed" prop="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 item's
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">local
name</xpropref> matches the element declaration's <propref comp="ed" prop="name"/>.</p>
<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>
</item>
<item id="c-psg">
<p>The element declaration is top-level (i.e. its
<propref comp="ed" prop="scope"/><phrase dg="ep01">'s <propref comp="sc_e" prop="variety"/></phrase> is <pt>global</pt>), its <propref comp="ed" prop="disallowed substitutions"/> does not contain
<pt>substitution</pt>, the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">local
</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 defined in <specref ref="cvc-resolve-instance"/> --
<termdef id="key-eqd" term="substituting 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 comp="ed" prop="disallowed substitutions"/> 
is <termref def="key-validly-sub"/> for the
<!--* check preceding line; I think entification of 'validly
    * substitutable' is part of ww-p, not in status quo.
    *-->
particle's element declaration as defined in <specref ref="cos-equiv-derived-ok-rec"/>.</p>
<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>
</item>
</olist></p>
<p dg="ww-p">In this case the element information item is 
<termref def="key-att-to">attributed to</termref> the particle.</p>
</item>
</olist>
</p>
</item>
<item>
<p role="if">the <propref comp="p" prop="term"/> is a model group</p>
<p role="then">
<olist role="andtest">
<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 comp="p" prop="min occurs"/>.</p></item>
<item><p>If <propref comp="p" prop="max occurs"/> is a number,
<code>n</code> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> less than or equal to <propref comp="p" prop="max occurs"/>.</p></item>
<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>
</olist>
<phrase dg="ww-p">In this case, the element information items
in each sub-sequence are <termref def="key-att-to">attributed to</termref>
<compref name="Particles" ref="p"/> within the model group which is the <propref comp="p" prop="term"/>,
as described in <specref ref="group-recognition"/>.</phrase></p>
</item>
</olist>

<!--* 
 <p diff="add" dg="ww-x">Although <specref ref="cos-nonambig"/> means that the
in-principle non-determinism of this formulation will rarely result in any
non-determinism in practice, it does not rule out it out entirely. 
When non-determinism <emph>does</emph> arise, it is always because a particular
element information item may be accepted by either a
<compref ref="w"/> or an <compref ref="ed"/>.  In such situations
implementations <rfc2119>MUST</rfc2119> favor the <compref ref="ed"/>, both in
terms of providing the <termref def="key-dd">context-determined
declaration</termref> for the element information item, and in terms of
choosing alternative paths through a content model.</p>
*-->

<!--* <ednote diff="add" dg="ww">
<edtext>Does following note still make sense?</edtext>
</ednote> *-->
<note dg="ww"><p>The rule just given does not require that the
content model be deterministic.  In practice, however, 
most <!--* although not all *-->
non-determinism in content models is ruled out by the schema
component constraint <specref ref="cos-nonambig"/>.
Non-determinism can occur despite that constraint for
several reasons.
In some such cases, 
some particular element information item may be accepted by either a
<compref ref="w"/> or an <compref ref="ed"/>.  In such situations,
the validation process defined in this specification matches the
element information item against the <compref ref="ed"/>, both in
identifying the <compref ref="ed"/> as the item's 
<termref def="key-dd">context-determined declaration</termref>, 
and in choosing alternative paths through a content model.
Other cases of non-determinism involve nested particles each of
which has <propref comp="p" prop="max occurs"/> greater than 1,
where the input sequence can be partitioned in multiple ways.
In those cases, there is no fixed rule for eliminating the
non-determinism.</p></note>

<note>
<p><clauseref ref="c-pw"/> and <clauseref ref="c-psg"/> do not
interact: an element information item validatable by a declaration
with a substitution group head <!--*
* material suppressed here by diff group b2867-1 *
*-->is
<emph>not</emph> validatable by a wildcard which accepts the head's
<phrase dg="b2867-1">(</phrase>namespace<phrase dg="b2867-1">, name) pair</phrase> but not its own.</p>
</note>
 <!--*
* material suppressed here by diff group rq146 *
*-->
 <!--*
* material suppressed here by diff group rq146 *
*-->
 <!--*
* material suppressed here by diff group rq146 *
*-->
     </constraintnote>
</div4>
    </div3>
    <div3>
     <head>Particle Information Set Contributions</head>
     <p>None as such.</p>
    </div3>
    <div3 id="coss-particle">
     <head>Constraints on Particle Schema Components</head>
  <p>All particles (see <specref ref="cParticles"/>) <rfc2119>must</rfc2119> satisfy the following constraints.</p>
  <constraintnote type="cos" id="p-props-correct">
   <head>Particle Correct</head>
   <olist role="And">
    <item>
   <p>The values of the properties of a particle <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as described in
the property tableau in
<specref ref="Particle_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
    </item>
    <item>
     <p>If <propref comp="p" prop="max occurs"/> is not <pt>unbounded</pt>, that is, it has a
numeric value, then
    <olist role="andtest">
     <item>
     <p><propref comp="p" prop="min occurs"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is not</phrase> greater than <propref comp="p" prop="max occurs"/>.</p>
    </item>
    <item>
     <p><propref comp="p" prop="max occurs"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> greater than or equal to 1.</p>
    </item>
    </olist>
   </p>
    </item>
   </olist>
  </constraintnote>
  <p>The following constraints define relations appealed to elsewhere in this specification.</p>
  <constraintnote type="cos" id="cos-particle-extend">
   <head>Particle Valid (Extension)</head>
   <p><termdef id="cd-model-extension" term="valid extension" role="local">For a particle
(call it <local>E</local>, for extension) to be a <term>valid extension</term> of
another particle (call it <local>B</local>, for base)</termdef>
    <olist role="or">
     <item>
      <p>They are the same particle.</p>
     </item>
     <item>
      <p><local>E</local>'s <propref comp="p" prop="min occurs"/>=<propref comp="p" prop="max occurs"/><code>=1</code> and its <propref comp="p" prop="term"/> is a <pt>sequence</pt> group whose <propref comp="mg" prop="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>
     </item>
    </olist>
   </p>
  </constraintnote>
   <!--*
* material suppressed here by diff group rq17p *
*-->
   <!--*
* material suppressed here by diff group rq17p *
*-->
     
  <!--*
* material suppressed here by diff group rq17p *
*-->
  <!--*
* material suppressed here by diff group rq17p *
*-->
  <!--*
* material suppressed here by diff group rq17p *
*-->
  <!--*
* material suppressed here by diff group rq17p *
*-->
  <!--*
* material suppressed here by diff group rq17p *
*-->
  <!--*
* material suppressed here by diff group rq17p *
*-->
  <!--*
* material suppressed here by diff group rq17p *
*-->
  <!--*
* material suppressed here by diff group rq17p *
*-->
  <!--*
* material suppressed here by diff group rq17p *
*-->
  <!--*
* material suppressed here by diff group rq17p *
*-->
  <!--*
* material suppressed here by diff group rq17p *
*-->
 <constraintnote id="cos-group-emptiable" type="cos">
  <head>Particle Emptiable</head>
  <p><termdef id="cd-emptiable" term="emptiable" role="local">For a particle to be
<term>emptiable</term></termdef>
   <olist role="or">
    <item>
     <p>Its <propref comp="p" prop="min occurs"/> is <code>0</code>.</p>
    </item>
    <item>
     <p>Its <propref comp="p" prop="term"/> is a group and the minimum part of the
effective total range of that group, as defined by <specref ref="cos-seq-range"/> (if
the group is <pt>all</pt> or <pt>sequence</pt>) or 
<specref ref="cos-choice-range"/> (if it is <pt>choice</pt>), is <code>0</code>.</p>
    </item>
   </olist>
  </p>
 </constraintnote> 
    </div3>
   </div2>
   <div2 id="Wildcards">
    <head>Wildcards</head>
    <p>In order to exploit the full potential for extensibility offered by XML
plus namespaces, more provision is needed than DTDs allow for targeted flexibility in content
models and attribute declarations.  A wildcard provides for <termref def="key-vn">validation</termref> of
attribute and element information items dependent on their namespace
name<phrase dg="b2867-1">s</phrase><!--*
* material suppressed here by diff group b2867-1a *
*-->
<!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1">and optionally on</phrase> their local name<phrase dg="b2867-1">s</phrase>.</p>
<!--*
* material suppressed here by diff group b2867-1 *
*-->
<note role="example"><eg xml:space="preserve">&lt;xs:any processContents="skip"/&gt;

&lt;xs:any namespace="##other" processContents="lax"/&gt;

&lt;xs:any namespace="http://www.w3.org/1999/XSL/Transform"<phrase dg="b2867-1">
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        notQName="xsl:comment xsl:fallback"</phrase>/&gt;

&lt;xs:any <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1">notN</phrase>amespace="##targetNamespace"/&gt;

&lt;xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/&gt;</eg>
    <p>XML representations of the four basic types of wildcard, plus one attribute wildcard.</p>
</note>
    <div3 id="Wildcard_details">
     <head>The Wildcard Schema Component</head>
   <p>The wildcard schema component has the following properties:</p>
     <compdef name="Wildcard" abbrev="w" showAKO="true"/>
    <microCompdef name="Namespace Constraint" abbrev="nc" dg="ep01"/>
<p><propref comp="w" prop="namespace constraint"/> provides for <termref def="key-vn">validation</termref> of attribute and element items that:
<olist>
<item>
<p>(<phrase dg="ep01"><propref comp="nc" prop="variety"/> </phrase><pt>any</pt>) have any namespace or are not namespace-qualified;</p>
</item>
<item>
<p><!--*
* material suppressed here by diff group b2867-1 *
*--></p>
</item>
<item>
<p><!--*
* material suppressed here by diff group b2867-1 *
*--></p>
</item>
<item>
<p><phrase dg="b2867-1">(<propref comp="nc" prop="variety"/> <pt>not</pt> and
 <propref comp="nc" prop="namespaces"/> a set whose members are either namespace names or
 <termref def="key-null">absent</termref>) have any namespace other than the specified namespaces
 and/or, if <termref def="key-null">absent</termref> is included in the set, are namespace-qualified;</phrase></p>
</item>
<item>
<p>(<phrase dg="ep01"><propref comp="nc" prop="variety"/>
<pt>enumeration</pt> and <propref comp="nc" prop="namespaces"/> </phrase>a set whose
members are either namespace names or <termref def="key-null">absent</termref>) have any of the
specified namespaces and/or, if <termref def="key-null">absent</termref> is included in the set, are unqualified.</p>
</item>
<item>
<p><phrase dg="b2867-1">(<propref comp="nc" prop="disallowed names"/> is not empty)
have any (namespace name, local name) other than the specified names.</phrase></p>
</item>
</olist></p>
    <p><propref comp="w" prop="process contents"/> controls the impact on <termref def="key-va">assessment</termref>
of the information items allowed by wildcards, as follows:
     <glist>
      <gitem>
       <label>strict</label>
       <def>
        <p>There <rfc2119>must</rfc2119> be a top-level declaration for the item
available, or the item <rfc2119>must</rfc2119> have an <code>xsi:type</code>, and the
item <rfc2119>must</rfc2119> be <termref def="key-vn">valid</termref> as
appropriate.</p>
       </def>
      </gitem>
      <gitem>
       <label>skip</label>
       <def>
        <p>No constraints at all:  the item <rfc2119>must</rfc2119> simply be well-formed XML.</p>
       </def>
      </gitem>
      <gitem>
       <label>lax</label>
       <def>
        <p>If the item has a uniquely
determined declaration available, it <rfc2119>must</rfc2119> be <termref def="key-vn">valid</termref> with respect to
that definition, that is, <termref def="key-vn">validate</termref>
if you
can, don't worry if you can't.</p>
       </def>
      </gitem>
     </glist>
    </p>
     <p>See <specref ref="cAnnotations"/> for information on the role of the
<propref comp="w" prop="annotations"/> property.</p>
    </div3>
     <div3 id="declare-openness">
    <head>XML Representation of Wildcard Schema Components</head>
    <p>The XML representation for a wildcard schema component is an
<eltref ref="any"/> or <eltref ref="anyAttribute"/> element information item.    The correspondences between the
properties of an <eltref ref="any"/> information item and
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>
   <!--* <ednote diff="add" dg="b2867-1">
    <edtext>For technical reasons, the editorial production system does not mark the change
     to <code>namespace</code> attribute and the addition of <code>notNamespace</code> and
     <code>notQName</code> attributes.</edtext>
   </ednote> *-->
   <!--* <ednote diff="add" dg="b2867-1">
    <edtext>How to make notNamespace show "list of (anyURI | (##targetNamespace | ##local))"?</edtext>
   </ednote> *-->
   <!--* <ednote diff="add" dg="b2867-1">
    <edtext>
    The component model doesn't allow <propref comp="nc" prop="variety"/> <pt>not</pt> and <propref comp="nc" prop="namespaces"/> an empty set.
     But the transfer syntax below allows <code>notNamespace=""</code>. Are we concerned about such "inconsistency"?</edtext>
   </ednote> *-->
    <reprdef>
 <reprelt eltname="any"/>
     <p>A particle containing a wildcard, with properties as follows (unless <code>minOccurs=maxOccurs=0</code>, in which case the item
corresponds to no component at all):</p>
     <reprcomp abstract="Particle" ref="Particle_details">
<propmap comp="p" prop="min occurs">The <termref def="key-vv">actual value</termref> of the <code>minOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <code>1</code>.</propmap>
  <propmap comp="p" prop="max occurs"><pt>unbounded</pt>, if the <code>maxOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> equals <pt>unbounded</pt>, otherwise the <termref def="key-vv">actual value</termref> of the <code>maxOccurs</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <code>1</code>.</propmap>
<propmap comp="p" prop="term">A wildcard as given below:</propmap>
</reprcomp>
 <reprcomp abstract="Wildcard" ref="Wildcard_details">
<propmap comp="w" prop="namespace constraint"><!--*
* material suppressed here by diff group b2867-1 *
*--><!--*
* material suppressed here by diff group b2867-1 *
*-->
 <phrase dg="b2867-1">A <compref ref="nc"/> with the following properties:</phrase>
 <pvlist dg="b2867-1">
  <pvpair comp="nc" prop="variety">
   <olist role="caseval">
    <item>
     <p role="if">the <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present</p>
     <p role="then">
      <olist role="caseval">
       <item>
        <p role="if">the <termref def="key-vv">actual value</termref> of the <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is <code>"##any"</code></p>
        <p role="then"><pt>any</pt>;</p>
       </item>
       <item>
        <p role="if">the <termref def="key-vv">actual value</termref> of the <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is <code>"##other"</code></p>
        <p role="then"><pt>not</pt>;</p>
       </item>
       <item>
        <p role="otherwise"><pt>enumeration</pt>;</p>
       </item>
      </olist>
     </p>
    </item>
    <item>
     <p role="if">the <code>notNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present</p>
     <p role="then">
      <phrase dg="b2867-1a"><pt>not</pt>;</phrase>
      <!--*
* material suppressed here by diff group b2867-1a *
*-->
     </p>
    </item>
    <item>
     <p role="otherwise">(neither <code>namespace</code> nor <code>notNamespace</code> is present) <pt>any</pt>.</p>
    </item>
   </olist>
  </pvpair>        
  <pvpair comp="nc" prop="namespaces">
   <olist role="caseval">
    <item>
     <p role="if">neither <code>namespace</code> nor <code>notNamespace</code> is present</p>
     <p role="then">the empty set;</p>
    </item>
    <item>
     <p role="if">the <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present and its <termref def="key-vv">actual value</termref> is <code>"##any"</code></p>
     <p role="then">the empty set;</p>
    </item>
    <item>
     <p role="if">the <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present and its <termref def="key-vv">actual value</termref> is <code>"##other"</code></p>
     <p role="then">a set consisting <termref def="key-null"/> and, if the <code>targetNamespace</code> [attribute]
      of the <eltref ref="schema"/> ancestor element information item is present, its <termref def="key-vv">actual value</termref>;</p>
    </item>
    <item>
     <p role="otherwise">a set whose members are namespace names corresponding to
      the space-delimited substrings of the <termref def="key-vv">actual value</termref> of the <code>namespace</code>
      or <code>notNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> (whichever is present), except
      <olist>
       <item>
        <p>if one such substring is <code>##targetNamespace</code>, the corresponding member is
         the <termref def="key-vv">actual value</termref> of the <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the <eltref ref="schema"/>
         ancestor element information item if present, otherwise <termref def="key-null"/>;</p>
       </item>
       <item>
        <p>if one such substring is <code>##local</code>, the corresponding member is <termref def="key-null"/>.</p>
       </item>
      </olist>
     </p>
    </item>
   </olist>
  </pvpair>
  <pvpair comp="nc" prop="disallowed names">
   A set whose members are <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#QName">QName</xtermref> values
   corresponding to the space-delimited substrings of the <termref def="key-vv">actual value</termref> of the <code>notQName</code>
   <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> if present, otherwise the empty set.
  </pvpair>
 </pvlist>
</propmap>
  <propmap comp="w" prop="process contents">The <termref def="key-vv">actual value</termref> of the
<code>processContents</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <pt>strict</pt>.</propmap>
<propmap comp="w" prop="annotations">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
</reprcomp></reprdef>
    <p>Wildcards are subject to the same ambiguity constraints
(<specref ref="cos-nonambig"/>) as other
content model particles:  If an instance element could match<!--*
* material suppressed here by diff group ww *
*--> one of two wildcards, within the content model of a
type, that model is in error.</p>
   </div3>
    <div3>
     <head>Constraints on XML Representations of Wildcards</head>
    <constraintnote type="src" id="src-wildcard">
   <head>Wildcard Representation OK</head>
   <p>In addition to the conditions imposed on <eltref ref="any"/> element
information items by the schema for schemas,<!--*
* material suppressed here by diff group b2867-1 *
*-->
    <olist role="and" dg="b2867-1">
     <item>
      <p><code>namespace</code> and <code>notNamespace</code> are not both present;</p>
     </item>
     <item>
      <p>The corresponding particle and model group satisfy the conditions set
       out in <specref ref="coss-modelGroup"/> and <specref ref="coss-particle"/>.</p>
     </item>
    </olist>
   </p>
  </constraintnote>
    </div3>
    <div3>
     <head>Wildcard Validation Rules</head>
    <constraintnote type="cvc" id="cvc-wildcard">
     <head>Item Valid (Wildcard)</head>
     <p>For an element or attribute information item to be locally <termref def="key-vn">valid</termref> with respect to a wildcard
constraint
      its <phrase dg="b2867-1">(</phrase><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace name</xpropref><phrase dg="b2867-1">,
       <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">local name</xpropref>) pair</phrase> <rfc2119>must</rfc2119> be <termref def="key-vn">valid</termref> with respect to the wildcard constraint, as defined in <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1"><specref ref="cvc-wildcard-name"/></phrase>.</p>
     <p>When this constraint applies
      <olist role="case">
       <item>
        <p role="if"><propref comp="w" prop="process contents"/> is <pt>lax</pt></p>
        <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>
       </item>
       <item>
        <p role="if"><propref comp="w" prop="process contents"/> is <pt>strict</pt></p>
        <p role="then">the item's <termref def="key-dd">context-determined declaration</termref> is <pt>mustFind</pt>.</p>
       </item>
       <item>
        <p role="if"><propref comp="w" prop="process contents"/> is <pt>skip</pt></p>
        <p role="then">the item's <termref def="key-dd">context-determined declaration</termref> is <pt>skip</pt>.</p>
       </item>
      </olist>
     </p>
    </constraintnote>
    <constraintnote type="cvc" id="cvc-wildcard-name" dg="b2867-1">
     <head>Wildcard allows Expanded Name</head>
     <p>For a (namespace name, local name) pair to be <termref def="key-vn">valid</termref> with respect to
      a wildcard constraint (the value of a <propref comp="w" prop="namespace constraint"/>)
      <olist role="and">
       <item>
        <p>The namespace name is <termref def="key-vn">valid</termref> with respect to the wildcard constraint,
         as defined in <specref ref="cvc-wildcard-namespace"/>;</p>
       </item>
       <item>
        <p>The constraint's <propref comp="nc" prop="disallowed names"/> does not contain such pair.</p>
       </item>
      </olist>
     </p>
    </constraintnote>
    <constraintnote type="cvc" id="cvc-wildcard-namespace">
     <head>Wildcard allows Namespace Name</head>
     <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
value of a <propref comp="w" prop="namespace constraint"/>)
      <olist role="or">
       <item>
        <p>The constraint<phrase dg="ep01">'s <propref comp="nc" prop="variety"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <pt>any</pt>.</p>
       </item>
       <item>
        <!--*
* material suppressed here by diff group b2867-1 *
*-->
        <p><phrase dg="b2867-1">The constraint's <propref comp="nc" prop="variety"/> is <pt>not</pt>,
         and the value is not identical to any of the members of the constraint's <propref comp="nc" prop="namespaces"/>.</phrase></p>
       </item>
       <item>
        <p>The constraint<phrase dg="ep01">'s <propref comp="nc" prop="variety"/></phrase> is <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><pt>enumeration</pt></phrase>, and the value is identical to one of the members of the <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">constraint's <propref comp="nc" prop="namespaces"/></phrase>.</p>
       </item>
      </olist>
     </p>
    </constraintnote>
    </div3>
    <div3>
     <head>Wildcard Information Set Contributions</head>
     <p>None as such.</p>
    </div3>
    <div3 id="coss-wildcard">
     <head>Constraints on Wildcard Schema Components</head>
  <p>All wildcards (see <specref ref="Wildcards"/>) <rfc2119>must</rfc2119> satisfy the following constraint.</p>
  <constraintnote type="cos" id="w-props-correct">
   <head>Wildcard Properties Correct</head>
   <olist role="And">
    <item>
     <p>The values of the properties of a wildcard <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as described in
the property tableau in
<specref ref="Wildcard_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
    </item>
    <item dg="ep01"><p>If <propref comp="nc" prop="variety"/> is <pt>not</pt>, <propref comp="nc" prop="namespaces"/> has <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1">at least</phrase> one member.</p></item>
    <item>
     <p><phrase dg="b2867-1">If <propref comp="nc" prop="variety"/> is <pt>any</pt>, <propref comp="nc" prop="namespaces"/> is empty.</phrase></p>
    </item>
    <item>
     <p><phrase dg="b2867-1">The namespace name of each member in <propref comp="nc" prop="disallowed names"/> is allowed by the <propref comp="w" prop="namespace constraint"/>, as defined in <specref ref="cvc-wildcard-namespace"/>.</phrase></p>
    </item>
   </olist>
   
  </constraintnote>
  <p>The following constraints define a relation appealed to elsewhere in this specification.</p>
  <!--* <ednote diff="add" dg="b2867-1">
   <edtext>Is the following style acceptable? The "Formally" part was to take Xan's suggestion
   from 3 years ago; the "Informally" part is to keep the shape of the original layout, and to
   keep existing error codes working. Another effort to keep error codes working and changes
   less disruptive is to deal with {disallowed names} separately, in a style like "one of the
   following must be true" then "and the following must be true", which is different from our
   usual approach "all of the following must be true; 1. one of the following...; 2 ...".
   In doing this, I had to hard-code the last constraint number.</edtext>
  </ednote> *-->
  <constraintnote type="cos" id="cos-ns-subset">
  <head>Wildcard Subset</head>
   <p><phrase dg="b2867-1">Formally, f</phrase><!--*
* material suppressed here by diff group b2867-1 *
*-->or
    a namespace constraint (call it <local>sub</local>) to be an intensional subset of
    another namespace constraint (call it <local>super</local>)<phrase dg="b2867-1">, the set of expanded
    <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#QName">QName</xtermref>s allowed by <local>super</local>,
    as defined in <specref ref="cvc-wildcard-name"/>, <rfc2119>must</rfc2119> be a superset of that allowed by <local>sub</local>.</phrase></p>
   <p><phrase dg="b2867-1">Informally, </phrase>
    <olist role="or">
     <item>
      <p><local>super</local><phrase dg="ep01">'s <propref comp="nc" prop="variety"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <pt>any</pt>.</p>
     </item>
     <item>
      <olist role="Andtest">
       <item><p><local>sub</local><phrase dg="ep01">'s <propref comp="nc" prop="variety"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <!--*
* material suppressed here by diff group ep01 *
*--><pt>not</pt><!--*
* material suppressed here by diff group ep01 *
*-->.</p></item>
       <item><p><local>super</local><phrase dg="ep01">'s <propref comp="nc" prop="variety"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <!--*
* material suppressed here by diff group ep01 *
*--><pt>not</pt> and <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><!--*
* material suppressed here by diff group b2867-1 *
*-->its <propref comp="nc" prop="namespaces"/> is <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1">a subset</phrase> of <local>sub</local>'s <propref comp="nc" prop="namespaces"/></phrase>.</p></item>
      </olist>
     </item>
     <item>
      <olist role="Andtest">
       <item>
        <p><local>sub</local><phrase dg="ep01">'s <propref comp="nc" prop="variety"/> is <pt>enumeration</pt></phrase><!--*
* material suppressed here by diff group ep01 *
*-->.</p>
       </item>
       <item>
        <olist role="Ortest">
       <item>
        <p><local>super</local><phrase dg="ep01">'s <propref comp="nc" prop="variety"/> is <pt>enumeration</pt> and its <propref comp="nc" prop="namespaces"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> the same set or a superset <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">of <local>sub</local>'s <propref comp="nc" prop="namespaces"/></phrase>.</p>
       </item>
         <item>
         <p><local>super</local><phrase dg="ep01">'s <propref comp="nc" prop="variety"/></phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <!--*
* material suppressed here by diff group ep01 *
*--><pt>not</pt><!--*
* material suppressed here by diff group ep01 *
*-->
and <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1">none of the members of its <propref comp="nc" prop="namespaces"/></phrase>
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> in <local>sub</local>'s <!--*
* material suppressed here by diff group ep01 *
*--><propref comp="nc" prop="namespaces"/>.</p>
        </item>
      </olist>
       </item>
      </olist>
     </item>
    </olist>
   </p>
<p dg="b2867-1">And <olist role="one">
<item>
<p>Each member of <local>super</local>'s <propref comp="nc" prop="disallowed names"/> is not
allowed by <local>sub</local>, as defined in <specref ref="cvc-wildcard-name"/>.</p>
</item>
</olist>
</p>
</constraintnote>

<constraintnote id="cos-aw-union" type="cos">
   <head>Attribute Wildcard Union</head>
   <p><phrase dg="b2867-1">Formally, f</phrase><!--*
* material suppressed here by diff group b2867-1 *
*-->or a <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref ref="nc"/></phrase> to be the intensional
union of two other <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref ref="nc"/>s</phrase> (call them <local>O1</local> and <local>O2</local>),
    <phrase dg="b2867-1">the set of expanded <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#QName">QName</xtermref>s allowed by such <compref ref="nc"/>,
    as defined in <specref ref="cvc-wildcard-name"/>, <rfc2119>must</rfc2119> be the union of those allowed by <local>O1</local> and <local>O2</local>.</phrase></p>
   <p><phrase dg="b2867-1">Informally,</phrase> it <rfc2119>must</rfc2119> be as given by
    <olist role="caseval">
     <item>
      <p role="if"><local>O1</local> and <local>O2</local> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">have</phrase> the same <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="nc" prop="variety"/> and identical <propref comp="nc" prop="namespaces"/></phrase></p>
      <p role="then"><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">a <compref ref="nc"/> with <propref comp="nc" prop="variety"/> and <propref comp="nc" prop="namespaces"/> as for <local>O1</local>.</phrase>
      </p>
     </item>
     <item>
      <p role="if">either <local>O1</local> or <local>O2</local> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="nc" prop="variety"/></phrase> <pt>any</pt></p>
      <p role="then"><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">a <compref ref="nc"/> with <propref comp="nc" prop="variety"/> <pt>any</pt>.</phrase></p>
     </item>
     <item>
      <p role="if">both <local>O1</local> and <local>O2</local> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">have <propref comp="nc" prop="variety"/> <pt>enumeration</pt></phrase></p>
      <p role="then"><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">a <compref ref="nc"/> with <propref comp="nc" prop="variety"/> <pt>enumeration</pt> and <propref comp="nc" prop="namespaces"/> the union of <local>O1</local>'s
<propref comp="nc" prop="namespaces"/> and <local>O2</local>'s
<propref comp="nc" prop="namespaces"/>.</phrase></p>
     </item>
     <item>
      <p role="if">the two <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">both have <propref comp="nc" prop="variety"/> <pt>not</pt></phrase><phrase dg="b2867-1"> and
let <local>I</local> be the intersection of <local>O1</local>'s <propref comp="nc" prop="namespaces"/> and
<local>O2</local>'s <propref comp="nc" prop="namespaces"/></phrase></p>
      <p role="then"><!--*
* material suppressed here by diff group b2867-1 *
*-->
       <olist role="caseval" dg="b2867-1">
        <item>
         <p role="if"><local>I</local> is the empty set</p>
         <p role="then">a <compref ref="nc"/> with <propref comp="nc" prop="variety"/> <pt>any</pt>.</p>
        </item>
        <item>
         <p role="otherwise">a <compref ref="nc"/> with <propref comp="nc" prop="variety"/> <pt>not</pt> and <propref comp="nc" prop="namespaces"/> <local>I</local>.</p>
        </item>
       </olist>
      </p>
     </item>
     <item>
      <p role="if">either <local>O1</local> or <local>O2</local> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="nc" prop="variety"/></phrase> <pt>not</pt>
and <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1"><propref comp="nc" prop="namespaces"/> <local>S1</local></phrase> and
the other <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="nc" prop="variety"/> <pt>enumeration</pt></phrase> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">and <propref comp="nc" prop="namespaces"/></phrase> <local>S</local><phrase dg="b2867-1"><local>2</local></phrase><!--*
* material suppressed here by diff group ep01 *
*-->
      <phrase dg="b2867-1">and let <local>S</local> be <local>S1</local> minus <local>S2</local></phrase></p>
      <p role="then">
       <!--*
* material suppressed here by diff group b2867-1 *
*-->
       <olist role="caseval" dg="b2867-1">
        <item>
         <p role="if"><local>S</local> is the empty set</p>
         <p role="then">a <compref ref="nc"/> with <propref comp="nc" prop="variety"/> <pt>any</pt>.</p>
        </item>
        <item>
         <p role="otherwise">a <compref ref="nc"/> with <propref comp="nc" prop="variety"/> <pt>not</pt> and <propref comp="nc" prop="namespaces"/> <local>S</local>.</p>
        </item>
       </olist>
      </p>
     </item>
     <!--*
* material suppressed here by diff group b2867-1 *
*-->
    </olist>
   </p>
   <p dg="b2867-1">And its <propref comp="nc" prop="disallowed names"/>
    <rfc2119>must</rfc2119> be as given by the following:<olist>
    <item>
    <p>It has members of <local>O1</local>'s <propref comp="nc" prop="disallowed names"/>
    that are not allowed by <local>O2</local>, as defined in <specref ref="cvc-wildcard-name"/>,
    and members of <local>O2</local>'s <propref comp="nc" prop="disallowed names"/>
    that are not allowed by <local>O1</local>.</p>
    </item>
   </olist></p>

   <p>In the case where there are more than two <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref ref="nc"/>s to be combined</phrase>, the intensional
union is determined by identifying the intensional union of two
of <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">them</phrase> as above, then the intensional union of <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">the result</phrase> with
the third (providing the first union was expressible), and so on as required.
   </p>
  </constraintnote>
  <constraintnote id="cos-aw-intersect" type="cos">
   <head>Attribute Wildcard Intersection</head>
   <p><phrase dg="b2867-1">Formally, f</phrase><!--*
* material suppressed here by diff group b2867-1 *
*-->or a <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref ref="nc"/></phrase> to be the intensional
intersection of two other <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref ref="nc"/>s</phrase> (call them <local>O1</local> and <local>O2</local>),
    <phrase dg="b2867-1">the set of expanded <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#QName">QName</xtermref>s allowed by such <compref ref="nc"/>,
    as defined in <specref ref="cvc-wildcard-name"/>, <rfc2119>must</rfc2119> be the intersection of those allowed by <local>O1</local> and <local>O2</local>.</phrase></p>
    <p><phrase dg="b2867-1">Informally,</phrase> it <rfc2119>must</rfc2119> be as given by:
    <olist role="caseval">
     <item>
      <p role="if"><local>O1</local> and <local>O2</local> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">have</phrase> the same <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="nc" prop="variety"/> and identical <propref comp="nc" prop="namespaces"/></phrase></p>
      <p role="then"><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">a <compref ref="nc"/> with <propref comp="nc" prop="variety"/> and <propref comp="nc" prop="namespaces"/> as for <local>O1</local>.</phrase>
      </p>
     </item>
     <item>
      <p role="if">either <local>O1</local> or <local>O2</local> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="nc" prop="variety"/></phrase> <pt>any</pt></p>
      <p role="then"><!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">a <compref ref="nc"/> with
<propref comp="nc" prop="variety"/> and <propref comp="nc" prop="namespaces"/> as for the other.</phrase></p>
     </item>
     <item>
      <p role="if">either <local>O1</local> or <local>O2</local> 
<!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="nc" prop="variety"/></phrase> <pt>not</pt>
and <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="nc" prop="namespaces"/> <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1"><local>S1</local></phrase></phrase> and the other <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="nc" prop="variety"/> <pt>enumeration</pt></phrase> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">and <propref comp="nc" prop="namespaces"/></phrase> <local>S</local><phrase dg="b2867-1"><local>2</local></phrase></p>
      <p role="then"><phrase dg="ep01">a <compref ref="nc"/> with
<propref comp="nc" prop="variety"/> <pt>enumeration</pt> and <propref comp="nc" prop="namespaces"/>
<!--*
* material suppressed here by diff group b2867-1 *
*--></phrase><!--*
* material suppressed here by diff group b2867-1 *
*-->
<phrase dg="b2867-1"><local>S2</local> minus <local>S1</local></phrase>.</p>
     </item>
     <item>
      <p role="if">both <local>O1</local> and <local>O2</local> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">have <propref comp="nc" prop="variety"/> <pt>enumeration</pt></phrase></p>
      <p role="then"><phrase dg="ep01">a <compref ref="nc"/> with
<propref comp="nc" prop="variety"/> <pt>enumeration</pt> and <propref comp="nc" prop="namespaces"/> </phrase>the intersection of <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">their <propref comp="nc" prop="namespaces"/></phrase>.</p>
     </item>
     <!--*
* material suppressed here by diff group b2867-1 *
*-->
     <!--*
* material suppressed here by diff group b2867-1 *
*-->
     <item dg="b2867-1">
      <p role="if">both <local>O1</local> and <local>O2</local> have <propref comp="nc" prop="variety"/> <pt>not</pt></p>
      <p role="then">a <compref ref="nc"/> with <propref comp="nc" prop="variety"/> <pt>not</pt> and
       <propref comp="nc" prop="namespaces"/> the union of their <propref comp="nc" prop="namespaces"/>.</p>
     </item>
    </olist>
   </p>
   <p dg="b2867-1">And its <propref comp="nc" prop="disallowed names"/>
    <rfc2119>must</rfc2119> be as given by the following:<olist>
    <item><p>
    It has members of <local>O1</local>'s <propref comp="nc" prop="disallowed names"/>
    that are allowed by <local>O2</local>, as defined in <specref ref="cvc-wildcard-name"/>,
    and members of <local>O2</local>'s <propref comp="nc" prop="disallowed names"/>
    that are allowed by <local>O1</local>.</p></item>
    </olist></p>

   <!--* <ednote diff="add" dg="b2867-1">
    <edtext>The above constraint #7 (both O1 and O2 are <pt>not</pt>) isn't showing correctly,
     due to (possibly) a problem in the production system?</edtext>
   </ednote> *-->

   <p>In the case where there are more than two <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><compref ref="nc"/>s to be combined</phrase>, the intensional
intersection is determined by identifying the intensional intersection of two
of <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">them</phrase> as above, then the intensional intersection of <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">the result</phrase> with
the third (providing the first intersection was expressible), and so on as required.
   </p>
  </constraintnote>
    </div3>
   </div2>
<div2 id="cIdentity-constraint_Definitions">
    <head>Identity-constraint Definitions</head>
<p>Identity-constraint definition components provide for uniqueness and
reference constraints with respect to the contents of multiple elements and attributes.</p>
 <note role="example">
  <eg xml:space="preserve">&lt;xs:key name="fullName"&gt;
 &lt;xs:selector xpath=".//person"/&gt;
 &lt;xs:field xpath="forename"/&gt;
 &lt;xs:field xpath="surname"/&gt;
&lt;/xs:key&gt;

&lt;xs:keyref name="personRef" refer="fullName"&gt;
 &lt;xs:selector xpath=".//personPointer"/&gt;
 &lt;xs:field xpath="@first"/&gt;
 &lt;xs:field xpath="@last"/&gt;
&lt;/xs:keyref&gt;

&lt;xs:unique name="nearlyID"&gt;
 &lt;xs:selector xpath=".//*"/&gt;
 &lt;xs:field xpath="@id"/&gt;
&lt;/xs:unique&gt;</eg>
  <p>XML representations for the three kinds of identity-constraint definitions.</p>
 </note>
    <div3 id="Identity-constraint_Definition_details">
     <head>The Identity-constraint Definition Schema Component</head>
     <p>The identity-constraint definition schema component has the following
properties:
</p>   

<issue id="RQ-14i" role="1.1" status="open">
<!--* <p><loc href="&reqs;#id-inconsistency" target="reqs">RQ-14 (id-inconsistency)</loc></p> *-->
<p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2848" target="reqs">Issue 2848 (RQ-14 annotations on field and select)</loc></p>
<p>Version 1.0 provided no home for annotations on <code>xs:field</code>
and <code>xs:select</code>.  The overall reworking of annotation at the
component level described in <specref ref="RQ-131i"/> will take care of this.</p>
<resolution>
<p>See <specref ref="RQ-131i"/>.</p>
</resolution>
</issue>
  <compdef name="Identity-constraint Definition" abbrev="icd" showAKO="true"/>

<p>Identity-constraint definitions are identified by their <propref comp="icd" prop="name"/> and <propref comp="icd" prop="target namespace"/>; Identity-constraint definition identities <rfc2119>must</rfc2119> be unique within an <termref def="key-schema">XML Schema</termref>.  See <specref ref="composition-schemaImport"/> for the use of component
identifiers when importing one schema into another.</p>
<p>Informally, <propref comp="icd" prop="identity-constraint category"/> identifies the Identity-constraint definition as playing one of
three roles:
<ulist>
 
<item><p>(<pt>unique</pt>) the Identity-constraint definition asserts uniqueness, with respect to the content
identified by <propref comp="icd" prop="selector"/>, of the tuples resulting from
evaluation of the <propref comp="icd" prop="fields"/> XPath expression(s). </p></item>
 
<item>
<p>(<pt>key</pt>) the Identity-constraint definition asserts uniqueness as for
<pt>unique</pt>.  <pt>key</pt> further asserts that all selected content
actually has such tuples.</p>
</item>
<item><p>(<pt>keyref</pt>) the Identity-constraint definition asserts a correspondence, with respect to the content
identified by <propref comp="icd" prop="selector"/>, of the tuples resulting from
evaluation of the <propref comp="icd" prop="fields"/> XPath expression(s), with those of the <propref comp="icd" prop="referenced key"/>. </p></item>
</ulist> </p>
<p>These constraints are specified along side the specification of types for the
attributes and elements involved, i.e. something declared as of type integer
<phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> also serve as a key.  Each constraint declaration has a name, which exists in a
single symbol space for constraints.  The 
<!--*
* material suppressed here by diff group b1915bis *
*--><phrase dg="b1915bis">identity</phrase>
conditions
appealed to in checking these constraints apply to the 
<emph>value<phrase dg="b1915bis">s</phrase></emph> of
the fields selected<phrase dg="b1915bis">, not their
lexical representation</phrase>, so that for example <code>3.0</code> and <code>3</code>
would be conflicting keys if they were both 
<!--*
* material suppressed here by diff group b1915bis *
*--><phrase dg="b1915bis">decimal</phrase>, but non-conflicting if
they were both strings, or one was a string and one a <!--*
* material suppressed here by diff group b1915bis *
*--><phrase dg="b1915bis">decimal</phrase>.  
<!--*
* material suppressed here by diff group b1915bis *
*--></p>
    <p>Overall the augmentations to XML's <code>ID/IDREF</code> mechanism are:</p>
    <ulist>
     <item>
<p>Functioning as a part of an identity-constraint is in addition to, not instead of,
having a type;</p>
     </item>
     <item><p>Not just attribute values, but also element content and combinations
of values and content can be declared to be unique;</p></item>
     <item><p>Identity-constraints are specified to hold within the scope of particular elements;</p></item>
     <item><p>(Combinations of) attribute values and/or element content can be
declared to be keys, that is, not only unique, but always present and non-nillable;</p></item>
     <item>
      <p>The comparison between <pt>keyref</pt> <propref comp="icd" prop="fields"/> and
<pt>key</pt> or <pt>unique</pt> <propref comp="icd" prop="fields"/> is by value equality,
not by string equality.</p>
     </item>
    </ulist>
    <p><propref comp="icd" prop="selector"/> specifies a restricted XPath (<bibref ref="bib-xpath"/>) expression relative to
instances of the element being declared.  This <rfc2119>must</rfc2119> identify a node set of
subordinate elements (i.e. contained within the declared element) to which the constraint applies.</p>
    <p><propref comp="icd" prop="fields"/> specifies XPath expressions relative to each
element selected by a <propref comp="icd" prop="selector"/>.  This <rfc2119>must</rfc2119> identify
a single node (element or attribute) whose content or value, which <rfc2119>must</rfc2119> be
of a simple type, is used in the constraint.  It is possible to specify an
ordered list of <propref comp="icd" prop="fields"/>s, to cater to multi-field keys,
keyrefs, and uniqueness constraints.
     </p>
     <p>In order to reduce the burden on implementers, in particular
implementers of streaming processors, only restricted subsets of XPath
expressions are allowed in <propref comp="icd" prop="selector"/> and <propref comp="icd" prop="fields"/>.  The details are given in <specref ref="coss-identity-constraint"/>.</p>
 <note>
      <p>Provision for multi-field keys etc. goes beyond what is supported by <code>xsl:key</code>.</p>
     </note>
<note dg="b2861cc-1b">
 <p>
  Identity constraints currently uses XPath 1.0. This may change in future working drafts
  of this specification to use XPath 2.0. Such change will not affect evaluation of
  identity constraints, given the XPath subset it uses.
 </p>
</note>
     <p>See <specref ref="cAnnotations"/> for information on the role of the
<propref comp="icd" prop="annotations"/> property.</p>
    </div3>
 <div3 id="declare-key">
    <head>XML Representation of Identity-constraint Definition Schema Components</head>
<p>The XML representation for an identity-constraint definition schema component is
either a
<eltref ref="key"/>, a <eltref ref="keyref"/> or a <eltref ref="unique"/>
element information item.    The correspondences between the
properties of those information items and
properties of the component they correspond to are as follows:</p>
    <reprdef>
 <reprelt eltname="unique"/>
 <reprelt eltname="key"/>
 <reprelt eltname="keyref"/>
 <reprelt eltname="selector"/>
 <reprelt eltname="field"/>
 <reprcomp abstract="Identity-constraint Definition" ref="Identity-constraint_Definition_details"><propmap comp="icd" prop="name">The <termref def="key-vv">actual value</termref> of the <code>name</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>
  <propmap comp="icd" prop="target namespace">The <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the parent <code>schema</code>
element information item.</propmap>
<propmap comp="icd" prop="identity-constraint category">One of <pt>key</pt>, <pt>keyref</pt> or
<pt>unique</pt>, depending on the item.</propmap>
<propmap comp="icd" prop="selector">A restricted XPath expression corresponding to the <termref def="key-vv">actual value</termref> of
the <code>xpath</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the <eltref ref="selector"/> element information item among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref></propmap>
<propmap comp="icd" prop="fields">A sequence of XPath expressions, corresponding to the
<termref def="key-vv">actual value</termref>s of the <code>xpath</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>s of the <eltref ref="field"/> element information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, in order.</propmap>
<propmap comp="icd" prop="referenced key">If the item is a <eltref ref="keyref"/>, the
identity-constraint definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>refer</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, otherwise <termref def="key-null">absent</termref>.</propmap>
<propmap comp="icd" prop="annotations">The annotations corresponding to the <eltref ref="annotation"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, and in the <eltref ref="selector"/> and <eltref ref="field"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
</reprcomp></reprdef>
    
    <note role="example">
     <eg xml:space="preserve">&lt;xs:element name="vehicle"&gt;
 &lt;xs:complexType&gt;
  . . .
  &lt;xs:attribute name="plateNumber" type="xs:integer"/&gt;
  &lt;xs:attribute name="state" type="twoLetterCode"/&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;

&lt;xs:element name="state"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:sequence&gt;
   &lt;xs:element name="code" type="twoLetterCode"/&gt;
   &lt;xs:element ref="vehicle" maxOccurs="unbounded"/&gt;
   &lt;xs:element ref="person" maxOccurs="unbounded"/&gt;
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;

 &lt;xs:key name="reg"&gt; &lt;!-- vehicles are keyed by their plate within states --&gt;
  &lt;xs:selector xpath=".//vehicle"/&gt;
  &lt;xs:field xpath="@plateNumber"/&gt;
 &lt;/xs:key&gt;
&lt;/xs:element&gt;

&lt;xs:element name="root"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:sequence&gt;
   . . .
   &lt;xs:element ref="state" maxOccurs="unbounded"/&gt;
   . . .
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;

 &lt;xs:key name="state"&gt; &lt;!-- states are keyed by their code --&gt;
  &lt;xs:selector xpath=".//state"/&gt;
  &lt;xs:field xpath="code"/&gt;
 &lt;/xs:key&gt;

 &lt;xs:keyref name="vehicleState" refer="state"&gt;
  &lt;!-- every vehicle refers to its state --&gt;
  &lt;xs:selector xpath=".//vehicle"/&gt;
  &lt;xs:field xpath="@state"/&gt;
 &lt;/xs:keyref&gt;

 &lt;xs:key name="regKey"&gt; &lt;!-- vehicles are keyed by a pair of state and plate --&gt;
  &lt;xs:selector xpath=".//vehicle"/&gt;
  &lt;xs:field xpath="@state"/&gt;
  &lt;xs:field xpath="@plateNumber"/&gt;
 &lt;/xs:key&gt;

 &lt;xs:keyref name="carRef" refer="regKey"&gt; &lt;!-- people's cars are a reference --&gt;
  &lt;xs:selector xpath=".//car"/&gt;
  &lt;xs:field xpath="@regState"/&gt;
  &lt;xs:field xpath="@regPlate"/&gt;
 &lt;/xs:keyref&gt;

&lt;/xs:element&gt;

&lt;xs:element name="person"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:sequence&gt;
   . . .
   &lt;xs:element name="car"&gt;
    &lt;xs:complexType&gt;
     &lt;xs:attribute name="regState" type="twoLetterCode"/&gt;
     &lt;xs:attribute name="regPlate" type="xs:integer"/&gt;
    &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;</eg>
     <p>A <code>state</code> element is defined, which
contains a <code>code</code> child and some <code>vehicle</code> and <code>person</code>
children.  A <code>vehicle</code> in turn has a <code>plateNumber</code> attribute,
which is an integer, and a <code>state</code> attribute.  State's
<code>code</code>s are a key for them within the document.  Vehicle's
<code>plateNumber</code>s are a key for them within states, and
<code>state</code> and
<code>plateNumber</code> is asserted to be a <pt>key</pt> for
<code>vehicle</code> within the document as a whole.  Furthermore, a <code>person</code> element has
an empty <code>car</code> child, with <code>regState</code> and
<code>regPlate</code> attributes, which are then asserted together to refer to
<code>vehicle</code>s via the <code>carRef</code> constraint.  The requirement
that a <code>vehicle</code>'s <code>state</code> match its containing
<code>state</code>'s <code>code</code> is not expressed here.</p>
    </note>
 </div3>
    <div3>
     <head>Constraints on XML Representations of Identity-constraint Definitions</head>
    <constraintnote type="src" id="src-identity-constraint">
   <head>Identity-constraint Definition Representation OK</head>
   <p>In addition to the conditions imposed on <eltref ref="key"/>, <eltref ref="keyref"/> and <eltref ref="unique"/> element
information items by the schema for schemas, the corresponding identity-constraint definition <rfc2119>must</rfc2119> satisfy the conditions set
out in <specref ref="coss-identity-constraint"/>.</p>
  </constraintnote>
    </div3>
    <div3>
     <head>Identity-constraint Definition Validation Rules</head>
 <constraintnote type="cvc" id="cvc-identity-constraint">
  <head>Identity-constraint Satisfied</head>
  <p>For an element information item to be locally <termref def="key-vn">valid</termref> with respect to an identity-constraint
   <olist role="and">
    <item>
     <p>The <propref comp="icd" prop="selector"/>, with the element information item as the
context node, evaluates to a node-set (as defined in
<bibref ref="bib-xpath"/>).  <termdef id="key-tns" term="target node set" role="local">Call this the <term>target node set</term></termdef>.</p>
    </item>
    <item>
     <p>Each node in the <termref def="key-tns">target node set</termref> is
either the context node 
<!--*
* material suppressed here by diff group wd2.silent *
*--><phrase dg="wd2.silent">or an</phrase>
element node among its descendants.</p>
    </item>
    <item>
     <p>For each node in the <termref def="key-tns">target node
set</termref> all of the <propref comp="icd" prop="fields"/>, with
that node as the context node, evaluate to either an empty node-set or
a node-set with exactly one member, which <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> a simple type.
<termdef id="key-ks" term="key-sequence" role="local">Call the
sequence of the type-determined values (as defined in <bibref ref="ref-xsp2"/>) of the <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>
    </item>
    <item>
     <p>
   <termdef id="key-qns" term="qualified node set" role="local">Call the subset of the <termref def="key-tns">target node set</termref> for
which all the <propref comp="icd" prop="fields"/> evaluate to a node-set with exactly one
member which is an element or attribute node with a simple type the <term>qualified node set</term></termdef>.
     <olist role="Casetest">
    <item id="c-u">
     <p role="if">the <propref comp="icd" prop="identity-constraint category"/> is <pt>unique</pt></p>
     <p role="then">no two members of the <termref def="key-qns">qualified node
set</termref> have <termref def="key-ks">key-sequences</termref> whose members
are pairwise equal, as defined by <!--*
* material suppressed here by diff group fpwd *
*--><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#equality" dg="fpwd">Equality</xtermref> in <bibref ref="ref-xsp2"/>.</p>
    </item>
      <item id="c-k">
     <p role="if">the <propref comp="icd" prop="identity-constraint category"/> is <pt>key</pt></p>
       <p role="then">
        <olist role="andtest">
         <item>
     <p>The <termref def="key-tns">target node set</termref> and the <termref def="key-qns">qualified node
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
set</termref> and <emph>vice versa</emph>.</p>
         </item>
    <item>
     <p>No two members of the <termref def="key-qns">qualified node
set</termref> have <termref def="key-ks">key-sequences</termref> whose members
are pairwise equal, as defined by <!--*
* material suppressed here by diff group fpwd *
*--><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#equality" dg="fpwd">Equality</xtermref> in <bibref ref="ref-xsp2"/>.</p>
    </item>
    <item id="c-nlbl">
     <p>No element member of the <termref def="key-ks">key-sequence</termref> of any
member of the <termref def="key-qns">qualified node
set</termref> was assessed as <termref def="key-vn">valid</termref> by reference to an element
declaration whose <propref comp="ed" prop="nillable"/> is <pt>true</pt>.</p>
    </item>
        </olist>
       </p>
    </item>
    <item id="cl-krv">
     <p role="if">the <propref comp="icd" prop="identity-constraint category"/> is <pt>keyref</pt></p>
     <p role="then">for each member of the <termref def="key-qns">qualified node
set</termref> (call this the <local>keyref member</local>), there <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a <termref def="key-nt">node table</termref> associated with the
<propref comp="icd" prop="referenced key"/> in the <propref role="psvi" ref="e-id_constraint_table"/>
of the element information item (see <specref ref="sic-key"/>, which <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase>
understood as logically prior to this clause of this constraint, below) and
there <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> an entry in that table whose
<termref def="key-ks">key-sequence</termref> is equal to the
<local>keyref member's</local> <termref def="key-ks">key-sequence</termref> member for
member, as defined by <!--*
* material suppressed here by diff group fpwd *
*--><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#equality" dg="fpwd">Equality</xtermref> in <bibref ref="ref-xsp2"/>.</p>
    </item>
   </olist>
     </p>
    </item>
   </olist>
  </p>
  <note>
   <p>The use of  <xpropref role="psviAnon">schema normalized value</xpropref> in the definition
of <termref def="key-ks">key sequence</termref> above means that
<pt>default</pt> or <pt>fixed</pt> value constraints <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> play a part in <termref def="key-ks">key sequence</termref>s.</p>
  </note>
 </constraintnote>
     <note>
      <p>Because the validation of <pt>keyref</pt> (see <clauseref ref="cl-krv"/>) depends on finding
appropriate entries in a element information item's <termref def="key-nt">node
table</termref>, and <termref def="key-nt">node tables</termref> are assembled
strictly recursively from the node tables of descendants, only element
information items within the sub-tree rooted at the element information item
being <termref def="key-vn">validated</termref> can be referenced successfully.</p>
     </note>
 <note>
  <p>Although this specification defines a <termref def="key-psvi">post-schema-validation infoset</termref>
contribution which would enable schema-aware processors to implement <clauseref ref="c-nlbl"/> above (<specref ref="sic-elt-decl"/>), processors are not required to
provide it.  This clause can be read as if in the absence of this infoset contribution, the
value of the relevant <propref comp="ed" prop="nillable"/> property <rfc2119>must</rfc2119> be available.</p>
 </note>
    </div3>
    <div3>
     <head>Identity-constraint Definition Information Set Contributions</head>
 <constraintnote type="sic" id="sic-key">
  <head>Identity-constraint Table</head>
  <p><termdef id="key-ec" term="eligible identity-constraint" role="local">An
<term>eligible identity-constraint</term> of an element information item is
one such that <clauseref ref="c-u"/> or <clauseref ref="c-k"/> of
<specref ref="cvc-identity-constraint"/> is satisfied with respect to that
item and that constraint, or such that any of the element information
item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of that item have an <propref role="psvi" ref="e-id_constraint_table"/> property whose value has an entry for
that constraint</termdef>.</p>
  <p><termdef id="key-nt" term="node table" role="local">A <term>node
table</term> is a set of pairs each consisting of a <termref def="key-ks">key-sequence</termref> and an element node</termdef>.</p>
  <p>Whenever an element information item has one or more <termref def="key-ec">eligible identity-constraints</termref>, in the <termref def="key-psvi">post-schema-validation infoset</termref> that
element information item <phrase dg="opt.144">has</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> a property as follows:</p>
  <proplist item="element" role="psvi">
    <propdef id="e-id_constraint_table" name="identity-constraint table">
     one
<local>Identity-constraint Binding</local>
information item for each <termref def="key-ec">eligible identity-constraint</termref>, with
properties as follows:
     <proplist item="Identity-constraint Binding" role="psvi">
      <propdef id="cb-definition" name="definition">The <termref def="key-ec">eligible identity-constraint</termref>.</propdef>
      <propdef id="cb-node_table" name="node table">A <termref def="key-nt">node table</termref> with one entry for every <termref def="key-ks">key-sequence</termref> (call it <local>k</local>) and
node (call it <local>n</local>) such that
   <olist role="ortest">
    <item id="c-kc">
     <p>There is an entry in one of the <termref def="key-nt">node
tables</termref> associated with the <propref role="psvi" ref="cb-definition"/> in an <local>Identity-constraint Binding</local>
information item in at least one of the <propref role="psvi" ref="e-id_constraint_table"/>s of the element information item
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of the element information item whose <termref def="key-ks">key-sequence</termref> is <local>k</local> and whose node
is <local>n</local>;</p>
    </item>
    <item>
     <p><local>n</local> appears with <termref def="key-ks">key-sequence</termref> <local>k</local> in the <termref def="key-qns">qualified node set</termref> for the <propref role="psvi" ref="cb-definition"/>.</p>
    </item>
   </olist> 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>
     </proplist>
    </propdef>
   </proplist>  
    <!--*
* material suppressed here by diff group ep01 *
*-->
  <note>
   <p>The complexity of the above arises from the fact that
<pt>keyref</pt> identity-constraints <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be defined on domains distinct from the
embedded domain of the identity-constraint they reference, or <phrase dg="may">the domains may be</phrase><!--*
* material suppressed here by diff group may *
*--> the
same but self-embedding at some depth.  In either case the <termref def="key-nt">node
table</termref> for the referenced identity-constraint needs to propagate upwards, with
conflict resolution.</p>
   <p>The <local>Identity-constraint Binding</local> information item, unlike
others in this specification, is essentially an internal bookkeeping
mechanism.  It is introduced to support the definition of <specref ref="cvc-identity-constraint"/>
above. Accordingly, conformant processors <rfc2119>may</rfc2119>, but are
<emph>not</emph> required to, expose them via
<propref role="psvi" ref="e-id_constraint_table"/> properties in the
<termref def="key-psvi">post-schema-validation infoset</termref>. In other words, the above constraints <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*-->
be read as saying <termref def="key-vn">validation</termref> of
identity-constraints proceeds <emph>as if</emph> such infoset items existed. 
</p></note>
 </constraintnote>
    </div3>
    <div3 id="coss-identity-constraint">
     <head>Constraints on Identity-constraint Definition Schema Components</head>
  <p>All identity-constraint definitions (see <specref ref="cIdentity-constraint_Definitions"/>) <rfc2119>must</rfc2119> satisfy the following constraint.</p>
  <constraintnote type="cos" id="c-props-correct">
   <head>Identity-constraint Definition Properties Correct</head>
   <olist role="And">
    <item>
     <p>The values of the properties of an identity-constraint definition <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as described in
the property tableau in
<specref ref="Identity-constraint_Definition_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
    </item>
    <item>
     <p>If the <propref comp="icd" prop="identity-constraint category"/> is
<pt>keyref</pt>, the cardinality of the <propref comp="icd" prop="fields"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is equal to</phrase> that of the <propref comp="icd" prop="fields"/> of the <propref comp="icd" prop="referenced key"/>.</p>
    </item>
   </olist>
  </constraintnote>
     <constraintnote type="cos" id="c-selector-xpath">
      <head>Selector Value OK</head>
      <olist role="And">
       <item>
      <p>The <propref comp="icd" prop="selector"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a valid XPath
expression, as defined in <bibref ref="bib-xpath"/>.</p>
       </item>
       <item>
        <olist role="Ortest">
         <item>
          <p>It <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">conforms</phrase> to the following extended BNF:
        <scrap lang="ebnf" headstyle="show">
         <head>Selector XPath expressions</head>
         <prod id="Selector">
          <lhs>Selector</lhs>
          <rhs><nt def="Path">Path</nt> ( '|' <nt def="Path">Path</nt> )*</rhs>
         </prod>
         <prod id="Path">
          <lhs>Path</lhs>
          <rhs>('.//')? <nt def="Step">Step</nt> ( '/' <nt def="Step">Step</nt> )*</rhs>
         </prod>
         <prod id="Step">
          <lhs>Step</lhs>
          <rhs>'.' | <nt def="NameTest">NameTest</nt></rhs>
         </prod>
         <prod id="NameTest">
          <lhs>NameTest</lhs>
          <rhs><xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml-names/#NT-QName">QName</xnt> | '*' | <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</xnt> ':' '*'</rhs>
         </prod>
        </scrap>
        </p>
         </item>
         <item>
          <p>It <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> an XPath expression involving the <code>child</code> axis
           whose abbreviated form is as given above.</p>
         </item>
        </olist>
       </item>
      </olist>
      <p>For readability, whitespace <rfc2119>may</rfc2119> be used in selector XPath expressions even though not
explicitly allowed by the grammar: <nt def="whitespace">whitespace</nt> <rfc2119>may</rfc2119> be freely added within patterns before or after any <nt def="token">token</nt>.
      <scrap lang="ebnf" headstyle="show">
         <head>Lexical productions</head>
         <prod id="token">
          <lhs>token</lhs>
          <rhs>'.' | '/' | '//' | '|' | '@' | <nt def="NameTest">NameTest</nt></rhs>
         </prod>
         <prod id="whitespace">
          <lhs>whitespace</lhs>
          <rhs><xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml/#NT-S">S</xnt></rhs>
         </prod>
        </scrap></p>
      <p>
When tokenizing, the longest possible token is always returned.</p>      
     </constraintnote>
     <constraintnote type="cos" id="c-fields-xpaths">
      <head>Fields Value OK</head>
      <olist role="And">
       <item>
      <p>Each member of the <propref comp="icd" prop="fields"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a valid XPath
expression, as defined in <bibref ref="bib-xpath"/>.</p>
       </item>
       <item>
        <olist role="Ortest">
         <item>
          <p>It <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">conforms</phrase> to the extended BNF given
above for <nt def="Selector">Selector</nt>, with the following modification:
        <scrap headstyle="show">
         <head>Path in Field XPath expressions</head>
         <prod id="fPath">
          <lhs>Path</lhs>
          <rhs>('.//')? ( <nt def="Step">Step</nt> '/' )* ( <nt def="Step">Step</nt> | '@' <nt def="NameTest">NameTest</nt> )</rhs>
         </prod>
        </scrap>
           This production differs from the one above in allowing the final
step to match an attribute node.
        </p>
         </item>
         <item>
          <p>It <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> an XPath expression involving the <code>child</code> and/or <code>attribute</code> axes whose abbreviated form is
as given above.</p>
         </item>
        </olist>
       </item>
      </olist>
      <p>For readability, whitespace <rfc2119>may</rfc2119> be used in field XPath expressions even though not
explicitly allowed by the grammar: <nt def="whitespace">whitespace</nt> <rfc2119>may</rfc2119> be freely added within patterns before or after any <nt def="token">token</nt>.
      </p>
      <p>When tokenizing, the longest possible token is always returned.</p>
     </constraintnote>
    </div3>
   </div2>
   <div2 id="cAssertions" dg="b2861cc-1">
    <head>Assertions</head>
    <p>Assertion components constrain the existence and values of related 
    elements and attributes.</p>
    <note role="example">
<eg xml:space="preserve">&lt;xs:assert test="@min le @max"/&gt;

&lt;xs:report test="@min gt @max"/&gt;</eg>
     <p>The XML representations for the two kinds of assertions.</p>
     <p dg="b2861cc-1a">The <eltref ref="assert"/> element requires that the 
     value of the <att>min</att> attribute be less than or equal to that of the
     <att>max</att> attribute, and fails if that is not the case.  
     The <eltref ref="report"/> element shown here enforces much the same condition,
     but expresses it differently; it detects an error if its
     predicate is true, in this case if the value of the <att>min</att>
     attribute is greater than that of <att>max</att>.</p>
    </note>
    <div3 id="Assertion_details">
     <head>The Assertion Schema Component</head>
     <p>The assertion schema component has the following properties:</p>

<!--*
<ednote diff="add" dg="b2861cc-1m">
<edtext>The following inquiry is tagged as a Note for technical reasons,
but it is not intended for inclusion in published drafts of this spec.</edtext>
</ednote>

<note diff="add" dg="b2861cc-1m">
      <p>We didn't agree on how to capture documentation/message information
       within assertions. What's presented in this proposal doesn't allow extra content
       other than the standard &lt;annotation>, and annotations have to be used to
       store things like error messages. Another possible proposal is to stay close to
       Schematron by allowing mixed content and any elements. It's not easy to show both
       proposals together (like what we usually do with Plan A vs. B). The following
       describes how plan B would work.       
      </p>
<olist>
        <item><p>
         Add a {message} property, whose value is a sequence of information items.
        </p></item>
        <item><p>
         The "assertion" type of assert/report will not be derived from "annoted":
<eg xml:space="preserve">  &lt;xs:complexType name="assertion" mixed="true">
    &lt;xs:choice>
      &lt;xs:element ref="xs:annotation" minOccurs="0"/>
      &lt;xs:any namespace="##other" processContents="lax"
              minOccurs="0" maxOccurs="unbounded"/>
    &lt;xs:choice>
    &lt;xs:attribute name="test">
      &lt;xs:simpleType>
        &lt;xs:annotation>
          &lt;xs:documentation>A subset of XPath expressions for use in assertion tests&lt;/xs:documentation>
        &lt;/xs:annotation>
        &lt;xs:restriction base="xs:token">
        &lt;/xs:restriction>
      &lt;/xs:simpleType>
    &lt;/xs:attribute>
    &lt;xs:attribute name="id" type="xs:ID"/>
    &lt;xs:anyAttribute namespace="##other" processContents="lax"/>
  &lt;/xs:complexType></eg>
        </p></item>
        <item><p>
         The mapping rule for {message} is "the sequence of information items in [children]".
        </p></item>
        <item><p>
         A description like the following:</p><p>
         {message} can store information about the assertion.
         This specification doesn't describe or mandate how such information is used.
         Applications are free to use it in any way. For example, to use it to form
         error messages.
        </p></item>
        <item><p>
         Add &lt;value-of> to one of the samples to illustrate how to use {message}.
<eg xml:space="preserve">  &lt;xs:assert test="@min le @max"/>
    The min value &lt;sch:value-of select="@min"/> is greater than the max value
    &lt;sch:value-of select="@max"/>.
  &lt;/xs:assert></eg>
        </p></item></olist>
</note> *-->
     <!--* <ednote>
      <edtext>TODO: how to indicate {category} has one of {assert, report}?
       And anything special needs to happen to assertExpr?</edtext>
     </ednote> *-->
     <compdef name="Assertion" abbrev="as" showAKO="true"/>
     <p><propref comp="as" prop="category"/> controls how assertions impact
      <termref def="key-va">assessment</termref> of the element information item.
      A <propref comp="as" prop="category"/> with the value <pt>assert</pt> means
      the <propref comp="as" prop="test"/> <rfc2119>must</rfc2119> evaluate to <code>true</code>.
      A <propref comp="as" prop="category"/> with the value <pt>report</pt> means
      the <propref comp="as" prop="test"/> <rfc2119>must</rfc2119> evaluate to <code>false</code>.</p>
     <p><propref comp="as" prop="test"/> specifies a restricted XPath
      (<bibref ref="bib-xpath2"/>) expression:</p>
     <!--* <ednote>
      <edtext>Are we OK with the following restrictions? We have agreement on
      some of them, but not all. In particular, we didn't decide which operators
      and functions to support. What's supported in this proposal is limited to
      operations defined by this spec.</edtext>
     </ednote> *-->
     <ulist>
      <item>
       <p>Path steps are restricted to only match information items within the element being
        <termref def="key-va">assessed</termref></p>
      </item>
      <item>
       <p><phrase dg="b2861cc-1b">XPath <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath20-20060608/#dt-predicate">predicates</xtermref></phrase>
        are <!--*
* material suppressed here by diff group b2861cc-1b *
*-->restricted to only refer to attributes on the current element.</p>
      </item>
      <item>
       <p>Operations are limited to those defined in this specification.
        For example, comparison of <termref def="key-vv">actual value</termref>s is supported,
        while general comparison, addition and multiplication are not.</p>
      </item>
      <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
      <item>
       <p>Functions are <phrase dg="b2861cc-1b">also </phrase>limited to
        <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
        <phrase dg="b2861cc-1b">those whose semantics is within the scope
        of this specification.</phrase>.</p>
      </item>
     </ulist>
     <p>As a result, <propref comp="as" prop="test"/> evaluates to either <code>true</code>
      or <code>false</code> (if any other value is returned, it's converted to
      either <code>true</code> or <code>false</code> as if by a call to the XPath
      <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-boolean">fn:boolean</loc> function).</p>
     <p>See <specref ref="cAnnotations"/> for information on the role of
      the <propref comp="as" prop="annotations"/> property.</p>
    </div3>
    <div3 id="declare-assertion">
     <head>XML Representation of Assertion Schema Components</head>
     <p>The XML representation for an assertion schema component is either
      an <eltref ref="assert"/> or a <eltref ref="report"/> element information item.
      The correspondences between the properties of those information items and
      properties of the component they correspond to are as follows:</p>
     <!--* <ednote>
      <edtext>We didn't decide which namespace to use for these 2 elements.
       This proposal uses the xs: namespace.</edtext>
     </ednote> *-->
     <!--* <ednote>
      <edtext>How to make "test" show "a subset of XPath expression, see below"?</edtext>
     </ednote> *-->
     <reprdef>
      <reprelt eltname="assert"/>
      <reprelt eltname="report"/>
      <reprcomp abstract="Assertion" ref="Assertion_details">
       <propmap comp="as" prop="category">Either <pt>assert</pt> or <pt>report</pt>,
        depending on the item.</propmap>
       <propmap comp="as" prop="test">A restricted XPath expression corresponding to
        the <termref def="key-vv">actual value</termref> of the <code>test</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>.</propmap>
       <propmap comp="as" prop="annotations">The annotation corresponding to
        the <eltref ref="annotation"/> element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>,
        if present, otherwise <termref def="key-null">absent</termref>.</propmap>
      </reprcomp>
     </reprdef>
     <note role="example">
<eg xml:space="preserve">&lt;xs:complexType name="intRange"&gt;
 &lt;xs:attribute name="min" type="xs:int"/&gt;
 &lt;xs:attribute name="max" type="xs:int"/&gt;
 &lt;xs:assert test="@min le @max"/&gt;
&lt;/xs:complexType&gt;</eg>
      <p>The value of the <code>min</code> attribute must be less than or equal to
       that of the <code>max</code> attribute.</p>
     </note>
     <note role="example">
<eg xml:space="preserve">&lt;xs:complexType name="arrayType"&gt;
 &lt;xs:sequence&gt;
  &lt;xs:element name="entry" minOccurs="0" maxOccurs="unbounded"/&gt;
 &lt;/xs:sequence&gt;
 &lt;xs:attribute name="length" type="xs:int"/&gt;
 &lt;xs:assert test="@length eq fn:count(./entry)"/&gt;
&lt;/xs:complexType&gt;</eg>
      <p>The value of the <code>length</code> attribute must be the same as
       the number of occurrences of <code>entry</code> sub-elements.</p>
     </note>
     <!--* <ednote diff="add" dg="b2861cc-1b">
      <edtext>TODO: need to come up with better examples. e.g. use predicates, etc.</edtext>
     </ednote> *-->
    </div3>
    <div3>
     <head>Constraints on XML Representations of Assertions</head>
     <constraintnote type="src" id="src-assertion">
      <head>Assertion Representation OK</head>
       <p>In addition to the conditions imposed on <eltref ref="assert"/> and
        <eltref ref="report"/> element information items by the schema for schemas,
        the corresponding assertion <rfc2119>must</rfc2119> satisfy the conditions set out in
        <specref ref="coss-assertion"/>.</p>
     </constraintnote>
    </div3>
    <div3>
     <head>Assertion Validation Rules</head>
     <constraintnote type="cvc" id="cvc-assertion">
      <head>Assertion Satisfied</head>
       <p>For an element information item to be locally <termref def="key-vn">valid</termref>
        with respect to an assertion 
        <olist role="and">
         <item>
          <p>The <propref comp="as" prop="test"/>, with the element information item
           as the context node, evaluates to either <code>true</code> or <code>false</code>
           (see below)<!--*
* material suppressed here by diff group b2861cc-1b *
*--> without raising any
           <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath20-20060608/#dt-type-error">type error</loc>.</p>
         </item>
         <item>
          <p>If the <propref comp="as" prop="category"/> is <pt>assert</pt>,
           then <propref comp="as" prop="test"/> evaluates to <code>true</code>.</p>
         </item>
         <item>
          <p>If the <propref comp="as" prop="category"/> is <pt>report</pt>,
           then <propref comp="as" prop="test"/> evaluates to <code>false</code>.</p>
         </item>
        </olist>
       </p>
       <p>Evaluation of <propref comp="as" prop="test"/> is performed as defined
       in <bibref ref="bib-xpath2"/>, with the following exceptions:</p>
       <ulist>
        <item>
         <p>If the evaluation returns a node-set, it is converted to either <code>true</code>
          or <code>false</code> as if by a call to the XPath
          <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-boolean">fn:boolean</loc> function.</p>
        </item>
        <item>
         <p>When operands are compared
          (see <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath20-20060608/#id-value-comparisons">Value Comparisons</loc>
          of <bibref ref="bib-xpath2"/>), values are <emph>not</emph> converted to other values by casting, promoting,
          or substitution. When the 2 values are <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-incomparable">incomparable</xtermref>,
          the comparison always returns <code>false</code>.</p>
        </item>
       </ulist>
     </constraintnote>
    </div3>
    <div3>
     <head>Assertion Information Set Contributions</head>
     <p>None as such.</p>
    </div3>
    <div3 id="coss-assertion">
     <head>Constraints on Assertion Schema Components</head>
     <p>All assertions (see <specref ref="cAssertions"/>) <rfc2119>must</rfc2119> satisfy the following constraints.</p>
     <constraintnote type="cos" id="as-props-correct">
      <head>Assertion Properties Correct</head>
      <p>The values of the properties of an assertion <rfc2119>must</rfc2119> be as described in
       the property tableau in <specref ref="Assertion_details"/>, modulo the impact of
       <specref ref="conformance-missing"/>.</p>   
     </constraintnote>
     <constraintnote type="cos" id="as-test-xpath">
      <head>Test Value OK</head>
      <olist role="And">
       <item>
        <p>The <propref comp="as" prop="test"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a valid XPath expression,
         as defined in <bibref ref="bib-xpath2"/>.</p>
       </item>
       <item>
        <olist role="Or">
         <item>
          <p>It conforms to the following extended BNF:
           <scrap lang="ebnf" headstyle="show">
            <!--
             The following tries to stay close to the XPath 2.0 grammar defined in
             http://www.w3.org/TR/xpath20/#id-grammar.
             Comments are given to exaplin why and how they differ.
            -->
            <head>Test XPath expressions</head>
            <!--
             The *root* expression is a boolean, as opposed to XPaths "single",
             "for", etc.
            -->
            <prod id="Test">
             <lhs>Test</lhs>
             <rhs><nt def="OrExpr">OrExpr</nt></rhs>
            </prod>
            <prod id="OrExpr">
             <lhs>OrExpr</lhs>
             <rhs><nt def="AndExpr">AndExpr</nt> ( 'or' <nt def="AndExpr">AndExpr</nt> )*</rhs>
            </prod>
            <prod id="AndExpr">
             <lhs>AndExpr</lhs>
             <rhs><nt def="BooleanExpr">BooleanExpr</nt> ( 'and' <nt def="BooleanExpr">BooleanExpr</nt> )*</rhs>
            </prod>
            <!--
             This is the main difference from XPath 2.0.
             There are 2 kinds of expressions: boolean and value. They can't be mixed.
             The only time a value can be used as a boolean is a node set treated as if
             fn:count(nodeset)>0.
             The BooleanExpr production connects the 2 kinds of expressions.
            -->
            <prod id="BooleanExpr">
             <lhs>BooleanExpr</lhs>
             <rhs>'(' <nt def="OrExpr">OrExpr</nt> ')'</rhs>
             <rhs><!--*
* material suppressed here by diff group b2861cc-1b *
*-->
              <phrase dg="b2861cc-1b"><nt def="BooleanFunction">BooleanFunction</nt></phrase> |</rhs>
             <rhs>( <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
              <phrase dg="b2861cc-1b"><nt def="ValueFunction">ValueFunction</nt></phrase>
              | <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
              <phrase dg="b2861cc-1b"><nt def="ConstructorFunction">ConstructorFunction</nt></phrase> )
              <nt def="ValueComp">ValueComp</nt> <nt def="ValueExpr">ValueExpr</nt> |</rhs>
             <rhs><nt def="UnionExpr">UnionExpr</nt> ( <nt def="ValueComp">ValueComp</nt> <nt def="ValueExpr">ValueExpr</nt> )?
             </rhs>
            </prod>
            <!--
             The only boolean function supported.
            -->
            <prod id="BooleanFunction">
             <lhs><!--*
* material suppressed here by diff group b2861cc-1b *
*--><phrase dg="b2861cc-1b">BooleanFunction</phrase></lhs>
             <rhs><xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml-names/#NT-QName">QName</xnt>
              '(' <nt def="OrExpr">OrExpr</nt><phrase dg="b2861cc-1b">?
              ( ',' <nt def="OrExpr">OrExpr</nt> )*</phrase> ')'</rhs>
            </prod>
            <!--
             ValueComp is closer to schema value comparison.
             GeneralComp is not supported.
            -->
            <prod id="ValueComp">
             <lhs>ValueComp</lhs>
             <rhs>'eq' | 'ne' | 'lt' | 'le' | 'gt' | 'ge'</rhs>
            </prod>
            <!--
             These are all expressions that produce values.
            -->
            <prod id="ValueExpr">
             <lhs>ValueExpr</lhs>
             <rhs><!--*
* material suppressed here by diff group b2861cc-1b *
*-->
              <phrase dg="b2861cc-1b"><nt def="ValueFunction">ValueFunction</nt></phrase> |
              <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
              <phrase dg="b2861cc-1b"><nt def="ConstructorFunction">ConstructorFunction</nt></phrase> |
              <nt def="UnionExpr">UnionExpr</nt></rhs>
            </prod>
            <prod id="ValueFunction">
             <lhs><!--*
* material suppressed here by diff group b2861cc-1b *
*--><phrase dg="b2861cc-1b">ValueFunction</phrase></lhs>
             <rhs><xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml-names/#NT-QName">QName</xnt> '('
              <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
              <phrase dg="b2861cc-1b"><nt def="ValueExpr">ValueExpr</nt></phrase>? ')'</rhs>
            </prod>
            <!--
             The only kind of casting is from string to a simple value.
            -->
            <prod id="ConstructorFunction">
             <lhs><!--*
* material suppressed here by diff group b2861cc-1b *
*--><phrase dg="b2861cc-1b">ConstructorFunction</phrase></lhs>
             <rhs><!--*
* material suppressed here by diff group b2861cc-1b *
*-->
              <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml-names/#NT-QName">QName</xnt>
              <phrase dg="b2861cc-1b"> '(' <nt def="StringLiteral">StringLiteral</nt> ')'</phrase></rhs>
            </prod>
            <prod id="StringLiteral">
             <lhs>StringLiteral</lhs>
             <rhs>('"' (<nt def="EscapeQuot">EscapeQuot</nt> | [^"])* '"') |
              ("'" (<nt def="EscapeApos">EscapeApos</nt> | [^'])* "'")</rhs>
            </prod>
            <prod id="EscapeQuot">
             <lhs>EscapeQuot</lhs>
             <rhs>'""'</rhs>
            </prod>
            <prod id="EscapeApos">
             <lhs>EscapeApos</lhs>
             <rhs>"''"</rhs>
            </prod>
            <prod id="UnionExpr">
             <lhs>UnionExpr</lhs>
             <rhs><nt def="PathExpr">PathExpr</nt> ( '|' <nt def="PathExpr">PathExpr</nt> )*</rhs>
            </prod>
            <!--
             Limit the path expression to only look in the current sub-tree
            -->
            <prod id="PathExpr">
             <lhs>PathExpr</lhs>
             <rhs>('.//')? ( <nt def="StepExpr">StepExpr</nt> '/' )*
              ( <nt def="StepExpr">StepExpr</nt> | '@' <nt def="NameTest">NameTest</nt>)</rhs>
            </prod>
            <!--
             FilterExpr not supported. Predicates are only allowed on steps.
            -->
            <prod id="StepExpr">
             <lhs>StepExpr</lhs>
             <rhs>('.' | <nt def="NameTest">NameTest</nt> ) ( '[' <nt def="PredicateExpr">PredicateExpr</nt> ']' )*</rhs>
            </prod>
            <!--
             Either a boolean expression or a position index.
            -->
            <prod id="PredicateExpr">
             <lhs>PredicateExpr</lhs>
             <rhs><nt def="PredicateOr">PredicateOr</nt> | <nt def="PositionLiteral">PositionLiteral</nt></rhs>
            </prod>
            <!--
             Expressions that only look at attributes on the current element.
            -->
            <prod id="PredicateOr">
             <lhs>PredicateOr</lhs>
             <rhs><nt def="PredicateAnd">PredicateAnd</nt> ( 'or' <nt def="PredicateAnd">PredicateAnd</nt> )*</rhs>
            </prod>
            <prod id="PredicateAnd">
             <lhs>PredicateAnd</lhs>
             <rhs><nt def="PredicateBoolean">PredicateBoolean</nt> ( 'and' <nt def="PredicateBoolean">PredicateBoolean</nt> )*</rhs>
            </prod>
            <prod id="PredicateBoolean">
             <lhs>PredicateBoolean</lhs>
             <rhs>
              '(' <nt def="PredicateOr">PredicateOr</nt> ')'</rhs>
             <rhs>
              <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
              <phrase dg="b2861cc-1b"><nt def="PBooleanFunction">PBooleanFunction</nt></phrase> |</rhs>
             <rhs>
              <phrase dg="b2861cc-1b">( <nt def="PValueFunction">PValueFunction</nt> |</phrase>
              <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
              <phrase dg="b2861cc-1b"><nt def="ConstructorFunction">ConstructorFunction</nt> )</phrase>
              <nt def="ValueComp">ValueComp</nt> <nt def="PredicateValue">PredicateValue</nt> |</rhs>
             <rhs>
              '@' <nt def="NameTest">NameTest</nt> ( <nt def="ValueComp">ValueComp</nt> <nt def="PredicateValue">PredicateValue</nt> )?
             </rhs>
            </prod>
            <prod id="PBooleanFunction">
             <lhs><!--*
* material suppressed here by diff group b2861cc-1b *
*--><phrase dg="b2861cc-1b">PBooleanFunction</phrase></lhs>
             <rhs><xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml-names/#NT-QName">QName</xnt>
              '(' <nt def="PredicateOr">PredicateOr</nt><phrase dg="b2861cc-1b">?
              ( ',' <nt def="PredicateOr">PredicateOr</nt> )*</phrase> ')'</rhs>
            </prod>
            <prod id="PValueFunction" dg="b2861cc-1b">
             <lhs dg="b2861cc-1b">PValueFunction</lhs>
             <rhs dg="b2861cc-1b"><xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/REC-xml-names/#NT-QName">QName</xnt>
              '(' <nt def="PredicateValue">PredicateValue</nt>? ')'</rhs>
            </prod>
            <prod id="PredicateValue">
             <lhs>PredicateValue</lhs>
             <rhs><!--*
* material suppressed here by diff group b2861cc-1b *
*-->
              <phrase dg="b2861cc-1b"><nt def="ConstructorFunction">ConstructorFunction</nt> | '.'</phrase>
              | '@' <nt def="NameTest">NameTest</nt></rhs>
            </prod>
            <prod id="PositionLiteral">
             <lhs>PositionLiteral</lhs>
             <rhs>[0-9]+</rhs>
            </prod>
           </scrap>
           <!--* <ednote>
            <edtext>In the above grammar, "value comparison" operators are used
             (the 2-letter names like "lt" "ne"). The symbol operators are for
             "general comparison" in XPath 2.0. "Value" comparison is very close
             to the kind of comparison defined by schema, whereas "general comparison"
             is very different. The use of "value comparison" gives us better inter-op
             with XPath, but leads to a slightly more ugly syntax.</edtext>
           </ednote> *-->
          </p>
         </item>
         <item>
          <p>It <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> an XPath expression involving the <code>child</code> and/or <code>attribute</code> axes
           whose abbreviated form is as given above.</p>
         </item>
        </olist>
        <p>For readability, whitespace <rfc2119>may</rfc2119> be used in field XPath expressions even though
         not explicitly allowed by the grammar: <nt def="whitespace">whitespace</nt>
         <rfc2119>may</rfc2119> be freely added within patterns before or after any <nt def="token">token</nt>.
        </p>
        <p>When tokenizing, the longest possible token is always returned.</p>
       </item>
       <item>
        <p>If part of the restricted XPath matches <code>QName</code> in the
         <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
         <phrase dg="b2861cc-1b"><nt def="BooleanFunction">BooleanFunction</nt></phrase>
         production or the
         <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
         <phrase dg="b2861cc-1b"><nt def="PBooleanFunction">PBooleanFunction</nt></phrase>
         production, then it identifies <!--*
* material suppressed here by diff group b2861cc-1b *
*--><phrase dg="b2861cc-1b">one of the following functions</phrase>
         defined in the <bibref ref="bib-fno"/> specification<!--*
* material suppressed here by diff group b2861cc-1b *
*--><phrase dg="b2861cc-1b">:
         <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-true">fn:true</loc>,
         <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-false">fn:false</loc>,
         <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-boolean-equal">op:boolean-equal</loc> and
         <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-not">fn:not</loc>.</phrase>
        </p>
       </item>
       <item>
        <p>If part of the restricted XPath matches <code>QName</code> in the
         <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
         <phrase dg="b2861cc-1b"><nt def="ValueFunction">ValueFunction</nt> production or the
         <nt def="PValueFunction">PValueFunction</nt></phrase>
         production, then it identifies <!--*
* material suppressed here by diff group b2861cc-1b *
*--><phrase dg="b2861cc-1b">one of the following functions</phrase>
         defined in the <bibref ref="bib-fno"/> specification<!--*
* material suppressed here by diff group b2861cc-1b *
*--><phrase dg="b2861cc-1b">:
         <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-data">fn:data</loc>,
         <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-local-name">fn:local-name</loc>,
         <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-namespace-uri">fn:nanmespace-uri</loc>,
         <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-count">op:count</loc>,
         <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-max">fn:max</loc> and
         <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608/#func-min">fn:min</loc>.</phrase>
        </p>
       </item>
       <item>
        <p>If part of the restricted XPath matches the
         <!--*
* material suppressed here by diff group b2861cc-1b *
*-->
         <phrase dg="b2861cc-1b"><nt def="ConstructorFunction">ConstructorFunction</nt></phrase>
         production, then
         <olist role="andtest">
          <item>
           <p>The piece that matches <code>QName</code> identifies a simple type definition.</p>
           </item>
          <item>
           <p>The <termref def="key-nv">normalized value</termref> of the piece that matches
            <code>StringLiteral</code> is locally <termref def="key-vn">valid</termref> with respect to
            the simple type definition identified in the above step, as per <specref ref="cvc-simple-type"/>.</p>
           </item>
         </olist>
        </p>
       </item>
      </olist>
      <note dg="b2861cc-1b"><p>
       Implementations <rfc2119>may</rfc2119> choose to support a bigger subset of XPath 2.0. This specification may also
       define other commonly used subsets in future working drafts.
      </p></note>
     </constraintnote>
    </div3>
   </div2>
   <div2 id="cNotation_Declarations">
    <head>Notation Declarations</head>
    <p>Notation declarations reconstruct XML<!--*
* material suppressed here by diff group fpwd *
*--> NOTATION declarations.</p>
    <note role="example">
     <eg xml:space="preserve">&lt;xs:notation name="jpeg" public="image/jpeg" system="viewer.exe"&gt;</eg>
     <p>The XML representation of a notation declaration.</p>
    </note>
    <div3 id="Notation_Declaration_details">
     <head>The Notation Declaration Schema Component</head>
    <p>The notation declaration schema component has the following
properties:</p>

  <compdef name="Notation Declaration" abbrev="nd" showAKO="true"/>
    <p>Notation declarations do not participate in <termref def="key-vn">validation</termref> as such.
They are referenced in the course of <termref def="key-vn">validating</termref> strings as members of
the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#NOTATION">NOTATION</xtermref> simple type.</p>
     <p>See <specref ref="cAnnotations"/> for information on the role of the
<propref comp="nd" prop="annotations"/> property.</p>
    </div3>
<div3 id="declare-notation">
<head>XML Representation of Notation Declaration Schema Components</head>
<p>The XML representation for a notation declaration schema component is
a
<eltref ref="notation"/>
element information item.    The correspondences between the
properties of that information item and
properties of the component it corresponds to are as follows:</p>
 <reprdef>
 <reprelt eltname="notation"/>
 <reprcomp abstract="Notation Declaration" ref="Notation_Declaration_details">
<propmap comp="nd" prop="name">The <termref def="key-vv">actual value</termref> of the
<code>name</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>
  <propmap comp="nd" prop="target namespace">The <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the parent <code>schema</code>
element information item.</propmap>
<propmap comp="nd" prop="system identifier">The <termref def="key-vv">actual value</termref> of the <code>system</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
<propmap comp="nd" prop="public identifier">The <termref def="key-vv">actual value</termref> of the <code>public</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></propmap>
<propmap comp="nd" prop="annotations">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise <termref def="key-null">absent</termref>.</propmap>
</reprcomp></reprdef>
<note role="example">
<eg xml:space="preserve">&lt;xs:notation name="jpeg"
             public="image/jpeg" system="viewer.exe" /&gt;

&lt;xs:element name="picture"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:simpleContent&gt;
   &lt;xs:extension base="xs:hexBinary"&gt;
    &lt;xs:attribute name="pictype"&gt;
     &lt;xs:simpleType&gt;
      &lt;xs:restriction base="xs:NOTATION"&gt;
       &lt;xs:enumeration value="jpeg"/&gt;
       &lt;xs:enumeration value="png"/&gt;
       . . .
      &lt;/xs:restriction&gt;
     &lt;/xs:simpleType&gt;
    &lt;/xs:attribute&gt;
   &lt;/xs:extension&gt;
  &lt;/xs:simpleContent&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;

&lt;picture pictype="jpeg"&gt;...&lt;/picture&gt;</eg>

</note>
</div3>
    <div3>
     <head>Constraints on XML Representations of Notation Declarations</head>
 <constraintnote type="src" id="src-notation">
   <head>Notation Definition Representation OK</head>
   <p>In addition to the conditions imposed on <eltref ref="notation"/> element
information items by the schema for schemas, the corresponding notation definition <rfc2119>must</rfc2119> satisfy the conditions set
out in <specref ref="coss-notation"/>.</p>
  </constraintnote>
    </div3>
    <div3>
     <head>Notation Declaration Validation Rules</head>
     <p>None as such.</p>
    </div3>
    <div3>
     <head>Notation Declaration Information Set Contributions</head>
    <constraintnote id="sic-notation-used" type="sic">
     <head>Validated with Notation</head>
     <p>Whenever an attribute information item is <termref def="key-vn">valid</termref> with respect to a <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#NOTATION">NOTATION</xtermref>, in the <termref def="key-psvi">post-schema-validation infoset</termref> its
parent element information item <!--*
* material suppressed here by diff group rq144nv *
*--><phrase dg="rq144nv">has the following
properties</phrase>:</p>

<proplist item="element" role="psvi">
<propdef id="e-notation" name="notation">An <termref def="key-iso">item isomorphic</termref> to the notation declaration
whose <propref comp="nd" prop="name"/> and <propref comp="nd" prop="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 <termref def="key-vv">actual value</termref></propdef>

<propdef id="e-notation_system" name="notation system" dg="rq144nv">The value of the <propref comp="nd" prop="system identifier"/> of that notation
declaration.</propdef>
<propdef id="e-notation_public" name="notation public" dg="rq144nv">The value of the <propref comp="nd" prop="public identifier"/> of that notation
declaration.</propdef>

</proplist>

     <!--*
* material suppressed here by diff group rq144nv *
*-->
     <!--*
* material suppressed here by diff group rq144nv *
*-->
     <note>
      <p>For compatibility, only one such attribute <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><rfc2119>should</rfc2119></phrase> appear
on any given element.  If more than one such attribute
<emph>does</emph> appear, which one supplies the infoset property or
properties above is not defined.</p>
     </note>
    </constraintnote>
    </div3>
    <div3 id="coss-notation">
     <head>Constraints on Notation Declaration Schema Components</head>
  <p>All notation declarations (see <specref ref="cNotation_Declarations"/>) <rfc2119>must</rfc2119> satisfy the following constraint.</p>
  <constraintnote type="cos" id="n-props-correct">
   <head>Notation Declaration Correct</head>
     <p>The values of the properties of a notation declaration <rfc2119>must</rfc2119> be as described in
the property tableau in
<specref ref="Notation_Declaration_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>   
  </constraintnote>
    </div3>
   </div2>
   <div2 id="cAnnotations">
    <head>Annotations</head>
    <p>Annotations provide for human- and machine-targeted annotations of
schema components.</p>
    <note role="example">
      <eg xml:space="preserve">&lt;xs:simpleType fn:note="special"&gt;
  &lt;xs:annotation&gt;
   &lt;xs:documentation&gt;A type for experts only&lt;/xs:documentation&gt;
   &lt;xs:appinfo&gt;
    &lt;fn:specialHandling&gt;checkForPrimes&lt;/fn:specialHandling&gt;
   &lt;/xs:appinfo&gt;
  &lt;/xs:annotation&gt;
     </eg>
      <p>XML representations of three kinds of annotation.</p>
     </note>
<div3 id="Annotation_details">
     <head>The Annotation Schema Component</head>
    <p>The annotation schema component has the following
properties:</p>
<compdef name="Annotation" abbrev="a" showAKO="true"/>
    <p><propref comp="a" prop="user information"/> is intended for human consumption,
<propref comp="a" prop="application information"/> for automatic processing.  In both
cases, provision is made for an optional URI reference to supplement the local
information, as the value of the <code>source</code> attribute of the
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 comp="a" prop="user information"/>, indication <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><rfc2119>should</rfc2119></phrase> be given as to the identity of the (human) language used in the contents, using the <code>xml:lang</code> attribute.</p>
     <p><propref comp="a" prop="attributes"/> ensures that when schema authors take
advantage of the provision for adding attributes from namespaces other than the
XML Schema namespace to schema documents, they are available within the components
corresponding to the element items where such attributes appear.</p>
<issue id="RQ-19i" role="1.1" status="open">
<!--* <p><loc href="&reqs;#annotation-psvi" target="reqs">RQ-19 (annotation-psvi)</loc></p> *-->
<p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2851" target="reqs">Issue 2851 (RQ-19 annotations in PSVI)</loc></p>
<p>Out-of-band attributes were not always handled properly during component
construction from schema documents.  This is fixed by the overall reworking of
annotation construction described in <specref ref="RQ-131i"/>.</p>
<resolution>
<p>See <specref ref="RQ-131i"/>.</p>
</resolution>
</issue>

<p>Annotations do not participate in <termref def="key-vn">validation</termref> as such.  Provided
an annotation itself satisfies all relevant <termref def="gloss-cos">Schema
Component Constraints</termref> it <emph>cannot</emph> affect the <termref def="key-vn">validation</termref> of element information items.</p>
 <p>The name <compdef name="Annotated Component" abbrev="ac" role="termdef" showAKO="true">
covers all the different kinds of component which may have annotations.</compdef></p>
    </div3>
    <div3 id="declare-annotation">
<head>XML Representation of Annotation Schema Components</head>
 <p>Annotation of schemas and schema components, with material for human or
computer consumption, is provided for by allowing application information and
human information at the beginning of most major schema elements, and anywhere
at the top level of schemas.  The XML representation for an annotation schema component is
an
<eltref ref="annotation"/>
element information item.    The correspondences between the
properties of that information item and
properties of the component it corresponds to are as follows:</p>
 <reprdef>
 <reprelt eltname="annotation"/>
 <reprelt eltname="appinfo"/>
 <reprelt eltname="documentation"/>
 <reprcomp abstract="Annotation" ref="Annotation_details">
<propmap comp="a" prop="application information">A sequence of the <eltref ref="appinfo"/> element
information items from among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, in order, if any, otherwise the
empty sequence.</propmap>
<propmap comp="a" prop="user information">A sequence of the <eltref ref="documentation"/> element
information items from among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, in order, if any, otherwise the
empty sequence.</propmap>
  <propmap comp="a" prop="attributes">A sequence of attribute information items, namely
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>
</reprcomp></reprdef>
<p>The annotation component corresponding to the <eltref ref="annotation"/>
element in the example above will have one element item in each of its <propref comp="a" prop="user information"/> and <propref comp="a" prop="application information"/> and one attribute item in its <propref comp="a" prop="attributes"/>.</p></div3>
    <div3>
     <head>Constraints on XML Representations of Annotations</head>
 <constraintnote type="src" id="src-annotation">
   <head>Annotation Definition Representation OK</head>
   <p>In addition to the conditions imposed on <eltref ref="annotation"/> element
information items by the schema for schemas, the corresponding annotation <rfc2119>must</rfc2119> satisfy the conditions set
out in <specref ref="coss-annotation"/>.</p>
  </constraintnote>
    </div3>
    <div3>
     <head>Annotation Validation Rules</head>
     <p>None as such.</p>
    </div3>
    <div3>
     <head>Annotation Information Set Contributions</head>
     <p>None as such: the addition of annotations to the <termref def="key-psvi">post-schema-validation infoset</termref> is
covered by the <termref def="key-psvi">post-schema-validation infoset</termref> contributions of the enclosing components.</p>
    </div3>
    <div3 id="coss-annotation">
     <head>Constraints on Annotation Schema Components</head>
  <p>All annotations (see <specref ref="cAnnotations"/>) <rfc2119>must</rfc2119> satisfy the following constraint.</p>
  <constraintnote type="cos" id="an-props-correct">
   <head>Annotation Correct</head>
   <p>The values of the properties of an annotation <rfc2119>must</rfc2119> be as described in
the property tableau in
<specref ref="Annotation_details"/>, modulo the impact of <specref ref="conformance-missing"/>.</p>
  </constraintnote>
    </div3>
   </div2>
<div2 id="Simple_Type_Definitions">
    <head>Simple Type Definitions</head>
 <note>
  <p>This section consists of a combination of <!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">copies</phrase> of
normative material from <bibref ref="ref-xsp2"/>, for local cross-reference
purposes, and<!--*
* material suppressed here by diff group eg-1852 *
*--> material
<phrase dg="eg-1852">unique to this specification, </phrase>relating to the interface between schema
components defined in this specification and the simple type definition component.</p>
 </note>
    <p>Simple type definitions provide for constraining character information item <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of element and attribute
information items.</p>
<note role="example">
      <eg xml:space="preserve">&lt;xs:simpleType name="fahrenheitWaterTemp"&gt;
 &lt;xs:restriction base="xs:<!--*
* material suppressed here by diff group b1915bis *
*--><phrase dg="b1915bis">decimal</phrase>"&gt;
  &lt;xs:fractionDigits value="2"/&gt;
  &lt;xs:minExclusive value="0.00"/&gt;
  &lt;xs:maxExclusive value="100.00"/&gt;
 &lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;</eg>
 <p>The XML representation of a simple type definition.</p>
     </note>
    <div3 id="Simple_Type_Definition_details">
     <head><!--*
* material suppressed here by diff group eg-1852 *
*-->The Simple Type Definition Schema Component</head>
<p>The simple type definition schema component has the following properties:
</p>
 <compdef name="Simple Type Definition" abbrev="std" showAKO="true"/>
 <!--*
* material suppressed here by diff group ep01-part1 *
*-->
   
<p>Simple types are identified by their <propref comp="std" prop="name"/> and <propref comp="std" prop="target namespace"/>.  Except
for anonymous simple types (those with no <propref comp="std" prop="name"/>), since
type definitions (i.e. both simple and complex type definitions taken together) <rfc2119>must</rfc2119> be uniquely identified within an <termref def="key-schema">XML
Schema</termref>, no simple type definition can have the same name as another
simple or complex type definition.  Simple type <propref comp="std" prop="name"/>s and <propref comp="ctd" prop="target namespace"/>s
are provided for reference from
instances (see <specref ref="xsi_type"/>), and for use in the XML
representation of schema components
(specifically in <eltref ref="element"/> and <eltref ref="attribute"/>).  See <specref ref="composition-schemaImport"/> for the use of component
identifiers when importing one schema into another.</p>
<note>
<p>The <propref comp="std" prop="name"/> of a simple type is not <emph>ipso
facto</emph> the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">(local) name</xpropref> of the
  element or attribute information items <termref def="key-vn">validated</termref> by that definition. The connection between a
  name and a type definition is described in <specref ref="cElement_Declarations"/> and <specref ref="cAttribute_Declarations"/>. </p>
</note>
     <p>A simple type definition with an empty specification for <propref comp="std" prop="final"/> can be used as the
<propref comp="std" prop="base type definition"/> for other types <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> by either of
extension or restriction, or as the <propref comp="std" prop="item type definition"/> in
the definition of a list, or in the <propref comp="std" prop="member type definitions"/> of
a union; the explicit values <pt>extension</pt>, <pt>restriction</pt>,
<pt>list</pt> and <pt>union</pt> prevent further
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derivations</xtermref> by extension (to yield a complex type) and restriction (to yield a
simple type) and use in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructing</xtermref> lists and unions respectively.</p>
<p><propref comp="std" prop="variety"/> determines whether the simple type corresponds to
an <pt>atomic</pt>, <pt>list</pt> or <pt>union</pt> type as defined by <bibref ref="ref-xsp2"/>.</p> 
<p>As described in <specref ref="Type_Derivation"/>, every simple type definition is
a <termref def="key-typeRestriction">restriction</termref> of some other simple
type (the <propref comp="std" prop="base type definition"/>), which is the <termref def="key-simpleUrType">simple ur-type definition</termref> if and only if the type
definition in question is <!--*
* material suppressed here by diff group eg-1852 *
*--><termref dg="eg-1852" def="key-anyAtomicType"/> or a list or
union type definition which is not itself <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> by restriction from a
list or union respectively.<phrase dg="eg-1852">A type definition
has <termref dg="eg-1852" def="key-anyAtomicType"/> as its <propref comp="std" prop="base type definition"/> if and only if it is one of the built-in primitive datatypes.</phrase>  Each
<emph>atomic</emph> type is ultimately a restriction of exactly one such
built-in primitive datatype, which is its <propref comp="std" prop="primitive type definition"/>.</p>
<p><propref comp="std" prop="facets"/> for each simple type definition are selected from those defined in
<bibref ref="ref-xsp2"/>.  For <pt>atomic</pt> definitions, these are restricted to those appropriate for
the corresponding <propref comp="std" prop="primitive type definition"/>.  Therefore, the value
space and lexical space (i.e. what is <termref def="key-vn">validated</termref> by any atomic simple type) is determined by the
pair (<propref comp="std" prop="primitive type definition"/>, <propref comp="std" prop="facets"/>). </p>
<p>As specified in <bibref ref="ref-xsp2"/>, <pt>list</pt> simple type definitions <termref def="key-vn">validate</termref> space separated tokens, each of
which conforms to a specified simple type definition, the <propref comp="std" prop="item type definition"/>.  The item type specified
<rfc2119>must not</rfc2119> itself be a <pt>list</pt> type, and <rfc2119>must</rfc2119> be one of the types identified in <bibref ref="ref-xsp2"/> as a
suitable item type for a list simple type.  In this case the <propref comp="std" prop="facets"/>
apply to the list itself, and are restricted to those appropriate for lists.</p>
<p>A <pt>union</pt> simple type definition <termref def="key-vn">validates</termref> strings which satisfy at
least one of its <propref comp="std" prop="member type definitions"/>.  As in the case of
<pt>list</pt>, the <propref comp="std" prop="facets"/>
apply to the union itself, and are restricted to those appropriate for unions.</p>
 
 <p>The <termref def="key-simpleUrType">simple ur-type definition</termref>
<phrase dg="eg-1852">or <termref def="key-anyAtomicType"/> </phrase><rfc2119>must</rfc2119> <emph>not</emph> be named as the <propref comp="std" prop="base type definition"/> of any user-defined atomic simple type definitions:  as <!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">they allow</phrase> no constraining facets, this would be incoherent.</p>
     <p>See <specref ref="cAnnotations"/> for information on the role of the
<propref comp="std" prop="annotations"/> property.</p>
    </div3>
 <div3 id="declare-datatype">
  <head><!--*
* material suppressed here by diff group eg-1852 *
*-->XML Representation of Simple Type Definition Schema Components</head>
<note>
<p>This section reproduces a version of material from <bibref ref="ref-xsp2"/>, for 
local cross-reference purposes.</p>
 </note>
 <reprdef>
 <reprelt eltname="simpleType" type="simpleType"/>
 <reprelt eltname="restriction"/>
 <reprelt eltname="list"/>
 <reprelt eltname="union"/>
 <reprcomp abstract="Simple Type Definition" ref="Simple_Type_Definition_details">
  <propmap comp="std" prop="name">The <termref def="key-vv">actual value</termref> of the <code>name</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> 
if present<phrase dg="std-1915"> on the <eltref ref="simpleType"/> element</phrase>, 
otherwise <termref def="key-null">absent</termref>.</propmap>
  <propmap comp="std" prop="target namespace">The <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of 
the <phrase dg="std-1915">parent</phrase> <eltref ref="schema"/> 
<!--*
* material suppressed here by diff group std-1915 *
*-->element information item if present, 
otherwise <termref def="key-null">absent</termref>.</propmap>
  <propmap comp="std" prop="base type definition">
   <olist role="Caseval">
    <item>
     <p role="if">the <eltref ref="restriction"/> alternative is chosen</p>
     <p role="then">the type definition <termref def="src-resolve">resolved</termref> to by the
<termref def="key-vv">actual value</termref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <eltref ref="restriction"/>, if present, otherwise the
type definition corresponding to the <eltref ref="simpleType"/> among
the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="restriction"/>.</p>
    </item>
    <item>
     <p role="if">the <eltref ref="list"/> or <eltref ref="union"/> alternative is chosen</p>
     <p role="then"><!--*
* material suppressed here by diff group std-1915 *
*--><phrase dg="std-1915"><termref def="simple-ur-type-itself">anySimpleType</termref></phrase>.</p>
    </item>
   </olist>
  </propmap>
  <!--*
* material suppressed here by diff group std-1915 *
*-->
<propmap comp="std" prop="final" dg="std-1915">
A subset of 
<code>{</code><pt>restriction</pt>, <pt>extension</pt>, <pt>list</pt>,
<pt>union</pt><code>}</code>, determined as follows.
<termdef role="local" term="FS" id="lt-vs">Let
<term>FS</term> be
the <termref def="key-vv">actual value</termref> of the
<att>final</att> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, 
if present, otherwise the <termref def="key-vv">actual value</termref> of the
<att>finalDefault</att> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the ancestor
<el>schema</el> element, 
if present, otherwise the empty string.</termdef>  Then the property value is
<olist role="caseval">
    <item>
     <p role="if"><termref def="lt-vs">FS</termref> is the empty string</p>
     <p role="then">the empty set;</p>
    </item>
    <item>
     <p role="if"><termref def="lt-vs">FS</termref> is 
<!--* MSM is not sure how to tag '#all' here.  In datatypes, it's tagged 'string',
    * but 'string' appears not to be in the Structures DTD.  I continue to find
    * the lack of any coherent story about phrase-level markup a depressing
    * feature of working on these documents. 
    * For now, I'll tag this 'code' inside 'quote'.
    *-->
<quote><code>#all</code></quote></p>
     <p role="then"><code>{</code><pt>restriction</pt>, <pt>extension</pt>, <pt>list</pt>,
<pt>union</pt><code>}</code>;</p>
    </item>
    <item>
     <p role="otherwise">Consider <termref def="lt-vs">FS</termref> as
a space-separated list, and include <pt>restriction</pt> if
<!--* code / string *-->
<quote><code>restriction</code></quote> is in that list, and similarly for
<pt>extension</pt>, <pt>list</pt> and <pt>union</pt>.
</p>
      <!-- HST doesn't think this is actually true 
       <p>Although the <att>finalDefault</att> &i-attribute; of
       <el>schema</el> may include other values,
       those values
       &must; be ignored in the determination of <propref comp="std" prop="final"/>
       </p> -->
</item>
</olist>
</propmap>
  <propmap comp="std" prop="context" dg="eg-1852">
  <olist role="Caseval">
   <item>
    <p role="if">the
<att>name</att> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present</p>
    <p role="then"><termref def="key-null">absent</termref></p>
   </item>
   <item>
    <p role="otherwise">
     <olist role="caseval">
     <item>
    <p role="if">the parent element information item is <eltref ref="attribute"/></p>
    <p role="then">the corresponding <compref name="Attribute Declaration" ref="ad"/></p>
   </item>
   <item>
    <p role="if">the parent element information item is <eltref ref="element"/></p>
    <p role="then">the corresponding <compref name="Element Declaration" ref="ed"/></p>
   </item>
   <item>
    <p role="if">the parent element information item is <eltref ref="list"/> or <eltref ref="union"/></p>
    <p role="then">the <compref name="Simple Type Definition" ref="std"/>
corresponding to the grandparent <eltref ref="simpleType"/> element information item</p>
   </item>
      <item>
    <p role="otherwise">(the parent element information item is <eltref ref="restriction"/>), 
     <olist role="caseval">
      <item>
       <p role="if">the grandparent element information item is <eltref ref="simpleType"/></p>
       <p role="then">the <compref name="Simple Type Definition" ref="std"/>
corresponding to the grandparent</p>
      </item>
      <item>
       <p role="otherwise">(the grandparent element information item is <eltref ref="simpleContent"/>), 
     the <compref name="Simple Type Definition" ref="std"/> which is the
<propref comp="ctd" prop="content type"/> of the <compref name="Complex Type Definition" ref="ctd"/>
corresponding to the great-grandparent <eltref ref="complexType"/> element information item.</p>
      </item>
     </olist>
    </p>
   </item>
    </olist>
    </p>
   </item>
  </olist>
 </propmap>
  <propmap comp="std" prop="variety">If the <eltref ref="list"/> alternative is chosen,
then <pt>list</pt>, otherwise if the <eltref ref="union"/> alternative is
chosen, then <pt>union</pt>, otherwise (the <eltref ref="restriction"/>
alternative is chosen), then the <propref comp="std" prop="variety"/>
of the <propref comp="std" prop="base type definition"/>.</propmap>
<propmap comp="std" prop="facets" dg="rec12-map"><olist role="Caseval">
<item>
<p role="if">the <eltref ref="restriction"/> alternative is chosen</p>
<p role="then">then a set of <compref ref="f" name="Constraining Facet"/> components <termref def="key-facets-restriction">constituting a restriction</termref>
of the <propref comp="std" prop="facets"/> of the
<propref comp="std" prop="base type definition"/> with respect to a
set of <compref ref="f" name="Constraining Facet"/> components corresponding to the appropriate element information items among the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="restriction"/> (i.e. those which specify facets, if any), as
defined in <specref ref="st-restrict-facets"/>.</p></item>
<item dg="std-1915">
<p role="if">the <eltref ref="list"/> alternative is chosen</p>
<p role="then">a set with one member, a <compref ref="f-w" name="whiteSpace"/> facet with 
<xpropref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#f-w-value" role="comp">value</xpropref> = <pt>collapse</pt> and <xpropref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#f-w-fixed" role="comp">fixed</xpropref> = <pt>true</pt>.</p>
</item>
<item><p role="otherwise">the empty set</p></item></olist>
</propmap>
  <propmap comp="std" prop="fundamental facets" dg="eg-1852">Based on
<propref comp="std" prop="variety"/>, <propref comp="std" prop="facets"/>,
<propref comp="std" prop="base type definition"/> and <propref comp="std" prop="member type definitions"/>, a set of <compref ref="ff" name="Fundamental Facet"/> components, one
each as specified in <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dc-ordered">The ordered Schema Component </xspecref>, <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dc-bounded">The bounded Schema Component </xspecref>,
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dc-cardinality">The cardinality Schema Component </xspecref> and <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dc-numeric">The numeric Schema Component </xspecref>.</propmap>
  <propmap comp="std" prop="annotations">
A sequence of <compref ref="a"/><phrase dg="std-1915"> component</phrase>s 
corresponding to
<olist>
  <item><p>
 the <eltref ref="annotation"/>
element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present;</p></item>
  <item><p>If the <eltref ref="restriction"/> alternative is chosen,
then
 the <eltref ref="annotation"/>
element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of the <eltref ref="restriction"/>, if present;</p></item>
  <item><p>If the <eltref ref="list"/> alternative is chosen,
then
 the <eltref ref="annotation"/>
element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of the <eltref ref="list"/>,
 if present;</p></item>
  <item><p>If the <eltref ref="union"/> alternative is chosen,
then
 the <eltref ref="annotation"/>
element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of the <eltref ref="union"/>,
 if present;</p></item>
</olist>
</propmap>
</reprcomp>
 <!--*
* material suppressed here by diff group std-1915 *
*-->

<p dg="std-1915">
<termdef term="ancestor" id="std-ancestor">The
<term>ancestors</term> of a 
<termref def="td">type definition</termref> are its 
<propref comp="std" prop="base type definition"/> and the 
<termref def="std-ancestor">ancestors</termref> of its 
<propref comp="std" prop="base type definition"/>.</termdef>
(The ancestors of a 
<compref ref="std"/> <var>T</var> in the type hierarchy are themselves
<termref def="td">type definitions</termref>; they are distinct from
the XML elements which may be ancestors, in the XML document
hierarchy, of the <eltref ref="simpleType"/> element which 
declares <var>T</var>.)
</p>

  <p>If the <propref comp="std" prop="variety"/> is <pt>atomic</pt>, the following
additional property <!--*
* material suppressed here by diff group rec12-map *
*--><phrase dg="rec12-map">mapping also applies</phrase>:</p>
  <reprcomp abstract="Atomic Simple Type Definition" ref="Simple_Type_Definition_details">
   <propmap comp="std" prop="primitive type definition"><!--*
* material suppressed here by diff group rec12-map *
*--><phrase dg="rec12-main"><!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="std-1915"><!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">From</phrase> among the <termref def="std-ancestor">ancestors</termref> of this <compref ref="std"/>, that <compref ref="std"/> which corresponds to a <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-primitive">primitive</xtermref> datatype</phrase>.</phrase></propmap>
<!--* MSM is puzzled by the fact that this property mapping rule, clearly 
    * labeled del, nevertheless shows up as status quo text in the
    * omnibus proposal of 7 September. 
    * This really does need to go away, as part of std-1915 if for no
    * other reason. *-->
   <!--*
* material suppressed here by diff group rec12-map *
*-->
</reprcomp>
  <p>If the <propref comp="std" prop="variety"/> is <pt>list</pt>, the following
additional property <!--*
* material suppressed here by diff group rec12-map *
*--><phrase dg="rec12-map">mapping also applies</phrase>:</p>
  <reprcomp abstract="List Simple Type Definition" ref="Simple_Type_Definition_details">
   <!--* we could just mark the deletion and add of specific item elements, but that
       * confuses diffspec_custom.xsl.  This rude whack is easier than
       * fixing the stylesheet. *-->
   <!--*
* material suppressed here by diff group std-1915 *
*-->
   <propmap comp="std" prop="item type definition" dg="std-1915">
    <olist role="Caseval">
     <item>
      <p role="if">the <propref comp="std" prop="base type definition"/> is <termref def="simple-ur-type-itself">anySimpleType</termref></p>

      <p role="then">the <compref ref="std"/> (a) <termref def="src-resolve">resolved</termref> 
to by the
<termref def="key-vv">actual value</termref> of the <code>itemType</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <eltref ref="list"/>,
or (b), corresponding to the <eltref ref="simpleType"/> among
the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="list"/>, whichever is present.
      <note>
<p><!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">In
this case, a</phrase> <eltref ref="list"/> element will invariably be present; it will
invariably have either an <code>itemType</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> or a <eltref ref="simpleType"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">child</xpropref>, but not both.</p>
</note>
      </p>
     </item>
     <item>

      <p role="otherwise">(that is, the <propref comp="std" prop="base type definition"/> is not <termref def="simple-ur-type-itself">anySimpleType</termref>), the <propref comp="std" prop="item type definition"/> of the <propref comp="std" prop="base type definition"/>.
       <note dg="eg-1852">
        <p>In this case, a <eltref ref="restriction"/> element will invariably
be present.</p>
       </note>
      </p>
     </item>
    </olist>
   </propmap>
   <!--*
* material suppressed here by diff group rec12-map *
*-->
</reprcomp>
  <p>If the <propref comp="std" prop="variety"/> is <pt>union</pt>, the following
additional property <!--*
* material suppressed here by diff group rec12-map *
*--><phrase dg="rec12-map">mapping also applies</phrase>:</p>
  <reprcomp abstract="Union Simple Type Definition" ref="Simple_Type_Definition_details">
   <!--*
* material suppressed here by diff group std-1915 *
*-->
   <propmap comp="std" prop="member type definitions" dg="std-1915"><olist role="Caseval">
     <item>
      <p role="if">the <propref comp="std" prop="base type definition"/> is <termref def="simple-ur-type-itself">anySimpleType</termref></p>
      <p role="then"><!--*
* material suppressed here by diff group b2333 *
*--><phrase dg="b2333">the</phrase> sequence of 
<!--*
* material suppressed here by diff group b2333 *
*--> <compref ref="std"/>s (a) 
<termref def="src-resolve">resolved</termref> to by the items in the
<termref def="key-vv">actual value</termref> of the <code>memberTypes</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <eltref ref="union"/>,
if any<phrase dg="b2333">,</phrase> and (b)<!--*
* material suppressed here by diff group b2333 *
*--> 
corresponding to the <eltref ref="simpleType"/>s among
the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="union"/>, if any, in order.  
<!--*
* material suppressed here by diff group b2333 *
*-->
      <note>
<p><!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">In
this case, a</phrase> <eltref ref="union"/> element will invariably be present; it will
invariably have either a <code>memberTypes</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> or one or more <eltref ref="simpleType"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, or both.</p>
</note>
</p>
     </item>
     <item>
      <p role="otherwise">(that is, the <propref comp="std" prop="base type definition"/> is not <termref def="simple-ur-type-itself">anySimpleType</termref>), the <propref comp="std" prop="member type definitions"/> of the <propref comp="std" prop="base type definition"/>.
      <note dg="eg-1852">
        <p>In this case, a <eltref ref="restriction"/> element will invariably
be present.</p>
       </note></p>
     </item>
    </olist>
<!--* N.B. the following note appears both here and in Datatypes.
    * Any changes must be made in both places.
    *-->
<ednote diff="nsq-add" role="pf" dg="b2333-feedback">
<!--* <name>Priority Feedback Request</name> *-->
<edtext>
Note that the rule just given allows <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-union">unions</xtermref> to be members of other
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-union">unions</xtermref>.  This is a change from version 1.0 of this specification,
which prohibited <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-union">unions</xtermref> in <propref comp="std" prop="member type definitions"/> and replaced any reference to a <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-union">union</xtermref> <var>M</var>,
in the XML declaration of a second <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-union">union</xtermref> <var>U</var>, with the
members of <var>M</var>.  This had the unintended consequence that
that if <var>M</var> had facets they were lost, and <var>U</var>
erroneously accepted values not accepted by <var>M</var>.  In order to
correct this error, this version of this specification allows <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-union">unions</xtermref>
in <propref comp="std" prop="member type definitions"/> and removes
the wording which replaced references to <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-union">unions</xtermref> with their members.
<!--* oh, for a paragraph break *-->
The XML Schema Working Group solicits input from implementors and
users of this specification as to whether this change is an acceptable
way of repairing the problem in version 1.0 of this specification, or
whether it would be preferable to allow <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-union">unions</xtermref> as members of other
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-union">unions</xtermref> only if they have an empty <propref comp="std" prop="facets"/> property. If such a change would make this
specification more (or less) attractive to users or implementors,
please let us know.
</edtext>

</ednote>

   </propmap>
   <!--*
* material suppressed here by diff group rec12-map *
*-->
</reprcomp>
 </reprdef>
</div3>
    <div3>
     <head>Constraints on XML Representations of Simple Type Definitions</head>
     <constraintnote type="src" id="src-simple-type">
      <head>Simple Type Definition Representation OK</head>
      <p>In addition to the conditions imposed on <eltref ref="simpleType"/> element
information items by the schema for schemas,
   <olist role="and">
    <item>
     <p>The corresponding simple type definition, if any, <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">satisfies</phrase> the conditions set out in <specref ref="coss-st"/>.</p>
    </item>
    <item><p>If the <eltref ref="restriction"/> alternative is chosen,
either it <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> a <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>
or a <eltref ref="simpleType"/> among its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, but not
both.</p>
    </item>
    <item><p>If the <eltref ref="list"/> alternative is chosen, either
it <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> an <code>itemType</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> or a <eltref ref="simpleType"/> among its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>,
but not both.</p>
    </item>
    <item dg="eg-1852">
     <p>
If the <eltref ref="union"/> alternative is chosen, either it <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> a non-empty <code>memberTypes</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> or
it <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> at least one <code>simpleType</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">child</xpropref>.</p>
    </item>
    <item>

<p><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">There are no
circular union type definitions.</phrase> That is, if the <eltref ref="union"/> alternative is chosen, there <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are no</phrase> entries in the <code>memberTypes</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> <!--*
* material suppressed here by diff group b2333 *
*-->which resolve to <phrase dg="b2333">simple types
with <propref comp="std" prop="variety"/> <pt>union</pt> which
include among their
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-transitivemembership">transitive
membership</xtermref></phrase> the component corresponding to the <eltref ref="simpleType"/>.</p>

     </item>
    <item dg="rec12-main">
     <p>With the exception of <eltref ref="enumeration"/> and <eltref ref="pattern"/>, the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="restriction"/> <rfc2119>must not</rfc2119> contain more than one element information item with the same name.</p>
    </item>
   </olist>
  </p>
     </constraintnote>
    </div3>
    <div3>
     <head>Simple Type Definition Validation Rules</head>
 <constraintnote type="cvc" id="cvc-simple-type">
 <head>String Valid</head>
 <p>For a string to be locally <termref def="key-vn">valid</termref> with respect to a simple type definition 
  <olist role="and">
   <item>
    <p>It is schema-valid with respect to that definition as defined by
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#cvc-datatype-valid">Datatype Valid</xtermref> in <bibref ref="ref-xsp2"/>.</p>    
   </item>
   <item>
    <olist role="Casetest">
     <item>
      <p role="if">The definition is <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ENTITY">ENTITY</xtermref> or is validly
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ENTITY">ENTITY</xtermref> given the empty set,
as defined in <specref ref="cos-st-derived-ok"/></p>
      <p role="then">the string <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a <termref def="key-vde">declared
entity name</termref>.</p>
     </item>
     <item>
      <p role="if">The definition is <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ENTITIES">ENTITIES</xtermref> or is validly
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ENTITIES">ENTITIES</xtermref> given the empty set,
as defined in <specref ref="cos-st-derived-ok"/></p>
      <p role="then">every whitespace-delimited substring of the string <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a <termref def="key-vde">declared
entity name</termref>.</p>
     </item>
     <item>
      <p role="otherwise">no further condition applies.</p>
     </item>
    </olist>
   </item>
  </olist>
 </p>
  <p><termdef id="key-vde" term="declared entity name">A string is a
<term>declared entity name</term> if<phrase dg="iff"> and only if</phrase> it is equal to the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.entity.unparsed">name</xpropref> 
of some unparsed entity information item in the value of the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.document">unparsedEntities</xpropref> 
property of the document information item at the root of the infoset
containing the element or attribute information item whose <termref def="key-nv">normalized value</termref>
the string is.</termdef></p>
</constraintnote>
    </div3>
    <div3>
     <head>Simple Type Definition Information Set
Contributions</head>
     <p>None as such.</p>
    </div3>
    <div3 id="coss-st">
     <head>Constraints on Simple Type Definition
Schema Components</head>
  <p>All simple type definitions<!--*
* material suppressed here by diff group eg-1852 *
*--> <rfc2119>must</rfc2119> satisfy both the following constraints.</p>
  <constraintnote type="cos" id="st-props-correct">
   <head>Simple Type Definition Properties Correct</head>
   <olist role="And">
    <item><p>The values of the properties of a simple type definition <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as described in
the property tableau in
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dc-defn"><!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main">The Simple Type Definition Schema Component</phrase></xspecref>, modulo the impact of <specref ref="conformance-missing"/>.</p></item>
    <item><p>All simple type definitions <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref>
ultimately from the <termref def="simple-ur-type-itself">simple ur-type
definition (so</termref> circular definitions are disallowed).  That is, it <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> possible to reach a built-in
primitive datatype or the <termref def="simple-ur-type-itself">simple ur-type definition</termref> by repeatedly following the <propref comp="std" prop="base type definition"/>.</p></item>
    <item>
      <p>The <propref comp="std" prop="final"/> of the <propref comp="std" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">does not</phrase> contain <pt>restriction</pt>.</p>
    </item>
    <item dg="rec12-main">
     <p>There <rfc2119>must not</rfc2119> be more than one member of <propref comp="std" prop="facets"/> of the same kind.</p>
    </item>
   </olist>
  </constraintnote>

  <constraintnote type="cos" id="cos-st-restricts">
<head>Derivation Valid (Restriction, Simple)</head>
   <olist role="Case">
    <item>
     <p role="if">the <propref comp="std" prop="variety"/> is <pt>atomic</pt></p>
     <p role="then">
      <olist role="andtest">
      <item>
       <p><!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">With one exception, the</phrase> <propref comp="std" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> an atomic simple type
definition<!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852">The exception is
<termref def="aat-def">anyAtomicType</termref>, which has <termref def="simple-ur-type-itself">anySimpleType</termref>, whose
<propref comp="std" prop="variety"/> is <termref def="key-null"/>, as its <propref comp="std" prop="base type definition"/></phrase></p>
      </item>
       <item>
           <p>The <propref comp="std" prop="final"/> of the <propref comp="std" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">does not</phrase> contain <pt>restriction</pt>.</p>
          </item>
      <item>
       <p>For each facet in the <propref comp="std" prop="facets"/> (call this <local>DF</local>) 
        <olist role="andtest">
         <item>
          <p><local>DF</local> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> an allowed constraining facet for the
<propref comp="std" prop="primitive type definition"/>, as specified in the appropriate
subsection of <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#built-in-primitive-datatypes">3.2 Primitive datatypes</xspecref>.</p>
         </item>
         <item>
          <p>If there is a facet of the same kind in the
<propref comp="std" prop="facets"/> of the <propref comp="std" prop="base type definition"/> (call
this <local>BF</local>), then the <local>DF</local>'s
<xpropref role="anon">value</xpropref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a valid restriction of <local>BF</local>'s <xpropref role="anon">value</xpropref>  as
defined in <bibref ref="ref-xsp2"/>.</p>
         </item>
        </olist>
        </p>
      </item>
     </olist></p>
    </item>
    <item>
       <p role="if">the <propref comp="std" prop="variety"/> is <pt>list</pt></p>
       <p role="then">
        <olist role="andtest">
        <item>
         <p>The <propref comp="std" prop="item type definition"/>
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> a <propref comp="std" prop="variety"/> of
<pt>atomic</pt> or <pt>union</pt> (in which case 
<!--*
* material suppressed here by diff group b2333 *
*--><phrase dg="b2333">there <rfc2119>must</rfc2119> be no
types whose <propref comp="std" prop="variety"/> is <pt>list</pt> among
the union's <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-transitivemembership">transitive
membership</xtermref></phrase>).</p>
        </item>
        <item>
         <olist role="Casetest">
          <item>
           <p role="if">the <propref comp="std" prop="base type definition"/>
is  the
<termref def="simple-ur-type-itself">simple ur-type definition</termref>        
          </p>
           <p role="then">
            <olist role="andtest">
            <item>
           <p>The <propref comp="std" prop="final"/> of the <propref comp="std" prop="item type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">does not</phrase> contain <pt>list</pt>.</p>
          </item>
            <item>
             <p>The <propref comp="std" prop="facets"/> <!--*
* material suppressed here by diff group modals *
*--> <phrase dg="modals">contains only</phrase> the
<pt>whiteSpace</pt> facet component.</p>
            </item>
           </olist>
           </p>
          </item>
          <item>
           <p role="otherwise">
            <olist role="andtest">
            <item>
             <p>The <propref comp="std" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> a <propref comp="std" prop="variety"/> of <pt>list</pt>.</p>
            </item>
            <item>
           <p>The <propref comp="std" prop="final"/> of the <propref comp="std" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">does not</phrase> contain <pt>restriction</pt>.</p>
          </item>
             <item>
              <p>The <propref comp="std" prop="item type definition"/>
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from the <propref comp="std" prop="base type definition"/>'s <propref comp="std" prop="item type definition"/>
given the empty set, as defined in <specref ref="cos-st-derived-ok"/>.</p>
             </item>
             <item><p>Only <pt>length</pt>, <pt>minLength</pt>, <pt>maxLength</pt>, <pt>whiteSpace</pt>,
<pt>pattern</pt> and <pt>enumeration</pt> facet components are allowed among
the <propref comp="std" prop="facets"/>.</p></item>
            <item>
             <p>For each facet in the <propref comp="std" prop="facets"/> (call this <local>DF</local>), if there is a facet of the same kind in the
<propref comp="std" prop="facets"/> of the <propref comp="std" prop="base type definition"/> (call
this <local>BF</local>), then the <local>DF</local>'s
<xpropref role="anon">value</xpropref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a valid restriction of <local>BF</local>'s <xpropref role="anon">value</xpropref>  as
defined in <bibref ref="ref-xsp2"/>.</p>
            </item>
           </olist>
           </p>
          </item>
         </olist>
          <p>The first case above will apply when a list is <!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> by
specifying an item type, the second when <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> by restriction from another list.</p>
         </item>
       </olist></p>
      </item>
    <item>
       <p role="if">the <propref comp="std" prop="variety"/> is <pt>union</pt></p>
       <p role="then">
        <olist role="andtest">
        <!--*
* material suppressed here by diff group b2333 *
*-->
        <item>
         <olist role="Casetest">
          <item>
           <p role="if">the <propref comp="std" prop="base type definition"/> is  the <termref def="simple-ur-type-itself">simple
ur-type definition</termref>        
          </p>
           <p role="then">
            <olist role="andtest">
            <item>
           <p>All of the <propref comp="std" prop="member type definitions"/> <!--*
* material suppressed here by diff group modals *
*--> have a
<propref comp="std" prop="final"/> which does not contain <pt>union</pt>.</p>
          </item>
            <item>
             <p>The <propref comp="std" prop="facets"/> <phrase dg="modals">property</phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> empty.</p>
            </item>
           </olist>
           </p>
          </item>
          <item>
           <p role="otherwise">
            <olist role="andtest">
            <item>
             <p>The <propref comp="std" prop="base type definition"/>
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> a <propref comp="std" prop="variety"/> of
<pt>union</pt>.</p>
            </item>
            <item>
           <p>The <propref comp="std" prop="final"/> of the <propref comp="std" prop="base type definition"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">does not</phrase> contain
<pt>restriction</pt>.</p>
          </item>
             <item>
              <p>The <propref comp="std" prop="member type definitions"/><!--*
* material suppressed here by diff group modals *
*-->
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> <phrase dg="modals">each</phrase> validly
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from the corresponding type definitions in the
<propref comp="std" prop="base type definition"/>'s <propref comp="std" prop="member type definitions"/> given the empty set, as
defined in <specref ref="cos-st-derived-ok"/>.</p>
             </item>
             <item><p>Only <pt>pattern</pt> and <pt>enumeration</pt>
facet components are allowed among the <propref comp="std" prop="facets"/>.</p></item>
            <item>
             <p>For each facet in the <propref comp="std" prop="facets"/> (call this <local>DF</local>), if there is a facet of
the same kind in the
<propref comp="std" prop="facets"/> of the <propref comp="std" prop="base type definition"/> (call this <local>BF</local>),then the
<local>DF</local>'s <xpropref role="anon">value</xpropref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a
valid restriction of <local>BF</local>'s <xpropref role="anon">value</xpropref>  as defined in <bibref ref="ref-xsp2"/>.</p>
            </item>
           </olist>
           </p>
          </item>
         </olist>
          <p>The first case above will apply when a union is
<!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> by specifying one or more member types, the second
when <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> by restriction from another union.</p>
</item>
<!--*
* material suppressed here by diff group b2333 *
*-->
<item dg="b2333">
<p>The <compref ref="std"/> is not a member of its
own <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-transitivemembership">transitive 
membership</xtermref>.</p>
</item>
</olist></p>
</item>
   </olist>
   <p><!--*
* material suppressed here by diff group iff *
*-->.</p>
</constraintnote>

<p dg="iff"><termdef id="cd-st-restriction" term="valid restriction">A
simple type definition <local>T</local> is a 
<term>valid restriction</term> of its <propref comp="std" prop="base type definition"/>
if and only if <local>T</local> satisfies constraint 
<specref ref="cos-st-restricts"/></termdef>.</p>

<p>The following constraint defines relations appealed to elsewhere in
this specification.</p>
<constraintnote id="cos-st-derived-ok" type="cos">
<head>Type Derivation OK (Simple)</head>
<p>For a simple type definition (call it <local>D</local>, for
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref>) to be validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from a type definition (call this
<local>B</local>, for base) given a subset of {<pt>extension</pt>,
<pt>restriction</pt>, <pt>list</pt>, <pt>union</pt>} (of which only
<pt>restriction</pt> is actually relevant)
<olist role="or">
<item id="c-stid"><!--* 1 *-->
<p>They are the same type definition.</p>
</item>
<item><!--* 2 *-->
<olist role="Andtest">     
<item><!--* 2.1 *-->
<p><pt>restriction</pt> is not in the subset, or in the <propref comp="std" prop="final"/> of its own
<propref comp="std" prop="base type definition"/>;</p>
</item>
<item><!--* 2.2 *-->     
<olist role="Ortest">
<item><!--* 2.2.1 *-->     
<p><local>D</local>'s <propref comp="std" prop="base type definition"/> is <local>B</local>.</p>
</item>
<item><!--* 2.2.2 *-->     
<p><local>D</local>'s <propref comp="std" prop="base type definition"/> is not the <termref def="ur-type-itself">ur-type
definition</termref> and is validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from <local>B</local>
given the subset, as defined by this constraint.</p>
</item>
<item><!--* 2.2.3 *-->     
<p><local>D</local>'s <propref comp="std" prop="variety"/> is
<pt>list</pt> or <pt>union</pt> and <local>B</local> is the <termref def="simple-ur-type-itself">simple ur-type definition</termref>.</p>
</item>
<item id="member_as_derived"><!--* 2.2.4 *-->     
<!--*
* material suppressed here by diff group b2333 *
*-->
<olist role="Andtest" dg="b2333">
<item><p><local>B</local>'s <propref comp="std" prop="variety"/> is
<pt>union</pt>.</p>
</item>
<item>
<p><local>D</local> is validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from <phrase diff="nsq-del" dg="rq17">a type definition</phrase><phrase diff="nsq-add" dg="rq17">an
<termref def="key-shadowed">unshadowed type
definition</termref></phrase> <local>M</local> in <local>B</local>'s
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-transitivemembership">transitive
membership</xtermref> given the subset, as defined by this
constraint.</p>
</item>
<item>
<p>The <propref comp="std" prop="facets"/> property of <local>B</local>
and of any <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-interveningunion">intervening
union</xtermref> datatypes is empty.<note>
<p>It is a consequence of this requirement that the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-value-space">value space</xtermref>, <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-lexical-space">lexical space</xtermref>, and
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-lexical-mapping">lexical
mapping</xtermref> of <local>D</local> will be subsets of those of
<local>B</local>.
</p>
</note></p>
<ednote diff="nsq-add" role="pf" dg="b2333-feedback">
<edtext>The requirement that <local>B</local> and any unions
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-interveningunion">intervening</xtermref>
between <local>B</local> and <local>D</local> have no constraining
facets is introduced in version 1.1 of this specification.  Version
1.0 had no such restriction and thus allowed members of any union to be
treated for some purposes as if derived from the union. The rules of
1.0 also did not ensure that values accepted by the member would
also be datatype-valid with respect to the union, thus providing an
unintended loophole which allowed values to be accepted which ought 
to have been invalid.
The XML Schema Working Group solicits input from implementors and
users of this specification as to whether the additional constraint
introduced here is an acceptable way of achieving the goal of closing
the loophole, or whether it is important that the loophole be closed
without excluding facet-based restrictions of unions from the
use of <clauseref ref="member_as_derived"/>.
</edtext>
</ednote>
</item>
<!--* <item>
<p>The <xtermref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-value-space">value
space</xtermref>, <xtermref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-lexical-space">lexical
space</xtermref>, and <xtermref
href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-lexical-mapping">lexical mapping</xtermref> of
<local>D</local> are subsets of those of <local>B</local>.
<note>
<p>The subset relation on value space, lexical space, and lexical
mapping requires in effect that <local>D</local> must enforce any
restrictions imposed by facets on <local>B</local> itself or on any
other union types through which <local>M</local> is a member of
<local>B</local>'s <xtermref
href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-transitivemembership">transitive
membership</xtermref>.</p>
</note>
</p>
</item>
*-->
</olist>
</item>
</olist> 
</item>
</olist>
</item>
</olist>    
</p>
<p diff="nsq-add" dg="rq17"><termdef id="key-shadowed" term="shadowed type definition">A
type definition <local>S</local> in the <propref comp="std" prop="member type definitions"/> of a union is <term>shadowed</term> if and only if its lexical space overlaps with the lexical space of some other simple type definition <local>O</local> which precedes it in that <propref comp="std" prop="member type definitions"/>, and <local>S</local> is not validly derived from <local>O</local> as defined by this constraint.</termdef></p>
</constraintnote>
<note>
<p>With respect to <clauseref ref="c-stid"/>, see the Note on identity at
the end of <specref ref="no-identity"/> above.</p>
</note>

  <constraintnote type="cos" id="st-restrict-facets">
   <head>Simple Type Restriction (Facets)</head>
   <p>For a simple type definition (call it <local>R</local>) to restrict another simple type
definition (call it <local>B</local>) with a
set of facets (call this <local>S</local>)
    <olist role="and">
     <item>
      <p>The <propref comp="std" prop="variety"/>  of <local>R</local> is the same as that of <local>B</local>.</p>
     </item>
     <item>
      <p>If <propref comp="std" prop="variety"/> is <pt>atomic</pt>, the 
<propref comp="std" prop="primitive type definition"/> of <local>R</local> is the same as that of <local>B</local>.</p>
     </item>
     <item id="c-fr">

<!--*
* material suppressed here by diff group iff *
*-->

<p dg="iff">The <propref comp="std" prop="facets"/> of <local>R</local>
<termref def="key-facets-restriction">constitute a restriction</termref> 
of the <propref comp="std" prop="facets"/> of
<local>B</local> with respect to <local>S</local>.</p>

<p>Additional constraint(s) <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*-->
apply depending on the kind of facet, see the appropriate sub-section
of <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#rf-facets">4.3 Constraining
Facets</xspecref></p>
     </item>
    </olist>
   </p>
   <!--*
* material suppressed here by diff group iff *
*-->
<p dg="iff"><termdef id="key-facets-restriction" term="constitute a restriction" role="local">
Given three sets of facets <local>R</local>, <local>B</local>, and <local>S</local>,
<local>R</local> <term>constitutes a restriction</term> of <local>B</local>
with respect to <local>S</local> if and only if<!--*
* material suppressed here by diff group rec12-main *
*-->
</termdef>
<!--*
* material suppressed here by diff group rec12-main *
*-->
<!--*
* material suppressed here by diff group rec12-main-eg-1852-override *
*-->
 <olist dg="eg-1852" role="andtest">
  <item id="fr1">
   <p>Every facet in <local>S</local> is in <local>R</local>.</p>
  </item>
  <item id="fr2"><p>Every facet in <local>B</local>
is in <local>R</local>,
unless it is of the same kind as some facet in <local>S</local>.</p>
  </item>
  <item>
      <p>Every facet in <local>R</local> is required by <clauseref ref="fr1"/>
or <clauseref ref="fr2"/> above.</p>
     </item>
 </olist>
</p>  </constraintnote>



<!--* I think it would be cleaner to say that F is the sum of
    * G and S, or something, but I think that would take me
    * further afield than I want to go with the iff proposal.
    *-->

</div3>

 <div3 id="builtin-stds">
  <head>Built-in Simple Type Definition<phrase dg="dgaat">s</phrase></head>
 <p><!--*
* material suppressed here by diff group std-1915 *
*-->
<phrase dg="std-1915">The <compref ref="std"/> of <!--*
* material suppressed here by diff group eg-1852 *
*--><xspecref xmlns:xlink="http://www.w3.org/1999/xlink" dg="eg-1852" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#anySimpleType">anySimpleType</xspecref>
is</phrase>
present in every schema<!--*
* material suppressed here by diff group std-1915 *
*-->.  
It has the following properties:</p>

 <schemaComp id="simple-ur-type-itself">
     <head>Simple Type Definition of <!--*
* material suppressed here by diff group std-1915 *
*--><phrase dg="std-1915">anySimpleType</phrase></head>

<!--* The WG said to align this "as closely as possible" with Datatypes 4.1.6,
    * so I've resequenced this to agree with the sequence in Datatypes.
    * The resequencing has not been marked.  If you need to reconstruct the
    * old order, check version 1.6.2.69. *-->
     <pvlist>
      <pvpair comp="std" prop="name"><string>anySimpleType</string></pvpair>
      <pvpair comp="std" prop="target namespace"><string>http://www.w3.org/2001/XMLSchema</string></pvpair>
      <pvpair comp="std" prop="final">The empty set</pvpair>
      <!--*
* material suppressed here by diff group std-1915-scope *
*-->
      <pvpair comp="std" prop="context" dg="std-1915"><termref def="key-null"/></pvpair>
      <pvpair comp="std" prop="base type definition"><termref def="ur-type-itself"><!--*
* material suppressed here by diff group std-1915 *
*--><phrase dg="std-1915">anyType</phrase></termref></pvpair>
      <!--* facets, fundamental facets, and annotations were all added after 200502,
          * so I'm moving the add markup from embedded phrases to the pvpairs.
          *-->
      <pvpair comp="std" prop="facets" dg="rec12-main">The empty set</pvpair>
      <pvpair comp="std" prop="fundamental facets" dg="rec12-main">The empty set</pvpair>
      <pvpair comp="std" prop="variety"><termref def="key-null"/></pvpair>
      <pvpair comp="std" prop="primitive type definition" dg="ast-pim"><termref def="key-null"/></pvpair>
      <pvpair comp="std" prop="item type definition" dg="ast-pim"><termref def="key-null"/></pvpair>
      <pvpair comp="std" prop="member type definitions" dg="ast-pim"><termref def="key-null"/></pvpair>
      <pvpair comp="std" prop="annotations" dg="rec12-main">The empty sequence</pvpair>
     </pvlist>
    </schemaComp>
  <p>The <!--*
* material suppressed here by diff group std-1915 *
*--><phrase dg="std-1915">definition
of <termref def="simple-ur-type-itself">anySimpleType</termref></phrase> is the 
root of the simple type definition
 hierarchy, and as such mediates between the other simple type
 definitions, which all eventually trace back to it via their 
<propref comp="std" prop="base type definition"/> properties, 
and 
<!--*
* material suppressed here by diff group std-1915 *
*--><phrase dg="std-1915"><termref def="ur-type-itself">anyType</termref></phrase>, which is
<emph>its</emph> <propref comp="std" prop="base type definition"/>.<!--*
* material suppressed here by diff group eg-1852 *
*--></p>
<!--*
  <issue id="RQ-141i" role="1.1">
	    <p><loc href="&reqs;#anyAtomicType" target="reqs">RQ-141 (anyAtomicType)</loc></p>
   <p>The XML Query Working Group has had to introduce a new high-level simple
type definition into the type hierarchy to have a handle on all and only the
atomic simple type definitions (i.e. no lists or unions).  This will be
added now to this spec. with the name <code>anyAtomicType</code>.</p>
    <resolution>
     <p>Add anyAtomicType as the supertype of all atomics and the
child of anySimpleType.</p>
    </resolution>
	    </issue>
*-->
<p dg="dgaat">
<!--*
* material suppressed here by diff group eg-1852 *
*-->
 <phrase dg="eg-1852">The <compref ref="std"/> of <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" dg="eg-1852" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#anyAtomicType">anyAtomicType</xspecref>
is present in every schema</phrase>.  
It has the following properties:</p>
 <schemaComp id="aat-def" dg="dgaat">
<!--* Properties resequenced to simplify collation between Datatypes and Structures -msm *-->
     <head>Simple Type Definition of anyAtomicType</head>
     <pvlist>
      <pvpair comp="std" prop="name"><string>anyAtomicType</string></pvpair>
      <pvpair comp="std" prop="target namespace"><string>http://www.w3.org/2001/XMLSchema</string></pvpair>
      <pvpair comp="std" prop="final">The empty set</pvpair>
      <!--*
* material suppressed here by diff group std-1915-scope *
*-->
      <pvpair comp="std" prop="context" dg="std-1915"><termref def="key-null"/></pvpair>
      <pvpair comp="std" prop="base type definition"><termref def="simple-ur-type-itself"><!--*
* material suppressed here by diff group std-1915 *
*--><phrase dg="std-1915">anySimpleType</phrase></termref></pvpair>
      <pvpair comp="std" prop="facets" dg="rec12-main">The empty set</pvpair>
      <pvpair comp="std" prop="fundamental facets" dg="rec12-main">The empty set</pvpair>
      <pvpair comp="std" prop="variety"><pt>atomic</pt></pvpair>
      <pvpair comp="std" prop="primitive type definition" dg="ast-pim"><termref def="key-null"/></pvpair>
      <pvpair comp="std" prop="item type definition" dg="ast-pim"><termref def="key-null"/></pvpair>
      <pvpair comp="std" prop="member type definitions" dg="ast-pim"><termref def="key-null"/></pvpair>
      <pvpair comp="std" prop="annotations" dg="rec12-main">The empty sequence</pvpair>
     </pvlist>
    </schemaComp>
<!--* Here, rec12-main is not only making the text harder to read, it's
    * introducing a deviation from the wording of Datatypes.
    * Bad idea. *-->
<p>Simple type definitions 
<!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main">corresponding to</phrase> 
all the built-in primitive datatypes, namely <pt>string</pt>, <pt>boolean</pt>, <pt>float</pt>,
<pt>double</pt>, <!--*
* material suppressed here by diff group rec12-main *
*--><pt dg="rec12-main">decimal</pt><phrase dg="rec12-main">,
<pt>precisionDecimal</pt></phrase>, <pt>dateTime</pt>, <pt>duration</pt>,
<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><phrase dg="rec12-main">,
<pt>QName</pt> and <pt>NOTATION</pt></phrase> (see the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#built-in-primitive-datatypes">Primitive
Datatypes</xtermref> section of <bibref ref="ref-xsp2"/>) are present by definition in every schema.<!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main">as follows:</phrase></p>
<schemaComp id="dummy-def" dg="rec12-main">
<head alt="Simple Type Definition corresponding to the built-in primitive datatypes"><compref ref="std"/> corresponding to the built-in primitive datatypes</head>

<pvlist>
<pvpair comp="std" prop="name">[as appropriate]</pvpair>
<pvpair comp="std" prop="target namespace"><string>http://www.w3.org/2001/XMLSchema</string></pvpair>
<pvpair comp="std" prop="base type definition"><termref def="aat-def">anyAtomicType</termref></pvpair>
<pvpair comp="std" prop="final">The empty set</pvpair>
<pvpair comp="std" prop="variety"><pt>atomic</pt></pvpair>
<pvpair comp="std" prop="primitive type definition">[this simple type
definition itself]</pvpair>
<pvpair comp="std" prop="facets">{a <compref ref="f-w" name="whitespace"/> facet with 
<xpropref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#f-w-value">value</xpropref> =
<pt>collapse</pt> and <xpropref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#f-w-fixed">fixed</xpropref> = <pt>true</pt> in all cases except
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#string">string</xtermref>, which has
<xpropref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#f-w-value">value</xpropref> =
<pt>preserve</pt> and <xpropref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#f-w-fixed">fixed</xpropref> = <pt>false</pt>}</pvpair>
<pvpair comp="std" prop="fundamental facets"><p>[as appropriate]</p></pvpair>
<!--*
* material suppressed here by diff group std-1915 *
*-->
<pvpair comp="std" prop="context" dg="std-1915"><termref def="key-null"/></pvpair>
<pvpair comp="std" prop="item type definition"><termref def="key-null"/></pvpair>
<pvpair comp="std" prop="member type definitions"><termref def="key-null"/></pvpair>
<pvpair comp="std" prop="annotations">The empty sequence</pvpair>
</pvlist><!--{<ulist>
<item><p>an <xspecref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ff-o">ordered</xspecref> <compref ref="ff" name="Fundamental Facet"/>
with <propref comp="ff-o" prop="value"/> = <pt>total</pt></p></item>
<item><p>a <xspecref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ff-b">bounded</xspecref> <compref ref="ff" name="Fundamental Facet"/>
with <propref comp="ff-b" prop="value"/> = <pt>false</pt></p></item>
<item><p>a <xspecref href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ff-c">cardinality</xspecref> <compref ref="ff" name="Fundamental Facet"/>
with <propref comp="ff-c" prop="value"/> = <pt>countable</pt></p></item>
<item><p>a <compref ref="ff-n"/> <compref ref="ff" name="Fundamental Facet"/>
with <propref comp="ff-n" prop="value"/> = <pt>true</pt></p></item>
</ulist>}-->
</schemaComp>

<p>Similarly, simple type definitions <!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main">corresponding to</phrase> all the<phrase dg="derive-1913"> other</phrase> built-in<!--*
* material suppressed here by diff group derive-1913 *
*--> datatypes (see the <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ordinary-built-ins"><!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913">Other Built-in</phrase> Datatypes</xspecref> section
of <bibref ref="ref-xsp2"/>) are present by definition in
every schema, with properties as specified in <bibref ref="ref-xsp2"/> and as
represented in XML in <!--*
* material suppressed here by diff group rec12-main *
*--><!--*
* material suppressed here by diff group eg-1852 *
*--><xspecref xmlns:xlink="http://www.w3.org/1999/xlink" dg="eg-1852" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#drvd.nxsd">Illustrative XML representations for the built-in ordinary type definitions</xspecref>.</p>

<schemaComp id="dummy-ddef" dg="eg-1852">
<head alt="Simple Type Definition corresponding to the built-in ordinary datatypes"><compref ref="std"/> corresponding to the ordinary built-in datatypes</head>

<pvlist>
<pvpair comp="std" prop="name">[as appropriate]</pvpair>
<pvpair comp="std" prop="target namespace"><string>http://www.w3.org/2001/XMLSchema</string></pvpair>
<pvpair comp="std" prop="base type definition">[as specified in the appropriate
sub-section of <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ordinary-built-ins">Other Built-in Datatypes</xspecref>]</pvpair>
<pvpair comp="std" prop="final">The empty set</pvpair>
<pvpair comp="std" prop="variety">[<pt>atomic</pt> or <pt>list</pt>, as specified in the appropriate
sub-section of <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ordinary-built-ins">Other Built-in Datatypes</xspecref>]</pvpair>
<pvpair comp="std" prop="primitive type definition">[if <propref comp="std" prop="variety"/> is
<pt>atomic</pt>, then the <propref comp="std" prop="primitive type definition"/> of the <propref comp="std" prop="base type definition"/>, otherwise <termref def="key-null"/>]</pvpair>
<pvpair comp="std" prop="facets">[as specified in the appropriate
sub-section of <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ordinary-built-ins">Other Built-in Datatypes</xspecref>]</pvpair>
<pvpair comp="std" prop="fundamental facets">[as specified in the appropriate
sub-section of <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ordinary-built-ins">Other Built-in Datatypes</xspecref>]</pvpair>
<pvpair comp="std" prop="context"><termref def="key-null"/></pvpair>
<pvpair comp="std" prop="item type definition">if <propref comp="std" prop="variety"/> is
<pt>atomic</pt>, then <termref def="key-null"/>, otherwise as specified in the appropriate
sub-section of <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ordinary-built-ins">Other Built-in Datatypes</xspecref>]</pvpair>
<pvpair comp="std" prop="member type definitions"><termref def="key-null"/></pvpair>
<pvpair comp="std" prop="annotations">As shown in the XML representations
of the ordinary built-in datatypes in <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" dg="eg-1852" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#drvd.nxsd">Illustrative XML representations for the built-in ordinary type definitions</xspecref></pvpair>
</pvlist>
</schemaComp>
 </div3>
   </div2>
   <div2 id="Schemas">
    <head>Schemas as a Whole</head>
    <p>A schema consists of a set of schema components.</p>
    <note role="example">
        <eg xml:space="preserve">&lt;xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.example.com/example"&gt;
  . . .
&lt;/xs:schema&gt;</eg>
        <p>The XML representation of the skeleton of a schema.</p>
    </note>
    <div3 id="Schema_details">
     <head>The Schema Itself</head>
    <p>At the abstract level, the schema itself is just a container
for its components.</p>
<!--* <issue id="RQ-16i" role="1.1">
< ! - - * 
<p>
<loc href="&reqs;#id-components" target="reqs"
>RQ-16 (id-components)</loc>, 
<loc href="&reqs;#scd-accessible-constraints" target="reqs"
>RQ-133 (scd-accessible-constraints)</loc>
</p> * - - >
<p>
<loc href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=3045" target="reqs"
>Issue 3045 (RQ-16 identity constraints)</loc>, 
<loc href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=3044" target="reqs"
>Issue 3044 (RQ-133 SCD-accessible constraints)</loc>
</p>
<p>Version 1.0 provides a property of the top-level 'schema'
component for every kind of named component <emph>except</emph>
identity constraints.  This omission will be rectified by giving it an
[identity constraints] property.</p>
<resolution>
<p>Add an [identity constraints] property of the schema
component, which contains all the identity constraint components.</p>
     < ! - - * <ednote>
      <edtext>This will actually happen as an erratum to XML Schema 2nd
edition, but this issue is here anyway to make sure it gets folded in.</edtext>
     </ednote> * - - >
</resolution>
</issue> *-->
    <compdef name="Schema" abbrev="s" showAKO="true"/>
    </div3>
    <div3 id="declare-schema">
      <head>XML Representations of Schemas</head>
     <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>
     <reprdef>
      <reprelt eltname="schema"/>
      <reprcomp abstract="Schema" ref="key-schema">
       <propmap comp="s" prop="type definitions">The simple and complex type definitions
corresponding to all the <eltref ref="simpleType"/> and <eltref ref="complexType"/> element information items in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, plus any included or imported definitions, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
       <propmap comp="s" prop="attribute declarations">The (top-level) attribute declarations
corresponding to all the <eltref ref="attribute"/> element information items in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, plus any included or imported declarations, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
       <propmap comp="s" prop="element declarations">The (top-level) element declarations
corresponding to all the <eltref ref="element"/> element information items in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, plus any included or imported declarations, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
       <propmap comp="s" prop="attribute group definitions">The attribute group definitions
corresponding to all the <eltref ref="attributeGroup"/> element information items in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, plus any included or imported definitions, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
       <propmap comp="s" prop="model group definitions">The model group definitions
corresponding to all the <eltref ref="group"/> element information items in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, plus any included or imported definitions, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
       <propmap comp="s" prop="notation declarations">The notation declarations
corresponding to all the <eltref ref="notation"/> element information items in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, plus any included or imported declarations, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
       <propmap comp="s" prop="identity-constraint definitions" dg="fpwd">The identity-constraint definitions
corresponding to all the <eltref ref="key"/>, <eltref ref="keyref"/> and
<eltref ref="unique"/> element information items anywhere within the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any, plus any included or imported identity-constraint definitions, see <specref ref="compound-schema"/> and <specref ref="composition-schemaImport"/>.</propmap>
       <propmap comp="s" prop="annotations">The annotations
corresponding to all the <eltref ref="annotation"/> element information items in the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any.</propmap>
      </reprcomp>
     </reprdef>
     <p>Note that none of the attribute information items displayed above
correspond directly to properties of schemas.  The <code>blockDefault</code>,
<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
global information applicable to many representation/component correspondences.  The
other attributes (<code>id</code> and <code>version</code>) are for user
convenience, and this specification defines no semantics for them.</p>
 <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>
     <p>Since the empty string is not a legal namespace name, supplying
an empty string for <code>targetNamespace</code> is incoherent, and is <emph>not</emph> the same
as not specifying it at all.  The appropriate form of schema document
corresponding to a <termref def="key-schema">schema</termref> whose components have no
<propref comp="ed" prop="target namespace"/> is one which has no
<code>targetNamespace</code> attribute specified at all.</p>
     <note><p><!--*
* material suppressed here by diff group b1838 *
*--><phrase dg="b1838"><bibref ref="ref-xml-namespaces"/></phrase> 
discusses only instance document syntax for
elements and attributes; it therefore provides no direct framework for managing
the names of type definitions, attribute group definitions, and so on.
Nevertheless, the specification applies the target namespace facility uniformly to all
schema components, i.e. not only declarations but also definitions have a <xpropref role="anon">target namespace</xpropref>.</p>
</note>
     <p>Although the example schema at the beginning of this section might be a complete XML document, <eltref ref="schema"/>
need not be the document element, but can appear within other documents.
Indeed there is no requirement that a schema correspond to a (text) document
at all:  it could correspond to an element information item constructed 'by
hand', for instance via a DOM-conformant API.</p>
<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 items which <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> appear in the content
of <eltref ref="schema"/>
corresponds to a schema component, and all except <eltref ref="annotation"/> are
named.  The sections below present each such item in turn, setting out
the components to which it <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> correspond.</p>

<div4 id="refSchemaConstructs">
<head>References to Schema Components</head>

<p>Reference to schema components from a schema document is managed in
a uniform way, whether the component corresponds to an element
information item from the same schema document or is imported
(<specref ref="composition-schemaImport"/>) from an external schema
(which <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*-->, but need not, correspond to an actual schema
document). The form of all such references is a <termref def="gloss-QName">QName</termref>.</p>
<p><termdef id="gloss-QName" term="QName">A <term>QName</term> is a
name with an optional namespace qualification, as defined in <bibref ref="ref-xml-namespaces"/>.  When used in connection with the XML
representation of schema components or references to them, this refers
to the simple type <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#QName">QName</xtermref>
as defined in <bibref ref="ref-xsp2"/></termdef>.</p>
<p><termdef id="gloss-NCName" term="NCName">An <term>NCName</term> is
a name with no colon, as defined in <bibref ref="ref-xml-namespaces"/>.  When used in connection with the XML
representation of schema components in this specification, this refers
to the simple type <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#NCName">NCName</xtermref> as defined in <bibref ref="ref-xsp2"/></termdef>.</p>
<note dg="b1838"><p>It is implementation-defined whether a
schema processor supports the definitions of <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-QName">QName</xnt> and <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> found in <bibref ref="ref-xml-namespaces"/> or those found in <bibref ref="ref-xml-namespaces-1.0"/> or both.
</p></note>
<p>In each of the XML
representation expositions in the following sections, an attribute is shown as
having type <code>QName</code> if and only if it is
interpreted as referencing a schema component.</p>

  <note role="example">
    <eg xml:space="preserve">&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:xhtml="http://www.w3.org/1999/xhtml"
            xmlns="http://www.example.com"
            targetNamespace="http://www.example.com"&gt;
  . . .

  &lt;xs:element name="elem1" type="Address"/&gt;

  &lt;xs:element name="elem2" type="xhtml:blockquote"/&gt;

  &lt;xs:attribute name="attr1"
                type="xsl:quantity"/&gt;
  . . .
&lt;/xs:schema&gt;

</eg>
    <p>The first of these is most probably a local reference, i.e. a reference
to a type
definition corresponding to a <eltref ref="complexType"/> element information item
located elsewhere in the schema document, the other two refer to type
definitions from schemas for other namespaces and assume that their namespaces
have been declared for import.  See <specref ref="composition-schemaImport"/> for a discussion of importing.</p>
</note>
</div4>
    <div4>
  <head>References to Schema Components from Elsewhere</head>
    <p>The names of schema components such as type definitions and element
declarations are not of type <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref>:  they are not
unique within a schema, just within a symbol space.  This means that simple
fragment identifiers will not always work to reference schema components from outside
the context of schema documents.</p>
    <p>There is currently no provision in the definition of the interpretation
of fragment identifiers for the <code>text/xml</code> MIME type, which is the
MIME type for schemas, for referencing
schema components as such.  However, 
<bibref ref="ref-xpointer"/> provides a mechanism which maps well onto the
notion of symbol spaces as it is reflected in the XML representation of schema components.  A fragment identifier of the form
<code>#xpointer(xs:schema/xs:element[@name="person"])</code> will uniquely identify
the representation of a top-level element declaration with name <code>person</code>, and similar fragment
identifiers can obviously be constructed for the other global symbol spaces.</p>
  <p>Short-form fragment identifiers <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> also be used in some cases, that is
when a DTD or XML Schema is available for the schema in question, and the
provision of an <code>id</code> attribute for the representations of all primary and secondary schema
components, which <emph>is</emph> of type
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref>, has been exploited.</p>
  <p>It is a matter for applications to specify whether they interpret
document-level references of either of the above varieties as being to the relevant element information item (i.e. without
special recognition of the relation of schema documents to schema components) or as being to the
corresponding schema component.</p>
 </div4>
</div3>
    <div3>
     <head>Constraints on XML Representations of Schemas</head>
 <constraintnote type="src" id="src-qname">
  <head>QName Interpretation</head>
  <p>Where the type of an attribute information item in a document involved in
<termref def="key-vn">validation</termref> is
identified as
<termref def="gloss-QName">QName</termref>, its <termref def="key-vv">actual value</termref> is composed of a
 <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 <termref def="key-vv">actual value</termref> is determined based on its <termref def="key-nv">normalized value</termref> and
the containing element information item's <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">in-scope
namespaces</xpropref> following <bibref ref="ref-xml-namespaces"/>:</p>
  <p><olist role="Case">
    <item>
     <p role="if">its <termref def="key-nv">normalized value</termref> is prefixed</p>
     <p role="then">
      <olist role="andtest">
       <item>
        <p>There <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> a namespace in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">in-scope
namespaces</xpropref> whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.namespace">prefix</xpropref> matches the prefix.</p>
       </item>
       <item>
       <p role="then">its <termref def="q-uri">namespace name</termref> is the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.namespace">namespace
name</xpropref> of that namespace.</p></item>
       <item>
        <p>Its <termref def="q-local">local name</termref> is the portion of
its <termref def="key-nv">normalized value</termref> after the colon (<code>':'</code>).</p>
       </item>
      </olist>
     </p>     
    </item>
    <item>
     <p role="otherwise">(its <termref def="key-nv">normalized value</termref> is unprefixed) <olist role="andtest">
       <item>
        <p>its <termref def="q-local">local name</termref> is its <termref def="key-nv">normalized value</termref>.</p>
       </item>
       <item>
        <olist role="Casetest">
       <item>
        <p role="if">there is a namespace in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">in-scope
namespaces</xpropref> whose <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.namespace">prefix</xpropref> has no value</p>
        <p role="then">its <termref def="q-uri">namespace name</termref> is the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.namespace">namespace
name</xpropref> of that namespace.</p>
       </item>
       <item>
        <p role="otherwise">its <termref def="q-uri">namespace name</termref> is <termref def="key-null">absent</termref>.</p>
       </item>
      </olist>
       </item>
      </olist></p>
    </item>
   </olist></p>
  <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 <rfc2119>must</rfc2119> 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>
 </constraintnote>
 <p><termdef id="key-resolve" term="resolve">Whenever the word <term>resolve</term> in any form is used in this
chapter in connection with a <termref def="gloss-QName">QName</termref> in a
schema document, the
following definition <specref ref="src-resolve"/> <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><rfc2119>must</rfc2119></phrase> be understood</termdef>:</p>
 <constraintnote type="src" id="src-resolve">
  <head>QName resolution (Schema Document)</head>
  <p>For a <termref def="gloss-QName">QName</termref>
to resolve to a schema component of a specified kind
   <olist role="and">
    <item>
     <p>That component is a member of the value of the appropriate
property of the schema which corresponds to the schema
document within which the <termref def="gloss-QName">QName</termref>
appears, that is
      <olist role="casetest">
    <item>
     <p role="if">the kind specified is simple or complex type definition</p>
     <p role="then">the property is the <propref comp="s" prop="type definitions"/>.</p>
    </item>
    <item>
     <p role="if">the kind specified is attribute declaration</p>
     <p role="then">the property is the <propref comp="s" prop="attribute declarations"/>.</p> 
    </item>
    <item>
     <p role="if">the kind specified is element declaration</p>
     <p role="then">the property is the <propref comp="s" prop="element declarations"/>.</p> 
    </item>
    <item>
     <p role="if">the kind specified
is attribute group</p>
     <p role="then">the property is the <propref comp="s" prop="attribute group definitions"/>.</p> 
    </item>
    <item>
     <p role="if">the kind specified is
model group</p>
     <p role="then">the property is the <propref comp="s" prop="model group definitions"/>.</p>
    </item>
    <item>
     <p role="if">the kind specified is notation declaration</p>
     <p role="then">the property is the <propref comp="s" prop="notation declarations"/>.</p> 
    </item>
   </olist>
     </p>
    </item>
    <item>
     <p>The
component's <xpropref role="anon">name</xpropref> matches the <termref def="q-local">local
name</termref> of the <termref def="gloss-QName">QName</termref>;</p>
    </item>
    <item>
     <p>The component's <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>
    </item>
    <item>
     <olist role="Casetest">
      <item>
       <p role="if">the <termref def="q-uri">namespace name</termref> of the <termref def="gloss-QName">QName</termref> is <termref def="key-null">absent</termref></p>
       <p role="then">
        <olist role="ortest">
         <item>
          <p>The <eltref ref="schema"/> element information item of the schema document containing the <termref def="gloss-QName">QName</termref> has no <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>.</p>
         </item>
         <item>
          <p>The <eltref ref="schema"/> element information item of the that schema document contains an <eltref ref="import"/> element
information item with no <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>.</p>
         </item>
        </olist>
       </p>
      </item>
      <item>
       <p role="otherwise">the <termref def="q-uri">namespace name</termref> of the <termref def="gloss-QName">QName</termref> is
the same as
        <olist role="orval">
         <item>
          <p>The <termref def="key-vv">actual value</termref> of the <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of
the <eltref ref="schema"/> element information item of the schema document containing the <termref def="gloss-QName">QName</termref>.</p>
         </item>
         <item>
          <p>The <termref def="key-vv">actual value</termref> of the <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of some
<eltref ref="import"/> element information item contained in the <eltref ref="schema"/> element information item of that schema document.</p>
         </item>
        </olist>.</p>
      </item>
     </olist>
     
    </item>
   </olist>
  </p>
 </constraintnote>
    </div3>
    <div3>
     <head>Validation Rules for Schemas as a Whole</head>
 <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
few cases, however, qualified names appearing in information items being
<termref def="key-vn">validated</termref> <rfc2119>must</rfc2119> be resolved to schema components by such lookup.  The following
constraint is appealed to in these cases.</p>
   <constraintnote type="cvc" id="cvc-resolve-instance">
  <head>QName resolution (Instance)</head>
  <p>A pair of a local name and a namespace name (or <termref def="key-null">absent</termref>)
resolve to a schema component of a specified kind in the context of <termref def="key-vn">validation</termref> by appeal to the appropriate
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,
   <olist role="case">
    <item>
     <p role="if">the kind specified is simple or complex type definition</p>
     <p role="then">the property is the <propref comp="s" prop="type definitions"/>.</p>
    </item>
    <item>
     <p role="if">the kind specified is attribute declaration</p>
     <p role="then">the property is the <propref comp="s" prop="attribute declarations"/>.</p> 
    </item>
    <item>
     <p role="if">the kind specified is element declaration</p>
     <p role="then">the property is the <propref comp="s" prop="element declarations"/>.</p> 
    </item>
    <item>
     <p role="if">the kind specified
is attribute group</p>
     <p role="then">the property is the <propref comp="s" prop="attribute group definitions"/>.</p> 
    </item>
    <item>
     <p role="if">the kind specified is
model group</p>
     <p role="then">the property is the <propref comp="s" prop="model group definitions"/>.</p>
    </item>
    <item>
     <p role="if">the kind specified is notation declaration</p>
     <p role="then">the property is the <propref comp="s" prop="notation declarations"/>.</p> 
    </item>
   </olist>
   The component resolved to is the entry in the table whose <xpropref role="anon">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.
  </p>
 </constraintnote>
    </div3>
    <div3>
     <head>Schema Information Set Contributions</head>
     <constraintnote type="sic" id="sic-schema">
     <head>Schema Information</head>
     <p>Schema components provide a wealth of information about the
basis of <termref def="key-va">assessment</termref>, which <phrase dg="may">may well be of relevance to</phrase><!--*
* material suppressed here by diff group may *
*--> subsequent
processing.  Reflecting component structure into a form suitable for
inclusion in the <termref def="key-psvi">post-schema-validation infoset</termref> is the way this specification provides for
making this information available.</p>
     <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>
      <p><!--*
* material suppressed here by diff group rq144nv *
*--><phrase dg="rq144nv">The <termref def="key-vr"/>
has the following properties</phrase>:</p>

      <proplist item="element or attribute" role="psvi">
<!--* rq144 adds the 'or attribute' in the item attribute.  Diff markup
    * doesn't show it. *-->
       <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 <xpropref role="anon">target namespace</xpropref> of any schema component in the
schema used for that assessment, and one for <termref def="key-null">absent</termref> if any schema component in the schema
had no <xpropref role="anon">target namespace</xpropref>.  Each
<iiName>namespace schema information</iiName> information item has the
following properties and values:
        <proplist item="namespace schema information" role="psvi">
         <propdef id="nsi-schema_namespace" name="schema namespace">A
namespace name or <termref def="key-null">absent</termref>.</propdef>
         <propdef id="nsi-schema_components" name="schema components">A (possibly 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 namespace</xpropref> is
the sibling <propref ref="nsi-schema_namespace" role="psvi"/> property above, drawn from
the schema used for <termref def="key-va">assessment</termref>.</propdef>
         <propdef name="schema documents" id="nsi-schema_documents">A
(possibly empty) set of <iiName>schema document</iiName> information
items, with properties and values as follows, for each schema document
which contributed components to the schema, and whose
<code>targetNamespace</code> matches the sibling <propref role="psvi" ref="nsi-schema_namespace"/> property above (or whose
<code>targetNamespace</code> was <termref def="key-null">absent</termref> but that contributed components to
that namespace by being <eltref ref="include"/>d by a schema document with that
<code>targetNamespace</code> as per
<specref ref="compound-schema"/>):
          <proplist item="schema document" role="psvi">
           <propdef name="document location" id="sd-document_location">Either a URI reference, if available,
otherwise <termref def="key-null">absent</termref>
           </propdef>
           <propdef name="document" id="sd-document">A document
information item, if available, otherwise <termref def="key-null">absent</termref>.</propdef>
          </proplist>
         </propdef>
        </proplist>
       </propdef>
      </proplist>
     <p>The <propref ref="nsi-schema_components"/> property is provided for
processors which wish to provide a single access point to the
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 <rfc2119>must</rfc2119> 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>
    </constraintnote>
     <constraintnote type="sic" id="sic-id">
  <head>ID/IDREF Table</head>
      <p>In the <termref def="key-psvi">post-schema-validation infoset</termref> a set of <iiName>ID/IDREF binding</iiName> information items 
<phrase dg="opt.144">is</phrase><!--*
* material suppressed here by diff group opt.144 *
*--> 
associated with the <termref def="key-vr"/><!--*
* material suppressed here by diff group rq144si *
*-->:</p>
      <proplist item="element" role="psvi">
       <propdef name="ID/IDREF table" id="e-ii_table">A (possibly empty) set of
<iiName>ID/IDREF binding</iiName> information items, as specified below.</propdef>
      </proplist>
      <p><termdef id="key-eas" term="eligible item set" role="local">Let the
<term>eligible item set</term> be the set of consisting of every attribute or element
information item</termdef> for which
         <olist role="andtest">
            <item>
             <p>its  <xpropref role="psviAnon">validation context</xpropref> is the
<termref def="key-vr"/>;</p>
            </item>
            <item>
             <p>it was successfully <termref def="key-vn">validated</termref> with respect to an attribute
declaration as per <specref ref="cvc-attribute"/> or element declaration as per
<specref ref="cvc-elt"/> (as appropriate) whose attribute <propref comp="ad" prop="type definition"/> or element <propref comp="ed" prop="type definition"/> (respectively) is the
built-in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref>, <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#IDREF">IDREF</xtermref> or <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#IDREFS">IDREFS</xtermref> simple type definition or a type <!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> from one of them.</p>
            </item>
           </olist></p>
      <p>Then there is one <iiName>ID/IDREF binding</iiName> in the <propref ref="e-ii_table" role="psvi"/>
for every distinct string which is</p><olist role="orval">
        <item>
         <p>the <termref def="key-vv">actual value</termref> of a member of the <termref def="key-eas">eligible
item set</termref> whose type definition is or is <!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> from <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref> or <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#IDREF">IDREF</xtermref>;</p>
        </item>
        <item>
         <p>one of the items in the <termref def="key-vv">actual value</termref> of a member of the <termref def="key-eas">eligible
item set</termref> whose type definition is or is <!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> from <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#IDREFS">IDREFS</xtermref>.</p>
        </item>
       </olist>
      <p>Each <iiName>ID/IDREF binding</iiName> has properties as follows:</p>
      <proplist item="ID/IDREF binding" role="psvi">
        <propdef name="id" id="iib-id">The string identified above.</propdef>
        <propdef id="iib-binding" name="binding">A set consisting of every element information item for which
          <olist role="andtest">
            <item>
             <p>its <propref role="psvi" ref="e-validation_context"/> is the
<termref def="key-vr"/>;</p>
            </item>
            <item>
             <p>it has an attribute information item in
its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> or an element information item in its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> which was <termref def="key-vn">validated</termref> by the
built-in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref> simple type definition or a type <!--*
* material suppressed here by diff group derive-1913 *
*--><phrase dg="derive-1913"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-constructed">constructed</xtermref></phrase> from it whose
 <xpropref role="psviAnon">schema normalized value</xpropref> is the <propref role="psvi" ref="iib-id"/> of
this <iiName>ID/IDREF binding</iiName>.</p>
            </item>
           </olist>
        </propdef>
       </proplist>
<p>The net effect of the above is to have one entry for every string used as an
id, whether by declaration or by reference, associated with those elements, if
any, which actually purport to have that id.  See <specref ref="cvc-id"/> above
for the validation rule which actually checks for errors here.</p>
  <note>
   <p>The <iiName>ID/IDREF binding</iiName>
information item, unlike most other aspects of this
specification, is essentially an internal bookkeeping mechanism.  It is introduced to
support the definition of <specref ref="cvc-id"/> above. 
Accordingly, conformant processors <rfc2119>may</rfc2119>, but are <emph>not</emph> required to,
expose it in the <termref def="key-psvi">post-schema-validation infoset</termref>.
In other words, the above constraint <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be read as saying <termref def="key-va">assessment</termref> proceeds <emph>as if</emph> such an infoset item existed.</p></note>
 </constraintnote>
    </div3>
    <div3 id="coss-schema">
     <head>Constraints on Schemas as a Whole</head>
  <p>All schemas (see <specref ref="Schemas"/>) <rfc2119>must</rfc2119> satisfy the following constraint.</p>
  <constraintnote type="cos" id="sch-props-correct">
   <head>Schema Properties Correct</head>
   <olist role="And">
    <item>
     <p>The values of the properties of a schema <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">are</phrase> as described in
the property tableau in
<specref ref="Schema_details"/>, modulo the impact of <specref ref="conformance-missing"/>;</p>
    </item>
    <item id="c-nmd">
     <p><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">None</phrase> of the <propref comp="s" prop="type definitions"/>,  <propref comp="s" prop="element declarations"/>, <propref comp="s" prop="attribute group definitions"/>, <propref comp="s" prop="model group definitions"/> and <propref comp="s" prop="notation declarations"/> <phrase dg="modals">properties</phrase> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">contains</phrase> two or more schema components with the same <xpropref role="anon">name</xpropref> and <xpropref role="anon">target
namespace</xpropref>.</p>
    </item>
   </olist>
  </constraintnote>
 
    </div3>
   </div2>
   <!--*
* material suppressed here by diff group ep01 *
*-->
  </div1>
   <div1 id="composition">
    <head>Schemas and Namespaces: Access and Composition</head>
      <issue id="RQ-151i" role="1.1" status="open">
<!--* <p><loc href="&reqs;#composition" target="reqs">RQ-151 (consistent)</loc></p> *-->
	<p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2824" target="reqs">Issue 2824 (RQ-151 schema composition)</loc></p>
       <p>Experience with version 1.0 has shown that the rules in this section
miss a few cases, and are unclear in others.  A full rewrite taking a more
formal approach, without changing the intended semantics, will be done to
address these problems.</p>
       <resolution>
        <p>Give a complete and formal definition of schema composition, and use it for currently defined (e.g. include) and currently undefined (e.g. schema docs on command line) cases. </p>
       </resolution>
	</issue>
<p>This chapter defines the mechanisms by which this specification establishes the necessary
precondition for <termref def="key-va">assessment</termref>, namely access to
one or more schemas. This chapter also sets out in detail the relationship
between schemas and namespaces, as well as mechanisms for
modularization of schemas, including provision for incorporating definitions
and declarations from one schema in another, possibly with modifications.</p>
<p><specref ref="concepts-conformance"/> describes three levels of conformance for schema
processors, and <specref ref="conformance"/> provides a formal definition of
<termref def="key-va">assessment</termref>. This section sets out
in detail the 3-layer architecture implied by the three conformance levels.
The layers
are: </p>
<olist>
  <item><p>The <termref def="key-va">assessment</termref> core, relating schema components and instance
information items; </p></item>
  <item><p>Schema representation: the connections between XML
representations and schema components, including the
  relationships between namespaces and schema components; </p></item>
  <item><p>XML Schema web-interoperability guidelines: instance-&gt;schema and
  schema-&gt;schema connections for the WWW. </p></item></olist>
<p>Layer 1 specifies the manner in which a schema composed of schema components
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"/>
elements in XML documents as the standard XML representation for
schema information in a broad range of computer systems and execution
environments. To support interoperation over the World Wide Web in particular,
layer 3 provides a set of conventions for schema reference on the
Web. Additional details on each of the three layers is provided in the sections below.</p>
<div2 id="layer1">
<head>Layer 1: Summary of the Schema-validity Assessment Core</head>
<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
element information item and its descendants with respect to a
complex type
definition. All processors are required to implement this core predicate in a
manner which conforms exactly to this specification. </p>
<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
<termref def="key-schemaDoc">schema document</termref>) which consists of (at a minimum) the set of schema
components (definitions and declarations) required for that
<termref def="key-va">assessment</termref>.  This is not a circular definition, but rather a
<emph>post facto</emph> observation:  no element information item can
be fully assessed unless all the components required by any aspect of
its (potentially recursive) <termref def="key-va">assessment</termref> are present in the schema.</p>
<p>As specified above, each schema component is associated directly or
indirectly with a target namespace, or explicitly with no namespace. In the case of multi-namespace documents,
components for more than one target namespace will co-exist in a schema.</p>
<p>Processors have the option to assemble (and perhaps to optimize or
pre-compile) the entire schema prior to the start of an 
<termref def="key-va">assessment</termref> episode, or to
gather the schema lazily as individual components are required. In all
cases it is required that:</p>
<ulist>
  <item><p>The processor succeed in locating the <termref def="c">schema components</termref>
  transitively required to complete an <termref def="key-va">assessment</termref> (note that components derived
from <termref def="key-schemaDoc">schema documents</termref> can be integrated
with components obtained through other means);</p></item>
  <item><p>no definition or declaration changes once it has been established;</p></item>
  <item><p>if the processor chooses to acquire declarations and definitions
  dynamically, that there be no side effects of such dynamic acquisition that
  would cause the results of <termref def="key-va">assessment</termref> to differ from that which would have
  been obtained from the same schema components acquired in bulk.</p></item></ulist>
<note><p> the <termref def="key-va">assessment</termref> core is defined in terms of schema components at the
abstract level, and no mention is made of the schema definition
syntax (i.e. <eltref ref="schema"/>). Although many processors will acquire
schemas in this format, others <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> operate on compiled representations, on a
programmatic representation as exposed in some programming language, etc.
</p></note>
<p>The obligation of a schema-aware processor as far as the <termref def="key-va">assessment</termref>
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
choice of element information item for that <termref def="key-va">assessment</termref>, nor which of the
means of initiating <termref def="key-va">assessment</termref> are used, is within the scope of this specification.</p>
<p>Although <termref def="key-va">assessment</termref> is defined recursively, it is also intended to be
implementable in streaming
processors.  Such processors <rfc2119>may</rfc2119> choose to incrementally assemble the schema during
processing in response, for example, to encountering new namespaces. 
The implication of the
invariants expressed above is that such incremental assembly <rfc2119>must</rfc2119>
result in an <termref def="key-va">assessment</termref> 
outcome that is the 
<emph>same</emph> as would
be given if <termref def="key-va">assessment</termref> was undertaken again
with the final, fully assembled schema. </p>
</div2>
<div2 id="layer2">
<head>Layer 2: Schema Documents, Namespaces and Composition</head>
<p>The sub-sections of <specref ref="components"/> define an
XML representation for type definitions and element declarations and so on,
specifying their target namespace and collecting them into schema documents.
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>
<note><p> The core <termref def="key-va">assessment</termref>
architecture requires that a complete schema with all the necessary
declarations and definitions be available. This <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> involve resolving both 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. In support of such evolution, this specification
observes the design principle that references from one schema document
to a schema use mechanisms that directly parallel those used to
reference a schema from an instance document.</p></note>
<note><p>In the sections below, "schemaLocation" really belongs at layer 3. 
For convenience, it is documented with the layer 2 mechanisms of import and
include, with which it is closely associated.</p></note>
 <div3 id="compound-schema">
<head>Assembling a schema for a single target namespace from multiple schema definition documents<phrase dg="imp"> (<code>&lt;include&gt;</code>)</phrase></head>
 <p>Schema components for a single target namespace can be assembled from
several <termref def="key-schemaDoc">schema documents</termref>, that is several <eltref ref="schema"/> element
information items: </p>
 <reprdef>
 <reprelt eltname="include"/>
</reprdef>
 <p>A <eltref ref="schema"/> information item <rfc2119>may</rfc2119> 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. 
</p>
<p>The <termref def="key-schema">XML Schema</termref> corresponding 
to <eltref ref="schema"/> contains not only the components corresponding to its definition and declaration <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, but also
all the components of all the <termref def="key-schema">XML Schemas</termref> corresponding to any <eltref ref="include"/>d schema documents.
Such included schema documents <rfc2119>must</rfc2119> either (a) have the same
<code>targetNamespace</code> as the <eltref ref="include"/>ing schema document, or 
(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>
 <constraintnote type="src" id="src-include">
 <head>Inclusion Constraints and Semantics</head>
 <p>In addition to the conditions imposed on <eltref ref="include"/> element
information items by the schema for schemas, 
    <olist role="and.apply">
    <item id="c-ins">
     <p>If the <termref def="key-vv">actual value</termref> of the <code>schemaLocation</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>
successfully resolves
      <olist role="or">
       <item id="c-vxd">
        <p>It resolves to (a fragment of) a resource which is an XML
document (of type
<code>application/xml</code> or <code>text/xml</code> with an XML declaration
for preference, but this is not required), which in turn corresponds to a <eltref ref="schema"/>
element information item in a well-formed information set, which in turn
corresponds to a valid schema.</p>
       </item>
       <item>
        <p>It resolves to a <eltref ref="schema"/>
element information item in a well-formed information set, which in turn
corresponds to a valid schema.</p>
       </item>
      </olist>
      In either case call the <eltref ref="include"/>d <eltref ref="schema"/> item <local>SII</local>, the valid
schema <local>I</local> and the <eltref ref="include"/>ing item's parent <eltref ref="schema"/> item <local>SII’</local>.</p>
    </item>
     <item>
      <olist role="Or">
       <item id="c-normi">
        <p><local>SII</local> has a <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, and its <termref def="key-vv">actual value</termref> is identical to the <termref def="key-vv">actual value</termref> of the <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <local>SII’</local> (which <rfc2119>must</rfc2119> have such an <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>).</p>
       </item>
       <item id="c-normi2"><p>Neither <local>SII</local> nor <local>SII’</local> have a <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>.</p></item>
       <item id="c-chami"><p><local>SII</local> has no <code>targetNamespace</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> (but <local>SII’</local> does).</p></item>
      </olist>      
     </item>
     <item>
      <olist role="Case">
       <item>
         <p role="if"><clauseref ref="c-normi"/> or <clauseref ref="c-normi2"/> above is satisfied</p>
        <p role="then">the schema corresponding to
<local>SII’</local> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">includes</phrase> not
only definitions or declarations corresponding to the appropriate
members of its own <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, but also components identical to all
the <termref def="c">schema components</termref> of
<local>I</local>.</p>
        </item>
        <item id="c-docham">
         <p role="if"><clauseref ref="c-chami"/> above is satisfied</p>
         <p role="then">the schema corresponding to the
<eltref ref="include"/>d item's parent <eltref ref="schema"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">includes</phrase> not only definitions or declarations
corresponding to the appropriate members of its own <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, but
also components identical to all the <termref def="c">schema components</termref> of <local>I</local>,
except that anywhere the <termref def="key-null">absent</termref>
target namespace name would have appeared, the <termref def="key-vv">actual value</termref> of the
<code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of
<local>SII’</local> is used.  In particular, it replaces
<termref def="key-null">absent</termref> in the following places:
          <olist>
           <item><p>The  <xpropref role="anon">target
namespace</xpropref> of named schema components, both at the top level
and (in the case of nested type definitions and nested attribute and
element declarations whose <code>code</code> was <pt>qualified</pt>)
nested within definitions;</p></item>
           <item>
            <p>The<phrase dg="b2867-1"><propref comp="nc" prop="namespaces"/> of
             the </phrase> <propref comp="w" prop="namespace constraint"/> of
             a wildcard<!--*
* material suppressed here by diff group b2867-1 *
*--><!--*
* material suppressed here by diff group b2867-1 *
*--></p>
            <note dg="b2867-1">
             <p>If a schema document is to be included in a way as described in <clauseref ref="c-chami"/>,
              then it should avoid using either <code>##other</code> or <code>##local</code>
              in a wildcard, because the result of the inclusion will not be the same as if
              the schema document being included had a <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>
              that is the same as that of the including schema document.</p>
            </note>
           </item>
          </olist>
         </p>
        </item>
       </olist>
     </item>
   </olist>
   </p>
 <p>It is <emph>not</emph> an error for the <termref def="key-vv">actual value</termref> of the
<code>schemaLocation</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> to fail to resolve it all,
in which case no corresponding inclusion is performed.  It
<emph>is</emph> an error for it to resolve but the rest of clause 1
above to fail to be satisfied.  Failure to resolve <phrase dg="may">may well</phrase><!--*
* material suppressed here by diff group may *
*--> cause less than complete <termref def="key-va">assessment</termref> outcomes, of course.</p>
  
   <p>As discussed in <specref ref="conformance-missing"/>, <termref def="gloss-QName">QName</termref>s in XML representations <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> fail to <termref def="key-resolve">resolve</termref>, rendering components incomplete
and unusable because of missing subcomponents.  During schema
construction, implementations <rfc2119>must</rfc2119> retain <termref def="gloss-QName">QName</termref> values for such references, in case
an appropriately-named component becomes available to discharge the
reference by the time it is actually needed.  <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 <rfc2119>must</rfc2119> also be converted if <clauseref ref="c-docham"/> is
satisfied.</p>
</constraintnote>
 <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
<clauseref ref="c-nmd"/> of <specref ref="sch-props-correct"/>, but applications are
allowed, indeed encouraged, to avoid <eltref ref="include"/>ing the same schema document more than once to forestall the necessity of establishing identity
component by component.</p></note>
</div3>
<div3 id="modify-schema">
<head>Including modified component definitions<phrase dg="imp"> (<code>&lt;redefine&gt;</code>)</phrase></head>
 <p>In order to provide some support for evolution and versioning, it is
possible to incorporate components corresponding to a schema document
<emph>with modifications</emph>.  The modifications have a pervasive impact,
that is, only the redefined components are used, even when referenced from
other incorporated components, whether redefined themselves or not.</p>
 <reprdef>
 <reprelt eltname="redefine"/>
</reprdef>
 <p>A <eltref ref="schema"/> information item <rfc2119>may</rfc2119> 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. 
</p>
<p>The <termref def="key-schema">XML Schema</termref> corresponding 
to <eltref ref="schema"/> contains not only the components corresponding to its definition and declaration <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, but also
all the components of all the <termref def="key-schema">XML Schemas</termref> corresponding to any <eltref ref="redefine"/>d schema documents.
Such schema documents <rfc2119>must</rfc2119> either (a) have the same
<code>targetNamespace</code> as the <eltref ref="redefine"/>ing schema document, or 
(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>
 <p>The definitions within the <eltref ref="redefine"/> element itself are
restricted to be redefinitions of components from the <eltref ref="redefine"/>d
schema document, <emph>in terms of themselves</emph>.  That is, 
  <ulist>
   <item>
    <p>Type
definitions <rfc2119>must</rfc2119> use themselves as their base type definition;</p>
   </item>
   <item>
    <p>
     Attribute
group definitions and model group definitions <rfc2119>must</rfc2119> be supersets or subsets of their original
definitions, either by including exactly one
reference to themselves or by containing only (possibly restricted) components
which appear in a corresponding way in their <eltref ref="redefine"/>d selves.</p>
   </item>
  </ulist>Not all the components of the <eltref ref="redefine"/>d
schema document need be redefined.</p>
 <p>This mechanism is intended to provide a declarative and modular approach to
schema modification, with functionality no different except in scope from what
would be achieved by wholesale text copying and redefinition by editing.  In
particular redefining a type is not guaranteed to be side-effect free:  it <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*-->
have unexpected impacts on other type definitions which are based
on the redefined one, even to the extent that some such definitions become
ill-formed.</p>
 <note>
  <p>The pervasive impact of redefinition reinforces the need for
implementations to adopt some form of lazy or 'just-in-time' approach to
component construction, which is also called for in order to avoid
inappropriate dependencies on the order in which definitions and references appear in (collections of) schema documents.</p>
 </note>
 <note role="example">
  <eg xml:space="preserve">v1.xsd:
 &lt;xs:complexType name="personName"&gt;
  &lt;xs:sequence&gt;
   &lt;xs:element name="title" minOccurs="0"/&gt;
   &lt;xs:element name="forename" minOccurs="0" maxOccurs="unbounded"/&gt;
  &lt;/xs:sequence&gt;
 &lt;/xs:complexType&gt;

 &lt;xs:element name="addressee" type="personName"/&gt;

v2.xsd:
 &lt;xs:redefine schemaLocation="v1.xsd"&gt;
  &lt;xs:complexType name="personName"&gt;
   &lt;xs:complexContent&gt;
    &lt;xs:extension base="personName"&gt;
     &lt;xs:sequence&gt;
      &lt;xs:element name="generation" minOccurs="0"/&gt;
     &lt;/xs:sequence&gt;
    &lt;/xs:extension&gt;
   &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
 &lt;/xs:redefine&gt;

 &lt;xs:element name="author" type="personName"/&gt;
  </eg>
  <p>The schema corresponding to <code>v2.xsd</code> has everything specified
by <code>v1.xsd</code>, with the <code>personName</code> type redefined, as
well as everything it specifies itself.  According to
this schema, elements constrained
by the <code>personName</code> type <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> end with a <code>generation</code>
element.  This includes not only the <code>author</code> element, but also the
<code>addressee</code> element.</p>
 </note>
 <constraintnote type="src" id="src-redefine">
 <head>Redefinition Constraints and Semantics</head>
 <p>In addition to the conditions imposed on <eltref ref="redefine"/> element
information items by the schema for schemas
    <olist role="and.apply">
     <item><p>If there are any element information items among the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> other than <eltref ref="annotation"/> then the <termref def="key-vv">actual value</termref>
of the <code>schemaLocation</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> 
<rfc2119>must</rfc2119> successfully resolve.</p></item>
    <item>
     <p>If the <termref def="key-vv">actual value</termref> of the <code>schemaLocation</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>
successfully resolves
      <olist role="or">
       <item>
        <p>it resolves to (a fragment of) a resource which is an XML document
(see <clauseref ref="c-vxd"/>), which in turn corresponds to a <eltref ref="schema"/>
element information item in a well-formed information set, which in turn
corresponds to a valid schema.</p>
       </item>
       <item>
        <p>It resolves to a <eltref ref="schema"/>
element information item in a well-formed information set, which in turn
corresponds to a valid schema.</p>
       </item>
      </olist>
      In either case call the <eltref ref="redefine"/>d <eltref ref="schema"/> item <local>SII</local>, the valid
schema <local>I</local> and the <eltref ref="redefine"/>ing item's parent <eltref ref="schema"/> item <local>SII’</local>.</p>
    </item>
     <item>
      <olist role="Or">
       <item id="c-normir">
        <p><local>SII</local> has a <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, and its <termref def="key-vv">actual value</termref> is identical to the <termref def="key-vv">actual value</termref> of the <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <local>SII’</local> (which <rfc2119>must</rfc2119> have such an <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>).</p>
       </item>
       <item id="c-normi2r"><p>Neither <local>SII</local> nor <local>SII’</local> have a <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>.</p></item>
       <item id="c-chamir"><p><local>SII</local> has no <code>targetNamespace</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> (but <local>SII’</local> does).</p></item>
      </olist>      
     </item>
     <item>
      <olist role="Case">
       <item>
         <p role="if"><clauseref ref="c-normir"/> or <clauseref ref="c-normi2r"/> above is satisfied</p>
        <p role="then">the schema corresponding to
<local>SII’</local> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">includes</phrase> not
only definitions or declarations corresponding to the appropriate
members of its own <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, but also components identical to all
the <termref def="c">schema components</termref> of
<local>I</local>, with the exception of those explicitly redefined
(see <specref ref="src-expredef"/> below).</p>
        </item>
        <item>
         <p role="if"><clauseref ref="c-chamir"/> above is satisfied</p>
         <p role="then">the schema corresponding to
<local>SII’</local> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">includes</phrase> not
only definitions or declarations corresponding to the appropriate
members of its own <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, but also components identical to all
the <termref def="c">schema components</termref> of
<local>I</local>, with the exception of those explicitly redefined
(see <specref ref="src-expredef"/> below), except that anywhere the <termref def="key-null">absent</termref> target namespace name would have
appeared, the <termref def="key-vv">actual value</termref> of the <code>targetNamespace</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <local>SII’</local> is used (see <clauseref ref="c-docham"/> in <specref ref="src-include"/>
for details).</p>
        </item>
       </olist>       
     </item>
     <item>
      <p>Within the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, each <eltref ref="simpleType"/>
<rfc2119>must</rfc2119> have a <eltref ref="restriction"/> among its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> and
each <eltref ref="complexType"/> <rfc2119>must</rfc2119> have a
<code>restriction</code> or <code>extension</code> among its
grand-<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> the <termref def="key-vv">actual value</termref> of whose <code>base</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> <rfc2119>must</rfc2119> be the same as the <termref def="key-vv">actual value</termref> of its own
<code>name</code> attribute plus target namespace;</p>
     </item>
     <item>
      <p>Within the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, for each <eltref ref="group"/> <olist role="case">
       <item>
        <p role="if">it has a <eltref ref="group"/> among its contents at some level the <termref def="key-vv">actual value</termref> of whose
<code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is the same as the <termref def="key-vv">actual value</termref> of its own
<code>name</code> attribute plus target namespace</p>
        <p role="then">
         <olist role="andtest">
          <item>
           <p>It <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> exactly one such group.</p>
          </item>
          <item>
           <p>The <termref def="key-vv">actual value</termref> of both that group's <code>minOccurs</code> and
<code>maxOccurs</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <code>1</code> (or <termref def="key-null">absent</termref>).</p>
          </item>
         </olist>
        </p>
       </item>
       <item>
        <p role="if">it has no such self-reference</p>
        <p role="then">
         <olist role="andtest">
         <item>
          <p>The <termref def="key-vv">actual value</termref> of its own <code>name</code> attribute plus target
namespace <!--*
* material suppressed here by diff group modals *
*--> successfully <termref def="key-resolve">resolve<phrase dg="modals">s</phrase></termref> to a
model group definition in <local>I</local>.</p>
         </item>
         <item>
          <p>The <propref comp="mgd" prop="model group"/> of the model group definition which
corresponds to it per <specref ref="declare-namedModelGroup"/> 
<!--*
* material suppressed here by diff group rq17p *
*--><phrase dg="rq17p">accepts a subset of the element sequences accepted by that
model group definition in <local>I</local>.  See
<specref ref="subsumptionCheckP"/> for references to techniques
for checking the subset relation on content models</phrase>.</p>
         </item>
        </olist></p>
       </item>
      </olist></p>
      
     </item>
     <item>
      <p>Within the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, for each <eltref ref="attributeGroup"/>
       <olist role="case">
       <item>
        <p role="if">it has an <eltref ref="attributeGroup"/> among its contents the <termref def="key-vv">actual value</termref> of whose
<code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is the same as the <termref def="key-vv">actual value</termref> of its own
<code>name</code> attribute plus target namespace</p>
        <p role="then">it <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> exactly one such group.</p>
       </item>
       <item id="c-agrere">
        <p role="if">it has no such self-reference</p>
        <p role="then">
         <olist role="andtest">
         <item>
          <p>The <termref def="key-vv">actual value</termref> of its own <code>name</code> attribute plus target
namespace <!--*
* material suppressed here by diff group modals *
*--> successfully <termref def="key-resolve">resolve<phrase dg="modals">s</phrase></termref> to an
attribute group definition in <local>I</local>.</p>
         </item>
         <item>
          <p>The <propref comp="agd" prop="attribute uses"/> and 
<propref comp="agd" prop="attribute wildcard"/> of the attribute group definition which
corresponds to it per <specref ref="declare-attributeGroup"/> 
<phrase diff="nsq-del" dg="rq17a"><!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> <termref def="cd-model-restriction">valid
restrictions</termref> of the <propref comp="agd" prop="attribute uses"/> and
<propref comp="agd" prop="attribute wildcard"/> of that attribute group
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
definition in <local>I</local>)</phrase><phrase diff="nsq-add" dg="rq17a">accept
a subset of the attribute-instance sets accepted by the attribute group
definition in <local>I</local>.  See <specref ref="subsumptionCheck"/> for
further details on checking the subset relation on attribute groups</phrase>.</p>
         </item>
        </olist></p>
       </item>
      </olist>
       <note>
        <p>An attribute group restrictively redefined per <clauseref ref="c-agrere"/> corresponds to an attribute group whose <propref comp="agd" prop="attribute uses"/> consist all and only of those attribute uses corresponding to <eltref ref="attribute"/>s  explicitly present among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of the <eltref ref="redefine"/>ing <eltref ref="attributeGroup"/>. No inheritance from the <eltref ref="redefine"/>d attribute group occurs.  Its  <propref comp="agd" prop="attribute wildcard"/> is similarly based purely on an explicit <eltref ref="anyAttribute"/>, if present.</p>
       </note>
      </p>
     </item>
   </olist>
   </p>
</constraintnote>
 <constraintnote type="src" id="src-expredef">
  <head>Individual Component Redefinition</head>
  <p>Corresponding to each non-<eltref ref="annotation"/> member of the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of a <eltref ref="redefine"/> there are one or two schema components in
the <eltref ref="redefine"/>ing schema:</p>
  <olist>
   <item>
    <p>The <eltref ref="simpleType"/> and <eltref ref="complexType"/>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> information items each
correspond to two components:</p>
    <olist>
     <item id="icr-c11">
      <p>One component which corresponds to the top-level definition item with
the same <code>name</code> in
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><phrase dg="context-2338"> and its <xpropref role="anon">context</xpropref> is the redefining component, as defined in <clauseref ref="icr-c12"/> below</phrase>;</p>
     </item>
     <item id="icr-c12">
      <p>One component which corresponds to the information item itself, as defined
in <specref ref="components"/>, except that its <xpropref role="anon">base type definition</xpropref> is
the component defined in <clauseref ref="icr-c11"/> above.</p>
     </item>
    </olist>
    <p>This pairing ensures the coherence constraints on type definitions
are respected, while at the same time achieving the desired effect, namely that
references to names of redefined components in both the <eltref ref="redefine"/>ing and
<eltref ref="redefine"/>d schema documents resolve to the redefined component
as specified in 1.2 above.</p>
   </item>
   <item>
    <p>The <eltref ref="group"/> and <eltref ref="attributeGroup"/>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> each correspond to a single component, as defined in <specref ref="components"/>, except that<phrase dg="b2861cc-1g"> if and when a self-reference based on a  <code>ref</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> whose <termref def="key-vv">actual value</termref> 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
<local>I</local> is used.</phrase></p>
    <!--*
* material suppressed here by diff group b2861cc-1g *
*-->
   </item>
  </olist>
  <p>In all cases there <rfc2119>must</rfc2119> be a top-level definition item of the appropriate name and kind in
the <eltref ref="redefine"/>d schema document.</p>
 </constraintnote>
 <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
<clauseref ref="c-nmd"/> of <specref ref="sch-props-correct"/>, but applications are
allowed, indeed encouraged, to avoid <eltref ref="redefine"/>ing the same
schema document in the same way more than once to forestall the necessity of
establishing identity component by component (although this will have to be
done for the individual redefinitions themselves).</p></note>
</div3>
<div3 id="composition-schemaImport">
<head>References to schema components across namespaces<phrase dg="imp"> (<code>&lt;import&gt;</code>)</phrase></head>
<p>As described in <specref ref="concepts-data-model"/>, every top-level schema component is associated with
a target namespace (or, explicitly, with none).  <phrase dg="imp">Furthermore,
each schema document carries on its <eltref ref="schema"/> element
at most one <att>targetNamespace</att> attribute associating that document
with a target namespace.</phrase> This section sets out
the <!--*
* material suppressed here by diff group imp *
*-->
<phrase dg="imp">syntax and mechanisms by which references
<phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be made from within a <termref def="key-schemaDoc">schema
document</termref> to components not within that document's target
namespace.  Also included within the same syntax is an optional
facility for suggesting the URI of a 
<termref def="key-schemaDoc">schema document</termref> containing 
definitions and declarations for components from the foreign 
target namespace.</phrase></p>

<note dg="imp">
<p>
Some users of XML Schema Version 1.0 have mistakenly assumed that the
primary purpose of the <eltref ref="import"/> is to cause retrieval of
a resource identified by the <code>schemaLocation</code> attribute.
Although the function of <eltref ref="import"/> is
unchanged in XML Schema Version 1.1, the presentation below has been
reorganized to clarify the two separate purposes served by 
<eltref ref="import"/>.
</p></note>

<!--*
* material suppressed here by diff group imp *
*-->

 <reprdef>
 <reprelt eltname="import"/>
</reprdef>
 <p>The <eltref ref="import"/> element information item identifies namespaces
used in external references, i.e. those whose
<termref def="gloss-QName">QName</termref> identifies them as coming from a
different namespace (or none) than the enclosing schema document's
<code>targetNamespace</code>.</p>
<!--* !!! paragraph split introduced by diff group 'imp' !!! *-->
<!--* For now, I'm going to assume that we plan to ignore 
    * changes like that in producing diff.  But I also assume
    * we may change our minds.  I.e. don't delete the preceding
    * comment until we're sure. Ditto for comments about
    * moving things.
    *-->

<div4 id="composition-importLicenseReferences">
<head>Licensing References to Components Across Namespaces</head>

<p dg="imp">At least two conditions must be satisfied for a
reference to be made to a foreign component: there must be not only a
means of addressing such foreign components but also a signal to
schema-aware processors that a schema document contains such
references. Thus, the <eltref ref="import"/> element information item
identifies namespaces used in <emph>external component
references</emph>, i.e.  those whose 
<termref def="gloss-QName">QName</termref> identifies them as coming 
from a namespace different from that of the enclosing schema
document's <code>targetNamespace</code>. 
<!--* MSM suppresses the "(or none)" after "namespace" two lines up,
    * because it makes the sentence
    * too gnarly.  For purposes of this paragraph, the 'anonymous
    * namespace' is best treated as a namespace. Damn and blast the
    * editors of the spec who too much loved paradox. *-->
By contrast, a namespace used for other purposes in a schema document
need not be imported. There is no need, for example, to import the
namespace of a vocabulary such as HTML for use in schema <eltref ref="documentation"/> elements, unless that same namespace is also
used as the target namespace for component references.
</p>

<p>The <termref def="key-vv">actual value</termref> of 
<!--*
* material suppressed here by diff group imp *
*--><phrase dg="imp">the</phrase> 
<att>namespace</att>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> indicates that the containing schema document <rfc2119>may</rfc2119> contain
qualified references to schema components in that namespace (via one or more
prefixes declared with namespace declarations in the normal way).  If that
attribute is absent, then the import allows unqualified reference to components
with no target namespace.
Note that components to be imported need not be in the form of a
<termref def="key-schemaDoc">schema document</termref><phrase dg="imp"> and 
need not in particular be declared in the particular schema document identified 
by a <code>schemaLocation</code> attribute</phrase>;  the processor
is free to access or construct components using means of its own
choosing<phrase dg="imp">, whether or not a <att>schemaLocation</att> 
hint is provided</phrase>.</p>

<!--* !!! The following example was originally further down !!! *-->

<note role="example" id="eg.import.html">
<p>The same namespace <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be used both for real work, and in the course of
defining schema components in terms of foreign 
components<!--*
* material suppressed here by diff group imp *
*--><phrase dg="imp">.
The import in this example is necessary because there is a reference to the element
component <code>html:p</code>.  If there were no component reference, then
the import would be unnecessary;  no import is needed for use of a namespace 
in a <eltref ref="documentation"/> 
or similar schema document element or attribute name.</phrase></p>
<eg xml:space="preserve">&lt;schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:html="http://www.w3.org/1999/xhtml"
        targetNamespace="uri:mywork" xmlns:my="uri:mywork"&gt;

 &lt;import namespace="http://www.w3.org/1999/xhtml"/&gt;

 &lt;annotation&gt;
  &lt;documentation&gt;
   &lt;html:p&gt;[Some documentation for my schema]&lt;/html:p&gt;
  &lt;/documentation&gt;
 &lt;/annotation&gt;

 . . .

 &lt;complexType name="myType"&gt;
  &lt;sequence&gt;
   &lt;element ref="html:p" minOccurs="0"/&gt;
  &lt;/sequence&gt;
  . . .
 &lt;/complexType&gt;

 &lt;element name="myElt" type="my:myType"/&gt;
&lt;/schema&gt;
</eg>
<p>The treatment of references as <termref def="gloss-QName">QNames</termref> implies that since (with the exception of
the schema for schemas) the target namespace and the XML Schema namespace
differ, without massive redeclaration of the default namespace
<emph>either</emph> internal references to the names being defined in a schema document
<emph>or</emph> the schema declaration and definition elements themselves <rfc2119>must</rfc2119>
be explicitly qualified.  This example takes the first option — most other
examples in this specification have taken the second.</p>
</note>
</div4>

<div4 id="schemaLocationHints">
<head>Providing Hints for Schema Document Locations</head>

<p>The <termref def="key-vv">actual value</termref> of the <code>schemaLocation</code><phrase dg="imp">attribute</phrase>, if present<phrase dg="imp"> on
an <eltref ref="import"/> element</phrase>, gives a hint as to where a
serialization of a <termref def="key-schemaDoc">schema
document</termref> with declarations and definitions for <!--*
* material suppressed here by diff group imp *
*--><phrase dg="imp">the
imported</phrase> namespace (or none) <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be found.  When no <code>schemaLocation</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present, the schema author is leaving the
identification of that schema to the instance, application or user,
via the mechanisms described below in <specref ref="composition-instances"/>.  When a
<code>schemaLocation</code> <phrase dg="imp">attribute</phrase> is present, it <rfc2119>must</rfc2119> contain a single URI
reference which the schema author warrants will resolve to a
serialization of a <termref def="key-schemaDoc">schema
document</termref> containing <!--*
* material suppressed here by diff group imp *
*-->
component(s) in the
<eltref ref="import"/>ed namespace<!--*
* material suppressed here by diff group imp *
*-->.</p>
<!--* same para? new? *-->
<p dg="imp">Conformance profiles may further 
restrict the use of the <code>schemaLocation</code> attribute.   For example, 
one profile might mandate that the hint be 
<!--* <termref def="key-honor">honored</termref>,  *-->
honored by the schema software, perhaps calling for a 
processor-dependent error should the URI fail to resolve, 
or mandating that the hint agree with some expected URI value;  
another profile might mandate that the hint not 
be honored,
<!--* <termref def="key-honor">honored</termref>, *-->
etc.
</p>
 <note>
  <p>Since both the <code>namespace</code> and <code>schemaLocation</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> are optional, a bare <code>&lt;import/&gt;</code> information item
is allowed.  This simply allows unqualified reference to foreign
components with no target namespace without giving any hints as to where to find them.</p>
 </note>

<!--* !!! example eg.import.html was originally located here. *-->

 <constraintnote type="src" id="src-import">
 <head>Import Constraints and Semantics</head>
 <p>In addition to the conditions imposed on <eltref ref="import"/> element
information items by the schema for schemas
    <olist role="and.apply">
     <item>
      <olist role="Case">
       <item>
        <p role="if">the <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present</p>
        <p role="then">its <termref def="key-vv">actual value</termref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">does not</phrase> match the <termref def="key-vv">actual value</termref> of the
enclosing <eltref ref="schema"/>'s <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>.</p>
       </item>
       <item>
        <p role="if">the <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is not present</p>
        <p role="then">the enclosing <eltref ref="schema"/> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> a <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></p>
       </item>
      </olist>
     </item>
    <item id="c-ims">
     <!-- HST rolled back one change here, since I think it forecloses an
          avenue we need to preserve -->
     <p>If the application schema reference strategy<phrase dg="rq144a"><!--* 
, as defined in <specref ref="var_schema_con"/>, *--> succeeds</phrase> using the <termref def="key-vv">actual value</termref>s of
the <code>schemaLocation</code> and <code>namespace</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref><!--*
* material suppressed here by diff group rq144a *
*-->
      <olist role="or">
       <item id="c-ivr">
        <p>The <!--*
* material suppressed here by diff group rq144a *
*--><phrase dg="rq144a">result</phrase> is (a fragment of) a resource which is an XML document
(see <clauseref ref="c-vxd"/>), which in turn corresponds to a <eltref ref="schema"/>
element information item in a well-formed information set, which in turn
corresponds to a valid schema.</p>
<!--* N.B. in NM's original proposal, the words "which in
    * turn corresponds to a valid schema" were deleted. *-->
<!--* MSM is not sure why NM's proposal deleted the requirement
    * that the infoset correspond to a valid schema.  He rather
    * suspects that NM is simply uncomfortable with the idea that
    * the imported schema could be a schema before being imported.
    *-->
       </item>
       <item id="c-ivs">
        <p>The <!--*
* material suppressed here by diff group rq144a *
*--><phrase dg="rq144a">result</phrase> is a <eltref ref="schema"/>
element information item in a well-formed information set, which in turn
corresponds to a valid schema.</p>
<!--* N.B. in NM's original proposal, the words "which in
    * turn corresponds to a valid schema" were deleted. *-->
       </item>
<!--* following item originally added by ht Feb 2005, struck by WG
Aug 2006
       <item diff="add" dg="rq144a">
        <p>The result is a valid schema.</p>
       </item>
*-->
      </olist>
      In either case call the <eltref ref="schema"/> item <local>SII</local> and the valid schema <local>I</local>.</p>
<!--* NM suppresses "and the valid schema I" *-->
    </item>
     <item>
      <p>If <local>SII</local> exists, that is, <clauseref ref="c-ivr"/> or <clauseref ref="c-ivs"/>
above were satisfied, then <olist role="case">
       <item>
        <p role="if">there is a <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></p>
        <p role="then">its <termref def="key-vv">actual value</termref> <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">is</phrase> identical to the <termref def="key-vv">actual value</termref> of the <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <local>SII</local>.</p>
       </item>
       <item>
        <p role="if">there is no <code>namespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></p>
        <p role="then"><local>SII</local>
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals">has</phrase> no <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></p>
       </item>
      </olist></p>
     </item>
     <!--<item diff="add" dg="imp">
      <olist role="Case.ixm">
       <item>
        <p role="if">The processor is not 
	*- - &lt;termref def="key-honor">honoring&lt;/termref> *- -  honoring
        the <code>schemaLocation</code> hint
        </p>
        <p role="then">the <eltref ref="import"/> is treated as if the <code>schemaLocation</code> was not provided.
        </p>       
       </item>
        <item>
         <p role="otherwise">The processor is 
 	  honoring  - -* &lt;termref def="key-honor">honoring&lt;/termref> *- - 
          the <code>schemaLocation</code> 
         hint; in this case, the element information item <local>SII</local> &must; appear in the 
          - -* &lt;termref def="key-set-of-docs">input-set-of-schema-documents&lt;/termref>. *- - 
         input set of schema documents. 
         </p>    </item>
   </olist>
      </item>-->
   <!--* Ooops.  This has more of a dependency on NM's proposal than I had
       * realized.  -msm
       * HST removes this item altogether, believing it to be mis-conceived
         in any case.
         See also Schema Documentation Location Strategy below *-->
   </olist>
   </p>
<p>It is <emph>not</emph> an error for the application schema<phrase dg="rq144a"> component</phrase> reference strategy to fail.
 It <emph>is</emph> an error for it to <!--*
* material suppressed here by diff group rq144a *
*--><phrase dg="rq144a"> succeed</phrase> but
the rest of <clauseref ref="c-ims"/> above to
fail to be satisfied.  Failure<!--*
* material suppressed here by diff group rq144a *
*--> <phrase dg="may">may
well</phrase><!--*
* material suppressed here by diff group may *
*--> cause
less than complete <termref def="key-va">assessment</termref>
outcomes, of course.</p>

<p>The <termref def="c">schema components</termref> (that is
<propref comp="s" prop="type definitions"/>, <propref comp="s" prop="attribute declarations"/>, <propref comp="s" prop="element declarations"/>, <propref comp="s" prop="attribute group definitions"/>, <propref comp="s" prop="model group definitions"/>,
<propref comp="s" prop="notation declarations"/>) of a schema
corresponding to a
<eltref ref="schema"/> element information item with one or more
<eltref ref="import"/> element information items <rfc2119>must</rfc2119> include not
only definitions or declarations corresponding to the appropriate
members of its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, 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="c">schema
components</termref> identical to all the <termref def="c">schema
components</termref> of <local>I</local>.</p>
</constraintnote>
<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
<clauseref ref="c-nmd"/> of <specref ref="sch-props-correct"/>, but
applications are allowed, indeed encouraged, to avoid <eltref ref="import"/>ing the
same schema document more than once to forestall the necessity of
establishing identity component by component.  Given that the
<code>schemaLocation</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is only a hint, it is open
to applications to ignore all but the first <eltref ref="import"/> for
a given namespace, regardless of the
<termref def="key-vv">actual value</termref> of <code>schemaLocation</code>, but such a strategy risks
missing useful information when new <code>schemaLocation</code>s are
offered.</p></note>
</div4>
</div3>
</div2>
<div2 id="composition-instances">
<head>Layer 3: Schema Document Access and Web-interoperability</head>
<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, <phrase dg="modals">it is possible that</phrase> a range of standards and
conventions <phrase dg="may">may well</phrase><!--*
* material suppressed here by diff group may *
*--> evolve to support
interoperability of XML Schema implementations on the World Wide Web.
Layer 3 defines the minimum level of function required of all
conformant processors operating on the Web: it is intended that, over
time, future standards (e.g. XML Packages) for interoperability on the
Web and in other environments can be introduced without the need to
republish this specification.</p>
<div3 id="schema-repr">
<head>Standards for representation of schemas and retrieval of schema documents on the Web</head>
<p>For interoperability, serialized <termref def="key-schemaDoc">schema documents</termref>, like all other Web
resources, <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><rfc2119>should</rfc2119></phrase> be identified by URI and
retrieved using the standard mechanisms of the Web (e.g. http, https,
etc.) Such documents on the Web <rfc2119>must</rfc2119> be part of XML documents (see
<clauseref ref="c-vxd"/>), and are represented in the standard XML
schema definition form described by layer 2 (that is as
<eltref ref="schema"/> element information items). </p>
<note><p> there will often be times when a schema document will be a
complete XML<!--*
* material suppressed here by diff group fpwd *
*--> document whose document element is <eltref ref="schema"/>. There will be
other occasions in which <eltref ref="schema"/> items will be contained in other
documents, perhaps referenced using fragment and/or XPointer notation.
</p></note>
 <note>
  <p>The variations among server software and web site administration policies
make it difficult to recommend any particular approach to retrieval requests
intended to retrieve serialized <termref def="key-schemaDoc">schema documents</termref>.  An <code>Accept</code> header of <code>application/xml,
text/xml; q=0.9, */*</code> is perhaps a reasonable starting point.</p>
 </note>
</div3>
<div3 id="schema-loc">
<head>How schema definitions are located on the Web</head>
<p>As described in <specref ref="layer1"/>, processors are responsible for providing the
schema components (definitions and declarations) needed for <termref def="key-va">assessment</termref>. This
section introduces a set of normative conventions to facilitate interoperability
for instance and schema documents retrieved and processed from the Web.</p>
<note><p> As discussed above in <specref ref="layer2"/>, other non-Web
mechanisms for delivering schemas for <termref def="key-va">assessment</termref> <!--*
* material suppressed here by diff group modals *
*--> exist, but are outside the scope of this
specification.</p></note>
<p>Processors on the Web are free to undertake <termref def="key-va">assessment</termref> against arbitrary
schemas in any of the ways set out in <specref ref="validation_outcome"/>. However, it
is useful to have a common convention for determining the schema to use. Accordingly, general-purpose schema-aware processors (i.e. those not
specialized to one or a fixed set of pre-determined schemas)
undertaking <termref def="key-va">assessment</termref> of a document on the web
<rfc2119>must</rfc2119> behave as follows:
<ulist>
<item>
<p>unless directed otherwise by the user, <termref def="key-va">assessment</termref> is undertaken on the document
element information item of the specified document;</p>
</item>
<item>
<p>unless directed otherwise by the user, the
processor is required to construct a schema corresponding to a schema document
whose <code>targetNamespace</code> is
identical to the
namespace name, if any, of the element information item on which <termref def="key-va">assessment</termref> is undertaken.</p>
</item>
</ulist>
</p>
<p>The composition of the complete
schema for use in <termref def="key-va">assessment</termref> is discussed in <specref ref="layer2"/> above.
The means used to locate appropriate schema document(s) are processor and
application dependent, subject to the following requirements: </p>
<olist>
  <item><p>Schemas are represented on the Web in the form specified above in <specref ref="schema-repr"/>;</p></item>
  <item><p>The author of a document uses namespace declarations to
indicate the intended interpretation of names appearing therein;
<phrase dg="may">there may or may not be</phrase><!--*
* material suppressed here by diff group may *
*-->
a schema <phrase dg="modals">is</phrase> retrievable via
the namespace name.  Accordingly whether a processor's default
behavior is or is not to attempt such dereferencing, it <rfc2119>must</rfc2119> always
provide for user-directed overriding of that default.
</p>
<note><p> Experience suggests that it is not in all cases safe or desirable from
a performance point of view to dereference namespace names as a matter of course.  User community and/or
consumer/provider agreements may <!--* I can't find a way to get rid of this one.
Perhaps I'm too tired. *-->
establish circumstances in which such dereference is a sensible
default strategy:  this specification allows but does not require particular communities to
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>
<item>
<p>
On the other hand, in case a document author (human or not) created a
document with a particular schema in view, and warrants that some or
all of the document conforms to that schema, the
<code>schemaLocation</code> and <code>noNamespaceSchemaLocation</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> (in the XML Schema instance namespace,
that is, <code>http://www.w3.org/2001/XMLSchema-instance</code>) (hereafter
<code>xsi:schemaLocation</code> and
<code>xsi:noNamespaceSchemaLocation</code>) are provided.  The first records
the author's warrant with pairs of URI references (one for the namespace name, and
one for a hint as to the location of a schema document defining names for that
namespace name).  The second similarly provides a URI reference as a hint as to
the location of a schema document with no <code>targetNamespace</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>.</p>
<p>Unless directed otherwise, for example by the invoking application
or by command line option, processors
<!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><rfc2119>should</rfc2119></phrase> attempt to dereference each schema document location URI in the
<termref def="key-vv">actual value</termref> of such
<code>xsi:schemaLocation</code> and <code>xsi:noNamespaceSchemaLocation</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref>, see details below.</p>
</item>
<item>  <p><code>xsi:schemaLocation</code> and
<code>xsi:noNamespaceSchemaLocation</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> can occur on any
element.  However, it is an error if such an attribute occurs
<emph>after</emph> the first appearance of an element or attribute information
item within an
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
  <specref ref="layer1"/>, the corresponding schema <rfc2119>may</rfc2119> be lazily assembled, but is otherwise
  stable throughout <termref def="key-va">assessment</termref>. Although schema location attributes can occur
  on any element, and can be processed incrementally as discovered, their effect
  is essentially global to the <termref def="key-va">assessment</termref>. Definitions and declarations remain
  in effect beyond the scope of the element on which the binding is declared.
  </p></item>
</olist>
<note role="example"><p>Multiple schema bindings can be declared using a single
attribute.  For example consider a stylesheet:</p>
<eg xml:space="preserve">
 &lt;stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
            xmlns:html="http://www.w3.org/1999/xhtml"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.w3.org/1999/XSL/Transform
                                http://www.w3.org/1999/XSL/Transform.xsd
                                http://www.w3.org/1999/xhtml
                                http://www.w3.org/1999/xhtml.xsd"&gt;
</eg><p>The namespace names used in <code>schemaLocation</code> can, but need not
  be identical to those actually qualifying the element within whose start tag
it is found or its other attributes. For example, as above, all
  schema location information can be declared on the document element
of a document, if desired,
  regardless of where the namespaces are actually used. </p></note>
 <!--*
* material suppressed here by diff group rq144sc *
*-->
<p>Improved or alternative conventions for Web interoperability can
be standardized in the future without reopening this specification. For
example, the W3C is currently considering initiatives to standardize the
packaging of resources relating to particular documents and/or namespaces: this
would be an addition to the mechanisms described here for layer 3. This
architecture also facilitates innovation at layer 2: for example, it would be
possible in the future to define an additional standard for the representation of
schema components which allowed e.g. type definitions to be specified piece by
piece, rather than all at once.</p>
</div3>
</div2>

</div1>
<div1 id="conformance">
<head>Schemas and Schema-validity Assessment</head>
 <issue id="RQ-144i" role="1.1" status="open">
  <p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2822" target="reqs">Issue 2822 (RQ-144 required properties)</loc>
<!--* <loc href="&reqs;#WhichPSVIPropertiesReqd" target="reqs">RQ-144 (WhichPSVIPropertiesReqd)</loc> *-->
</p>
  <p>A much more systematic and detailed exposition will be provided of what kinds of
processing/processors imply what sorts of requirements for properties and their
values in the PSVI.</p>
  <resolution>
   <p>Several overlapping but distinct positions have been offered on
this issue.  See
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004Mar/0111.html">http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004Mar/0111.html</loc>)
and <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004Mar/0124.html">http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004Mar/0124.html</loc>
(W3C-member-only links) for details.  Summaries follow below:</p>

<glist>
<gitem>
<label>Position 1</label>
<def>
  <olist>
<item>
<p>We should say clearly that like the Infoset REC, our description
     of the PSVI defines, in the first instance, a vocabulary for 
     describing the outcome of schema-validity assessment.</p>
</item>

  <item>
<p>The conformance section should say explicitly what it means to 
     "completely and correctly implement . . . the Schema Information 
     Set Contributions".</p>
  

     <p>What it should say is that a "Minimally conforming" processor
     <rfc2119>must</rfc2119> expose all the specified information.</p>
</item>

  <item>
<p>The existing classes of conformant processors should be renamed</p>

     <olist>
<item><p>Minimally conforming general-purpose;</p></item>
     <item><p>Minimally conforming general-purpose, in conformance to the XML
        Representation of Schemas;</p></item>
     <item><p>Fully conforming general-purpose.</p></item>
</olist>

     <p>And new definitions of corresponding "... special-purpose"
     processors should be added.  These should allow 'self-consistent'
     subsets of Schema Component Constraints, Validation Rules, and
     Schema Information Set Contributions.</p>
</item>
</olist>
</def></gitem>
<gitem><label>Position 2</label>
<def>


  <ulist><item>
<p>Make support of the schema document format and the web media
    type orthogonal to levels of PSVI reporting.  A processor that
    accepts schema documents "conforms to the XML representation 
    of schemas."</p>
</item>

  <item>
<p>Make the processor conformance sections a completely separate
    chapter, to make clear that other people's processor conformance
    specs can appeal to the definition of the language and the PSVI.</p>
</item>

  <item>
<p>Make very clear that different specs can define processor
    conformance for different processor classes, and that our own
    processor classes are ones we recommend but not the only possible
    ones.</p>
</item></ulist></def></gitem>
<gitem><label>Position 3</label>
<def>
    <olist>
<item>
<p>We might say that in order to conform w.r.t. the XML
      transfer syntax, a processor <rfc2119>must</rfc2119> not only accept all
      valid schema documents, but should reject or flag all 
      invalid ones (i.e. it's not enough that the processor
      accept every member of the valid set; it <rfc2119>must</rfc2119> recognize
      the valid set by distinguishing it from its complement).</p>
</item>

    <item>
<p>The crucial bit might be the production of some part of the
      PSVI.  The reason an off the shelf XSLT is not a schema
      processor is that it doesn't produce any actual PSVI output.  If
      it did, it could be.</p>
</item>
</olist></def></gitem>
<gitem><label>Synthesis</label>
<def>
<p>It was proposed to amend RQ-144 to make it say (not necessarily in
these exact words):
</p>
  <ulist><item>
<p>There should be a clean separation between descriptions of the
    language(s) and descriptions of processors.</p>
</item>
  <item>
<p>We should make a good attempt to call out (in a separate
    chapter) a particular specification of processor classes that we
    hope will be useful and widely deployed.</p>
</item>
  <item>
<p>We should make clear that other processor class descs are OK.</p>
</item></ulist></def></gitem></glist>
  </resolution>
 </issue>
 <p>The architecture of schema-aware processing allows for a rich
characterization of XML documents:  schema validity is not a binary
predicate.</p>
 <p>This specification distinguishes between errors in schema
construction and structure, on the one hand, and schema validation
outcomes, on the other.</p>
<div2 id="conformance-schemaValidity">
<head>Errors in Schema Construction and Structure</head>
 <p>Before <termref def="key-va">assessment</termref> can be
attempted, a schema is required. Special-purpose applications are free
to determine a schema for use in <termref def="key-va">assessment</termref> by whatever means are appropriate,
but general purpose processors <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><rfc2119>should</rfc2119></phrase> implement <!--*
* material suppressed here by diff group rq144a *
*--><phrase dg="rq144a">and
document a strategy for <!--*
* material suppressed here by diff group rq144wg *
*--><phrase dg="rq144wg">assembling
a schema</phrase>, exploiting at
least some if not all of the non-hard-coded methods outlined in
<specref ref="var_schema_con"/></phrase>, starting with the namespaces
declared in the document whose <termref def="key-va">assessment</termref> is being undertaken, and the
<termref def="key-vv">actual value</termref>s of the <code>xsi:schemaLocation</code> and
<code>xsi:noNamespaceSchemaLocation</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> thereof, if
any, along with any other information about schema identity or schema
document location provided by users in application-specific ways, if
any.</p>
 <p>It is an
error if a
schema and all the components which are the value of any of its properties,
recursively, fail to satisfy all the relevant Constraints on Schemas set out in
the last section of each of the subsections of <specref ref="components"/>.</p>
 <p>If a schema is derived from one or more schema documents (that is, one or
more <eltref ref="schema"/> element information items) based on the
correspondence rules set out in <specref ref="components"/> and <specref ref="composition"/>, two additional
conditions hold:
  <ulist>
   <item>
    <p>It is an error if any such schema document would not be fully valid with respect
to a schema corresponding to the <specref ref="normative-schemaSchema"/>, that
is, following schema-validation with such a schema, the <eltref ref="schema"/> element
information items would have a <propref role="psvi" ref="e-validation_attempted"/>
property with value <pt>full</pt> or <pt>partial</pt> and a
<propref role="psvi" ref="e-validity"/> property
with value <pt>valid</pt>.</p>
   </item>
   <item>
    <p>It is an error if any such schema document is or contains any element
information items which violate any of the relevant Schema Representation
Constraints set out in <specref ref="outcome-src"/>.</p>
   </item>
  </ulist>
 </p>
 <p>The three cases described above are the only types of error which
this specification defines.  With respect to the processes of the
checking of schema structure and the construction of schemas
corresponding to schema documents, this specification imposes no
restrictions on processors after an error is detected. <phrase dg="ed18-errors">However <termref def="key-va">assessment</termref> with respect to schema-like entities
which do <emph>not</emph> satisfy all the above conditions is
incoherent.  Accordingly, conformant processors <rfc2119>must not</rfc2119> attempt to
undertake <termref def="key-va">assessment</termref> using such
non-schemas.</phrase></p>
</div2>

<div2 id="validation_outcome">
<head>Assessing Schema-Validity</head>

<p>With a schema which satisfies the conditions expressed in <specref ref="conformance-schemaValidity"/> above, the schema-validity of an
element<phrase dg="rq144si"> or attribute</phrase>
information item <phrase dg="rq144si">(the
<termref def="key-vr"/>)</phrase> can be assessed.  <!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">Five</phrase>
primary approaches to this are <!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">described
and given names here; conforming processors <rfc2119>may</rfc2119> but are not required
to provide interfaces so that they can be invoked in ways consistent 
with any or all of these approaches.</phrase>

<!--* The rather awkward tagging below is motivated by the fact that
    * one of the revisions performed in dg rq144 is changing from an
    * olist to a glist while keeping mostly the same text. 
    * Diff group rq144aux should be 'pre' if rq144 is pre,
    * and 'post' otherwise'.
    *-->
<!--* !!! need to add attribute-based entry points.
    *-->
<!--*
* material suppressed here by diff group rq144aux *
*-->
<glist dg="rq144aux">
<!--* In theory, it is the label elements which should be marked
    * as additions, rather than their contents.  But at the moment
    * (Feb. 2005), it is tagging the contents that is given the
    * better formatted results.
    *-->
<gitem>
<label><phrase dg="rq144si">type-driven validation</phrase></label>
<def>
<!--* addition of attributes requested by WG 2005-03.
    * change of 'appeals to' en passant; it's undefined
    * and doesn't seem the right word 
    *-->
<p>The user or application identifies a <!--*
* material suppressed here by diff group rq144si *
*--> type definition from among the <!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">type
definitions</phrase> of the schema<!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">. If the
<termref def="key-vr"/> is an element, then it is validated as described
in</phrase> <specref ref="cvc-assess-elt"/>
(<clauseref ref="c-td"/>)<!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">; if it is an
attribute, then it is validated with respect to that type definition
as described in <specref ref="cvc-simple-type"/>.</phrase></p>
<note dg="rq144wg2">
<p>Top-level (named) types <rfc2119>should</rfc2119> be supported; 
support for local types is optional.</p>
</note>
</def></gitem>

<gitem id="c-res">
<label><phrase dg="rq144si">element-driven validation</phrase></label>
<def>
<!--* change of 'appeals to' for consistency with other items
    *-->
<p>The user or application identifies a<phrase dg="rq144si">n</phrase> element declaration  from among the <!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">element
declarations</phrase> of the schema, checks that its <propref comp="ed" prop="name"/> and
<propref comp="ed" prop="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 <!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">the
item is validated as described in</phrase> <specref ref="cvc-assess-elt"/> (<clauseref ref="c-ed"/>);</p>
<note dg="rq144wg2">
<p>Top-level elements <rfc2119>should</rfc2119> be supported; 
support for local elements is optional.</p>
</note>
</def>
</gitem>

<gitem dg="rq144si">
<label>attribute-driven validation</label>
<def>
<!--* attribute-based entry point requested by WG 2006-03
    *-->
<p>The user or application identifies an attribute declaration from
among the <!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">attribute declarations</phrase> of the schema, checks
that its <propref comp="ed" prop="name"/> and
<propref comp="ed" prop="target namespace"/> match the <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> of the item, and the item is validated as described in
<specref ref="cvc-assess-attr"/> (<clauseref ref="c-ad"/>);</p>
</def>
</gitem>

<gitem>
<label><phrase dg="rq144si">lax wildcard validation</phrase></label>
<def><p>The processor starts from <specref ref="cvc-assess-elt"/> with
no stipulated declaration or definition<!--*
* material suppressed here by diff group rq144si *
*-->. <phrase dg="rq144si">If the <termref def="key-vr"/> and the schema determine an
element declaration (by the name of the element), an attribute
declaration (by the name of the attribute), or a type definition (by
<att>xsi:type</att>), then <termref def="key-sva">strict
validation</termref> is performed.  If they do
not idenfity any declaration or definition, then 
<termref def="key-lva">lax validation</termref> is
performed.</phrase>
<note dg="rq144si"><p>The name for this method of
invocation reflects the fact that it is analogous to the validation of
an element information item which matches a <pt>lax</pt>
wildcard.</p></note></p>
</def>
</gitem>
<gitem dg="rq144si">
<!--* strictly speaking we shouldn't need the phrase with diff/dg pair in 
    * the label element, but for now this is the way to get it colored right in
    * diffs. 2005-02-21 *-->
<!--* <label><phrase diff="add" dg="rq144si">strict wildcard validation</phrase></label>
<def>
<p diff="add" dg="rq144si">The processor starts 
from <specref ref="cvc-assess-elt"/> with
no stipulated declaration or definition, and if
the element information and the schema determine 
either an element declaration (by name) or a
type definition (via <code>xsi:type</code>), then 
<termref def="key-sva">strict</termref> assessment ensues;
if they do not identify any declaration or definition,
then no schema-validity assessment is performed (and
in typical cases the invoking process
will report an error to its environment; if no such
error is desired, lax wildcard validation will be used instead).
The name for this method of invocation
reflects the fact that it is analogous to the
validation of an element information item which matches a
<pt>strict</pt> wildcard.</p>
</def>
*-->
<label>strict wildcard validation</label>
<def>
<p>The processor starts from <specref ref="cvc-assess-elt"/> with no
stipulated declaration or definition. If the <termref def="key-vr"/>
and the schema determine an element declaration (by the name of the element),
an attribute declaration (by the name of the attribute), or a
type definition (via <code>xsi:type</code>), then <termref def="key-sva">strict</termref> <!--*
* material suppressed here by diff group rq144wg2 *
*--><phrase dg="rq144wg2">validation </phrase><!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">is
performed</phrase>; if they do not identify any declaration or
definition, then no schema-validity assessment is performed.
</p>
<!--*
* material suppressed here by diff group rq144wg2 *
*-->
<note>
<p>From the point of view of schema-validity assessment and the
resulting <termref def="key-psvi">post-schema-validation infoset</termref>, lax and strict wildcard validation 
<!--*
* material suppressed here by diff group rq144wg2 *
*--><phrase dg="rq144wg2">produce 
the same result</phrase>.  <!--*
* material suppressed here by diff group rq144wg2 *
*-->
The distinction is provided in order to provide two different terms
to express the different expectations of the invoking process.
</p>
<p>
In typical cases strict wildcard validation will be
performed when the invoking process expects the <termref def="key-vr"/>
to be declared and valid and will otherwise 
report an error to its environment.  If the absence of
a declaration for the <termref def="key-vr"/> counts as a successful
outcome of validation, then it is preferable to use lax wildcard 
validation instead.
</p>
<p dg="rq144wg2">
The name for this method of invocation
reflects the fact that it is analogous to the
validation of an element information item which matches a
<pt>strict</pt> wildcard.
</p>
</note>
</def>
</gitem>
</glist>
</p>

<note dg="rq144si">
<p>For type-, element-, and attribute-driven validation,
there is no requirement that the declaration or definition
identified by the user or application be a top-level
component of the schema.  Mechanisms for referring to 
other components are out of scope for this specification,
but see <bibref ref="ref-scds"/>.</p>
</note>

<!--* <ednote diff="add" dg="rq144si">
<edtext>The rules as given in 1.0 appear to restrict type-, element-,
and attribute-driven validation to top-level types, elements, and
attributes.  This wording proposal changes that, in the belief that
there is no reason to forbid the use of non-top-level components,
other than the practical difficulty of identifying them to the
processor.  The Working Group should consider whether it supports
this change.
</edtext>
</ednote> *-->

<p dg="rq144si"><termdef id="key-vr" term="validation root">The element or attribute information item at which <termref def="key-va">assessment</termref> begins is called the
<term>validation root</term>.</termdef></p>

<p>The outcome of <!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">schema-validity
assessment</phrase> will be manifest in the <xpropref role="psviAnon">validation attempted</xpropref> and <xpropref role="psviAnon">validity</xpropref> properties on the <phrase dg="rq144si"><termref def="key-vr"/>, and if the <termref def="key-vr"/>
is an</phrase> element information item <!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si">then also
on</phrase> its <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref> and <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, recursively, as
defined by <specref ref="sic-e-outcome"/> and <specref ref="sic-a-outcome"/>.  <phrase dg="rq144si">There is no
requirement that input which is not schema-valid be rejected by an
application.</phrase> It is up to applications to decide what
constitutes a successful outcome<phrase dg="rq144si"> of
validation</phrase>.</p>

<p>Note that every element and attribute information item
participating in the <termref def="key-va">assessment</termref> will
also have a <xpropref role="psviAnon">validation context</xpropref>
property which refers back to the <!--*
* material suppressed here by diff group rq144si *
*--><phrase dg="rq144si"><termref def="key-vr"/></phrase>.  <!--*
* material suppressed here by diff group rq144si *
*-->.</p>

  <note>
    <p>This specification does not reconstruct the XML<!--*
* material suppressed here by diff group fpwd *
*--> notion of
      <emph>root</emph> in either schemas or instances.  Equivalent
functionality is provided for at <termref def="key-va">assessment</termref>
invocation, via <clauseref ref="c-res"/> above.</p>
  </note>
  <note>
   <p>This specification has nothing normative to say about multiple
<termref def="key-va">assessment</termref> episodes.  It should
however be clear from the above that if a processor restarts <termref def="key-va">assessment</termref> with respect to a <termref def="key-psvi">post-schema-validation infoset</termref> some <termref def="key-psvi">post-schema-validation infoset</termref>
contributions from the previous <termref def="key-va">assessment</termref> <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> be overwritten.  Restarting <phrase dg="may">nonetheless may</phrase><!--*
* material suppressed here by diff group may *
*--> be useful, particularly at a node whose <xpropref role="psviAnon">validation attempted</xpropref> property is
<pt>none</pt>, in which case there are three obvious cases in which
additional useful information <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*-->
result:
    <ulist>
     <item>
      <p><termref def="key-va">assessment</termref> was not attempted
because of a <termref def="key-vn">validation</termref> failure, but
declarations and/or definitions are available for at least some of the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> or <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref>;</p>
     </item>
     <item>
      <p><termref def="key-va">assessment</termref> was not attempted
because a named definition or declaration was missing, but after
further effort the processor has retrieved it.</p>
     </item>
     <item>
      <p><termref def="key-va">assessment</termref> was not attempted
because it was <pt>skip</pt>ped, but the processor has at least some
declarations and/or definitions available for at least some of the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> or <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attributes</xpropref>.</p>
     </item>
    </ulist>
   </p>
  </note>
 </div2>
 <div2 id="conformance-missing">
  <head>Missing Sub-components</head>
  <p>At the beginning of <specref ref="components"/>, attention is drawn to the
fact that most kinds of schema components have properties which are described therein
as having other components, or sets of other components, as values, but that
when components are constructed on the basis of their correspondence with
element information items in schema documents, such properties usually
correspond to <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#QName">QNames</xtermref>, and the
<termref def="src-resolve">resolution</termref> of such <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#QName">QNames</xtermref> <phrase dg="may">may</phrase><!--*
* material suppressed here by diff group may *
*--> fail, resulting in one or more values of or containing <termref def="key-null">absent</termref> where a component is mandated.</p>
  <p>If at any time during <termref def="key-va">assessment</termref>, an
element or attribute information item is being <termref def="key-vn">validated</termref> with respect to a component of any kind any of whose
properties has or contains such an <termref def="key-null">absent</termref> value,
the <termref def="key-vn">validation</termref> is modified, as following:
   <ulist>
    <item>
     <p>In the case of attribute information items, the effect is
as if <clauseref ref="c-a1"/> of <specref ref="cvc-attribute"/> had failed;</p>
    </item>
    <item>
     <p>In the case of element information items, the effect is
as if <clauseref ref="c-ea"/> of <specref ref="cvc-elt"/> had failed;</p>
    </item>
    <item>
     <p>In the case of element information items, processors <rfc2119>may</rfc2119> choose to
continue <termref def="key-va">assessment</termref>: see <termref def="key-lva">lax assessment</termref>.</p>
    </item>
   </ulist>
  </p>
  <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
document as a whole cannot show a <propref role="psvi" ref="e-validation_attempted"/>
of <pt>full</pt>.</p>
 </div2>

<div2 id="conformance-processorResponsibilities">
<head>Responsibilities of Schema-aware Processors</head>
 <p>Schema-aware processors are responsible for processing XML documents,
schemas and schema documents, as appropriate given the level of conformance
(as defined in <specref ref="concepts-conformance"/>) they support,
consistently with the conditions set out above.</p>
</div2>
</div1>
</body>

<back>
<div1 id="normative-schemaSchema">
<head>Schema for <!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main">Schema Documents (Structures)</phrase> (normative)</head>

<p>The XML representation of the schema for schema documents is
presented here as a normative part of the specification, and as an
illustrative example of how the XML Schema language can define itself
using its own constructs. The names of XML Schema language types,
elements, attributes and groups defined here are evocative of their
purpose, but are occasionally verbose. </p>

<p>There is some annotation in comments, but a fuller annotation will
require the use of embedded documentation facilities or a hyperlinked
external annotation for which tools are not yet readily available.</p>

<!--*
* material suppressed here by diff group std-1915 *
*-->

<p dg="std-1915">Like any other XML document, schema
documents may carry XML and document type declarations. An XML
declaration and a document type declaration are provided here for
convenience. Since this schema document describes the XML Schema
language, the <code>targetNamespace</code> attribute on the
<code>schema</code> element refers to the XML Schema namespace
itself.</p>
<p dg="b1838">
Schema documents conforming to this specification may be in XML
1.0 or XML 1.1.  Conforming implementations may accept input in
XML 1.0 or XML 1.1 or both.  See <specref ref="intro-relatedWork"/>.
</p>
<!--*
* material suppressed here by diff group lp *
*-->
<codeScrap dg="lp" id="sdfsd" file="structures.xsd">
<head>Schema for schema documents</head>
<codeBlock>&lt;!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" [

&lt;!-- provide ID type information even for parsers which only read the
     internal subset --&gt;
&lt;!ATTLIST xs:schema          id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:complexType     id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:complexContent  id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:simpleContent   id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:extension       id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:element         id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:group           id  ID  #IMPLIED&gt; 
&lt;!ATTLIST xs:all             id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:choice          id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:sequence        id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:any             id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:anyAttribute    id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:attribute       id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:attributeGroup  id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:unique          id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:key             id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:keyref          id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:selector        id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:field           id  ID  #IMPLIED&gt;
<phrase dg="b2861cc-1">
&lt;!ATTLIST xs:assert          id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:report          id  ID  #IMPLIED&gt;
</phrase>
&lt;!ATTLIST xs:include         id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:import          id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:redefine        id  ID  #IMPLIED&gt;
&lt;!ATTLIST xs:notation        id  ID  #IMPLIED&gt;
]&gt;

<phrase>&lt;?xml version='1.0'?&gt;</phrase>
&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" blockDefault="#all"
           elementFormDefault="qualified" xml:lang="EN"
           targetNamespace="http://www.w3.org/2001/XMLSchema"
           version="<!--*
* material suppressed here by diff group lp *
*--><phrase dg="lp">structures.xsd (wd-20060831)</phrase>"&gt;
  &lt;xs:annotation&gt;
    &lt;xs:documentation <!--*
* material suppressed here by diff group  *
*--> <phrase>source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html"&gt;</phrase>
   The schema corresponding to this document is normative,
   with respect to the syntactic constraints it expresses in the
   XML Schema language.  The documentation (within &amp;lt;documentation&gt; elements)
   below, is not normative, but rather highlights important aspects of
   the W3C Recommendation of which this is a part&lt;/xs:documentation&gt;
  &lt;/xs:annotation&gt;
  &lt;xs:annotation&gt;
    &lt;xs:documentation&gt;
   The simpleType element and all of its members are defined
   in datatypes.xsd&lt;/xs:documentation&gt;
  &lt;/xs:annotation&gt;
  &lt;xs:include schemaLocation="datatypes.xsd"/&gt;
  &lt;xs:import namespace="http://www.w3.org/XML/1998/namespace"
             schemaLocation="http://www.w3.org/2001/xml.xsd"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
       Get access to the xml: attribute groups for xml:lang
       as declared on 'schema' and 'documentation' below
     &lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:import&gt;
  &lt;xs:complexType name="openAttrs"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
       This type is extended by almost all schema types
       to allow attributes from other namespaces to be
       added to user schemas.
     &lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:anyType"&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="annotated"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
       This type is extended by all types which allow annotation
       other than &amp;lt;schema&gt; itself
     &lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:openAttrs"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="id" type="xs:ID"/&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:group name="schemaTop"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   This group is for the
   elements which occur freely at the top level of schemas.
   All of their types are based on the "annotated" type by extension.&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:choice&gt;
      &lt;xs:group ref="xs:redefinable"/&gt;
      &lt;xs:element ref="xs:element"/&gt;
      &lt;xs:element ref="xs:attribute"/&gt;
      &lt;xs:element ref="xs:notation"/&gt;
    &lt;/xs:choice&gt;
  &lt;/xs:group&gt;
  &lt;xs:group name="redefinable"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   This group is for the
   elements which can self-redefine (see &amp;lt;redefine&gt; below).&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:choice&gt;
      &lt;xs:element ref="xs:simpleType"/&gt;
      &lt;xs:element ref="xs:complexType"/&gt;
      &lt;xs:element ref="xs:group"/&gt;
      &lt;xs:element ref="xs:attributeGroup"/&gt;
    &lt;/xs:choice&gt;
  &lt;/xs:group&gt;
  &lt;xs:simpleType name="formChoice"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   A utility type, not for public use&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:restriction base="xs:NMTOKEN"&gt;
      &lt;xs:enumeration value="qualified"/&gt;
      &lt;xs:enumeration value="unqualified"/&gt;
    &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:simpleType name="reducedDerivationControl"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   A utility type, not for public use&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:restriction base="xs:derivationControl"&gt;
      &lt;xs:enumeration value="extension"/&gt;
      &lt;xs:enumeration value="restriction"/&gt;
    &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:simpleType name="derivationSet"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   A utility type, not for public use&lt;/xs:documentation&gt;
      &lt;xs:documentation&gt;
   #all or (possibly empty) subset of {extension, restriction}&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:union&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:restriction base="xs:token"&gt;
          &lt;xs:enumeration value="#all"/&gt;
        &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:list itemType="xs:reducedDerivationControl"/&gt;
      &lt;/xs:simpleType&gt;
    &lt;/xs:union&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:simpleType name="typeDerivationControl"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   A utility type, not for public use&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:restriction base="xs:derivationControl"&gt;
      &lt;xs:enumeration value="extension"/&gt;
      &lt;xs:enumeration value="restriction"/&gt;
      &lt;xs:enumeration value="list"/&gt;
      &lt;xs:enumeration value="union"/&gt;
    &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:simpleType name="fullDerivationSet"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   A utility type, not for public use&lt;/xs:documentation&gt;
      &lt;xs:documentation&gt;
   #all or (possibly empty) subset of {extension, restriction, list, union}&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:union&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:restriction base="xs:token"&gt;
          &lt;xs:enumeration value="#all"/&gt;
        &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:list itemType="xs:typeDerivationControl"/&gt;
      &lt;/xs:simpleType&gt;
    &lt;/xs:union&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:element name="schema" id="schema"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-schema"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:openAttrs"&gt;
          &lt;xs:sequence&gt;
            &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
              &lt;xs:element ref="xs:include"/&gt;
              &lt;xs:element ref="xs:import"/&gt;
              &lt;xs:element ref="xs:redefine"/&gt;
              &lt;xs:element ref="xs:annotation"/&gt;
            &lt;/xs:choice&gt;
            &lt;xs:sequence minOccurs="0" maxOccurs="unbounded"&gt;
              &lt;xs:group ref="xs:schemaTop"/&gt;
              &lt;xs:element ref="xs:annotation" minOccurs="0"
                          maxOccurs="unbounded"/&gt;
            &lt;/xs:sequence&gt;
          &lt;/xs:sequence&gt;
          &lt;xs:attribute name="targetNamespace" type="xs:anyURI"/&gt;
          &lt;xs:attribute name="version" type="xs:token"/&gt;
          &lt;xs:attribute name="finalDefault" type="xs:fullDerivationSet"
                        default="" use="optional"/&gt;
          &lt;xs:attribute name="blockDefault" type="xs:blockSet" default=""
                        use="optional"/&gt;
          &lt;xs:attribute name="attributeFormDefault" type="xs:formChoice"
                        default="unqualified" use="optional"/&gt;
          &lt;xs:attribute name="elementFormDefault" type="xs:formChoice"
                        default="unqualified" use="optional"/&gt;
          &lt;xs:attribute name="id" type="xs:ID"/&gt;
          &lt;xs:attribute ref="xml:lang"/&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
    &lt;xs:key name="element"&gt;
      &lt;xs:selector xpath="xs:element"/&gt;
      &lt;xs:field xpath="@name"/&gt;
    &lt;/xs:key&gt;
    &lt;xs:key name="attribute"&gt;
      &lt;xs:selector xpath="xs:attribute"/&gt;
      &lt;xs:field xpath="@name"/&gt;
    &lt;/xs:key&gt;
    &lt;xs:key name="type"&gt;
      &lt;xs:selector xpath="xs:complexType|xs:simpleType"/&gt;
      &lt;xs:field xpath="@name"/&gt;
    &lt;/xs:key&gt;
    &lt;xs:key name="group"&gt;
      &lt;xs:selector xpath="xs:group"/&gt;
      &lt;xs:field xpath="@name"/&gt;
    &lt;/xs:key&gt;
    &lt;xs:key name="attributeGroup"&gt;
      &lt;xs:selector xpath="xs:attributeGroup"/&gt;
      &lt;xs:field xpath="@name"/&gt;
    &lt;/xs:key&gt;
    &lt;xs:key name="notation"&gt;
      &lt;xs:selector xpath="xs:notation"/&gt;
      &lt;xs:field xpath="@name"/&gt;
    &lt;/xs:key&gt;
    &lt;xs:key name="identityConstraint"&gt;
      &lt;xs:selector xpath=".//xs:key|.//xs:unique|.//xs:keyref"/&gt;
      &lt;xs:field xpath="@name"/&gt;
    &lt;/xs:key&gt;
  &lt;/xs:element&gt;
  &lt;xs:simpleType name="allNNI"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   for maxOccurs&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:union memberTypes="xs:nonNegativeInteger"&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:restriction base="xs:NMTOKEN"&gt;
          &lt;xs:enumeration value="unbounded"/&gt;
        &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
    &lt;/xs:union&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:attributeGroup name="occurs"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   for all particles&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:attribute name="minOccurs" type="xs:nonNegativeInteger" default="1"
                  use="optional"/&gt;
    &lt;xs:attribute name="maxOccurs" type="xs:allNNI" default="1" use="optional"/&gt;
  &lt;/xs:attributeGroup&gt;
  &lt;xs:attributeGroup name="defRef"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   for element, group and attributeGroup,
   which both define and reference&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:attribute name="name" type="xs:NCName"/&gt;
    &lt;xs:attribute name="ref" type="xs:QName"/&gt;
  &lt;/xs:attributeGroup&gt;
  &lt;xs:group name="typeDefParticle"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   'complexType' uses this&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:choice&gt;
      &lt;xs:element name="group" type="xs:groupRef"/&gt;
      &lt;xs:element ref="xs:all"/&gt;
      &lt;xs:element ref="xs:choice"/&gt;
      &lt;xs:element ref="xs:sequence"/&gt;
    &lt;/xs:choice&gt;
  &lt;/xs:group&gt;
  &lt;xs:group name="nestedParticle"&gt;
    &lt;xs:choice&gt;
      &lt;xs:element name="element" type="xs:localElement"/&gt;
      &lt;xs:element name="group" type="xs:groupRef"/&gt;
      &lt;xs:element ref="xs:choice"/&gt;
      &lt;xs:element ref="xs:sequence"/&gt;
      &lt;xs:element ref="xs:any"/&gt;
    &lt;/xs:choice&gt;
  &lt;/xs:group&gt;
  &lt;xs:group name="particle"&gt;
    &lt;xs:choice&gt;
      &lt;xs:element name="element" type="xs:localElement"/&gt;
      &lt;xs:element name="group" type="xs:groupRef"/&gt;
      &lt;xs:element ref="xs:all"/&gt;
      &lt;xs:element ref="xs:choice"/&gt;
      &lt;xs:element ref="xs:sequence"/&gt;
      &lt;xs:element ref="xs:any"/&gt;
    &lt;/xs:choice&gt;
  &lt;/xs:group&gt;
  &lt;xs:complexType name="attribute"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:annotated"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attributeGroup ref="xs:defRef"/&gt;
        &lt;xs:attribute name="type" type="xs:QName"/&gt;
        &lt;xs:attribute name="use" default="optional" use="optional"&gt;
          &lt;xs:simpleType&gt;
            &lt;xs:restriction base="xs:NMTOKEN"&gt;
              &lt;xs:enumeration value="prohibited"/&gt;
              &lt;xs:enumeration value="optional"/&gt;
              &lt;xs:enumeration value="required"/&gt;
            &lt;/xs:restriction&gt;
          &lt;/xs:simpleType&gt;
        &lt;/xs:attribute&gt;
        &lt;xs:attribute name="default" type="xs:string"/&gt;
        &lt;xs:attribute name="fixed" type="xs:string"/&gt;
        &lt;xs:attribute name="form" type="xs:formChoice"/&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="topLevelAttribute"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:attribute"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="ref" use="prohibited"/&gt;
        &lt;xs:attribute name="form" use="prohibited"/&gt;
        &lt;xs:attribute name="use" use="prohibited"/&gt;
        &lt;xs:attribute name="name" type="xs:NCName" use="required"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:group name="attrDecls"&gt;
    &lt;xs:sequence&gt;
      &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
        &lt;xs:element name="attribute" type="xs:attribute"/&gt;
        &lt;xs:element name="attributeGroup" type="xs:attributeGroupRef"/&gt;
      &lt;/xs:choice&gt;
      &lt;xs:element ref="xs:anyAttribute" minOccurs="0"/&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:group&gt;
  &lt;xs:element name="anyAttribute" type="xs:wildcard" id="anyAttribute"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-anyAttribute"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  <phrase dg="b2861cc-1">&lt;xs:group name="assertions"&gt;
    &lt;xs:sequence&gt;
      &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
        &lt;xs:element name="assert" type="xs:assertion"/&gt;
        &lt;xs:element name="report" type="xs:assertion"/&gt;
      &lt;/xs:choice&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:group&gt;
  &lt;xs:complexType name="assertion"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:annotated"&gt;
&lt;!-- 
<!--* <ednote>
<edtext>TODO: what type to use? A pattern? (would be too complicated).</edtext>
</ednote> *-->
--&gt;
        &lt;xs:attribute name="test"/&gt;
          &lt;xs:simpleType&gt;
            &lt;xs:annotation&gt;
              &lt;xs:documentation&gt;A subset of XPath expressions for use in assertion tests&lt;/xs:documentation&gt;
            &lt;/xs:annotation&gt;
            &lt;xs:restriction base="xs:token"&gt;
            &lt;/xs:restriction&gt;
          &lt;/xs:simpleType&gt;
        &lt;/xs:attribute&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;</phrase>
  &lt;xs:group name="complexTypeModel"&gt;
    &lt;xs:choice&gt;
      &lt;xs:element ref="xs:simpleContent"/&gt;
      &lt;xs:element ref="xs:complexContent"/&gt;
      &lt;xs:sequence&gt;
        &lt;xs:annotation&gt;
          &lt;xs:documentation&gt;
   This branch is short for
   &amp;lt;complexContent&gt;
   &amp;lt;restriction base="xs:anyType"&gt;
   ...
   &amp;lt;/restriction&gt;
   &amp;lt;/complexContent&gt;&lt;/xs:documentation&gt;
        &lt;/xs:annotation&gt;
        &lt;xs:group ref="xs:typeDefParticle" minOccurs="0"/&gt;
        &lt;xs:group ref="xs:attrDecls"/&gt;
        <phrase dg="b2861cc-1">&lt;xs:group ref="xs:assertions"/&gt;</phrase>
      &lt;/xs:sequence&gt;
    &lt;/xs:choice&gt;
  &lt;/xs:group&gt;
  &lt;xs:complexType name="complexType" abstract="true"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:annotated"&gt;
        &lt;xs:group ref="xs:complexTypeModel"/&gt;
        &lt;xs:attribute name="name" type="xs:NCName"&gt;
          &lt;xs:annotation&gt;
            &lt;xs:documentation&gt;
      Will be restricted to required or forbidden&lt;/xs:documentation&gt;
          &lt;/xs:annotation&gt;
        &lt;/xs:attribute&gt;
        &lt;xs:attribute name="mixed" type="xs:boolean" default="false"
                      use="optional"&gt;
          &lt;xs:annotation&gt;
            &lt;xs:documentation&gt;
      Not allowed if simpleContent child is chosen.
      May be overriden by setting on complexContent child.&lt;/xs:documentation&gt;
          &lt;/xs:annotation&gt;
        &lt;/xs:attribute&gt;
        &lt;xs:attribute name="abstract" type="xs:boolean" default="false"
                      use="optional"/&gt;
        &lt;xs:attribute name="final" type="xs:derivationSet"/&gt;
        &lt;xs:attribute name="block" type="xs:derivationSet"/&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="topLevelComplexType"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:complexType"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:group ref="xs:complexTypeModel"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="name" type="xs:NCName" use="required"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="localComplexType"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:complexType"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:group ref="xs:complexTypeModel"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="name" use="prohibited"/&gt;
        &lt;xs:attribute name="abstract" use="prohibited"/&gt;
        &lt;xs:attribute name="final" use="prohibited"/&gt;
        &lt;xs:attribute name="block" use="prohibited"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="restrictionType"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:annotated"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:choice minOccurs="0"&gt;
            &lt;xs:group ref="xs:typeDefParticle"/&gt;
            &lt;xs:group ref="xs:simpleRestrictionModel"/&gt;
          &lt;/xs:choice&gt;
          &lt;xs:group ref="xs:attrDecls"/&gt;
          <phrase dg="b2861cc-1">&lt;xs:group ref="xs:assertions"/&gt;</phrase>
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="base" type="xs:QName" use="required"/&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="complexRestrictionType"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:restrictionType"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:choice minOccurs="0"&gt;
            &lt;xs:annotation&gt;
              &lt;xs:documentation&gt;This choice is added simply to
                   make this a valid restriction per the REC&lt;/xs:documentation&gt;
            &lt;/xs:annotation&gt;
            &lt;xs:group ref="xs:typeDefParticle"/&gt;
          &lt;/xs:choice&gt;
          &lt;xs:group ref="xs:attrDecls"/&gt;
          <phrase dg="b2861cc-1">&lt;xs:group ref="xs:assertions"/&gt;</phrase>
        &lt;/xs:sequence&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="extensionType"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:annotated"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:group ref="xs:typeDefParticle" minOccurs="0"/&gt;
          &lt;xs:group ref="xs:attrDecls"/&gt;
          <phrase dg="b2861cc-1">&lt;xs:group ref="xs:assertions"/&gt;</phrase>
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="base" type="xs:QName" use="required"/&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:element name="complexContent" id="complexContent"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-complexContent"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:annotated"&gt;
          &lt;xs:choice&gt;
            &lt;xs:element name="restriction" type="xs:complexRestrictionType"/&gt;
            &lt;xs:element name="extension" type="xs:extensionType"/&gt;
          &lt;/xs:choice&gt;
          &lt;xs:attribute name="mixed" type="xs:boolean"&gt;
            &lt;xs:annotation&gt;
              &lt;xs:documentation&gt;
       Overrides any setting on complexType parent.&lt;/xs:documentation&gt;
            &lt;/xs:annotation&gt;
          &lt;/xs:attribute&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:complexType name="simpleRestrictionType"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:restrictionType"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:choice minOccurs="0"&gt;
            &lt;xs:annotation&gt;
              &lt;xs:documentation&gt;This choice is added simply to
                   make this a valid restriction per the REC&lt;/xs:documentation&gt;
            &lt;/xs:annotation&gt;
            &lt;xs:group ref="xs:simpleRestrictionModel"/&gt;
          &lt;/xs:choice&gt;
          &lt;xs:group ref="xs:attrDecls"/&gt;
          <phrase dg="b2861cc-1">&lt;xs:group ref="xs:assertions"/&gt;</phrase>
        &lt;/xs:sequence&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="simpleExtensionType"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:extensionType"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:annotation&gt;
            &lt;xs:documentation&gt;
      No typeDefParticle group reference&lt;/xs:documentation&gt;
          &lt;/xs:annotation&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:group ref="xs:attrDecls"/&gt;
          <phrase dg="b2861cc-1">&lt;xs:group ref="xs:assertions"/&gt;</phrase>
        &lt;/xs:sequence&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:element name="simpleContent" id="simpleContent"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-simpleContent"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:annotated"&gt;
          &lt;xs:choice&gt;
            &lt;xs:element name="restriction" type="xs:simpleRestrictionType"/&gt;
            &lt;xs:element name="extension" type="xs:simpleExtensionType"/&gt;
          &lt;/xs:choice&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="complexType" type="xs:topLevelComplexType" id="complexType"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-complexType"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  &lt;xs:simpleType name="blockSet"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
    A utility type, not for public use&lt;/xs:documentation&gt;
      &lt;xs:documentation&gt;
    #all or (possibly empty) subset of {substitution, extension,
    restriction}&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:union&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:restriction base="xs:token"&gt;
          &lt;xs:enumeration value="#all"/&gt;
        &lt;/xs:restriction&gt;
      &lt;/xs:simpleType&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:list&gt;
          &lt;xs:simpleType&gt;
            &lt;xs:restriction base="xs:derivationControl"&gt;
              &lt;xs:enumeration value="extension"/&gt;
              &lt;xs:enumeration value="restriction"/&gt;
              &lt;xs:enumeration value="substitution"/&gt;
            &lt;/xs:restriction&gt;
          &lt;/xs:simpleType&gt;
        &lt;/xs:list&gt;
      &lt;/xs:simpleType&gt;
    &lt;/xs:union&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:complexType name="element" abstract="true"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   The element element can be used either
   at the top level to define an element-type binding globally,
   or within a content model to either reference a globally-defined
   element or type or declare an element-type binding locally.
   The ref form is not allowed at the top level.&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:annotated"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:choice minOccurs="0"&gt;
            &lt;xs:element name="simpleType" type="xs:localSimpleType"/&gt;
            &lt;xs:element name="complexType" type="xs:localComplexType"/&gt;
          &lt;/xs:choice&gt;
          &lt;xs:group ref="xs:identityConstraint" minOccurs="0"
                    maxOccurs="unbounded"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attributeGroup ref="xs:defRef"/&gt;
        &lt;xs:attribute name="type" type="xs:QName"/&gt;
        &lt;xs:attribute name="substitutionGroup" type="xs:QName"/&gt;
        &lt;xs:attributeGroup ref="xs:occurs"/&gt;
        &lt;xs:attribute name="default" type="xs:string"/&gt;
        &lt;xs:attribute name="fixed" type="xs:string"/&gt;
        &lt;xs:attribute name="nillable" type="xs:boolean" default="false"
                      use="optional"/&gt;
        &lt;xs:attribute name="abstract" type="xs:boolean" default="false"
                      use="optional"/&gt;
        &lt;xs:attribute name="final" type="xs:derivationSet"/&gt;
        &lt;xs:attribute name="block" type="xs:blockSet"/&gt;
        &lt;xs:attribute name="form" type="xs:formChoice"/&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="topLevelElement"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:element"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:choice minOccurs="0"&gt;
            &lt;xs:element name="simpleType" type="xs:localSimpleType"/&gt;
            &lt;xs:element name="complexType" type="xs:localComplexType"/&gt;
          &lt;/xs:choice&gt;
          &lt;xs:group ref="xs:identityConstraint" minOccurs="0"
                    maxOccurs="unbounded"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="ref" use="prohibited"/&gt;
        &lt;xs:attribute name="form" use="prohibited"/&gt;
        &lt;xs:attribute name="minOccurs" use="prohibited"/&gt;
        &lt;xs:attribute name="maxOccurs" use="prohibited"/&gt;
        &lt;xs:attribute name="name" type="xs:NCName" use="required"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="localElement"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:element"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:choice minOccurs="0"&gt;
            &lt;xs:element name="simpleType" type="xs:localSimpleType"/&gt;
            &lt;xs:element name="complexType" type="xs:localComplexType"/&gt;
          &lt;/xs:choice&gt;
          &lt;xs:group ref="xs:identityConstraint" minOccurs="0"
                    maxOccurs="unbounded"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="substitutionGroup" use="prohibited"/&gt;
        &lt;xs:attribute name="final" use="prohibited"/&gt;
        &lt;xs:attribute name="abstract" use="prohibited"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:element name="element" type="xs:topLevelElement" id="element"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-element"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  &lt;xs:complexType name="group" abstract="true"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   group type for explicit groups, named top-level groups and
   group references&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:annotated"&gt;
        <!--*
* material suppressed here by diff group b2861cc-1g *
*-->
          &lt;xs:group ref="xs:particle" minOccurs="0" maxOccurs="unbounded"/&gt;
          <!--*
* material suppressed here by diff group b2861cc-1g *
*-->
        &lt;xs:attributeGroup ref="xs:defRef"/&gt;
        &lt;xs:attributeGroup ref="xs:occurs"/&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="realGroup"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:group"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:choice minOccurs="0" maxOccurs="1"&gt;
            &lt;xs:element ref="xs:all"/&gt;
            &lt;xs:element ref="xs:choice"/&gt;
            &lt;xs:element ref="xs:sequence"/&gt;
          &lt;/xs:choice&gt;
          <!--*
* material suppressed here by diff group b2861cc-1g *
*-->
        &lt;/xs:sequence&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="namedGroup"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:realGroup"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:choice minOccurs="1" maxOccurs="1"&gt;
            &lt;xs:element name="all"&gt;
              &lt;xs:complexType&gt;
                &lt;xs:complexContent&gt;
                  &lt;xs:restriction base="xs:all"&gt;
                    &lt;xs:group ref="xs:allModel"/&gt;
                    &lt;xs:attribute name="minOccurs" use="prohibited"/&gt;
                    &lt;xs:attribute name="maxOccurs" use="prohibited"/&gt;
                    &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
                  &lt;/xs:restriction&gt;
                &lt;/xs:complexContent&gt;
              &lt;/xs:complexType&gt;
            &lt;/xs:element&gt;
            &lt;xs:element name="choice" type="xs:simpleExplicitGroup"/&gt;
            &lt;xs:element name="sequence" type="xs:simpleExplicitGroup"/&gt;
          &lt;/xs:choice&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="name" type="xs:NCName" use="required"/&gt;
        &lt;xs:attribute name="ref" use="prohibited"/&gt;
        &lt;xs:attribute name="minOccurs" use="prohibited"/&gt;
        &lt;xs:attribute name="maxOccurs" use="prohibited"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="groupRef"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:realGroup"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="ref" type="xs:QName" use="required"/&gt;
        &lt;xs:attribute name="name" use="prohibited"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="explicitGroup"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   group type for the three kinds of group&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:group"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="name" type="xs:NCName" use="prohibited"/&gt;
        &lt;xs:attribute name="ref" type="xs:QName" use="prohibited"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="simpleExplicitGroup"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:explicitGroup"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="minOccurs" use="prohibited"/&gt;
        &lt;xs:attribute name="maxOccurs" use="prohibited"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:group name="allModel"&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
      &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
        &lt;xs:annotation&gt;
          &lt;xs:documentation&gt;This choice with min/max is here to
                          avoid a pblm with the Elt:All/Choice/Seq
                          Particle derivation constraint&lt;/xs:documentation&gt;
        &lt;/xs:annotation&gt;
        &lt;xs:element name="element" type="<!--*
* material suppressed here by diff group all-2506-1 *
*--><phrase dg="all-2506-1">xs:localElement</phrase>"/&gt;<phrase dg="all-2506-1">
        &lt;xs:element ref="xs:any"/&gt;</phrase>
      &lt;/xs:choice&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:group&gt;<!--*
* material suppressed here by diff group all-2506-1 *
*-->
  &lt;xs:complexType name="all"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   Only elements allowed inside&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:explicitGroup"&gt;
        &lt;xs:group ref="xs:allModel"/&gt;
        &lt;xs:attribute name="minOccurs" default="1" use="optional"&gt;
          &lt;xs:simpleType&gt;
            &lt;xs:restriction base="xs:nonNegativeInteger"&gt;
              &lt;xs:enumeration value="0"/&gt;
              &lt;xs:enumeration value="1"/&gt;
            &lt;/xs:restriction&gt;
          &lt;/xs:simpleType&gt;
        &lt;/xs:attribute&gt;
        &lt;xs:attribute name="maxOccurs" default="1" use="optional"&gt;
          &lt;xs:simpleType&gt;
            &lt;xs:restriction base="xs:allNNI"&gt;
              &lt;xs:enumeration value="1"/&gt;
            &lt;/xs:restriction&gt;
          &lt;/xs:simpleType&gt;
        &lt;/xs:attribute&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:element name="all" type="xs:all" id="all"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-all"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="choice" type="xs:explicitGroup" id="choice"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-choice"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="sequence" type="xs:explicitGroup" id="sequence"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-sequence"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="group" type="xs:namedGroup" id="group"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-group"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  &lt;xs:complexType name="wildcard"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:annotated"&gt;
        &lt;xs:attribute name="namespace" type="xs:namespaceList"<!--*
* material suppressed here by diff group b2867-1 *
*-->
                      use="optional"/&gt;
        <phrase dg="b2867-1">&lt;xs:attribute name="notNamespace" type="xs:basicNamespaceList"
                      use="optional"/&gt;
        &lt;xs:attribute name="notQName" use="optional"&gt;
          &lt;xs:simpleType&gt;
            &lt;xs:list itemType="xs:QName"/&gt;
          &lt;/xs:simpleType&gt;
        &lt;/xs:attribute&gt;</phrase>
        &lt;xs:attribute name="processContents" default="strict" use="optional"&gt;
          &lt;xs:simpleType&gt;
            &lt;xs:restriction base="xs:NMTOKEN"&gt;
              &lt;xs:enumeration value="skip"/&gt;
              &lt;xs:enumeration value="lax"/&gt;
              &lt;xs:enumeration value="strict"/&gt;
            &lt;/xs:restriction&gt;
          &lt;/xs:simpleType&gt;
        &lt;/xs:attribute&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:element name="any" id="any"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-any"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:wildcard"&gt;
          &lt;xs:attributeGroup ref="xs:occurs"/&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:annotation&gt;
    &lt;xs:documentation&gt;
   simple type for the value of the 'namespace' attr of
   'any' and 'anyAttribute'&lt;/xs:documentation&gt;
  &lt;/xs:annotation&gt;
  &lt;xs:annotation&gt;
    &lt;xs:documentation&gt;
   Value is
              ##any      - - any non-conflicting WFXML/attribute at all

              ##other    - - any non-conflicting WFXML/attribute from
                              namespace other than targetNS

              ##local    - - any unqualified non-conflicting WFXML/attribute 

              one or     - - any non-conflicting WFXML/attribute from
              more URI        the listed namespaces
              references
              (space separated)

    ##targetNamespace or ##local may appear in the above list, to
        refer to the targetNamespace of the enclosing
        schema or an absent targetNamespace respectively&lt;/xs:documentation&gt;
  &lt;/xs:annotation&gt;
  &lt;xs:simpleType name="namespaceList"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   A utility type, not for public use&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    <!--*
* material suppressed here by diff group b2867-1 *
*-->
    <phrase dg="b2867-1">&lt;xs:union memberTypes="xs:specialNamespaceList xs:basicNamespaceList" /&gt;</phrase>
  &lt;/xs:simpleType&gt;
  <phrase dg="b2867-1">&lt;xs:simpleType name="basicNamespaceList"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   A utility type, not for public use&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:list&gt;
      &lt;xs:simpleType&gt;
        &lt;xs:union memberTypes="xs:anyURI"&gt;
          &lt;xs:simpleType&gt;
            &lt;xs:restriction base="xs:token"&gt;
              &lt;xs:enumeration value="##targetNamespace"/&gt;
              &lt;xs:enumeration value="##local"/&gt;
            &lt;/xs:restriction&gt;
          &lt;/xs:simpleType&gt;
        &lt;/xs:union&gt;
      &lt;/xs:simpleType&gt;
    &lt;/xs:list&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:simpleType name="specialNamespaceList"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   A utility type, not for public use&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:restriction base="xs:token"&gt;
      &lt;xs:enumeration value="##any"/&gt;
      &lt;xs:enumeration value="##other"/&gt;
    &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;</phrase>
  &lt;xs:element name="attribute" type="xs:topLevelAttribute" id="attribute"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-attribute"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  &lt;xs:complexType name="attributeGroup" abstract="true"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:annotated"&gt;
        <!--*
* material suppressed here by diff group b2861cc-1g *
*-->
          &lt;xs:group ref="xs:attrDecls"/&gt;
          <!--*
* material suppressed here by diff group b2861cc-1g *
*-->
        &lt;xs:attributeGroup ref="xs:defRef"/&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="namedAttributeGroup"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:attributeGroup"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
          &lt;xs:group ref="xs:attrDecls"/&gt;
          <!--*
* material suppressed here by diff group b2861cc-1g *
*-->
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="name" type="xs:NCName" use="required"/&gt;
        &lt;xs:attribute name="ref" use="prohibited"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="attributeGroupRef"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:restriction base="xs:attributeGroup"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="ref" type="xs:QName" use="required"/&gt;
        &lt;xs:attribute name="name" use="prohibited"/&gt;
        &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
      &lt;/xs:restriction&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:element name="attributeGroup" type="xs:namedAttributeGroup"
              id="attributeGroup"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-attributeGroup"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="include" id="include"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-include"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:annotated"&gt;
          &lt;xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="redefine" id="redefine"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-redefine"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:openAttrs"&gt;
          &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
            &lt;xs:element ref="xs:annotation"/&gt;
            &lt;xs:group ref="xs:redefinable"/&gt;
          &lt;/xs:choice&gt;
          &lt;xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/&gt;
          &lt;xs:attribute name="id" type="xs:ID"/&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="import" id="import"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-import"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:annotated"&gt;
          &lt;xs:attribute name="namespace" type="xs:anyURI"/&gt;
          &lt;xs:attribute name="schemaLocation" type="xs:anyURI"/&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="selector" id="selector"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-selector"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:annotated"&gt;
          &lt;xs:attribute name="xpath" use="required"&gt;
            &lt;xs:simpleType&gt;
              &lt;xs:annotation&gt;
                &lt;xs:documentation&gt;A subset of XPath expressions for use
in selectors&lt;/xs:documentation&gt;
                &lt;xs:documentation&gt;A utility type, not for public
use&lt;/xs:documentation&gt;
              &lt;/xs:annotation&gt;
              &lt;xs:restriction base="xs:token"&gt;
                &lt;xs:annotation&gt;
                  &lt;xs:documentation&gt;The following pattern is intended to allow XPath
                           expressions per the following EBNF:
	  Selector    ::=    Path ( '|' Path )*  
	  Path    ::=    ('.//')? Step ( '/' Step )*  
	  Step    ::=    '.' | NameTest  
	  NameTest    ::=    QName | '*' | NCName ':' '*'  
                           child:: is also allowed
         &lt;/xs:documentation&gt;
                &lt;/xs:annotation&gt;
                &lt;xs:pattern
                     value="(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*"/&gt;
              &lt;/xs:restriction&gt;
            &lt;/xs:simpleType&gt;
          &lt;/xs:attribute&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="field" id="field"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-field"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:annotated"&gt;
          &lt;xs:attribute name="xpath" use="required"&gt;
            &lt;xs:simpleType&gt;
              &lt;xs:annotation&gt;
                &lt;xs:documentation&gt;A subset of XPath expressions for use
in fields&lt;/xs:documentation&gt;
                &lt;xs:documentation&gt;A utility type, not for public
use&lt;/xs:documentation&gt;
              &lt;/xs:annotation&gt;
              &lt;xs:restriction base="xs:token"&gt;
                &lt;xs:annotation&gt;
                  &lt;xs:documentation&gt;The following pattern is intended to allow XPath
                           expressions per the same EBNF as for selector,
                           with the following change:
          Path    ::=    ('.//')? ( Step '/' )* ( Step | '@' NameTest ) 
         &lt;/xs:documentation&gt;
                &lt;/xs:annotation&gt;
                &lt;xs:pattern
                     value="(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*"/&gt;
              &lt;/xs:restriction&gt;
            &lt;/xs:simpleType&gt;
          &lt;/xs:attribute&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:complexType name="keybase"&gt;
    &lt;xs:complexContent&gt;
      &lt;xs:extension base="xs:annotated"&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element ref="xs:selector"/&gt;
          &lt;xs:element ref="xs:field" minOccurs="1" maxOccurs="unbounded"/&gt;
        &lt;/xs:sequence&gt;
        &lt;xs:attribute name="name" type="xs:NCName" use="required"/&gt;
      &lt;/xs:extension&gt;
    &lt;/xs:complexContent&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:group name="identityConstraint"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;The three kinds of identity constraints, all with
                     type of or derived from 'keybase'.
   &lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:choice&gt;
      &lt;xs:element ref="xs:unique"/&gt;
      &lt;xs:element ref="xs:key"/&gt;
      &lt;xs:element ref="xs:keyref"/&gt;
    &lt;/xs:choice&gt;
  &lt;/xs:group&gt;
  &lt;xs:element name="unique" type="xs:keybase" id="unique"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-unique"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="key" type="xs:keybase" id="key"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-key"/&gt;
    &lt;/xs:annotation&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="keyref" id="keyref"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-keyref"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:keybase"&gt;
          &lt;xs:attribute name="refer" type="xs:QName" use="required"/&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="notation" id="notation"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-notation"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:annotated"&gt;
          &lt;xs:attribute name="name" type="xs:NCName" use="required"/&gt;
          &lt;xs:attribute name="public" type="xs:public"/&gt;
          &lt;xs:attribute name="system" type="xs:anyURI"/&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:simpleType name="public"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   A utility type, not for public use&lt;/xs:documentation&gt;
      &lt;xs:documentation&gt;
   A public identifier, per ISO 8879&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:restriction base="xs:token"/&gt;
  &lt;/xs:simpleType&gt;
  &lt;xs:element name="appinfo" id="appinfo"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-appinfo"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType mixed="true"&gt;
      &lt;xs:sequence minOccurs="0" maxOccurs="unbounded"&gt;
        &lt;xs:any processContents="lax"/&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name="source" type="xs:anyURI"/&gt;
      &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="documentation" id="documentation"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-documentation"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType mixed="true"&gt;
      &lt;xs:sequence minOccurs="0" maxOccurs="unbounded"&gt;
        &lt;xs:any processContents="lax"/&gt;
      &lt;/xs:sequence&gt;
      &lt;xs:attribute name="source" type="xs:anyURI"/&gt;
      &lt;xs:attribute ref="xml:lang"/&gt;
      &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:element name="annotation" id="annotation"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation
           source="http://www.w3.org/TR/2006/WD-xmlschema11-1-20060831/structures.html#element-annotation"/&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:complexType&gt;
      &lt;xs:complexContent&gt;
        &lt;xs:extension base="xs:openAttrs"&gt;
          &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
            &lt;xs:element ref="xs:appinfo"/&gt;
            &lt;xs:element ref="xs:documentation"/&gt;
          &lt;/xs:choice&gt;
          &lt;xs:attribute name="id" type="xs:ID"/&gt;
        &lt;/xs:extension&gt;
      &lt;/xs:complexContent&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:annotation&gt;
    &lt;xs:documentation&gt;
   notations for use within XML Schema schemas&lt;/xs:documentation&gt;
  &lt;/xs:annotation&gt;
  &lt;xs:notation name="XMLSchemaStructures" public="structures"
               system="http://www.w3.org/2000/08/XMLSchema.xsd"/&gt;
  &lt;xs:notation name="XML" public="REC-xml-19980210"
               system="http://www.w3.org/TR/1998/REC-xml-19980210"/&gt;
  &lt;xs:complexType name="anyType" mixed="true"&gt;
    &lt;xs:annotation&gt;
      &lt;xs:documentation&gt;
   Not the real urType, but as close an approximation as we can
   get in the XML representation&lt;/xs:documentation&gt;
    &lt;/xs:annotation&gt;
    &lt;xs:sequence&gt;
      &lt;xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/&gt;
    &lt;/xs:sequence&gt;
    &lt;xs:anyAttribute processContents="lax"/&gt;
  &lt;/xs:complexType&gt;
&lt;/xs:schema&gt;
</codeBlock>
</codeScrap>
<!--*
* material suppressed here by diff group rec12-main *
*-->


</div1>
<div1 id="normative-references">
<head>References (normative)</head>

<blist> 

<bibl xmlns:xlink="http://www.w3.org/1999/xlink" key="IETF RFC 2119" id="rfc-2119" dg="fpwd"><emph>RFC
2119: Key words for use in RFCs to Indicate Requirement Levels.</emph>
Scott Bradner, IETF (Internet Engineering Task Force), 1997. See <loc href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</loc>.</bibl>

<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-xsp2" key="XML Schema: Datatypes">
<emph>XML Schema<phrase dg="fpwd"> Version 1.1</phrase>
Part 2: Datatypes</emph>, <phrase dg="fpwd">Dave Peterson,
</phrase>Paul V. Biron and Ashok Malhotra, eds., W3C, <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd">16 July 2004</phrase>.  See <!--*
* material suppressed here by diff group fpwd *
*--><loc href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html" dg="fpwd">http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html</loc> </bibl>

<!--*
* material suppressed here by diff group fpwd *
*-->

<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-xml-1.0" key="XML 1.0"><emph>Extensible Markup Language
(XML) 1.0, <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd">Third Edition</phrase></emph>, Tim Bray et al.,
eds., W3C, <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd">4 February 2004</phrase>. See <!--*
* material suppressed here by diff group fpwd *
*--><loc href="http://www.w3.org/TR/2004/REC-xml-20040204/" dg="fpwd">http://www.w3.org/TR/2004/REC-xml-20040204/</loc> <phrase role="annotation" dg="b1838">For details of the dependency
of this specification on XML 1.1, see <specref ref="intro-relatedWork"/>.</phrase>
</bibl>

<bibl xmlns:xlink="http://www.w3.org/1999/xlink" dg="b1838" id="ref-xml" key="XML 1.1"><emph>Extensible Markup Language (XML) 1.1,</emph>, Tim Bray et
al., eds., W3C, 15 April 2004. See <loc href="http://www.w3.org/TR/xml11/">http://www.w3.org/TR/xml11/</loc> <phrase role="annotation" dg="b1838">For details of the dependency of this specification on XML
1.1, see <specref ref="intro-relatedWork"/>.  </phrase></bibl>

<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-xmlinfo" key="XML-Infoset"><emph>XML Information
Set</emph>, John Cowan and Richard Tobin, eds., W3C, <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd">4 February 2004</phrase>. See <!--*
* material suppressed here by diff group fpwd *
*-->
<loc href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/" dg="fpwd">http://www.w3.org/TR/2004/REC-xml-infoset-20040204/</loc>
</bibl>

<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-xml-namespaces-1.0" key="XML-Namespaces 1.0">
<emph>Namespaces in XML</emph>, Tim Bray et al., eds., W3C, 14 January
1999. See <loc href="http://www.w3.org/TR/1999/REC-xml-names-19990114/">http://www.w3.org/TR/1999/REC-xml-names-19990114/</loc>
<phrase role="annotation" dg="b1838">For details of the
dependency of this specification on Namespaces in XML 1.1, see
<specref ref="intro-relatedWork"/>.  </phrase></bibl>


<bibl xmlns:xlink="http://www.w3.org/1999/xlink" dg="b1838" id="ref-xml-namespaces" key="XML-Namespaces 1.1">
World Wide Web Consortium.  <emph>Namespaces in XML
1.1</emph>. Available at: <loc href="http://www.w3.org/TR/xml-names11/">http://www.w3.org/TR/xml-names11/</loc>
<phrase role="annotation">For details of the dependency of this
specification on Namespaces in XML 1.1, see <specref ref="intro-relatedWork"/>.  </phrase></bibl>

<!--*
* material suppressed here by diff group fpwd *
*-->

<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="bib-xpath" key="XPath">
<emph>XML Path Language</emph>, James Clark 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>

<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="bib-xpath2" key="XPath 2.0" dg="b2861cc-1">
<phrase dg="b2861cc-1"><emph>XML Path Language 2.0</emph>,
World Wide Web Consortium, 8 June 2006.
See <loc href="http://www.w3.org/TR/2006/CR-xpath20-20060608">http://www.w3.org/TR/2006/CR-xpath20-20060608</loc></phrase>
</bibl>

<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="bib-fno" key="Functions and Operators" dg="b2861cc-1">
<phrase dg="b2861cc-1"><emph>XQuery 1.0 and XPath 2.0 Functions and Operators</emph>,
World Wide Web Consortium, 8 June 2006.  See <loc href="http://www.w3.org/TR/2006/CR-xpath-functions-20060608">http://www.w3.org/TR/2006/CR-xpath-functions-20060608</loc></phrase>
</bibl>

<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="schema2e-1" key="XML Schema 2nd Edition" dg="fpwd"><emph>XML Schema Part 1: Structures</emph>, Henry S.
Thompson et al., eds., W3C 18 March 2004.  See <loc href="http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/">http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/</loc>.</bibl>
</blist>

</div1>
 <div1 id="outcomes">
  <head>Outcome Tabulations (normative)</head>
  <p>To facilitate consistent reporting of schema errors and <termref def="key-vn">validation</termref>
failures, this section tabulates and provides unique names for all the
constraints listed in this document.  Wherever such constraints have numbered
parts, reports <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><rfc2119>must</rfc2119></phrase> use the name given below plus the part number, separated
by a period ('.').  Thus for example <code>cos-ct-extends.1.2</code> <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><rfc2119>must</rfc2119></phrase> be
used to report a violation of the <clauseref ref="c-cte"/> of
<specref ref="cos-ct-extends"/>.</p>
      <issue id="RQ-137i" role="1.1" status="open">
	<p><loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=2843" target="reqs">RQ-137 (error-codes)</loc></p>
       <p>The promise that each error and failure defined in this
spec. would have a distinct identifier was not systematically delivered on in
version 1.0.  Version 1.1 will do better.</p>
       <resolution>
        <p>Add markup and/or an operational definition to support the
generation of an appropriate error code for any schema error or validation
failure specified outside a named constraint or rule, e.g. uses of <rfc2119>must</rfc2119> and,
in particular, phrases such as "it is an error" in <specref ref="conformance-schemaValidity"/>.</p>
       </resolution>
	</issue>
  <div2 id="validation_failures">
   <head>Validation Rules</head>
   <p/>
  </div2>
  <div2 id="PSVI_contributions">
   <head>Contributions to the post-schema-validation infoset</head>
  </div2>
  <div2 id="outcome-src">
   <head>Schema Representation Constraints</head>
   <p/>
  </div2>
  <div2 id="outcome-cos">
   <head>Schema Component Constraints</head>
  </div2>
 </div1>

<div1 id="var_terminology" dg="rq144">
<head>Terminology for implementation-defined features</head>
<p>This section defines some terms for use in describing
choices made by implementations in areas where the 
effect of XML Schema language features is explicitly
implementation-defined.</p>
<p>Future versions of this specification are expected to use
the terminology defined here to specify conformance profiles.
Conformance profiles may also be defined by other specifications
without requiring any revision to this specification.</p>

<div2 id="var_psvi" dg="rq144fl">
<head>Subset of the Post-schema-validation Infoset</head>
<p>This specification defines a number of ways in which the
information set taken as input is augmented in the course
of schema-validity assessment.  Conforming processors <rfc2119>may</rfc2119>
provide access to some or all of this information; in the
interests of simplifying discussion and documentation, this
section defines names for several subsets of the PSVI, with
the intention of simplifying short-hand descriptions of
processors.  These terms <rfc2119>may</rfc2119> be used to describe what parts of
the PSVI a particular schema processor provides access to, or
to specify requirements for processors, or for other purposes.
A processor provides access to a particular subset
of the PSVI if and only if it makes accessible some representation
of the information in question, for information items to which
it is applicable.  (The properties labeled <quote>if applicable</quote>
or <quote>where applicable</quote> below are simply the most obvious
cases of properties which do not apply to every information item;
the same qualification implicitly applies to all properties listed
below.)
<!--* (If a property does not apply to a 
particular item, the inclusion of the property name in a
list below does not constitute an obligation to provide
that property on that item.  *-->
</p>
<p>
If other subsets of the PSVI prove important in practice it is
expected that definitions of those subsets <rfc2119>may</rfc2119> be provided by
other specifications or in later revisions of this one.
</p>
<p>
The definition in this section of a term denoting a particular
subset of the PSVI does not constitute a requirement that
conforming processors provide access to that subset.
</p>
<!--* <p>
The inclusion of an item or property in any list below does
not constitute a requirement to include some representation 
of it in instances where it is not applicable or is undefined.
</p> *-->
<glist>
<gitem>
<label>root-validity subset</label><!--* was: red, then minimal *-->
<def>
<p><termdef id="dt-root-validity_subset" term="root-validity subset">The 
<term>root-validity subset</term> of the PSVI consists of the 
following properties of the <termref def="key-vr"/>:

<!--* 
<proplist role="psvi" item="vroot">
<propdef id="vr_validity" name="validity">xyz</propdef>
</proplist> *-->
<!--* <ulist>
<item>
<p><xpropref role="psviAnon">validity</xpropref> (on the validation root only)</p>
</item>
<item>
<p><xpropref role="psviAnon">validation attempted</xpropref> (on the validation root only)</p>
</item>
<item>
<p><xpropref role="psviAnon">error code</xpropref> (if applicable)</p>
</item>
</ulist> *-->
<!--*
* material suppressed here by diff group rq144wg2 *
*--></termdef><ulist>
<item><p><propref ref="e-validity"/></p></item>
<item><p><propref ref="e-validation_attempted"/></p></item>
<item><p><propref ref="e-schema_error_code"/>, if applicable</p></item>
</ulist>
</p>
</def>
</gitem>

<gitem>
<label>instance-validity subset</label><!--* was: yellow *-->
<def><p><termdef id="dt-instance-validity_subset" term="instance-validity subset">
The <term>instance-validity subset</term> of the PSVI consists of
the <termref def="dt-root-validity_subset"/>, plus the following properties on elements,
wherever applicable:
</termdef>
      <ulist>
<item>
<p><propref ref="e-validity"/></p></item>
<item><p><propref ref="e-validation_attempted"/></p></item>
<item><p><propref ref="e-notation_system"/></p></item>
<item><p><propref ref="e-notation_public"/></p></item>
<item><p><propref ref="e-schema_error_code"/></p></item>
</ulist>
and the following properties on attributes, wherever applicable:
<ulist>
<item><p><propref ref="a-validity"/></p></item>
<item><p><propref ref="a-validation_attempted"/></p></item>
<item><p><propref ref="a-schema_error_code"/></p></item>
</ulist>
</p>
<!--* 
<ulist>
<item>
<p><xpropref role="psviAnon">validity</xpropref> (on all items where applicable)</p>
</item>
<item>
<p><xpropref role="psviAnon">validation attempted</xpropref> (on all items where
applicable)</p>
</item>
<item>
<p><xpropref role="psviAnon">error code</xpropref> (where applicable)</p>
</item>
<item>
<p><xpropref role="psviAnon">notation system</xpropref> (where applicable)</p>
</item>
<item>
<p><xpropref role="psviAnon">notation public</xpropref> (where applicable)</p>
</item>
</ulist> *-->
</def>
</gitem>

<gitem>
<label>type-aware subset</label><!--* was: blue *-->
<def>
<p><termdef id="dt-type-aware_subset" term="type-aware subset">The 
<term>type-aware subset</term> of the PSVI consists of the
<termref def="dt-instance-validity_subset"/>, plus the following 
items and properties.</termdef>
It is intended that the type-aware subset of the PSVI include
all the information needed by schema-aware XQuery 1.0 or
XSLT 2.0 processors.
In each case, the information is to be provided in some
implementation-defined representation.  For elements:
<ulist>
<item><p><propref ref="e-declaration"/></p></item>
<item><p><propref ref="e-type_definition"/></p></item>
<item><p><propref ref="e-member_type_definition"/> (where applicable)</p></item>
</ulist>
and for attributes:<ulist>
<item><p><propref ref="a-declaration"/></p></item>
<item><p><propref ref="a-type_definition"/></p></item>
<item><p><propref ref="a-member_type_definition"/> (where applicable)</p></item>
<item><p><propref ref="a-schema_normalized_value"/> (where applicable)</p></item>
</ulist></p>
<note>
<p>In a future draft of this specification, it is expected that
a list of specific component properties to which access 
<rfc2119>should</rfc2119> or <rfc2119>must</rfc2119> be provided will be included.  No such
list is present in the current draft; input from readers,
users, schema authors, and implementors as to what properties
are most usefully exposed in this subset would be very welcome.</p>
</note>
</def>
</gitem>

<gitem>
<label>lightweight type-aware subset</label><!--* was: blue *-->
<def>
<p><termdef id="dt-lightweight_type-aware_subset" term="type-aware subset">The 
<term>lightweight type-aware subset</term> of the PSVI provides
the same information as the 
<termref def="dt-type-aware_subset"/>, except that instead of providing
direct access to schema components, it provides only their names and
related information.</termdef>
For elements:
<ulist>
<item><p><propref ref="e-type_definition_name"/></p></item>
<item><p><propref ref="e-type_definition_namespace"/></p></item>
<item><p><propref ref="e-type_definition_type"/></p></item>
<item><p><propref ref="e-type_definition_anonymous"/></p></item>
<item><p><propref ref="e-member_type_definition_name"/> (where applicable)</p></item>
<item><p><propref ref="e-member_type_definition_namespace"/> (where applicable)</p></item>
<item><p><propref ref="e-member_type_definition_anonymous"/> (where applicable)</p></item>
</ulist>
and for attributes:<ulist>
<item><p><propref ref="a-type_definition_name"/></p></item>
<item><p><propref ref="a-type_definition_namespace"/></p></item>
<item><p><propref ref="a-type_definition_type"/></p></item>
<item><p><propref ref="a-type_definition_anonymous"/></p></item>
<item><p><propref ref="a-member_type_definition_name"/> (where applicable)</p></item>
<item><p><propref ref="a-member_type_definition_namespace"/> (where applicable)</p></item>
<item><p><propref ref="a-member_type_definition_anonymous"/> (where applicable)</p></item>
<item><p><propref ref="a-schema_normalized_value"/> (where applicable)</p></item>
</ulist></p>
</def>
</gitem>
<gitem>
<label>full instance subset</label><!--* was: indigo *-->
<def><p>
<termdef id="dt-full_instance_subset" term="full instance subset">The 
<term>full instance subset</term> of the PSVI includes almost all
properties defined by this specification as applying to
element and attribute information items, but excludes 
schema components. It
consists of
the <termref def="dt-instance-validity_subset"/>, 
plus the following properties for elements:</termdef>
<ulist>
<item><p><propref ref="e-nil"/></p></item>
<item><p><propref ref="e-type_definition_name"/></p></item>
<item><p><propref ref="e-type_definition_namespace"/></p></item>
<item><p><propref ref="e-type_definition_type"/></p></item>
<item><p><propref ref="e-type_definition_anonymous"/></p></item>
<item><p><propref ref="e-member_type_definition_name"/> (where applicable)</p></item>
<item><p><propref ref="e-member_type_definition_namespace"/> (where applicable)</p></item>
<item><p><propref ref="e-member_type_definition_anonymous"/> (where applicable)</p></item>
<item><p><propref ref="e-schema_default"/> (where applicable)</p></item>
<item><p><propref ref="e-schema_information"/> some implementation-defined
representation (including at least the
names of resources from which components were drawn)</p>
</item>
</ulist>
and the following for attributes:
<ulist>
<item><p><propref ref="a-type_definition_name"/></p></item>
<item><p><propref ref="a-type_definition_namespace"/></p></item>
<item><p><propref ref="a-type_definition_type"/></p></item>
<item><p><propref ref="a-type_definition_anonymous"/></p></item>
<item><p><propref ref="a-member_type_definition_name"/> (where applicable)</p></item>
<item><p><propref ref="a-member_type_definition_namespace"/> (where applicable)</p></item>
<item><p><propref ref="a-member_type_definition_anonymous"/> (where applicable)</p></item>
<item><p><propref ref="a-schema_normalized_value"/></p></item>
<item><p><propref ref="a-schema_default"/> (where applicable)</p></item>
<item><p><propref ref="a-schema_specified"/> (where applicable)</p></item>
</ulist>
</p></def>
</gitem>
<gitem>
<label>full PSVI with components</label><!--* was: violet *-->
<def><p>
The <term>full PSVI with components</term> consists of
every property and information item defined in this
specification.
</p>
<p>
In exposing element declarations, attribute declarations,
type definitions, and other components, processors
providing access to the full subset must provide some
representation for all of the defined properties of the
components.  Note that although the properties are often
redundant with other information, it is not required that
the full subset include more than one representation of
redundant information.  
</p>
<note><p>
The PSVI is a description of an information set,
not a specification of a data structure or an application-programming
interface.  For convenience, this specification defines
in some cases more than one term for denoting a particular
piece of information:  for example, 
the <xpropref role="psviAnon">type definition name</xpropref> 
property of an element and the 
<xpropref role="psviAnon">name</xpropref>
property of the <xpropref role="psviAnon">type definition</xpropref> 
property of that element are the same piece of information.
If the <xpropref role="psviAnon">type definition</xpropref> is 
supplied, then the <xpropref role="psviAnon">type
definition name</xpropref> is necessarily also available.
</p>
<p>Similar observations can be made for other properties present in
the full-instance subset but not mentioned here.  Processors
<rfc2119>should</rfc2119> allow access to the information without requiring
users or applications to distinguish between the different
names or access paths under which it might be described in this
specification.  
</p></note>
</def>
</gitem>
</glist>
</div2>

<div2 id="var_schema_con" dg="rq144sc">
<head>
Terminology of schema construction
</head>
<p>
Conforming processors <rfc2119>may</rfc2119> implement any combination of the
following strategies for locating schema components, in any
order.  They <rfc2119>may</rfc2119> also implement other strategies.
</p>
<p>
The terminology offered here is intended to be useful in
discussions of processor behavior, whether documenting
existing behavior or describing required behavior.  
</p>
<p>
General-purpose processors <rfc2119>should</rfc2119> support multiple
methods for locating schema documents, and to provide user
control over which methods are used and how to fall back in
case of failure.
</p>
<div3>
<head>Identifying locations where components are sought</head>
<p>
Some terms describe how a processor identifies locations from
which schema components can be sought:
<glist>
<gitem>
<label>hard-coded schemas</label>
<def><p>
Full knowledge of one or more schemas is
built into the processor.  (Note: all processors are
required to have some built-in knowledge of 
of the built-in components.  <termref def="key-interchange">Schema-document
aware</termref> processors are additionally required to have
built-in knowledge of the XML Schema for schema documents.)
</p>
</def>
</gitem>
<gitem>
<label>hard-coded schema locations</label>
<def><p>
A list of locations at which
schema documents will be sought is built into the processor.
Particular locations can be associated with specific
namespaces or can be used to seek any schema document.
</p>

</def>
</gitem>
<gitem>
<label>named pairs</label>
<def><p>
At invocation time, the user passes a set or
sequence of (namespace-name, schema document) pairs to the
processor, e.g. as a command-line option.  (Can be used with
early or slow exit strategy.)  The namespace name is used
as a check on the document, not as an instruction; if the 
schema document has a target namespace which differs from 
the namespace name specified, the processor signals an error.
<!--* <ednote>
<edtext><quote>The processor signals an error</quote>? or <quote>the
pair is ignored</quote>? or <quote>a mistake has been made</quote>? or
<quote>trouble ensues</quote>? In March 2005 the Working Group said
<quote>Named pairs case should be edited to match the semantics of the
schemaLocation attribute.</quote>  But they didn't specify whether
they meant the <att>schemaLocation</att> on instance elements, which
doesn't specify what to do if the namespace given disagrees with the
target namespace of the schema document, or the
<att>schemaLocation</att> attribute on 
<eltref ref="xsd:include"/> and other schema-composition elements,
which specify that it's an error.
</edtext>
</ednote> *-->
</p>
</def>
</gitem>
<gitem>
<label>schema documents</label>
<def><p>
At invocation time, the user passes a set or sequence of schema
documents, or identifiers for schema documents (e.g. URIs), to the
processor, e.g. as a command-line option.  Each schema document
is associated with its target namespace, if any.
(Can be used with early or
slow exit strategy.)
</p>
</def>
</gitem>
<gitem>
<label>interactive inquiry</label>
<def><p>
For each namespace, the processor asks
the user interactively (though mechanisms not specified
here) where to seek the required schema components.
<note>
<p>This will perhaps be most useful as a fallback after other methods
have failed.</p>
</note>
</p>
</def>
</gitem>
<gitem>
<label>namespace name</label>
<def><p>
For each namespace, the processor attempts
to dereference the namespace name; if a schema document is
returned, it is processed. If some other kind of resource representation is
returned, processors <rfc2119>may</rfc2119> interpret its content to locate a schema document. 
<note>
<p>For example, if a RDDL document is returned,
a processor <rfc2119>may</rfc2119> search the RDDL document for <el>rddl:resource</el>
elements with the well-known property <att>xlink:role</att>
= <quote><code>http://www.w3.org/2001/XMLSchema</code></quote>
and then attempt to dereference the location(s) indicated on the
<att>xlink:href</att> attribute of the link.
</p>
</note>
</p>
</def>
</gitem>
<gitem>
<label>schemaLocation hints</label>
<def><p>
For each namespace, if the input
document includes one or more schemaLocation hints for that
namespace, the processor attempts to dereference those
locations.
</p>
</def>
</gitem>
<gitem>
<label>local repository</label>
<def><p>
For each namespace, a local repository of
schema components is consulted.  In some situations the consultation 
will require a key, in which see the terminology for indirection
given below.
</p>
</def>
</gitem>
</glist>
</p>
</div3>
<div3>
<head>Identifying methods of indirection</head>
<p>
Some terms describe various methods of indirection through
local catalogs, search paths, or local repositories of schema
documents and/or schema components.  In each of these, a
‘search key’ is assumed which helps to control the
indirection.  Terms for different sorts of search key are
defined below.
<glist>
<gitem>
<label>path indirection</label>
<def><p>
The processor has (hard-coded or accepted
as a parameter at invocation time or acquired from the
environment) a series of expressions into which a search key
is substituted.  After substitution, each element of the
series is interpreted as a file-system path and a schema
document is sought at the location indicated by that path.
</p>
</def>
</gitem>
<gitem>
<label>URI indirection</label>
<def><p>
The processor has (hard-coded or accepted
as a parameter at invocation time or acquired from the
environment) a series of expressions into which a search key
is substituted.  After substitution, each element of the
series is interpreted as a URI and a schema document is
sought at the location indicated by that path.
</p></def>
</gitem>
<gitem>
<label>catalog indirection</label>
<def><p>
The processor consults an OASIS catalog
(whose location can be hard-coded, passed as a parameter at
invocation time or acquired from the environment) using a
search key.  The key can be sought for as a namespace name,
as a public identifier, or as a system identifier.
</p></def>
</gitem>
<gitem>
<label>local repository indirection</label>
<def><p>
A local repository of schema
components is consulted using a search key.
</p></def>
</gitem>
<gitem>
<label>recursion</label>
<def><p>
The location(s) returned by a catalog or other
indirection mechanism are not consulted immediately but
instead used as a key in a renewed indirection.  Only after
the indirection mechanism fails to return a value is an
attempt made to dereference the last location returned.
</p></def>
</gitem>
<gitem>
<label>non-recursion</label>
<def><p>
The location(s) returned by a catalog or
other indirection mechanism are consulted immediately; they
are not used in recursive indirections.
</p></def></gitem>
</glist>
</p>
</div3>
<div3>
<head>Identifying the key for use in indirection</head>
<p>
Locating schema components by means of any of the ‘indirect’
methods just identified will sometimes involve the specification of a
value of some kind as a search key.  Processors <rfc2119>may</rfc2119> vary in
their choice of values to use as the key:
<glist>
<gitem>
<label>namespace key</label>
<def><p>
The namespace name is used as a key.
</p></def>
</gitem>
<gitem>
<label>location key</label>
<def><p>
A location (e.g. a schema location hint or the
location specified in a catalog or by the user) is used as a
key.
</p></def>
</gitem>
</glist></p>
</div3>
<div3>
<head>Identifying when to stop searching</head>
<p>
When more than one location is available for a given
namespace, two distinct behaviors can be distinguished; these
are orthogonal to other terms defined here:
<glist>
<gitem>
<label>early-exit</label>
<def><p>
When more than one location is available for a
given namespace, the processor attempts each in turn.  When
a location is successfully dereferenced and a schema
document is obtained, the later locations on the list are
ignored.
</p></def>
</gitem>
<gitem>
<label>slow-exit</label>
<def><p>
When more than one location is available for a
given namespace, the processor attempts each in turn.  All
locations are tried, even if a schema document for the
namespace has been obtained.
</p></def>
</gitem>
</glist></p>
</div3>
</div2>

<!--*
* material suppressed here by diff group rq144-abandoned *
*-->
</div1>

 <div1 id="infoset">
  <head>Required Information Set Items and Properties (normative)</head>
  <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>
  <glist>
   <gitem>
    <label>Attribute Information Item</label>
    <def>
     <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>,
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.attribute">normalized value</xpropref></p>
    </def>
   </gitem>
   <gitem>
    <label>Character Information Item</label>
    <def>
     <p><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.character">character code</xpropref></p>
    </def>
   </gitem>
   <gitem>
    <label>Element Information Item</label>
    <def>
     <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>,
<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
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">namespace attributes</xpropref></p>
    </def>
   </gitem>
   <gitem>
    <label>Namespace Information Item</label>
    <def>
     <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>
    </def>
   </gitem>
  </glist>
  <p>In addition, infosets <!--*
* material suppressed here by diff group modals *
*--><phrase dg="modals"><rfc2119>should</rfc2119></phrase> support the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.document">unparsedEntities</xpropref> property of the Document Information Item.  Failure to do so will mean all items of type <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ENTITY">ENTITY</xtermref> or <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ENTITIES">ENTITIES</xtermref> will fail to <termref def="key-vn">validate</termref>.</p>
  <p>This specification does not require any destructive alterations to the input
information set: all the information set contributions specified herein are additive.</p>
  <p>This appendix is intended to satisfy the requirements for <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2001/WD-xml-infoset-20010316/#conformance">Conformance</xspecref> to the <bibref ref="ref-xmlinfo"/> specification.</p>
 </div1>

<div1 id="impl-def-list" dg="rq144">
<head>Checklist of implementation-defined features</head>

<p>
This appendix provides a summary of XML Schema language
features whose effect is explicitly implementation-defined. 
Any software which claims to conform to this specification
<rfc2119>must</rfc2119> describe how these choices have been exercised, in
documentation which accompanies any conformance claim.
</p>
<p>In describing the choices made for a given processor, 
it is hoped that the terminology defined in <specref ref="var_terminology"/>
will be found useful.</p>
<olist>
<item dg="b1838">
<p>For the datatypes defined by
<bibref ref="ref-xsp2"/> which depend on
<bibref ref="ref-xml"/> or <bibref ref="ref-xml-namespaces"/>, it is
implementation-defined whether a schema processor takes the relevant
definitions from
<bibref ref="ref-xml"/> and <bibref ref="ref-xml-namespaces"/>, or
from
<bibref ref="ref-xml-1.0"/> and <bibref ref="ref-xml-namespaces-1.0"/>. Implementations <rfc2119>may</rfc2119> support either
the 1.0 versions of these datatypes, or the 1.1 versions, or both.
The same applies to the definition of whitespace.
</p>
</item>
<item dg="rq144cf">
<p>It is implementation-defined whether a schema processor
can read schema documents in the XML transfer syntax
defined here, or in the form of information sets which
correspond to the XML syntax.
(See <specref ref="concepts-conformance"/>, which defines 
<quote><termref def="key-minimallyConforming">minimally conforming</termref></quote>
processors as those which cannot read schema
documents in XML form, and <quote><termref def="key-interchange"/></quote> 
processors as those which can.)
</p>
</item>
<item dg="rq144cf">
<p>Whether a <termref def="key-interchange"/> processor 
is able to retrieve schema documents from the Web
is implementation-defined. (See <specref ref="concepts-conformance"/>,
which defines <quote><termref def="key-fullyConforming"/></quote> processors
as <termref def="key-interchange"/> processors 
which can retrieve schema documents from the Web.)</p>
</item>
<item dg="rq144si">
<p>The way in which a processor is invoked, and the way in
which values are specified for the schema to be used,
the information item to be validated,
and the declaration or definition with which to begin
validation, is implementation-defined.  (See 
<specref ref="validation_outcome"/>.)</p>
</item>
<item dg="rq144">
<p>The manner in which a processor provides access to the 
information items and properties in the PSVI to any 
downstream or user applications, or to the invoker, 
is implementation-defined.</p>
</item>
<item dg="rq144fl">
<p>The <!--*
* material suppressed here by diff group rq144wg2 *
*--> 
information items and properties in the PSVI to which
the processor provides access, if any, is implementation-defined.
(See <specref ref="var_psvi"/> for some subsets of the PSVI for
which this specification provides names and definitions.)</p>
</item>
<!--* 
  c They can provide access to different subsets of the PSVI,
    both as will be provided for in our resolution of RQ-144
    and as already documented:

    c.1 They may expose, or not expose, attribute
        declarations (sec. 3.2.5).

    c.2 They may expose either element declarations or the
        [nil] property (sec. 3.3.5).

    c.3 They may expose either type definitions or
        selected properties (name, namespace, anonymous, type)
        of them (sec. 3.2.5, 3.3.5).

    c.4 They may provide names for anonymous type
        definitions (sec. 3.2.5, 3.3.5).

    c.5 They may signal violation of ID uniqueness either
        at (as part of the PSVI representation of) the root
        element or "as it arises" (sec. 3.3.4).

        Strictly speaking, what the draft currently says is
        that processors are allowed to (i.e. MAY) "wish to
        detect and signal" the violation as it arises.  I take
        that to mean they are allowed not only to wish to do
        so, but to do so.

    c.6 They may expose, or not expose, the
        identity-constraint binding info item in the PSVI
        (sec. 3.11.5).

    c.7 They may expose, or not expose, the ID/IDREF
        binding info item in the PSVI (sec. 3.15.5).

    c.8 They may expose either notation components or
        selected properties (system, public)
        of them (sec. 3.12.5).
*-->
<item dg="rq144">
<p>When the <termref def="key-psvi">post-schema-validation infoset</termref> includes
<xpropref role="psviAnon">type definition name</xpropref> and
similar properties, it is implementation-defined whether
unique names are provided for anonymous type definitions.
</p></item>
<item dg="rq144sc">
<p>The method used for assembling a set of schema components
for use in validation is implementation-defined.
(See <specref ref="schema-loc"/> for the normative prose and
<specref ref="var_schema_con"/> for some terminology which
can be used in describing implementation choices.)</p>
</item>
<!--*
* material suppressed here by diff group rq144-abandoned *
*-->
<!--* 
  f Processors may assemble a schema incrementally (4.1,
    4.3.2).  This is required to have no effect on 
    the results of schema-validity assessment, but the spec
    goes out of its way to stress that processors MAY
    use lazy schema assembly.

  g Processors may have different views on whether two components
    are the same or not (Sec. 3.4.6).
*-->
</olist>
</div1>

 <div1 id="changes">
  <head>Changes since version 1.0</head>
  <div2 id="done">
   <head>Changes already made</head>

<p dg="ww-1">The <specref ref="cos-nonambig"/> constraint
has been relaxed.  While competition between two <termref def="key-ep">element particles</termref> is
still forbidden, as is competition between two <termref def="key-wp">wildcard particles</termref>,
competition between an <termref def="key-ep"/> and a <termref def="key-wp"/> is no
longer forbidden.  In the course of making this substantive change,
some editorial changes have also been made, in order to make the
exposition clearer.  (Readers familiar with version 1.0 of this
specification will find that the constraint works in almost exactly
the same way as it did in 1.0, except that content models in which an
input item matches either a <termref def="key-wp"/> or an <termref def="key-ep"/> are
now allowed.)
</p>

<p>Support for XML 1.1 has been added.  It is now implementation
defined whether datatypes dependent on definitions in 
XML (<bibref ref="ref-xml"/>, <bibref ref="ref-xml-1.0"/>)
and Namespaces in XML 
(<bibref ref="ref-xml-namespaces"/>, <bibref ref="ref-xml-namespaces-1.0"/>)
use the definitions
as found in version 1.1 or version 1.0 of those specifications.
</p>

<p>Correction of an error in version 1.0 of this specification 
relating to the construction of union types from other union types.
Unions may now appear as members of other unions, and all
restrictions of unions are correctly enforced.</p>

<p>A <propref comp="ctd" prop="context"/> property has been defined
for the definitions of complex and of simple types.</p>

<p>Since not all datatypes have a defined canonical representation
for all of their values, appeals to the canonical forms
of values have been eliminated.</p>

<p>Changes to ensure that the descriptions of the <compref name="Simple Type Definition" ref="std"/> component and of <termref def="simple-ur-type-itself">anySimpleType</termref> agree in all
details with those of <bibref ref="ref-xsp2"/>.</p>

<p>Addition of a note warning that the <local>replace</local> and
<local>collapse</local> values for whitespace handling are not a
reliable means of neutralizing the effects of word-wrapping and
pretty-printing of natural-language data and should not be used
for that purpose.</p>

<p>Some minor corrections and clarifications.  
Usage of some technical terminology has been clarified, normalized,
and aligned where appropriate with the usage in <bibref ref="ref-xsp2"/>.  Conditionals using <quote>if</quote>
have been rephrased to use <quote>if and only if</quote>
where appropriate.</p>

   
<p dg="b2867-1">Support for negative wildcard has been expanded to handle multiple namespaces.
 Support has also been added to specify a set of explicitly enumerated expanded names
 that are not allowed by the wildcard.</p>

<p dg="b2861cc-1">Support for check clauses to implement some
 co-occurrence constraints has been added.
 Each complex type can carry a list of assertions, which are checked when the complex type
 is used to validate an element information item.</p>

<p>Support for XML 1.1 has been added.  It is now implementation
defined whether datatypes dependent on definitions in 
XML (<bibref ref="ref-xml"/>, <bibref ref="ref-xml-1.0"/>)
and Namespaces in XML 
(<bibref ref="ref-xml-namespaces"/>, <bibref ref="ref-xml-namespaces-1.0"/>)
use the definitions
as found in version 1.1 or version 1.0 of those specifications.
</p>

<p>An error in version 1.0 of this specification 
relating to the construction of union types from other union types
has been corrected.
Unions may now appear as members of other unions, and all
restrictions of unions are correctly enforced, even when
<att>xsi:type</att> is used on an element to name a member of
the union.</p>

<p>A <propref comp="ctd" prop="context"/> property has been defined
for the definitions of complex and of simple types; this property
simplifies testing for the identity of anonymous type definitions.
See e.g. <specref ref="Complex_Type_Definition_details"/>.  The
{context} property replaces the {scope} property found in some earlier
drafts of this document.</p>

<p>Since not all datatypes have a defined canonical representation
for all of their values, appeals to the canonical forms
of values have been eliminated.</p>

<p>Changes have been made to ensure that the descriptions of the <compref name="Simple Type Definition" ref="std"/> component and of <termref def="simple-ur-type-itself">anySimpleType</termref> agree in all
details with those of <bibref ref="ref-xsp2"/>.</p>

<p>A note has been added, warning that the <local>replace</local> and
<local>collapse</local> values for whitespace handling are not a
reliable means of neutralizing the effects of word-wrapping and
pretty-printing of natural-language data and should not be used
for that purpose.</p>
      
<p>The magic RFC-2119 words have been distinguished when their normative
rfc-2119 meaning is intended, e.g. '<rfc2119>must</rfc2119>'.  See <specref ref="intro-terminology"/>.</p>
   
   
<p>Certain constraints involving <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref> have been extended to include lists
of <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref> and unions including
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#ID">ID</xtermref>.  See e.g. <specref ref="coss-attribute"/>.</p>
   
<p>Every component now has an {annotations} property whose value is a
sequence of annotation elements and out-of-band attributes.  See
e.g. <specref ref="Complex_Type_Definition_details"/>.</p>
   
   
<p>A new type definition called <code>anyAtomicType</code> has been
introduced into the type hierarchy between <code>anySimpleType</code>
and all the <emph>atomic</emph> built-in type definitions.  See
<specref ref="builtin-stds"/>.</p>
  
   
<p>The 'schema' component has an additional {identity-constraint
definitions} property containing all the identity constraints in the
corresponding schema.  See <specref ref="Schema_details"/> and
<specref ref="declare-schema"/>.</p>

<!--* diff added here to prevent dangling IDREF to Auxiliary_Components
    * when generating versions without ep01, MSM 2005-02-19 *-->
<p dg="ep01">The underlying basis for the definition of all
the different kinds of components has changed to make use of a regular
and formal tabulation of their properties.  This has been achieved by
introducing <emph>property records</emph> whereever version 1.0 had complex
property values.  For example instead of describing the {scope}
property as having "either <pt>global</pt> or a complex type
definition" for its value, a <compref ref="sc_e"/> property record is called
for, which in turn has its own simple properties and values.  See
e.g. <specref ref="Element_Declaration_details"/>.</p>

<p>Several minor corrections and clarifications have been made.
The usage of some technical terminology has been clarified, normalized,
and aligned where appropriate with the usage in <bibref ref="ref-xsp2"/>.  Conditionals using <quote>if</quote>
have been rephrased to use <quote>if and only if</quote>
where appropriate.</p>
  
  </div2>
  <div2 id="issues">
   <head>Outstanding issues</head>
   <p>In addition to the changes already made, the Working Group has decided on
a number of further changes which have not yet been reflected in this draft. 
These are indicated throughout the text as issues, including more or less
detail on the intended resolution.  The ones remaining in this draft are
summarized below, linked to their occurrence in the text above, where more
detail can be found, including links to the original requirement or other
point of origin.</p>
   <!--* <ednote diff="add" dg="b2867-1">
    <edtext>Need to remove RQ-9 from the list, but don't know how.</edtext>
   </ednote> *-->
   <issue role="tabulate" id="hack" status="open"><p/></issue>
  </div2>
 </div1>
 <div1 diff="nsq-add" id="subsumptionCheck" dg="rq17">
  <head>Implementing 'actually restricts'</head>
  <p>The constraint <specref ref="cos-ct-restrict"/> requires a check of
local validity over all possible element information items.  Although
this may at first appear difficult if not impossible, in fact it can be
down without too much difficulty.  The following conditions on a complex type
definition are sufficient to
guarantee that clause 1 of <specref ref="cos-ct-restrict"/> is satisfied: 
  </p>
  <constraintnote id="practicalSubsumption" type="cvc">
   <head>Checking complex type subsumption</head>
   <olist role="And">
      <item id="c-radN">
       <p>For each attribute use (call this <local>R</local>) in the <propref comp="ctd" prop="attribute uses"/>
        <olist role="caseval">
         <item>
          <p role="if">there is an attribute use in the
<propref comp="ctd" prop="attribute uses"/> of the <propref comp="ctd" prop="base type definition"/> (call this <local>B</local>) whose <propref comp="au" prop="attribute declaration"/> has the same <propref comp="ad" prop="name"/> and <propref comp="ad" prop="target namespace"/></p>
          <p role="then">
           <olist role="andtest">
            <item>
             <p><olist role="ortest">
             <item>
              <p><local>B</local>'s <propref comp="au" prop="required"/> is <pt>false</pt>.</p>
             </item>
             <item>
              <p><local>R</local>'s <propref comp="au" prop="required"/> is <pt>true</pt>.</p>
             </item>
            </olist></p>
            </item>
           <item>
            <p><local>R</local>'s <propref comp="au" prop="attribute declaration"/>'s <propref comp="ad" prop="type definition"/> is validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> from <local>B</local>'s <propref comp="ad" prop="type definition"/> given the
empty set as defined in
<specref ref="cos-st-derived-ok"/>.</p>
           </item>
           <item>
            <p><termdef id="key-evc" term="effective base value constraint" role="local">Let the
<term>effective value constraint</term> of an attribute use be
its <propref comp="au" prop="value constraint"/>, if present, otherwise
its <propref comp="au" prop="attribute declaration"/>'s <propref comp="ad" prop="value constraint"/>
</termdef>.  Then <olist role="ortest">
             <item>
              <p><local>B</local>'s <termref def="key-evc">effective value
constraint</termref> is <termref def="key-null">absent</termref> or <pt>default</pt>.</p>
             </item>
             <item>
              <p><local>R</local>'s <termref def="key-evc">effective value
constraint</termref> is
<pt>fixed</pt> with the same string as <local>B</local>'s.</p>
             </item>
            </olist>
            </p>
           </item>
          </olist>
          </p>
         </item>
         <item>
          <p role="otherwise">the <propref comp="ctd" prop="base type definition"/> has an <propref comp="ctd" prop="attribute wildcard"/> and
           the <phrase dg="b2867-1">(</phrase><propref comp="ad" prop="target namespace"/><phrase dg="b2867-1">, <propref comp="ad" prop="name"/>) pair</phrase>
           of the <local>R</local>'s <propref comp="au" prop="attribute declaration"/> is <termref def="key-vn">valid</termref> with respect to that wildcard, as defined in
           <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1"><specref ref="cvc-wildcard-name"/></phrase>.</p>
         </item>
        </olist>
       </p>
      </item>
      <item id="c-radN2">
       <p>For each attribute use in the <propref comp="ctd" prop="attribute uses"/> of
the <propref comp="ctd" prop="base type definition"/> whose <propref comp="au" prop="required"/> is
<pt>true</pt>, there is an attribute use with an <propref comp="au" prop="attribute declaration"/> with the same <propref comp="ad" prop="name"/> and <propref comp="ad" prop="target namespace"/> as its <propref comp="au" prop="attribute declaration"/> in the
<propref comp="ctd" prop="attribute uses"/> of the complex type definition
itself whose <propref comp="au" prop="required"/> is
<pt>true</pt>.</p>
      </item>
      <item id="c-rawN">
           <p>If there is an <propref comp="ctd" prop="attribute wildcard"/>, 
            <olist role="andtest">
             <item>
              <p>The
<propref comp="ctd" prop="base type definition"/> also has one.</p>
             </item>
             <item>
              <p>The complex
type definition's <propref comp="ctd" prop="attribute wildcard"/>'s <propref comp="w" prop="namespace constraint"/> is a subset of the <propref comp="ctd" prop="base type definition"/>'s <propref comp="ctd" prop="attribute wildcard"/>'s <propref comp="w" prop="namespace constraint"/>, as defined by <specref ref="cos-ns-subset"/>.</p>
             </item>
             <item>
      <p>The complex
type definition's <propref comp="ctd" prop="attribute wildcard"/>'s <propref comp="w" prop="process contents"/> is identical
to or stronger than the <propref comp="ctd" prop="base type definition"/>'s <propref comp="ctd" prop="attribute wildcard"/>'s <propref comp="w" prop="process contents"/>, where
<pt>strict</pt> is stronger than <pt>lax</pt> is stronger than <pt>skip</pt>.</p>
     </item>
            </olist>
           </p>
          </item>
    <item>
     <olist role="Caseval">
         <item>
          <p role="if">The <propref comp="ctd" prop="content type"/> of
the complex type definition <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/> <pt>simple</pt></phrase></p>
          <p role="then"><olist role="ortest">
            <item>
             <p>The <propref comp="ctd" prop="content type"/> of the <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/> <pt>simple</pt> and <propref comp="ct" prop="simple type definition"/></phrase> a simple type
definition from which
the <propref comp="ctd" prop="content type"/><phrase dg="ep01">'s <propref comp="ct" prop="simple type definition"/></phrase> is  validly <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/datatypes.html#dt-derived">derived</xtermref> given the empty set as defined in
<specref ref="cos-st-derived-ok"/>.</p>
            </item>
            <item>
             <p>The <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>mixed</pt>
and <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="particle"/> a <compref ref="p"/></phrase> which is <termref def="cd-emptiable">emptiable</termref> as defined in <specref ref="cos-group-emptiable"/>.</p>
            </item>
           </olist></p>
         </item>
         <item>
          <p role="if">The <propref comp="ctd" prop="content type"/> of
the complex type definition <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>empty</pt>
          </p>
          <p role="then"><olist role="ortest">
            <item>
             <p>The <propref comp="ctd" prop="content type"/> of the <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">also has <propref comp="ct" prop="variety"/></phrase> <pt>empty</pt>.</p>
            </item>
            <item>
             <p>The <propref comp="ctd" prop="content type"/> of the <propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>elementOnly</pt> or <pt>mixed</pt> and <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="particle"/> a <compref ref="p"/></phrase> which is <termref def="cd-emptiable">emptiable</termref> as defined in <specref ref="cos-group-emptiable"/>.</p>
            </item>
           </olist></p>
         </item>
         <item>
          <p role="otherwise">(the <propref comp="ctd" prop="content type"/> of the complex type
definition <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>element-only</pt> or <pt>mixed</pt>)
          <olist role="andtest">
           <item>
          <p>If the <propref comp="ctd" prop="content type"/> of the complex
type definition itself <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">has <propref comp="ct" prop="variety"/></phrase> <pt>mixed</pt>, that of the
<propref comp="ctd" prop="base type definition"/> <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01">also has <propref comp="ct" prop="variety"/></phrase> <pt>mixed</pt>.</p>
            </item>
          <item><p>The <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="particle"/></phrase> of the complex type definition's
<propref comp="ctd" prop="content type"/> subsumes
the <!--*
* material suppressed here by diff group ep01 *
*--><phrase dg="ep01"><propref comp="ct" prop="particle"/></phrase> of the <propref comp="ctd" prop="content type"/> of the <propref comp="ctd" prop="base type definition"/>.</p></item>
</olist></p>         
         </item>         
        </olist>
    </item>
   </olist>
   <p>Two published algorithms are available for checking content model
subsumption: <bibref ref="ThomTobXMLEu"/> and <bibref ref="FuchsBrownExtreme"/>.</p>
  </constraintnote>
 </div1>
 <div1 id="subsumptionCheckP" dg="rq17p">
  <head>Checking content-type restriction</head>
  <p>The constraint <specref ref="cos-content-act-restrict"/> requires 
<!--* a check of local validity over all possible sequences of element
information items, with respect to at least the derived and usually
the base content models.  Although this may at first appear difficult
if not impossible, in fact it can be done without too much difficulty.
All that is required is that the base content model subsume the
derived content model.  Three published algorithms are available for
checking content model subsumption: *-->
that the set of element sequences accepted by one complex type (the 
restriction) be a subset of the set accepted by another complex type
(the base type).  Among the published algorithms for checking
this subset relation are <bibref ref="ThomTobXMLEu"/>, 
<bibref ref="FuchsBrownExtreme"/> and <bibref ref="CMSMCQExtreme"/>.</p>
<!--* MSM does not believe 'subsumption' is the best term for
    * describing this simple straightforward subset relation.
    * Subsumption is better reserved for the more general relation
    * which holds if every member of a set of sequences corresponds,
    * after deletion of zero or more elements, to some member of
    * the subsuming set.
    *
    * If we use 'subsume' for 'be a superset of', we'll have no term
    * left to use where he thinks 'subsumption' is the only available term.
    *
    * Accordingly, he has deleted the use of the term 'subsumption' here.
    *-->
 </div1>
 <div1 id="component-diagram">
  <head>Schema Components Diagram (non-normative)</head>
  <graphic xmlns:xlink="http://www.w3.org/1999/xlink" source="components.jpg" alt="Diagram of schema components" map="compImage"/>
  <imagemap source="image-map.html" id="compImage"/>
 </div1>
 
<div1 id="normative-glossary">
<head>Glossary (non-normative)</head>
<p>The listing below is for the benefit of readers of a printed version of this
document:  it collects together all the definitions which appear in the
document above.</p>
<ednote role="glossary">
<edtext>An XSL macro is used to
collect definitions from throughout the spec and gather them here for easy
reference.</edtext>
</ednote>
<!--* do not delete the preceding ednote, unless you wish to suppress
    * the generation of the glossary *-->

</div1>
 <div1 id="nonnormative-schemaDTD">
<head>DTD for Schemas (non-normative)</head>
<p>The DTD for schema documents is given below.  Note there is <emph>no</emph>
implication here that <code>schema</code> <rfc2119>must</rfc2119> be the root element of a
document.</p>
<p>Although this DTD is non-normative, any XML document which is
     not valid per this DTD, given redefinitions in its internal subset of the
     'p' and 's' parameter entities below appropriate to its namespace
     declaration of the XML Schema namespace, is almost certainly not
     a valid schema document, with the exception of documents with multiple namespace
     prefixes for the XML Schema namespace itself.  Accordingly
authoring XML Schema documents using this DTD and DTD-based authoring tools, and
specifying it as the DOCTYPE of documents intended to be XML Schema
documents and validating them with a validating XML parser, are
sensible development strategies which users are encouraged to adopt
until XML Schema-based authoring tools and validators are more widely available.</p>
<!--* <ednote diff="add" dg="b2861cc-1">
<edtext>TODO: It is not clear to me where restriction is defined.</edtext>
</ednote> *-->
<!--*
* material suppressed here by diff group lp *
*-->
<codeScrap dg="lp" id="dtdfsd" file="structures.dtd">
<head>DTD for Schema Documents</head>
<codeBlock>&lt;!-- DTD for XML Schemas: Part 1: Structures
     Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN"
     Official Location: http://www.w3.org/2001/XMLSchema.dtd --&gt;
&lt;!-- Id: structures.dtd,v 1.1 2003/08/28 13:30:52 ht Exp  --&gt;
&lt;!-- With the exception of cases with multiple namespace
     prefixes for the XML Schema namespace, any XML document which is
     not valid per this DTD given redefinitions in its internal subset of the
     'p' and 's' parameter entities below appropriate to its namespace
     declaration of the XML Schema namespace is almost certainly not
     a valid schema. --&gt;

&lt;!-- The simpleType element and its constituent parts
     are defined in XML Schema: Part 2: Datatypes --&gt;
&lt;!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' &gt;

&lt;!ENTITY % p 'xs:'&gt; &lt;!-- can be overriden in the internal subset of a
                         schema document to establish a different
                         namespace prefix --&gt;
&lt;!ENTITY % s ':xs'&gt; &lt;!-- if %p is defined (e.g. as foo:) then you must
                         also define %s as the suffix for the appropriate
                         namespace declaration (e.g. :foo) --&gt;
&lt;!ENTITY % nds 'xmlns%s;'&gt;

&lt;!-- Define all the element names, with optional prefix --&gt;
&lt;!ENTITY % schema "%p;schema"&gt;
&lt;!ENTITY % complexType "%p;complexType"&gt;
&lt;!ENTITY % complexContent "%p;complexContent"&gt;
&lt;!ENTITY % simpleContent "%p;simpleContent"&gt;
&lt;!ENTITY % extension "%p;extension"&gt;
&lt;!ENTITY % element "%p;element"&gt;
&lt;!ENTITY % unique "%p;unique"&gt;
&lt;!ENTITY % key "%p;key"&gt;
&lt;!ENTITY % keyref "%p;keyref"&gt;
&lt;!ENTITY % selector "%p;selector"&gt;
&lt;!ENTITY % field "%p;field"&gt;
&lt;!ENTITY % group "%p;group"&gt;
&lt;!ENTITY % all "%p;all"&gt;
&lt;!ENTITY % choice "%p;choice"&gt;
&lt;!ENTITY % sequence "%p;sequence"&gt;
&lt;!ENTITY % any "%p;any"&gt;
&lt;!ENTITY % anyAttribute "%p;anyAttribute"&gt;
&lt;!ENTITY % attribute "%p;attribute"&gt;
&lt;!ENTITY % attributeGroup "%p;attributeGroup"&gt;
&lt;!ENTITY % include "%p;include"&gt;
&lt;!ENTITY % import "%p;import"&gt;
&lt;!ENTITY % redefine "%p;redefine"&gt;
&lt;!ENTITY % notation "%p;notation"&gt;
<phrase dg="b2861cc-1">
&lt;!ENTITY % assert   "%p;assert"&gt;
&lt;!ENTITY % report   "%p;report"&gt;
</phrase>

&lt;!-- annotation elements --&gt;
&lt;!ENTITY % annotation "%p;annotation"&gt;
&lt;!ENTITY % appinfo "%p;appinfo"&gt;
&lt;!ENTITY % documentation "%p;documentation"&gt;

&lt;!-- Customisation entities for the ATTLIST of each element type.
     Define one of these if your schema takes advantage of the
     anyAttribute='##other' in the schema for schemas --&gt;

&lt;!ENTITY % schemaAttrs ''&gt;
&lt;!ENTITY % complexTypeAttrs ''&gt;
&lt;!ENTITY % complexContentAttrs ''&gt;
&lt;!ENTITY % simpleContentAttrs ''&gt;
&lt;!ENTITY % extensionAttrs ''&gt;
&lt;!ENTITY % elementAttrs ''&gt;
&lt;!ENTITY % groupAttrs ''&gt;
&lt;!ENTITY % allAttrs ''&gt;
&lt;!ENTITY % choiceAttrs ''&gt;
&lt;!ENTITY % sequenceAttrs ''&gt;
&lt;!ENTITY % anyAttrs ''&gt;
&lt;!ENTITY % anyAttributeAttrs ''&gt;
&lt;!ENTITY % attributeAttrs ''&gt;
&lt;!ENTITY % attributeGroupAttrs ''&gt;
&lt;!ENTITY % uniqueAttrs ''&gt;
&lt;!ENTITY % keyAttrs ''&gt;
&lt;!ENTITY % keyrefAttrs ''&gt;
&lt;!ENTITY % selectorAttrs ''&gt;
&lt;!ENTITY % fieldAttrs ''&gt;
<phrase dg="b2861cc-1">
&lt;!ENTITY % assertAttrs ''&gt;
&lt;!ENTITY % reportAttrs ''&gt;
</phrase>
&lt;!ENTITY % includeAttrs ''&gt;
&lt;!ENTITY % importAttrs ''&gt;
&lt;!ENTITY % redefineAttrs ''&gt;
&lt;!ENTITY % notationAttrs ''&gt;
&lt;!ENTITY % annotationAttrs ''&gt;
&lt;!ENTITY % appinfoAttrs ''&gt;
&lt;!ENTITY % documentationAttrs ''&gt;

&lt;!ENTITY % complexDerivationSet "CDATA"&gt;
      &lt;!-- #all or space-separated list drawn from derivationChoice --&gt;
&lt;!ENTITY % blockSet "CDATA"&gt;
      &lt;!-- #all or space-separated list drawn from
                      derivationChoice + 'substitution' --&gt;

&lt;!ENTITY % mgs '%all; | %choice; | %sequence;'&gt;
&lt;!ENTITY % cs '%choice; | %sequence;'&gt;
&lt;!ENTITY % formValues '(qualified|unqualified)'&gt;


&lt;!ENTITY % attrDecls    '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'&gt;

<phrase dg="b2861cc-1">&lt;!ENTITY % assertions   '(%assert;| %report;)*'&gt;</phrase>

&lt;!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;<phrase dg="b2861cc-1">, %assertions;</phrase>)'&gt;

&lt;!-- This is used in part2 --&gt;
&lt;!ENTITY % restriction1 '((%mgs; | %group;)?)'&gt;

%xs-datatypes;

&lt;!-- the duplication below is to produce an unambiguous content model
     which allows annotation everywhere --&gt;
&lt;!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*,
                    ((%simpleType; | %complexType;
                      | %element; | %attribute;
                      | %attributeGroup; | %group;
                      | %notation; ),
                     (%annotation;)*)* )&gt;
&lt;!ATTLIST %schema;
   targetNamespace      %URIref;               #IMPLIED
   version              CDATA                  #IMPLIED
   %nds;                %URIref;               #FIXED 'http://www.w3.org/2001/XMLSchema'
   xmlns                CDATA                  #IMPLIED
   finalDefault         %complexDerivationSet; ''
   blockDefault         %blockSet;             ''
   id                   ID                     #IMPLIED
   elementFormDefault   %formValues;           'unqualified'
   attributeFormDefault %formValues;           'unqualified'
   xml:lang             CDATA                  #IMPLIED
   %schemaAttrs;&gt;
&lt;!-- Note the xmlns declaration is NOT in the Schema for Schemas,
     because at the Infoset level where schemas operate,
     xmlns(:prefix) is NOT an attribute! --&gt;
&lt;!-- The declaration of xmlns is a convenience for schema authors --&gt;
 
&lt;!-- The id attribute here and below is for use in external references
     from non-schemas using simple fragment identifiers.
     It is NOT used for schema-to-schema reference, internal or
     external. --&gt;

&lt;!-- a type is a named content type specification which allows attribute
     declarations--&gt;
&lt;!-- --&gt;

&lt;!ELEMENT %complexType; ((%annotation;)?,
                         (%simpleContent;|%complexContent;|
                          %particleAndAttrs;))&gt;

&lt;!ATTLIST %complexType;
          name      %NCName;                        #IMPLIED
          id        ID                              #IMPLIED
          abstract  %boolean;                       #IMPLIED
          final     %complexDerivationSet;          #IMPLIED
          block     %complexDerivationSet;          #IMPLIED
          mixed (true|false) 'false'
          %complexTypeAttrs;&gt;

&lt;!-- particleAndAttrs is shorthand for a root type --&gt;
&lt;!-- mixed is disallowed if simpleContent, overriden if complexContent
     has one too. --&gt;

&lt;!-- If anyAttribute appears in one or more referenced attributeGroups
     and/or explicitly, the intersection of the permissions is used --&gt;

&lt;!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))&gt;
&lt;!ATTLIST %complexContent;
          mixed (true|false) #IMPLIED
          id    ID           #IMPLIED
          %complexContentAttrs;&gt;

&lt;!-- restriction should use the branch defined above, not the simple
     one from part2; extension should use the full model  --&gt;

&lt;!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))&gt;
&lt;!ATTLIST %simpleContent;
          id    ID           #IMPLIED
          %simpleContentAttrs;&gt;

&lt;!-- restriction should use the simple branch from part2, not the 
     one defined above; extension should have no particle  --&gt;

&lt;!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))&gt;
&lt;!ATTLIST %extension;
          base  %QName;      #REQUIRED
          id    ID           #IMPLIED
          %extensionAttrs;&gt;

&lt;!-- an element is declared by either:
 a name and a type (either nested or referenced via the type attribute)
 or a ref to an existing element declaration --&gt;

&lt;!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,
                     (%unique; | %key; | %keyref;)*)&gt;
&lt;!-- simpleType or complexType only if no type|ref attribute --&gt;
&lt;!-- ref not allowed at top level --&gt;
&lt;!ATTLIST %element;
            name               %NCName;               #IMPLIED
            id                 ID                     #IMPLIED
            ref                %QName;                #IMPLIED
            type               %QName;                #IMPLIED
            minOccurs          %nonNegativeInteger;   #IMPLIED
            maxOccurs          CDATA                  #IMPLIED
            nillable           %boolean;              #IMPLIED
            substitutionGroup  %QName;                #IMPLIED
            abstract           %boolean;              #IMPLIED
            final              %complexDerivationSet; #IMPLIED
            block              %blockSet;             #IMPLIED
            default            CDATA                  #IMPLIED
            fixed              CDATA                  #IMPLIED
            form               %formValues;           #IMPLIED
            %elementAttrs;&gt;
&lt;!-- type and ref are mutually exclusive.
     name and ref are mutually exclusive, one is required --&gt;
&lt;!-- In the absence of type AND ref, type defaults to type of
     substitutionGroup, if any, else the ur-type, i.e. unconstrained --&gt;
&lt;!-- default and fixed are mutually exclusive --&gt;

&lt;!ELEMENT %group; ((%annotation;)?,(%mgs;)?<!--*
* material suppressed here by diff group b2861cc-1g *
*-->)&gt;
&lt;!ATTLIST %group; 
          name        %NCName;               #IMPLIED
          ref         %QName;                #IMPLIED
          minOccurs   %nonNegativeInteger;   #IMPLIED
          maxOccurs   CDATA                  #IMPLIED
          id          ID                     #IMPLIED
          %groupAttrs;&gt;

&lt;!ELEMENT %all; ((%annotation;)?, (%element;)*)&gt;
&lt;!ATTLIST %all;
          minOccurs   (1)                    #IMPLIED
          maxOccurs   (1)                    #IMPLIED
          id          ID                     #IMPLIED
          %allAttrs;&gt;

&lt;!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)&gt;
&lt;!ATTLIST %choice;
          minOccurs   %nonNegativeInteger;   #IMPLIED
          maxOccurs   CDATA                  #IMPLIED
          id          ID                     #IMPLIED
          %choiceAttrs;&gt;

&lt;!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)&gt;
&lt;!ATTLIST %sequence;
          minOccurs   %nonNegativeInteger;   #IMPLIED
          maxOccurs   CDATA                  #IMPLIED
          id          ID                     #IMPLIED
          %sequenceAttrs;&gt;

&lt;!-- an anonymous grouping in a model, or
     a top-level named group definition, or a reference to same --&gt;

&lt;!-- Note that if order is 'all', group is not allowed inside.
     If order is 'all' THIS group must be alone (or referenced alone) at
     the top level of a content model --&gt;
&lt;!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside --&gt;
&lt;!-- Should allow minOccurs=0 inside order='all' . . . --&gt;

&lt;!ELEMENT %any; (%annotation;)?&gt;
&lt;!ATTLIST %any;
            namespace       CDATA                  <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1">#IMPLIED
</phrase><phrase dg="b2867-1">
            notNamespace    CDATA                  #IMPLIED
            notQName        CDATA                  ''</phrase>
            processContents (skip|lax|strict)      'strict'
            minOccurs       %nonNegativeInteger;   '1'
            maxOccurs       CDATA                  '1'
            id              ID                     #IMPLIED
            %anyAttrs;&gt;

&lt;!-- namespace is interpreted as follows:
                  ##any      - - any non-conflicting WFXML at all

                  ##other    - - any non-conflicting WFXML from namespace other
                                  than targetNamespace

                  ##local    - - any unqualified non-conflicting WFXML/attribute
                  one or     - - any non-conflicting WFXML from
                  more URI        the listed namespaces
                  references

                  ##targetNamespace ##local may appear in the above list,
                    with the obvious meaning --&gt;
<phrase dg="b2867-1">
&lt;!-- notNamespace is interpreted as follows:
                  ##local    - - any unqualified non-conflicting WFXML/attribute
                  one or     - - any non-conflicting WFXML from
                  more URI        the listed namespaces
                  references

                  ##targetNamespace ##local may appear in the above list,
                    with the obvious meaning --&gt;</phrase>

&lt;!ELEMENT %anyAttribute; (%annotation;)?&gt;
&lt;!ATTLIST %anyAttribute;
            namespace       CDATA              <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1">#IMPLIED</phrase>
<phrase dg="b2867-1">
            notNamespace    CDATA              #IMPLIED
            notQName        CDATA              ''</phrase>
            processContents (skip|lax|strict)  'strict'
            id              ID                 #IMPLIED
            %anyAttributeAttrs;&gt;
&lt;!-- namespace <!--*
* material suppressed here by diff group b2867-1 *
*--><phrase dg="b2867-1">and notNamespace are</phrase> interpreted as for 'any' above --&gt;

&lt;!-- simpleType only if no type|ref attribute --&gt;
&lt;!-- ref not allowed at top level, name iff at top level --&gt;
&lt;!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)&gt;
&lt;!ATTLIST %attribute;
          name      %NCName;      #IMPLIED
          id        ID            #IMPLIED
          ref       %QName;       #IMPLIED
          type      %QName;       #IMPLIED
          use       (prohibited|optional|required) #IMPLIED
          default   CDATA         #IMPLIED
          fixed     CDATA         #IMPLIED
          form      %formValues;  #IMPLIED
          %attributeAttrs;&gt;
&lt;!-- type and ref are mutually exclusive.
     name and ref are mutually exclusive, one is required --&gt;
&lt;!-- default for use is optional when nested, none otherwise --&gt;
&lt;!-- default and fixed are mutually exclusive --&gt;
&lt;!-- type attr and simpleType content are mutually exclusive --&gt;

&lt;!-- an attributeGroup is a named collection of attribute decls, or a
     reference thereto --&gt;
&lt;!ELEMENT %attributeGroup; ((%annotation;)?,
                       (%attribute; | %attributeGroup;)*,
                       (%anyAttribute;)?<!--*
* material suppressed here by diff group b2861cc-1g *
*-->) &gt;
&lt;!ATTLIST %attributeGroup;
                 name       %NCName;       #IMPLIED
                 id         ID             #IMPLIED
                 ref        %QName;        #IMPLIED
                 %attributeGroupAttrs;&gt;

&lt;!-- ref iff no content, no name.  ref iff not top level --&gt;

&lt;!-- better reference mechanisms --&gt;
&lt;!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)&gt;
&lt;!ATTLIST %unique;
          name     %NCName;       #REQUIRED
	  id       ID             #IMPLIED
	  %uniqueAttrs;&gt;

&lt;!ELEMENT %key;    ((%annotation;)?, %selector;, (%field;)+)&gt;
&lt;!ATTLIST %key;
          name     %NCName;       #REQUIRED
	  id       ID             #IMPLIED
	  %keyAttrs;&gt;

&lt;!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)&gt;
&lt;!ATTLIST %keyref;
          name     %NCName;       #REQUIRED
	  refer    %QName;        #REQUIRED
	  id       ID             #IMPLIED
	  %keyrefAttrs;&gt;

&lt;!ELEMENT %selector; ((%annotation;)?)&gt;
&lt;!ATTLIST %selector;
          xpath %XPathExpr; #REQUIRED
          id    ID          #IMPLIED
          %selectorAttrs;&gt;
&lt;!ELEMENT %field; ((%annotation;)?)&gt;
&lt;!ATTLIST %field;
          xpath %XPathExpr; #REQUIRED
          id    ID          #IMPLIED
          %fieldAttrs;&gt;

<phrase dg="b2861cc-1">
&lt;!-- co-constraint assertions --&gt;
&lt;!ELEMENT %assert; ((%annotation;)?)&gt;
&lt;!ATTLIST %assert;
          test  %XPathExpr; #REQUIRED
          id    ID          #IMPLIED
          %assertAttrs;&gt;
&lt;!ELEMENT %report; ((%annotation;)?)&gt;
&lt;!ATTLIST %report;
          test  %XPathExpr; #REQUIRED
          id    ID          #IMPLIED
          %reportAttrs;&gt;
</phrase>

&lt;!-- Schema combination mechanisms --&gt;
&lt;!ELEMENT %include; (%annotation;)?&gt;
&lt;!ATTLIST %include;
          schemaLocation %URIref; #REQUIRED
          id             ID       #IMPLIED
          %includeAttrs;&gt;

&lt;!ELEMENT %import; (%annotation;)?&gt;
&lt;!ATTLIST %import;
          namespace      %URIref; #IMPLIED
          schemaLocation %URIref; #IMPLIED
          id             ID       #IMPLIED
          %importAttrs;&gt;

&lt;!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; |
                      %attributeGroup; | %group;)*&gt;
&lt;!ATTLIST %redefine;
          schemaLocation %URIref; #REQUIRED
          id             ID       #IMPLIED
          %redefineAttrs;&gt;

&lt;!ELEMENT %notation; (%annotation;)?&gt;
&lt;!ATTLIST %notation;
	  name        %NCName;    #REQUIRED
	  id          ID          #IMPLIED
	  public      CDATA       #REQUIRED
	  system      %URIref;    #IMPLIED
	  %notationAttrs;&gt;

&lt;!-- Annotation is either application information or documentation --&gt;
&lt;!-- By having these here they are available for datatypes as well
     as all the structures elements --&gt;

&lt;!ELEMENT %annotation; (%appinfo; | %documentation;)*&gt;
&lt;!ATTLIST %annotation; %annotationAttrs;&gt;

&lt;!-- User must define annotation elements in internal subset for this
     to work --&gt;
&lt;!ELEMENT %appinfo; ANY&gt;   &lt;!-- too restrictive --&gt;
&lt;!ATTLIST %appinfo;
          source     %URIref;      #IMPLIED
          id         ID         #IMPLIED
          %appinfoAttrs;&gt;
&lt;!ELEMENT %documentation; ANY&gt;   &lt;!-- too restrictive --&gt;
&lt;!ATTLIST %documentation;
          source     %URIref;   #IMPLIED
          id         ID         #IMPLIED
          xml:lang   CDATA      #IMPLIED
          %documentationAttrs;&gt;

&lt;!NOTATION XMLSchemaStructures PUBLIC
           'structures' 'http://www.w3.org/2001/XMLSchema.xsd' &gt;
&lt;!NOTATION XML PUBLIC
           'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' &gt;
</codeBlock>
</codeScrap>
</div1>
 <div1 id="non-ambig">
  <head>Analysis of the Unique Particle Attribution Constraint (non-normative)</head>
  <p>A specification of the import of <specref ref="cos-nonambig"/> which does
not appeal to a processing model is difficult.  What follows is intended as
guidance, without claiming to be complete.</p>
   <p><termdef term="overlap" id="key-overlap" role="local">Two non-group
particles <term>overlap</term> if </termdef>
   <ulist>
    <item>
     <p>They are both element declaration particles whose declarations have the
same <propref comp="ed" prop="name"/> and <propref comp="ed" prop="target namespace"/>.</p>
    </item>
   </ulist>
    or
    <ulist>
    <item>
     <p>They are both element declaration particles one of whose <propref comp="ed" prop="name"/> and <propref comp="ed" prop="target namespace"/> are the same as those of an element declaration in the
other's <termref def="key-eq">substitution group</termref>.</p>
    </item>
   </ulist>
    or
    <ulist>
     <item>
      <p>They are both wildcards, and the <phrase dg="b2867-1"><propref comp="nc" prop="variety"/> of the </phrase>intensional intersection of their <propref comp="w" prop="namespace constraint"/>s as defined
in <specref ref="cos-aw-intersect"/> is not <phrase dg="b2867-1"><pt>any</pt> and the <propref comp="nc" prop="namespaces"/> of such intersection is not </phrase>the empty set.</p>
     </item>
    </ulist>
    <!--*
* material suppressed here by diff group ww *
*-->
    <!--*
* material suppressed here by diff group ww *
*-->
   </p>
   <p>A content model will violate the unique attribution constraint if it
contains two particles which <termref def="key-overlap">overlap</termref> and which either
    <ulist>
     <item>
      <p>are both in the <propref comp="mg" prop="particles"/> of a <pt>choice</pt> or
<pt>all</pt> group</p>
     </item>
    </ulist>
    or
    <ulist>
     <item>
      <p>may <termref def="key-vn">validate</termref> adjacent information items and the first has
<propref comp="p" prop="min occurs"/> less than <propref comp="p" prop="max occurs"/>.</p>
     </item>
    </ulist>
   </p>
   <p>Two particles may <termref def="key-vn">validate</termref> adjacent information items if they are
separated by at most epsilon transitions in the most obvious transcription of a
content model into a finite-state automaton.</p>
  <p>A precise formulation of this constraint can also be offered in terms of
operations on finite-state automaton:  transcribe the content model into an
automaton in the usual way using epsilon transitions for optionality and
unbounded maxOccurs, unfolding other numeric occurrence ranges and treating the heads of substitution groups as if
they were choices over all elements in the group, <emph>but</emph> using not
element QNames as transition labels, but rather pairs of element QNames and
positions in the model.  Determinize this automaton, treating wildcard transitions as opaque.  Now replace all
QName+position transition labels with the element QNames alone.  If the result has any states
with two or more identical-QName-labeled transitions from it<!--*
* material suppressed here by diff group ww *
*-->, or two
wildcard transitions whose intentional intersection is non-empty, the model does not
satisfy the Unique Attribution constraint.   </p>
 </div1>
 <div1 id="nonnormative-references">
  <head>References (non-normative)</head>
  <blist>
   <bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ThomTobXMLEu" key="Finite State Automata"><phrase dg="rq17p"><emph>Using Finite State Automata to Implement W3C XML Schema Content Model Validation and Restriction Checking</emph>, Henry S. Thompson and Richard Tobin, IDEAlliance, London, 2003.  Available online at <loc href="http://www.idealliance.org/papers/dx_xmle03/papers/02-02-05/02-02-05.html">http://www.idealliance.org/papers/dx_xmle03/papers/02-02-05/02-02-05.html</loc> (imperfectly rendered) or <loc href="http://www.ltg.ed.ac.uk/~ht/XML_Europe_2003.html">http://www.ltg.ed.ac.uk/~ht/XML_Europe_2003.html</loc>.</phrase></bibl>
   <bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="CMSMCQExtreme" key="Brzozowski derivatives"><phrase dg="rq17p"><emph>Applications of Brzozowski derivatives to XML Schema processing</emph>, C. M. Sperberg-McQueen, IDEAlliance, Montréal, 2005.   Available online at  
<loc href="http://www.mulberrytech.com/Extreme/Proceedings/html/2005/SperbergMcQueen01/EML2005SperbergMcQueen01.html">http://www.mulberrytech.com/Extreme/Proceedings/html/2005/SperbergMcQueen01/EML2005SperbergMcQueen01.html</loc></phrase></bibl>
   <bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="FuchsBrownExtreme" key="UPA and restriction"><phrase dg="rq17p"><emph>Supporting UPA and restriction on an extension of XML Schema</emph>, Matthew Fuchs and Allen Brown, IDEAlliance, Montreal, 2003.  Available online at <loc href="http://www.idealliance.org/papers/extreme03/html/2003/Fuchs01/EML2003Fuchs01.html">http://www.idealliance.org/papers/extreme03/html/2003/Fuchs01/EML2003Fuchs01.html</loc></phrase></bibl>
   <bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-xsreq" key="XML Schema Requirements"><phrase dg="fpwd">
<emph>XML Schema Requirements </emph>, Ashok Malhotra and Murray Maloney, eds.,
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></phrase> </bibl>
   <bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-xpointer" key="XPointer"> <phrase dg="fpwd"><emph>XML
Pointer Language (XPointer)</emph>, Steve DeRose et al., eds., W3C, 16
August 2002. See <loc href="http://www.w3.org/TR/2002/WD-xptr-20020816/">http://www.w3.org/TR/2002/WD-xptr-20020816/</loc></phrase> </bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-dcd" key="DCD"> <emph>Document
Content Description for XML (DCD)</emph>, Tim Bray et al., eds., W3C, 10 August 1998.
See <loc href="http://www.w3.org/TR/1998/NOTE-dcd-19980731">http://www.w3.org/TR/1998/NOTE-dcd-19980731</loc> </bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-ddml" key="DDML"> <emph>Document
Definition Markup Language</emph>, Ronald Bourret, John Cowan, Ingo Macherius,
Simon St. Laurent, eds., W3C, 19 January 1999. See
<loc href="http://www.w3.org/TR/1999/NOTE-ddml-19990119">http://www.w3.org/TR/1999/NOTE-ddml-19990119
</loc></bibl>
 <bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="bib-expo" key="XML Schema: Primer"><emph>XML Schema Part 0:
Primer</emph>, <phrase dg="fpwd">Priscilla Walm<!--*
* material suppressed here by diff group wd2.silent *
*-->sley
and and</phrase> David C. Fallside, <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd">eds</phrase>., W3C, <!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd">18 March 2004</phrase>.  See 
<phrase dg="wd2hax"><!--*
* material suppressed here by diff group fpwd *
*--><phrase dg="fpwd"><loc href="http://www.w3.org/TR/2004/PER-xmlschema-0-20040318/">http://www.w3.org/TR/2004/PER-xmlschema-0-20040318/</loc></phrase></phrase><!--*
* material suppressed here by diff group wd2hax *
*--></bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-sox" key="SOX"> <emph>Schema for
Object-oriented XML</emph>, Andrew Davidson et al., eds., W3C, 1998. See
<loc href="http://www.w3.org/1999/07/NOTE-SOX-19990730/">http://www.w3.org/1999/07/NOTE-SOX-19990730/</loc> </bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-sox-1.1" key="SOX-2"> <emph>Schema
for Object-oriented XML</emph>, Version 2.0, Andrew Davidson, et al., W3C, 30
July 1999. See
<loc href="http://www.w3.org/TR/NOTE-SOX/">http://www.w3.org/TR/NOTE-SOX/</loc></bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-xdr" key="XDR"> <emph>XML-Data
Reduced</emph>, Charles Frankston and Henry S. Thompson, 3 July 1998.  See
<loc href="http://www.ltg.ed.ac.uk/~ht/XMLData-Reduced.htm">http://www.ltg.ed.ac.uk/~ht/XMLData-Reduced.htm
</loc> </bibl>
<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-xml-data" key="XML-Data">
<emph>XML-Data</emph>, Andrew Layman et al., W3C, 05 January 1998. See
<loc href="http://www.w3.org/TR/1998/NOTE-XML-data-0105/">http://www.w3.org/TR/1998/NOTE-XML-data-0105/</loc> </bibl>



<bibl xmlns:xlink="http://www.w3.org/1999/xlink" id="ref-scds" key="XML Schema: Component Designators" dg="rq144si"><emph>XML Schema: Component Designators</emph>, ed. Mary
Holstege and Asir Vedamuthu, W3C 29 March 2005.  See 
<loc href="http://www.w3.org/TR/xmlschema-ref/">http://www.w3.org/TR/xmlschema-ref/</loc>.
</bibl>
</blist>


</div1>
<div1 id="acknowledgments">
<head>Acknowledgements (non-normative)</head>
<p>The following contributed material to version 1.0 of this specification:</p>
<slist>
<sitem>David Fallside, IBM</sitem>
<sitem>Scott Lawrence, Agranat Systems</sitem>
<sitem>Andrew Layman, Microsoft</sitem>
<sitem>Eve L. Maler, Sun Microsystems</sitem>
<sitem>Asir S. Vedamuthu, webMethods, Inc</sitem>
</slist>
<p>The Working Group thanks the members of other W3C Working
Groups and industry experts in other forums who have contributed
directly or indirectly to the creation of this document and its
predecessor.</p>

<p>At the time this Working Draft is published, the members 
in good standing of the XML Schema Working Group are:</p>
<orglist>
<member>
<name>Leonid Arbouzov</name>
<affiliation>Sun Microsystems</affiliation>
</member>
<member>
<name>Peter Chen</name>
<affiliation>Bootstrap Alliance and LSU</affiliation>
</member>
<member>
<name>David Ezell</name>
<affiliation>National Association of Convenience Stores</affiliation>
<role>chair</role>
</member>
<member>
<name>Shudi (Sandy) Gao 高殊镝</name>
<affiliation>IBM</affiliation>
</member>
<member>
<name>Mary Holstege</name>
<affiliation>Mark Logic</affiliation>
</member>
<member>
<name>Kohsuke Kawaguchi</name>
<affiliation>Sun Microsystems</affiliation>
</member>
<member>
<name>Ashok Malhotra</name>
<affiliation>Oracle Corporation</affiliation>
</member>
<member>
<name>Noah Mendelsohn</name>
<affiliation>IBM</affiliation>
</member>
<member>
<name>Ravi Murthy</name>
<affiliation>Oracle Corporation</affiliation>
</member>
<member>
<name>Dave Peterson</name>
<affiliation>Invited Expert</affiliation>
</member>
<member>
<name>Anli Shundi</name>
<affiliation>TIBCO Extensibility</affiliation>
</member>
<member>
<name>C. M. Sperberg-McQueen</name>
<affiliation>W3C</affiliation>
<role>staff contact</role>
</member>
<member>
<name>Henry S. Thompson</name>
<affiliation>University of Edinburgh</affiliation>
</member>
<member>
<name>Fabio Vitali</name>
<affiliation>University of Bologna</affiliation>
</member>
<member>
<name>Kongyi Zhou</name>
<affiliation>Oracle Corp.</affiliation>
</member>
</orglist>
<p>The XML Schema Working Group has benefited in its work from the
participation and contributions of a number of people who are no
longer members of the Working Group in good standing at the time 
of publication of this Working Draft.  Their names are given below.  
In particular we note
with sadness the accidental death of Mario Jeckle shortly before
publication of the first Working Draft of XML Schema 1.1.
Affiliations given were current at the time of their work
with the WG.
</p>
<orglist>

<member>
<name>Paula Angerstein</name>
<affiliation>Vignette Corporation</affiliation>
</member>
<member>
<name>Jim Barnette</name>
<affiliation>Defense Information Systems Agency (DISA)</affiliation>
</member>
<member>
<name>David Beech</name>
<affiliation>Oracle Corp.</affiliation>
</member>
<member>
<name>Gabe Beged-Dov</name>
<affiliation>Rogue Wave Software</affiliation>
</member>
<member>
<name>Laila Benhlima</name>
<affiliation>Ecole Mohammadia d'Ingenieurs Rabat (EMI)</affiliation>
</member>
<member>
<name>Doris Bernardini</name>
<affiliation>Defense Information Systems Agency (DISA)</affiliation>
</member>
<member>
<name>Paul V. Biron</name>
<affiliation>Health Level Seven</affiliation>
</member>
<member>
<name>Don Box</name>
<affiliation>DevelopMentor</affiliation>
</member>
<member>
<name>Allen Brown</name>
<affiliation>Microsoft</affiliation>
</member>
<member>
<name>Lee Buck</name>
<affiliation>TIBCO Extensibility</affiliation>
</member>
<member>
<name>Greg Bumgardner</name>
<affiliation>Rogue Wave Software</affiliation>
</member>
<member>
<name>Dean Burson</name>
<affiliation>Lotus Development Corporation</affiliation>
</member>
<member>
<name>Charles E. Campbell</name>
<affiliation>Invited expert</affiliation>
</member>
<member>
<name>Oriol Carbo</name>
<affiliation>University of Edinburgh</affiliation>
</member>
<member>
<name>Wayne Carr</name>
<affiliation>Intel</affiliation>
</member>
<member>
<name>Tyng-Ruey Chuang</name>
<affiliation>Academia Sinica</affiliation>
</member>
<member>
<name>Tony Cincotta</name>
<affiliation>NIST</affiliation>
</member>
<member>
<name>David Cleary</name>
<affiliation>Progress Software</affiliation>
</member>
<member>
<name>Mike Cokus</name>
<affiliation>MITRE</affiliation>
</member>
<member>
<name>Dan Connolly</name>
<affiliation>W3C</affiliation>
<role>staff contact</role>
</member>
<member>
<name>Ugo Corda</name>
<affiliation>Xerox</affiliation>
</member>
<member>
<name>Roger L. Costello</name>
<affiliation>MITRE</affiliation>
</member>
<member>
<name>Joey Coyle</name>
<affiliation>Health Level Seven</affiliation>
</member>
<member>
<name>Haavard Danielson</name>
<affiliation>Progress Software</affiliation>
</member>
<member>
<name>Josef Dietl</name>
<affiliation>Mozquito Technologies</affiliation>
</member>
<member>
<name>Kenneth Dolson</name>
<affiliation>Defense Information Systems Agency (DISA)</affiliation>
</member>
<member>
<name>Andrew Eisenberg</name>
<affiliation>Progress Software</affiliation>
</member>
<member>
<name>Rob Ellman</name>
<affiliation>Calico Commerce</affiliation>
</member>
<member>
<name>Tim Ewald</name>
<affiliation>Developmentor</affiliation>
</member>
<member>
<name>Alexander Falk</name>
<affiliation>Altova GmbH</affiliation>
</member>
<member>
<name>David Fallside</name>
<affiliation>IBM</affiliation>
</member>
<member>
<name>George Feinberg</name>
<affiliation>Object Design</affiliation>
</member>
<member>
<name>Dan Fox</name>
<affiliation>Defense Logistics Information Service (DLIS)</affiliation>
</member>
<member>
<name>Charles Frankston</name>
<affiliation>Microsoft</affiliation>
</member>
<member>
<name>Matthew Fuchs</name>
<affiliation>Commerce One</affiliation>
</member>
<member>
<name>Andrew Goodchild</name>
<affiliation>Distributed Systems Technology Centre (DSTC Pty Ltd)</affiliation>
</member>
<member>
<name>Xan Gregg</name>
<affiliation>TIBCO Extensibility</affiliation>
</member>
<member>
<name>Paul Grosso</name>
<affiliation>Arbortext, Inc</affiliation>
</member>
<member>
<name>Martin Gudgin</name>
<affiliation>DevelopMentor</affiliation>
</member>
<member>
<name>Ernesto Guerrieri</name>
<affiliation>Inso</affiliation>
</member>
<member>
<name>Dave Hollander</name>
<affiliation>Hewlett-Packard Company</affiliation>
<role>co-chair</role>
</member>
<member>
<name>Nelson Hung</name>
<affiliation>Corel</affiliation>
</member>
<member>
<name>Jane Hunter</name>
<affiliation>Distributed Systems Technology Centre (DSTC Pty Ltd)</affiliation>
</member>
<member>
<name>Michael Hyman</name>
<affiliation>Microsoft</affiliation>
</member>
<member>
<name>Renato Iannella</name>
<affiliation>Distributed Systems Technology Centre (DSTC Pty Ltd)</affiliation>
</member>
<member>
<name>Mario Jeckle</name>
<affiliation>DaimlerChrysler</affiliation>
</member>
<member>
<name>Rick Jelliffe</name>
<affiliation>Academia Sinica</affiliation>
</member>
<member>
<name>Marcel Jemio</name>
<affiliation>Data Interchange Standards Association</affiliation>
</member>
<member>
<name>Simon Johnston</name>
<affiliation>Rational Software</affiliation>
</member>
<member>
<name>Dianne Kennedy</name>
<affiliation>Graphic Communications Association</affiliation>
</member>
<member>
<name>Janet Koenig</name>
<affiliation>Sun Microsystems</affiliation>
</member>
<member>
<name>Setrag Khoshafian</name>
<affiliation>Technology Deployment International (TDI)</affiliation>
</member>
<member>
<name>Melanie Kudela</name>
<affiliation>Uniform Code Council</affiliation>
</member>
<member>
<name>Ara Kullukian</name>
<affiliation>Technology Deployment International (TDI)</affiliation>
</member>
<member>
<name>Andrew Layman</name>
<affiliation>Microsoft</affiliation>
</member>
<member>
<name>Dmitry Lenkov</name>
<affiliation>Hewlett-Packard Company</affiliation>
</member>
<member>
<name>Bob Lojek</name>
<affiliation>Mozquito Technologies</affiliation>
</member>
<member>
<name>John McCarthy</name>
<affiliation>Lawrence Berkeley National Laboratory</affiliation>
</member>
<member>
<name>Matthew MacKenzie</name>
<affiliation>XML Global</affiliation>
</member>
<member>
<name>Murata Makoto</name>
<affiliation>Xerox</affiliation>
</member>
<member>
<name>Eve Maler</name>
<affiliation>Sun Microsystems</affiliation>
</member>
<member>
<name>Murray Maloney</name>
<affiliation>Muzmo Communication, acting for Commerce One</affiliation>
</member>
<member>
<name>Lisa Martin</name>
<affiliation>IBM</affiliation>
</member>
<member>
<name>Jim Melton</name>
<affiliation>Oracle Corp</affiliation>
</member>
<member>
<name>Adrian Michel</name>
<affiliation>Commerce One</affiliation>
</member>
<member>
<name>Alex Milowski</name>
<affiliation>Invited Expert</affiliation>
</member>
<member>
<name>Don Mullen</name>
<affiliation>TIBCO Extensibility</affiliation>
</member>
<member>
<name>Chris Olds</name>
<affiliation>Wall Data</affiliation>
</member>
<member>
<name>Frank Olken</name>
<affiliation>Lawrence Berkeley National Laboratory</affiliation>
</member>
<member>
<name>Paul Pedersen</name>
<affiliation>Mark Logic Corporation</affiliation>
</member>
<member>
<name>Shriram Revankar</name>
<affiliation>Xerox</affiliation>
</member>
<member>
<name>Mark Reinhold</name>
<affiliation>Sun Microsystems</affiliation>
</member>
<member>
<name>Jonathan Robie</name>
<affiliation>Software AG</affiliation>
</member>
<member>
<name>Cliff Schmidt</name>
<affiliation>Microsoft</affiliation>
</member>
<member>
<name>John C. Schneider</name>
<affiliation>MITRE</affiliation>
</member>
<member>
<name>Eric Sedlar</name>
<affiliation>Oracle Corp.</affiliation>
</member>
<member>
<name>Lew Shannon</name>
<affiliation>NCR</affiliation>
</member>
<member>
<name>William Shea</name>
<affiliation>Merrill Lynch</affiliation>
</member>
<member>
<name>Jerry L. Smith</name>
<affiliation>Defense Information Systems Agency (DISA)</affiliation>
</member>
<member>
<name>John Stanton</name>
<affiliation>Defense Information Systems Agency (DISA)</affiliation>
</member>
<member>
<name>Tony Stewart</name>
<affiliation>Rivcom</affiliation>
</member>
<member>
<name>Bob Streich</name>
<affiliation>Calico Commerce</affiliation>
</member>
<member>
<name>William K. Stumbo</name>
<affiliation>Xerox</affiliation>
</member>
<member>
<name>Hoylen Sue</name>
<affiliation>Distributed Systems Technology Centre (DSTC Pty Ltd)</affiliation>
</member>
<member>
<name>Ralph Swick</name>
<affiliation>W3C</affiliation>
</member>
<member>
<name>John Tebbutt</name>
<affiliation>NIST</affiliation>
</member>
<member>
<name>Ross Thompson</name>
<affiliation>Contivo</affiliation>
</member>
<member>
<name>Matt Timmermans</name>
<affiliation>Microstar</affiliation>
</member>
<member>
<name>Jim Trezzo</name>
<affiliation>Oracle Corp.</affiliation>
</member>
<member>
<name>Steph Tryphonas</name>
<affiliation>Microstar</affiliation>
</member>
<member>
<name>Mark Tucker</name>
<affiliation>Health Level Seven</affiliation>
</member>
<member>
<name>Asir S. Vedamuthu</name>
<affiliation>webMethods, Inc</affiliation>
</member>
<member>
<name>Scott Vorthmann</name>
<affiliation>TIBCO Extensibility</affiliation>
</member>
<member>
<name>Priscilla Walmsley</name>
<affiliation>XMLSolutions</affiliation>
</member>
<member>
<name>Norm Walsh</name>
<affiliation>Sun Microsystems</affiliation>
</member>
<member>
<name>Cherry Washington</name>
<affiliation>Defense Information Systems Agency (DISA)</affiliation>
</member>
<member>
<name>Aki Yoshida</name>
<affiliation>SAP AG</affiliation>
</member>
</orglist> 
</div1>
</back>
</spec>
