<?xml version='1.0'?>
<?xml:stylesheet type='text/xsl' href='xmlschema.msxsl'?>
<!-- $Id: structures.xml,v 1.46.1.48.2.3 2000/02/25 02:14:44 ht Exp $ -->
<!DOCTYPE spec PUBLIC "-//HST//DTD Specification::19990423//EN" "xmlspec-19990429.dtd" [
   <!ENTITY % versionEntities SYSTEM "versionInfo.ent">
   %versionEntities; <!-- get path and date entities -->
   <!ENTITY SchemaWG "<loc
href='http://www.w3.org/XML/Activity#schema-wg'>W3C XML Schema Working
Group</loc>">
   <!ENTITY XSP1 "<emph>XML Schema: Structures</emph>">
   <!ENTITY XSP2 "<bibref ref='ref-xsp2'/>">
   <!ENTITY doc.date "&draft.day; &draft.month; &draft.year;">
   <!ENTITY w3c.doc.date "&draft.day;-&draft.month;-&draft.year;">
   <!ENTITY iso.doc.date "&draft.YY;&draft.MM;&draft.DD;">
   <!ENTITY XSP1.version "0.8">
   <!ENTITY doc.audience "WG-internal review.">
   <!ENTITY doc.distribution "Schema IG">

   <!ENTITY eacute "&#233;" > <!-- small e, acute accent -->
   <!ENTITY constraint "identity-constraint">
   <!ENTITY Constraint "Identity-constraint"> <!-- for replacement later? -->
   <!ATTLIST eg text CDATA #IMPLIED> <!-- experimental pointer to out-of-line
                                          example text -->
   <!ELEMENT propdef ANY> <!-- best we can do without editing xml-spec -->
   <!ATTLIST propdef id ID #REQUIRED
                     name CDATA #REQUIRED>
   <!ELEMENT propref EMPTY>
   <!ATTLIST propref ref IDREF #REQUIRED>
   <!ELEMENT xpropref (#PCDATA)>
   <!ATTLIST xpropref href CDATA #IMPLIED>
   <!ELEMENT compdef (proplist)>
   <!ATTLIST compdef name CDATA #REQUIRED
                     ref IDREF #REQUIRED>
   <!ELEMENT proplist (propdef*)>
   <!ELEMENT reprdef (reprelt*,reprcomp*)>
   <!ELEMENT reprelt EMPTY>
   <!ATTLIST reprelt eltname NMTOKENS #REQUIRED
                     local NMTOKEN #IMPLIED>
   <!ELEMENT reprcomp (reprdep?,propmap*)>
   <!ATTLIST reprcomp ref IDREF #REQUIRED
                      abstract CDATA #REQUIRED>
   <!ELEMENT propmap ANY> <!-- best we can do without editing xml-spec -->
   <!ATTLIST propmap name IDREF #REQUIRED>
   <!ELEMENT reprdep ANY> <!-- best we can do without editing xml-spec -->
   <!ELEMENT eltref EMPTY>
   <!ATTLIST eltref ref NMTOKEN #REQUIRED>
   <!ELEMENT stale ANY>
   <!ENTITY % local.p.class "|stale">
   <!ENTITY % local.termdef.class "|propdef">
   <!ENTITY % local.ref.class "|propref|xpropref|eltref">
   <!ENTITY % local.illus.class "|compdef|reprdef|proplist">
   <!ENTITY i-attribute "<xpropref href='http://www.w3.org/TR/xml-infoset#infoitem.element'>attribute</xpropref>">
   <!ENTITY i-children "<xpropref href='http://www.w3.org/TR/xml-infoset#infoitem.element'>children</xpropref>">
   <!ENTITY i-attributes "<xpropref href='http://www.w3.org/TR/xml-infoset#infoitem.element'>attributes</xpropref>">
   <!ENTITY i-attrChildren "<xpropref href='http://www.w3.org/TR/xml-infoset#infoitem.attribute'>children</xpropref>">
   <!ENTITY i-value "<xpropref href='http://www.w3.org/TR/xml-infoset#infoitem.attribute'>value</xpropref>">
   <!ENTITY i-ccode "<xpropref
href='http://www.w3.org/TR/xml-infoset#infoitem.character'>character code</xpropref>">
 ]>
<spec>
  <header>
    <title>XML Schema Part 1: Structures</title>
    <version>&XSP1.version;</version>
    <w3c-designation>&WD-XSP1;-&iso.doc.date;</w3c-designation>
    <w3c-doctype>W3C Working Draft</w3c-doctype>
    <pubdate>
      <day>&draft.day;</day>
      <month>&draft.month;</month>
      <year>&draft.year;<!-- (Point release id: <code>$Id: structures.xml,v 1.46.1.48.2.3 2000/02/25 02:14:44 ht Exp $</code>)--></year>
    </pubdate>
    <notice role="publoc"><ednote><edtext>The following SHOULD be in the publoc, but
the DTD doesn't currently allow it: the stylesheet fakes it.</edtext></ednote>
     <p>(in <loc href="&XSP1.URI;.xml">XML</loc> (with its own <loc href="&XSP1.base;/xmlspec-19990429.dtd">DTD</loc>, <loc href="&XSP1.base;/xmlschema.xsl">XSL
stylesheet</loc> (Nov REC version)
and <loc href="&XSP1.base;/xmlschema.msxsl">IE5 stylesheet</loc> (XSL as supported by version 5 of
Microsoft's Internet Explorer)) and <loc href="&XSP1.URI;.html">HTML</loc>, with separate provision of the <loc href="&XSP1.URI;.xsd">schema</loc> and <loc href="&XSP1.URI;.dtd">DTD</loc> for schemas described herein.</p>
</notice>
    <publoc> <loc href="&XSP1.base;/">&XSP1.base;/</loc> </publoc>
   <latestloc><loc href="http://www.w3.org/TR/xmlschema-1/">http://www.w3.org/TR/xmlschema-1/</loc>   
 </latestloc>   
   <prevlocs>
    <loc href="http://www.w3.org/TR/1999/WD-xmlschema-1-19991217/">http://www.w3.org/TR/1999/WD-xmlschema-1-19991217/</loc>
    <loc href="http://www.w3.org/TR/1999/WD-xmlschema-1-19991105/">http://www.w3.org/TR/1999/WD-xmlschema-1-19991105/</loc>
    <loc href="http://www.w3.org/TR/1999/WD-xmlschema-1-19990924/">http://www.w3.org/TR/1999/WD-xmlschema-1-19990924/</loc>
     <loc href="http://www.w3.org/1999/05/06-xmlschema-1/">http://www.w3.org/1999/05/06-xmlschema-1/</loc>
    </prevlocs>
    <authlist>
      <author>
        <name>Henry S. Thompson</name>
        <affiliation>University of Edinburgh</affiliation>
        <email href="mailto:ht@cogsci.ed.ac.uk">ht@cogsci.ed.ac.uk</email>
      </author>
     <author>
      <name>David Beech</name>
      <affiliation>Oracle Corp.</affiliation>
      <email href="mailto:dbeech@us.oracle.com">dbeech@us.oracle.com</email>
     </author>
     <author>
      <name>Murray Maloney</name>
      <affiliation>Commerce One</affiliation>
      <email href="mailto:murray@muzmo.com">murray@muzmo.com</email>
     </author>
     <author>
      <name>Noah Mendelsohn</name>
      <affiliation>Lotus Development Corporation</affiliation>
      <email href="mailto:Noah_Mendelsohn@lotus.com">Noah_Mendelsohn@lotus.com</email>
     </author>
    </authlist>
    <status>
<p>This is a public working draft of XML Schema 1.0 for review by the
public and by members of the World Wide Web Consortium.
</p><p>
It has been reviewed by the XML Schema Working Group, and the Working
Group has agreed to its publication.  The WG believes this draft to be
`feature-complete': the functionality included here is substantially
complete and is expected to be stable.  We do not expect to add major
new functionality, or to make major changes to the functionality
described in this draft.  Some sections of the draft (in particular
those on conformance), and some aspects of the design (in particular
details of the transfer syntax for schemas), on the other hand, are
still rough and are expected to be revised.
</p><p>
Following a period of review and polishing, it is the WG's intent
to issue a Last Call for Review by other W3C working groups sometime
during March, 2000, and to submit this specification thereafter for publication as a Candidate Recommendation.  This schedule
may vary, depending on the comments of the public and of other W3C
working groups on this draft.  Such comments are instrumental in the
WG's deliberations, and we encourage readers to review the draft and send comments to
        <loc
         href="http://lists.w3.org/Archives/Public/www-xml-schema-comments/">www-xml-schema-comments@w3.org</loc>
</p>
     <p>This working draft has been substantially restructured since the previous public
release.  This structural reorganisation is not yet complete.
In this
draft, unrestructured material is distinguished as follows:</p>
     <stale><p>This material may be in the wrong section, and is likely to
contain broken references, particularly to now-vanished abstract syntax
productions, and out-of-date terminology.</p>
     </stale>
     <p>The restructuring of Chapters 1 through 3 is largely completed:
Attributes and Attribute groups give the clearest picture of how Chapters 5 and
6 will eventually look.</p>
     <p>The lengthy introductory example material from the old Chapter 2 has
been moved out of line into a non-normative companion document (<bibref ref="bib-expo"/> and expanded
considerably.  Pointers to this will in due course be added to this document.</p>
     <p>Although the Working Group does not anticipate further substantial
changes to the functionality described here, this is still a working
draft, subject to change.  The present version should
be implemented only by those interested in providing a check on
its design or by those preparing for an implementation of the
Candidate Recommendation. <emph>The Schema WG will
not allow early implementation to constrain its ability to make changes to this
specification prior to final release. </emph></p>
      <p>A list of current W3C working drafts can be found at
        <loc href="http://www.w3.org/TR/">http://www.w3.org/TR/</loc>. They may be
        updated, replaced, or obsoleted by other documents at any time. It is
        inappropriate to use W3C Working Drafts as reference material or to cite them
        as other than "work in progress". </p>
    </status>
     <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 1.0 documents. The schema language, which is itself represented in XML
            1.0, provides a superset of the capabilities found in XML 1.0 document type
            definitions (DTDs).  This specification depends on <emph>XML Schema Part 2:
            Datatypes</emph>.</p>
    </abstract>
    <pubstmt>
      <p>Boston, Mountain View, Toronto, et al.: World-Wide Web Consortium, XML
        Working Group, 1999.</p>
    </pubstmt>
    <sourcedesc>
      <p>Created in electronic form using XML.</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>1999-09-05: HST: Abandoned this method of logging
changes:  see CVS change log at the end of the document</sitem>
       <sitem>1999-09-02: HST: Marked non-status-quo sections as such.</sitem>
       <sitem>1999-09-01: HST: incorporated Section 2 examples from 'Simple',
modified to include some attributes.  Massaged explanatory text.</sitem>
       <sitem>1999-08-22: HST: incorporated 'Simple' section 3 changes and started to smooth over
the joints.</sitem>
       <sitem>1999-07-18: DB: updated definition of "Schema" following WG and IG email discussion.
         Changed "Schemata" to "Schemas" except where directly quoted from Requirements doc.
         Clarified in 2.5 that elements and attributes have separate symbol spaces (public comment).
         Fixed assorted typos.
       </sitem>
       <sitem>1999-06-23: HST: pushed &amp; down to lowest level, fixed incoherent
validity definition in 6.2.3.7 to agree with the note which follows.  Wrapped validation
text from 3.4 in appropriately named div4's.</sitem>
       <sitem>1999-06-20: HST: stripped out validation</sitem>
        <sitem>1999-05-03: MCM: Updated schema and DTD. Package and test.
        </sitem>
        <sitem>1999-05-03 Integration of final editors' concerns for WD1.
          Includes HT work on constraints.</sitem>
        <sitem>1999-05-02 NRM General cleanup of first few chapters. Remove
          chapter 4 redundancy (tuple discussion) with new validity rules. </sitem>
        <sitem>1999-05-02: HST: still chipping away at validity. Redefined the
          XSDL/XDTL entities.</sitem>
        <sitem>19940502: MCM: mostly annotating the schema. Also moved info
          about abstract grammar into Chapter 2. Chapter 3 now starts right into defining
          a schema. Edited text entities to make them easier to manage.</sitem>
        <sitem>19940501: HST: various</sitem>
        <sitem>1999-04-30: NRM : revisions to chapter 4</sitem>
        <sitem>1999-04-28: DB (pp HST) : promised edits for improved
          consistency and definition of 'schema'; suggested modifications to
          3.4.9/10 and 3.5 </sitem>
        <sitem>1999-04-39: HST : integrated DB's edits, completely rewrote
          6.1, replaced virtually all &lt;B&gt; with correct &lt;...ref&gt; </sitem>
        <sitem>1999-04-28: DB (pp HST) : promised edits for improved
          consistency and definition of 'schema'; suggested modifications to
          3.4.9/10 and 3.5 </sitem>
        <sitem>1999-04-23: HST : Got all productions sorted using
          'nt' and correct IDs.</sitem>
        <sitem>1999-04-21 : HST : Added lots of IDs and constraint heads:
          Validates w/o error</sitem>
        <sitem>1999-04-21 : HST : Converted with no content changes to speak of
          from MCM-XSDL-19990416.html. This version has only ID/IDREF related errors
          left.</sitem>
      </slist>
    </revisiondesc>
  </header>
  <body>
    <div1 id="intro">
      <head>Introduction</head>
      <p>This document sets out the structural part (&XSP1;) 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 a formal specification
of 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.</p>
     <p>Chapter 4, <specref ref="declare"/>, presents the XML representation
that maps to the abstract model, in the form
of a DTD and XML Schema for an XML Schema document type, along with rules and
conventions for identifying the components needed for any particular
validation.</p>
      <p>Chapter 5 presents <specref ref="composition"/>, including the
connection between documents and schemas, the import and inclusion of declarations and definitions and
        the foundations of schema-validity.</p>
      <p>Chapter 6 discusses <specref ref="conformance"/>, including the rules
        by which documents are validated, and responsibilities of schema-aware
        processors. </p>
      <p>The normative appendices include a <specref ref="normative-schemaDTD"/>
        and a <specref ref="normative-schemaSchema"/> for the transfer syntax, a <specref ref="normative-glossary"/> [not yet written] and
        <specref ref="normative-references"/>.</p>
    <div2 id="intro-purpose">
      <head>Purpose</head>
      <p>The purpose of &XSP1; 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 &XSP1; 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 may also provide for the specification of additional
        document information, such as default values for attributes
and elements. Schemas have
facilities for self-documentation. Thus, &XSP1; 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 &XSP1;
        formalism to express syntactic, structural and value constraints applicable to
        its document instances. The &XSP1; formalism allows a useful level of
        constraint checking to be described and validated 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 may require constraint capabilities not
        expressible in this language, and so may need to perform their own additional
        validations.</p>
    </div2>
    <div2 id="intro-relatedWork">
    <!-- This section was very charter-like; removed most of it because either it's
    already in the charter, or a separate document should cover how well we met our
    requirements, or the References appendix already covers things.  It's possible
    that this list should be in the Conformance section instead. elm -->
      <head>Dependencies on Other Specifications</head>
      <p>The definition of &XSP1; depends on the following specifications:
      <bibref ref="ref-uri"/>,
      <bibref ref="ref-xmlinfo"/>,
      <bibref ref="ref-xml-namespaces"/>,
      <bibref ref="bib-xpath"/>, and
      <bibref ref="ref-xsp2"/>.
      </p>
    </div2>
    <div2 id="intro-terminology">
        <head>Documentation Conventions and Terminology</head>
        <p>The following highlighting and typography is used to present technical material in
          this document: </p>
        <p>Special terms are defined at their point of
introduction in the text; hyperlinks connect other uses of the
term to the definition.  For example, a definition of
<termref def="key-sampledef">term</termref> might read: <termdef id="key-sampledef" term="term">A <term>term</term> is
          something we use a lot</termdef>.  The definition is labeled as such and the term is highlighted
typographically.  The end of the definition is not specially marked
in the displayed or printed text.</p>
      <p>The following terms are used in building
        definitions and describing the actions of &XSP1; processors: </p>
      <glist>
        <gitem>
          <label><termdef id="key-may" term="may"><term>may</term></termdef>
          </label>
          <def>
            <p>Conforming documents and processors are permitted to but need
              not behave as described. </p>
          </def>
        </gitem>
      </glist>
     <stale>
      <glist><gitem>
          <label><termdef id="key-must" term="must"><term>must</term></termdef>
            </label>
          <def>
            <p>Conforming documents and processors are required to behave as
              described; otherwise they are in <termref def="key-error">error</termref>. </p>

          </def>
        </gitem>
        <gitem>
          <label><termdef id="key-error" term="error"><term>error</term></termdef> </label>
          <def>
            <p>A violation of the rules of this specification; results are
              undefined. Conforming software may detect and report an error and may recover
              from it. </p>
          </def>
        </gitem>
        <gitem>
          <label><termdef id="key-fatalError" term="fatal error"><term>fatal
            error</term></termdef> </label>
          <def>
            <p>An <termref def="key-error">error</termref> which a conforming
              processor must detect and report to the application. </p>
          </def>
        </gitem></glist>
     </stale>
          <p>Non-normative examples are set off
typographically and accompanied by a brief
explanation:</p>
        <note role="example">
          <eg xml:space="preserve">&lt;schema
        targetNamespace="http://www.muzmo.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>
        <compdef name="Example" ref="intro-terminology">
   <proplist>
  <propdef id="xmpl-prop" name="example property">
Definition of the property.
   </propdef>
  </proplist>
 </compdef>
      <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,
followed by a tabulation of the correspondence between properties of the component
and properties of the information item.  Where context may determine which of
several different components may arise, several tabulations, one per component,
are given.  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.  The allowed content of the information item is
shown as a grammar fragment, using the Kleene operators <code>?</code>,
<code>*</code> and <code>+</code>.  The property correspondences are normative, but
the illustration of the XML representation element information items is not.</p>
<reprdef>
 <reprelt eltname="example"/>
 <reprcomp abstract="Example" ref="intro-terminology">
<propmap name="xmpl-prop">Description of what the property corresponds to, e.g. the value of the <code>size</code>
&i-attribute;
</propmap>
</reprcomp>
 </reprdef>

      <p>The following highlighting is used for non-normative commentary in
        this document:</p>
      <issue id="dummy">
        <p>A recorded issue.</p>
      </issue>

      <ednote>
        <edtext>Notes from the editors to themselves or the Working Group.</edtext>
      </ednote>

      <note>
        <p>General comments directed to all readers. </p>
      </note>
    </div2>
  </div1>
  <div1 id="concepts">
    <head>Conceptual Framework</head>
<p>This chapter gives an overview of &XSP1; at the level of its abstract data model.  (<specref ref="components"/> provides details on this model, and subsequent
chapters define
a normative representation in XML for the components of the model.)
Readers interested primarily in learning to write schema documents may wish to first read <bibref ref="bib-expo"/>  and then consult <specref ref="declare"/>, using the sections below as a guide to the underlying formal structure of the schema language.</p>
   <div2>
    <head>Overview of XML Schema</head>
    <p>An XML Schema
defines a set of schema-valid XML documents.  At a minimum, it consists of type definitions
and element declarations.  It
identifies a set of well-formed element information items (as defined
in <bibref ref="ref-xmlinfo"/>), and furthermore
may specify augmentations to those items and their descendants.  This augmentation makes explicit information which may have
been implicit in the original document, such as default values for
attributes and elements and
the types of element and attribute information items.</p>
    <p>The process of schema validation consists of determining
whether an element information item is a member of the set defined by an XML Schema, and if so of
adding any appropriate augmentations.</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 href="http://www.w3.org/TR/1999/WD-xml-infoset-19991220#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 href="http://www.w3.org/TR/REC-xml#sec-well-formed">well-formedness</xtermref>
(as defined in <bibref ref="ref-xml"/>) and <xtermref 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 schema-validity.</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
must 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 interchange format for schemas is described in <specref ref="declare"/></p>
<ednote>
<edtext>The datatype spec's use of the word "component" makes things somewhat confusing
next to this specification's use of the same word.  Perhaps the terminology in the datatype spec should be revised?</edtext>
</ednote>
<p><termdef id="key-component" term="schema component"> <term>Schema component</term> is the generic term for the building blocks that comprise the abstract data model of the schema.
</termdef>
<termdef id="key-schema" term="XML Schema">
An <term>XML Schema</term> is a
set of <termref def="key-component">schema component</termref>s.</termdef>  There are 12 kinds of
component in all, falling into three groups.  The primary components
are as follows.  They may have names, and (except for some element
declarations) may be independently accessed:</p>
<ulist>
<item><p>Simple type definitions
</p></item>
<item><p>Complex type definitions</p></item>
<item><p>Element declarations</p></item>
</ulist><p>The secondary components are as follows. Like the primary
components, they may have names and be independently accessed:</p>
<ulist>
<item><p>Attribute group definitions</p></item>
<item><p>&Constraint; definitions</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 and
cannot be independently accessed:</p>
<ulist>
<item><p>Annotations</p></item>
<item><p>Attribute declarations</p></item>
<item><p>Model groups</p></item>
<item><p>Particles</p></item>
<item><p>Wildcards</p></item>
</ulist>
     <p>During validation, <termdef id="key-declaration" term="declaration"><term>Declaration</term> components are associated by
(qualified) name to information items being validated</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 may 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">null</termref> or a namespace URI, also as
defined by <bibref ref="ref-xml-namespaces"/></termdef>.  The target
namespace 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 URI of, for example, the element
information items it may validate.</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
schema-validation 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 <specref ref="declare"/>, in which each schema document contributes
definitions and declarations to a single target namespace.</p>
    </note>
    <p>Schema-validity, defined in detail in <specref ref="conformance"/>, is a
relation between information items and schema components.  For example, an
attribute information item may be schema-valid with respect to an attribute
declaration, a list of element information items may be schema-valid 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 the overall definition of
schema-validity.  </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="key-typeDefn" 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.  First we 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>
<p>
<termdef id="key-typeDefinitionHierarchy" term="Type Definition
Hierarchy">Except for a distinguished <termref def="key-urType">ur-type definition</termref>, every <termref def="key-typeDefn">type definition</termref> is, by construction, either a
<termref def="key-typeRestriction">restriction</termref>, an <termref def="key-typeExtension">extension</termref> of some other type definition.  Collectively, the graph of these relationships forms a tree known as the <term>Type Definition Hierarchy</term>.</termdef>
</p>
<p><termdef id="key-typeRestriction" term="restriction">A type
definition whose
declarations or facets are in a one-to-one relation with those of another type
definition, with each in turn restricting the possibilities of the one it
corresponds to, is said to be a <term>restriction</term>.</termdef>
The specific restrictions 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.</p>
<p><termdef id="key-typeExtension" term="extension">A complex type definition
which allows element or attribute content in addition to that allowed by another type
definition is said to be an <term>extension</term>.</termdef></p>
<p><termdef id="key-urType" term="ur-type definition">A distinguished <term>ur-type
definition</term> is present in each <termref def="key-schema">XML Schema</termref>, serving as the root of the type
definition hierarchy for that schema.</termdef>  The ur-type definition has
the unique characteristic that it can function as a complex or a
simple type definition, according to context.
Specifically, <termref def="key-typeRestriction">restriction</termref>s of the ur-type definition can
themselves be either simple or complex type definitions.
</p>
<p><termdef id="key-baseTypeDefinition" term="base type definition">A 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>
<ednote><edtext>Should use this as a target for other references
throughout the text.</edtext></ednote>
</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 &i-children; of an attribute
information item or of an element information item with no element children.
Informally, it applies to attribute values and text-only content of elements.
</p>
     <p>Each simple type definition, whether built-in (that is, defined in &XSP2;) or
user-defined, is a  <termref def="key-typeRestriction">restriction</termref> of some particular
simple <termref def="key-baseTypeDefinition">base type
definition</termref>, which can be the <termref def="key-urType">ur-type definition</termref>.</p>


     <p>For details on the composition and
schema-validation contributions of simple type definitions, see <specref ref="Simple_Type_Definition_details"/> and &XSP2;.  The latter also defines an extensive inventory of
pre-defined simple types.  See <specref ref="declare-datatype"/> for the XML representation of
simple type definitions, and <specref ref="coss-st"/> for constraints on simple
type definition components as such.</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 &i-attributes; and
&i-children; of an element information item respectively.  The content type may require the &i-children; to be empty, to be a string which is schema-valid with respect to particular simple type or to contain element information items which is schema-valid with respect to a particular model group, with or without character information items as well.</p>
     <p>Each is complex type definition is either a:
<ulist>
<item>
<p>A <termref def="key-typeRestriction">restriction</termref> of a complex <termref def="key-baseTypeDefinition">base
type definition</termref>, or...</p>
</item>
<item>
<p>An <termref def="key-typeExtension">extension</termref> of a simple or complex <termref def="key-baseTypeDefinition">base
type definition</termref>, or...</p>
</item>
<item>
<p>A <termref def="key-typeRestriction">restriction</termref> of the
<termref def="key-urType">ur-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 derived to
base type.  Future versions may allow more kinds of extension, requiring more
complex transformations to effect casting.</p>
  </note></p>
     <p>
See <specref ref="Complex_Type_Definition_details"/> for the composition and
schema-validation contributions of complex type definition schema components, <specref ref="declare-type"/> for the XML representation of
complex type definitions and <specref ref="coss-ct"/> for constraints on complex
type definition components as such.</p>
</div4>
</div3>

     <div3 id="Declarations_Summary">
<head>Declaration Components</head>
<p>There are three kinds of declaration component: element, attribute, and
notation.  Each described in a section below. Also included is a discussion of element equivalence
classes, 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 set of &constraint;
definitions.  The association is either global or scoped to a containing complex type definition.  A
global element declaration with name 'A' is broadly comparable to a pair of
DTD declarations as follows, where the associated type definition
fills in the ellipsis:</p>
<eg>&lt;!ELEMENT A . . .&gt;
&lt;!ATTLIST A . . .&gt;
</eg>
<p>Element declarations contribute to
schema-validity as part of model group validation, when their defaults and type components are checked against an element
information item with a matching name and namespace, and by triggering
&constraint; definition validation.</p>
     <p>
See <specref ref="Element_Declaration_details"/> for the composition and
schema-validation contributions of element declaration schema components, <specref ref="declare-element"/> for the XML representation of
element declarations and <specref ref="coss-element"/> for constraints on
element declaration components as such.</p>
</div4>
<div4 id="Element_Equivalence_Class">
<head>Element Equivalence Class</head>
<p>In XML 1.0, the name and content of an element must correspond exactly to the element type referenced in the corresponding content model.</p>
<p><termdef id="key-equivalenceClass" term="element equivalence class">Through the new mechanism of <term>element equivalence classes</term>, XML Schemas provides a more powerful model supporting substitution of one named element for another.</termdef>
Any global element declaration can serve as the defining element, or
exemplar, for an element equivalence class.  Other global element declarations, regardless of target namespace, can be designated as members of the class defined by the exemplar.  In a suitably enabled content model, a reference to the exemplar validates not just the exemplar itself, but elements corresponding to any member of the equivalence class as well.
</p>
<p>All such members must have type definitions which are either the same as the
exemplar'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 equivalence class are defined, the
content of member elements is strictly limited according to the type
definition of the equivalence class exemplar.</p>
<p>Note that element equivalence classes are not represented as separate components.  They are
specified in the property values for element declarations (see <specref ref="Element_Declaration"/>).</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 local to its containing complex type definition.  Attribute declarations contribute to
schema-validity as part of complex type definition validation, when their
occurrence, defaults and type components are checked against an attribute
information item with a matching name and namespace.</p>
     <p>
See <specref ref="Attribute_Declaration_details"/> for the composition and
schema validation contributions of attribute declaration schema components, <specref ref="declare-attribute"/> for the XML representation of
attribute declarations and <specref ref="coss-attribute"/> for constraints on
attribute declaration components as such.</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 schema-valid with respect to a
<code>NOTATION</code> simple type definition, its value must have been declared
with a notation declaration.</p>
     <p>
See <specref ref="Notation_Declaration_details"/> for the composition and
schema validation contributions of notation declaration schema components, <specref ref="declare-notation"/> for the XML representation of
notation declarations and <specref ref="coss-notation"/> for constraints on
notation declaration components as such.</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 type.</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>
See <specref ref="Model_Group_details"/> for the composition and
schema-validation contributions of model group schema components, <specref ref="Complex_Type_Definition_details"/> for the use of model groups as content models, <specref ref="declare-contentModel"/> for the XML representation of
model groups and <specref ref="coss-modelGroup"/> for constraints
on model group components as such.</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
schema-validity as part of complex type validation, when they allow anywhere
from zero to many element information items or sequences thereof, depending on
their contents and occurrence
constraints.</p>
      <p><termdef id="key-contentModel" term="content model">A particle can
be used in a complex type definition to express a validity
constraint on the &i-children; of an element information item; such a particle is called
a <term>content model</term></termdef>.
<note>
<p>&XSP1; <termref def="key-contentModel">content model</termref>s are similar to but more expressive than
<bibref ref="ref-xml"/> content models; unlike <bibref ref="ref-xml"/>, &XSP1; applies <termref def="key-contentModel">content model</termref>s to the validation of both mixed and element-only content. </p>
</note></p>
     <p>
See <specref ref="Particle_details"/> for the composition and
schema-validation contributions of particle schema components, <specref ref="declare-contentModel"/> for the XML representation of
particles and <specref ref="coss-particle"/> for constraints
on particle components as such.</p>
</div4>
<div4 id="Wildcard">
<head>Wildcard</head>
<p>A wildcard is a special kind of particle which matches element information items dependent on their namespace URI, independently
of their local names.</p>
     <p>
See <specref ref="Wildcard_details"/> for the composition and
schema-validation contributions of wildcard schema components, <specref ref="declare-openness"/> for the XML representation of
wildcards and <specref ref="coss-wildcard"/> for constraints
on wildcard components as such.</p>
</div4>
</div3>

     <div3 id="&Constraint;_Definition">
<head>&Constraint; Definition Components</head>
<p>A &constraint; definition is an association between a name and one of
several varieties of
&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 valid reference, within
a specified scope. An element information item is only schema-valid with
respect to an element declaration
with &constraint; definitions if those definitions are all satisfied for all the descendants
of that element information item which they pick out.</p>
     <p>
See <specref ref="&Constraint;_Definition_details"/> for the composition and
schema-validation contributions of &constraint; definition schema components, <specref ref="declare-key"/> for the XML representation of
&constraint; definitions and <specref ref="coss-&constraint;"/> for constraints
on &constraint; definition components as such.</p>
    </div3>
<div3 id="Group_Definitions">
<head>Group Definition Components</head>
<p>There are two kinds of convenience definitions available for use
in reusing 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,
for use in reusing the same model group in several complex type
definitions.</p>
     <p>
See <specref ref="Model_Group_Definition_details"/> for the composition and
schema validation contributions of model group definition schema components, <specref ref="declare-namedModelGroup"/> for the XML representation of
model group definitions and <specref ref="coss-groupDef"/> for constraints
on model group definition components as such.</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,
for use in reusing the same set in several complex type
definitions.</p>
     <p>
See <specref ref="Attribute_Group_Definition_details"/> for the composition and
schema-validation contributions of attribute group definition schema components, <specref ref="declare-attributeGroup"/> for the XML representation of
attribute group definitions and <specref ref="coss-attrGroup"/> for constraints
on attribute group definition components as such.</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>
See <specref ref="Annotation_details"/> for the composition and
schema-validation contributions of annotation schema components, <specref ref="declare-annotation"/> for the XML representation of
annotations and <specref ref="coss-annotation"/> for constraints
on annotation components as such.</p>
<ednote>
<edtext>We need a Chapter 2 intro to the interchange syntax.</edtext>
</ednote>
     </div3>
   </div2>
    <div2 id="concepts-schemaConstraints">
      <head>Constraints and Contributions</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 focussed on schema-validity, 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
schema-validation of information items:</p>
      <glist>
        <gitem>
          <label><termdef id="gloss-cos" term="Constraint on Schemas"><term>Constraint on Schemas</term></termdef>
          </label>
          <def>
            <p>Constraints on the schema components themselves, i.e.
conditions components must satisfy to be components at all.  Largely to be
found in <specref ref="conformance"/>.</p>
          </def>
        </gitem>
       <gitem>
        <label><termdef id="gloss-src" term="Schema Representation Constraint"><term>Schema Representation Constraint</term></termdef></label>
        <def>
         <p>Constraints on the
representation of schema components in XML.  Some but not all of these are expressed in <specref ref="normative-schemaDTD"/> and <specref ref="normative-schemaSchema"/>.  Largely to be
found in <specref ref="declare"/>.</p>
        </def>
       </gitem>
        <gitem>
          <label><termdef id="gloss-cvc" term="Validity Contribution"><term>Validity Contribution</term></termdef> </label>
          <def>
            <p>Constraints expressed by schema components which information
items must satisfy to
              be schema-valid.  Largely to be
found in <specref ref="components"/>.</p>
          </def>
        </gitem>
        <gitem>
          <label><termdef id="gloss-sic" term="Schema Information Set Contribution"><term>Schema Information Set
            Contribution </term></termdef></label>
          <def>
            <p>Augmentations to post-schema-validation information sets
expressed by schema components, which follow
              as a consequence of schema-validation.
Largely to be
found in <specref ref="components"/>.</p>
          </def>
        </gitem>
      </glist>
        <p>Schema information set
          contributions are not new.  XML 1.0
          validation augments the XML 1.0 information set in similar ways,
for example by
          providing values for attributes not present in instances, and by implicitly
          exploiting type information for normalisation or access.
(As an example of the latter case, consider the
          effect of <code>NMTOKENS</code> on attribute whitespace, 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 1.0 left implicit.</p>

    </div2>
<div2 id="concepts-conformance">
<head>Conformance</head>
<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 must completely and
correctly implement the <termref def="gloss-cos">Constraints on
Schemas</termref>, <termref def="gloss-cvc">Validity Contributions</termref>,
and <termref def="gloss-sic">Schema Information
Set Contributions</termref> contained in this specification.</termdef></p>
<p><termdef id="key-interchange" term="conformance to the XML Representation of Schemas">Processors which accept
schemas in the form of XML documents as described in <specref ref="declare"/> are
additionally said to provide <term>conformance to the XML Representation of Schemas</term>.
</termdef>
Such processors must, when processing schema documents, completely and
correctly implement all <termref def="gloss-src">Schema Representation
Constraint</termref>s in this specification, and must adhere exactly to the
specifications in <specref ref="declare"/> for mapping the contents of such documents to <termref def="key-component">schema component</termref>s for use in validation.</p>
<note>
<p>By separating the conformance requirements relating to the concrete syntax of XML schema
documents, this specification admits  processors
which validate using schemas stored in optimised 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 in <termref def="key-interchange">conformance to the XML Representation of Schemas</termref>.</p>
</note>
<p><termdef id="key-fullyConforming" term="fully conforming"> <term>Fully conforming</term>
processors are network-enabled processors which support both levels of conformance described
above, and which must additionally be capable of accessing
schema documents from the World Wide Web according to <specref ref="web-representation"/> and XXX.
</termdef>.
</p>
<ednote>
<edtext>A a reference to the rules for handling
schema location, dereference of namespace Uris, etc.</edtext>
</ednote>
<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 recommendation to define such additional levels of conformance.</p></note>
</div2>
    <div2 id="concepts-nameSymbolSpaces">
      <head>Names and Symbol Spaces</head>
      <p>As discussed in <specref ref="concepts-data-model"/>, most schema
        components (may) have <termref def="key-compName">name</termref>s.
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>
This specification
therefore introduces the term
        <termdef id="key-symbolSpace" term="symbol space"><term>symbol space</term> to represent 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 href="http://www.w3.org/TR/REC-xml-names/#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 may appear in more than one symbol space without conflict. For example, the same name can appear in both a type definition and an element declaration, without conflict or necessary relation between the two.
</p>
      <p>Attribute declarations and locally scoped element
declarations are special with regard to symbol spaces.
Every complex type definition defines its own attribute declaration
symbol space and local element declaration symbol
        space, where these symbol spaces are distinct from each other and from any of the other
symbol spaces.  So, for example, several complex type definitions having
the same target namespace can contain
an 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 Schema-Validated</head>
  <p>The XML representation of schema components uses a vocabulary
identified by the namespace URI <code>&XMLSchemaNS;</code>.
&XSP1; also defines several attributes for direct use in XML documents.  These attributes are in a different namespace,
which has the namespace URI <code>&XMLSchemaInstanceNS;</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.
</p>
<div3 id="xsi:type">
<head>xsi:type</head>
<p>The <specref ref="Simple_Type_Definition"/> or <specref ref="Complex_Type_Definition"/> used to validate an element is usually
determined by reference to the appropriate schema components.
However, when permitted by those components, an element can
explicitly assert its type using the attribute <code>xsi:type</code>.
The value of this attribute is a <xtermref href="&XSP2.URI;#QName">QName</xtermref>;  see <specref ref="src-qname"/> for
the means by which the <xtermref href="&XSP2.URI;#QName">QName</xtermref> is
associated with a type definition.
</p>
</div3>
<div3 id="xsi:null">
<head>xsi:null</head>
<p>&XSP1; introduces a distinguished <code>null</code> value for XML document elements.  An
element has the null value if it has no &i-children; and carries the attribute <code>xsi:null</code>.</p>
<ednote>
<edtext>Are other attributes allowed?  Must sync with validation rules.</edtext>
</ednote>
</div3>
<div3 id="xsi:schemaLocation">
<head>xsi:schemaLocation</head>
<p>The <code>xsi:schemaLocation</code> attribute can be used in a document to provide
hints as to the physical location of schema documents to be used for validation.
</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 documents of MIME type
"text/xml", conforming to the specifications in <specref ref="declare"/>.   </p>
</div2>
 </div1>
  <div1 id="components">
   <head>Schema Component Details</head>
   <p>The following sections provide full details on the properties and
significance of each kind of schema component.  For each property, its range,
that is the kinds of values it may have, is defined.  This can be understood as
defining a schema as a labelled directed graph, where every vertex is a schema
component or a literal (string, boolean, number) and every labelled edge a property.  Any property not
identified as optional is required to be present, optional properties which are absent are taken to have <termref def="key-null">null</termref> as their value.  Any
property identified as a having a set, subset or list value may have an empty value unless this is explicitly
ruled out:  this is <emph>not</emph> the same as <termref def="key-null">null</termref>.  Any property value identified as subset of some set may be equal to that set, unless a proper subset is explicitly called for.
By 'string' here and below is meant a
sequence of ISO 10646 character codes identified as <xtermref href="http://www.w3.org/TR/REC-xml#charset">legal XML character codes</xtermref>
in <bibref ref="ref-xml"/>.</p>
   <ednote>
    <edtext>Or the UNICODE 3 addendum, where/when?</edtext>
   </ednote>
   <p>Throughout the following sections, when we refer to the &i-value; of some
attribute information item, we mean by this a string composed of, in order, the
&i-ccode; of each character information item in the &i-attrChildren; of that
attribute information item.</p>
   <p>Many properties of schema components are identified below as having
other schema 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 may be violated if one or more references
cannot be discharged.  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>
   <note>
    <p>Schema components are an idealisation 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 above of language such as "properties . . . having . . .
components as values".</p>
   </note>
   <note>
    <p>Readers whose primary interest is in the XML representation of schemas
may wish to skip this chapter on the first reading, concentrating on <specref ref="declare"/> and &expo;.</p>
   </note>
<ednote>
<edtext>Due to time constraints in preparing this draft, the {annotation} properties are not explicitly described for the
components below.  In all cases, the property is an annotation
(see "Annotation Details" below).</edtext>
</ednote>
   <div2 id="Attribute_Declaration_details">
    <head>Attribute Declaration Details</head>
    <p>Attribute declarations provide for:</p>
    <ulist>
     <item><p>Requiring/preventing the appearance of attribute information items;</p></item>
     <item><p>Constraining attribute information item values by a simple type definition;</p></item>
     <item><p>Providing default or fixed values for an attribute information item.</p></item>
    </ulist>
    <p>The attribute declaration schema component has the following
properties:</p>
    <compdef name="Attribute Declaration" ref="Attribute_Declaration">
     <proplist>
      <propdef id="a-name" name="name">An NCName as defined by
<bibref ref="ref-xml-namespaces"/>.</propdef>
      <propdef id="a-target_namespace" name="target namespace">Either <termref def="key-null">null</termref> or
a namespace URI, as defined in <bibref ref="ref-xml-namespaces"/>.</propdef>
      <propdef id="a-simple_type_definition" name="simple type definition">A
simple type definition.</propdef>
      <propdef id="a-min_occurs" name="min occurs"><pt>0</pt> or
<pt>1</pt></propdef>
      <propdef id="a-max_occurs" name="max occurs"><pt>0</pt> or
<pt>1</pt></propdef>
      <propdef id="a-value_constraint" name="value constraint">Optional.  A pair
consisting of a string and one of <pt>default</pt>, <pt>fixed</pt>.</propdef>
      <propdef id="a-annotation" name="annotation">Optional.  An annotation</propdef>
     </proplist>
    </compdef>
<p>The <propref ref="a-name"/> property must match the local part of the names of attributes being validated.</p>
<p>A <quote>qualified</quote> attribute name is one that appears with a namespace prefix which is itself declared with a
value other than the empty string.  A non-<termref def="key-null">null</termref> value of the <propref ref="a-target_namespace"/> property provides for validation of
such attributes qualified with an identical namespace URI.  Null values of <propref ref="a-target_namespace"/> provide for validation of local
(unprefixed) attributes. Each complex type definition provides its own symbol space for the
names of its associated local attribute declarations. (E.g. an attribute
named <code>title</code> within one type definition need not have the same
simple type definition as one declared within another complex
type; neither of these need agree with the declaration for a similarly named qualified attribute.)</p>
<p>A <propref ref="a-min_occurs"/> of 1 specifies that the corresponding attribute must
be present; a value of 0 allows for optional attributes.
Similarly, a <propref ref="a-max_occurs"/> of 0 indicates an attribute that must
not be present; a value of 1 (the normal case) allows the attribute to occur
explicitly.</p>
<p>The value of the attribute must conform to the supplied <propref ref="a-simple_type_definition"/>.</p>
<p><propref ref="a-value_constraint"/> reproduces the functions of XML 1.0 default and #FIXED
attribute values.  <pt>fixed</pt> indicates that the attribute value must match the supplied
constraint string; <pt>default</pt> specifies that the attribute is to appear unconditionally in
the post-schema-validation information set, with the supplied value used
whenever the attribute is not actually present.</p>
<note><p>A more complete and formal presentation of the semantics of <propref ref="a-name"/>, <propref ref="a-target_namespace"/>,
<propref ref="a-min_occurs"/>, <propref ref="a-max_occurs"/> and
<pt>default</pt> <propref ref="a-value_constraint"/> is provided in
conjunction with other aspects of complex type validation (see <specref ref="cvc-complex-type"/>.)</p></note>
    <p><bibref ref="ref-xmlinfo"/> distinguishes namespace declarations such as <code>xmlns</code> or <code>xmlns:xsl</code> from
attributes.  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 to supply a
default value for a namespace declaration.</p>
    <p>See <specref ref="declare-attribute"/> for the XML representation of
attribute declarations and <specref ref="coss-attribute"/> for constraints on attribute
declaration components as such.</p>
<constraintnote type="cvc" id="cvc-attribute">
     <head>Attribute Valid</head>
     <p>For an attribute information item to be schema-valid with respect to an
attribute declaration, its &i-value; must
      <ulist>
       <item>
        <p>be schema-valid with respect to the <propref ref="a-simple_type_definition"/> as per <specref ref="cvc-simple-type"/>;</p>
       </item>
       <item>
        <p>match the string of the <propref ref="a-value_constraint"/> if it is
present and <pt>fixed</pt>.</p>
       </item>
      </ulist>
     </p>
    </constraintnote>

    <constraintnote type="sic" id="sic-attrType">
     <head>Attribute Type</head>
     <p>In the post-schema
validation infoset a <xpropref>schema type</xpropref> property is added to the attribute information item with the <propref ref="a-simple_type_definition"/> as its value.</p>
    </constraintnote>
   </div2>
   <div2 id="Element_Declaration_details">
    <head>Element Declaration Details</head>
       <p>Element declarations provide for:</p>
    <ulist>
     <item><p>Establishing the validity of element information items.</p></item>
     <item><p>Determining schema information set contributions, such as default values.</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 equivalence classes</termref>.</p>
     </item>
    </ulist><p>The element declaration schema component has the following
properties:</p>

    <compdef name="Element Declaration" ref="Element_Declaration">
     <proplist>
      <propdef id="e-name" name="name">An NCName as defined by
<bibref ref="ref-xml-namespaces"/>.</propdef>
      <propdef id="e-target_namespace" name="target namespace">Either <termref def="key-null">null</termref> or
a namespace URI, as defined in <bibref ref="ref-xml-namespaces"/>.</propdef>
      <propdef id="scope" name="scope">Optional.  Either <pt>global</pt> or a complex type
definition.</propdef>
      <propdef id="type_definition" name="type definition">Either a simple type
definition or a complex type definition.</propdef>
      <propdef id="nullable" name="nullable">A boolean</propdef>
      <propdef id="e-value_constraint" name="value constraint">Optional.  A
pair consisting of a string and one of <pt>default</pt>, <pt>fixed</pt>.</propdef>
      <propdef id="&constraint;_definitions" name="&constraint; definitions">A set
of constraint definitions.</propdef>
      <propdef id="class_exemplar" name="equivalence class affiliation">Optional.  A global
element definition.</propdef>
      <propdef id="e-final" name="equivalence class exclusions">A subset of
{<pt>extension</pt>, <pt>list</pt>,
<pt>restriction</pt>, <pt>reproduction</pt>}.  </propdef>
      <propdef id="e-exact" name="disallowed substitutions">A subset of {<pt>equivClass</pt>, <pt>extension</pt>, <pt>list</pt>,
<pt>restriction</pt>, <pt>reproduction</pt>}.</propdef>
      <propdef id="e-abstract" name="abstract">A boolean</propdef>
      <propdef id="e-annotation" name="annotation">Optional.  An annotation</propdef>
     </proplist>

    </compdef>
<p>The <propref ref="e-name"/> property must match the local part of the names
of elements being validated.</p>
<p>A <propref ref="scope"/> of <pt>global</pt> declares elements available for use in content
models throughout the schema.  Locally scoped elements are available for use only within the
complex type identified by the <propref ref="scope"/> property.  For globally scoped element declarations, a non-<termref def="key-null">null</termref> value of the <propref ref="a-target_namespace"/> property provides for validation of
namespace qualified elements.  <termref def="key-null">Null</termref> values of
<propref ref="a-target_namespace"/> validate unqualified elements, including
locally scoped elements.  This property is also <termref def="key-null">null</termref> in the case of non-<pt>global</pt> declarations within named model groups:  their scope will be determined when they are used in the construction of complex type definitions.</p>
<p>An element is schema-valid
if it obeys the schema validity constraints of the <propref ref="type_definition"/>.  For such an
element, the schema information set contributions from the <propref ref="type_definition"/> are applied to the
corresponding element information item in the post-schema-validation information set.  <propref ref="type_definition"/> must not be an
<pt>abstract</pt> type definition.
</p>
<p>If <propref ref="nullable"/> is <pt>true</pt>, then the element is also schema valid if it has
no text or element content, and
carries the namespace qualified attribute with <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">local name</xpropref> <code>null</code> from namespace <code>&XMLSchemaInstanceNS;</code> (see <specref ref="xsi:null"/>). Formal details of element validation are described in <specref ref="cvc-elt"/>.</p>
<p><propref ref="e-value_constraint"/> establishes a default or fixed value for an element.  If <pt>default</pt> is specified, and if the element
being validated is empty, then the supplied
constraint string becomes <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.character">character</xpropref>
&i-children; of the validated element in the post-schema-validation
infoset.  If <pt>fixed</pt> is specified, then the element's content
must either be empty, in which case <pt>fixed</pt> behaves as <pt>default</pt>,
or it must match the supplied constraint string.</p>
<p><propref ref="&constraint;_definitions"/> express constraints establishing uniquenesses and reference relationships among the values of related elements and
attributes.  See <specref ref="&Constraint;_Definition_details"/>.</p>
<p>Element declarations are members of the equivalence class, if any, identified
by <propref ref="class_exemplar"/>.  Membership is transitive;  an element
declaration is implicitly a member of any class of which its <propref ref="class_exemplar"/> is a member.</p>
<p>An empty <propref ref="e-final"/> creates an equivalence
class admitting other element declarations having the same <propref ref="type_definition"/> or
types derived therefrom.  The explicit
values of <propref ref="e-final"/> exclude from the equivalence class elements having types which
are <pt>extension</pt>s, <pt>list</pt>s, <pt>restriction</pt>s or <pt>reproduction</pt>s respectively of <propref ref="type_definition"/>.  If all values are specified, then no equivalence class is possible based on this element declaration.</p>

<p>The supplied values for <propref ref="e-exact"/> determine
whether an element declaration appearing in a <termref def="key-contentModel">content model</termref> will be prevented from additionally
validating elements (a) with an <specref ref="xsi:type"/> that identifies an
<pt>extension</pt>, <pt>list</pt>, <pt>restriction</pt> and/or <pt>reproduction</pt> of the type of the declared element, and/or (b) from validating elements which are in the same
equivalence class (<pt>equivClass</pt>) as the declared element.
If <propref ref="e-exact"/> is empty, then all derived types and equivalence class members are valid.</p>
<p>Element declarations for which <propref ref="e-abstract"/> is <pt>true</pt> can appear in
content models only when equivalence class substitution is allowed;
such declarations may not themselves ever be used to validate element content.</p>
<p>See <specref ref="declare-element"/> for the XML representation of
element declarations and <specref ref="coss-element"/> for constraints on element
declaration components as such.</p>
    <constraintnote type="cvc" id="cvc-elt">
     <head>Element Valid (Explicit)</head>
     <p>An element information item is schema-valid with respect to an
element declaration if
      <olist>
       <item>
        <p>If <propref ref="nullable"/> is false there is no attribute information item among the element
information item's &i-attributes; whose <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">namespace URI</xpropref> is identical to <code>&XMLSchemaInstanceNS;</code> and whose <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">local name</xpropref> is <code>null</code>;</p>
       </item>
       <item>
        <p>If <propref ref="nullable"/> is true and there is such an attribute
information item and its &i-value; is <code>true</code>, then
         <olist>
          <item>
           <p>the element information item must have no character or element information item
&i-children;;</p>
          </item>
          <item>
           <p>there is no <pt>fixed</pt> <propref ref="e-value_constraint"/>.</p>
          </item>
         </olist>
        </p>
       </item>
      </olist>
     </p>
     <p>If there is an attribute information item among the element
information item's &i-attributes; whose <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">namespace URI</xpropref> is identical to <code>&XMLSchemaInstanceNS;</code> and whose <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">local name</xpropref> is <code>type</code>, then
      <olist>
       <item>
        <p>The &i-value; of that attribute information item is
schema-valid with respect to the built-in <xtermref href="&XSP2.URI;#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 URI</termref> (as defined in <specref ref="src-qname"/>), of the &i-value; of that attribute information item resolve to a type definition, as defined in <specref ref="src-resolve"/> -- <termdef id="key-ltd" term="item type definition">call this type definition the <term>item type definition</term></termdef>;</p></item>
       <item>
        <p>The <termref def="key-ltd">item type definition</termref> is
validly derived from the <propref ref="type_definition"/> given the <propref ref="e-exact"/> as defined in <specref ref="cos-st-derived-ok"/> (if it is a simple type definition) or as defined in <specref ref="cos-ct-derived-ok"/> (if it is a complex type definition).</p>
       </item>
      </olist>
      <termdef id="key-atd" term="actual type definition">We refer below to the
<term>actual type definition</term>.  If the above three clauses obtain, this
should be understood as referring to the <termref def="key-ltd">local type
definition</termref>, otherwise to the <propref ref="type_definition"/>.</termdef>
     </p>
     <p>If the declaration has a <propref ref="e-value_constraint"/>, then
provided clause 1.2 has not obtained
      <olist>
       <item>
        <p>If the element information item has no character information item
&i-children; and the <termref def="key-atd">actual type definition</termref> is a <termref def="key-ltd">local type
definition</termref>, the <propref ref="e-value_constraint"/> string is schema-valid with respect to the <termref def="key-atd">actual
type definition</termref> as defined by <specref ref="cvc-simple-type"/> (if
the <termref def="key-atd">actual
type definition</termref> is a simple type definition) or else (the <termref def="key-atd">actual
type definition</termref> is a complex type definition) the string must
be 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>If the <propref ref="e-value_constraint"/> is
<pt>fixed</pt>, the element information item must have no element information
item &i-children;, and the string composed of the element information item's character information item
&i-children;
in order must be either empty or match the string of the <propref ref="e-value_constraint"/>;</p>
       </item>
      </olist>
     </p>
     <p>Otherwise (the element information item has character information item
&i-children; or there is no <propref ref="e-value_constraint"/>) if the <termref def="key-atd">actual type definition</termref> is a simple type
definition, then
      <olist>
       <item><p>The element information item's &i-attributes; must be empty,
excepting those whose <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">namespace URI</xpropref> is identical to <code>&XMLSchemaInstanceNS;</code> and whose <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">local name</xpropref> is one of <code>type</code>, <code>nullable</code> or <code>schemaLocation</code>;</p></item>
       <item>
        <p>The element information item must have no element information item &i-children;;</p>
       </item>
       <item>
        <p>the string composed of the &i-ccode; of each of the element information item's character information item
&i-children;
in order must be schema-valid with respect to the
<termref def="key-atd">actual type definition</termref> as defined by <specref ref="cvc-simple-type"/>
        </p>
       </item>

      </olist>
otherwise (the <termref def="key-atd">actual type definition</termref> is a complex type
definition)
      <olist>
       <item>
        <p>The element information item must be schema-valid with respect to the <termref def="key-atd">actual type definition</termref> as per <specref ref="cvc-complex-type"/>;</p>
       </item>
       <item>
        <p>The element information item must be schema-valid with respect to
each of the <propref ref="&constraint;_definitions"/> as per <specref ref="cvc-&constraint;"/>.</p>
       </item>
      </olist>
</p>

 <issue id="nullRequiresEmpty">
  <p>Is it a precondition for being nullable that the element's contentType
allow no content?  If not, then more needs to be said in Chapter 6, if so, this needs
to be spelled out.</p>
 </issue>
<ednote><edtext>The above also allows null elements to have
attributes, i.e. it's their CONTENT which is null.  Was that the
designers' intention?  See related ednote under xsi:null in chapter 2.</edtext></ednote>

    </constraintnote>
    <note><p>The <propref ref="e-name"/> and <propref ref="e-target_namespace"/> properties are not
mentioned above because they are checked during particle validation, as per
<specref ref="cvc-particle"/>.</p></note>
    <constraintnote type="sic" id="sic-eltDefault">
     <head>Element Default Value</head>
     <p>If the <propref ref="e-value_constraint"/> is present and the element
information item has no character or element information item &i-children;, the post-schema
validation infoset has a list of character information items, one per character
in the <propref ref="e-value_constraint"/> string, appended to its &i-children;.</p>
    </constraintnote>
    <ednote>
     <edtext>Should we add a property to indicate THAT the value was supplied by default?</edtext>
    </ednote>
    <constraintnote type="sic" id="sic-eltType">
     <head>Element Type</head>
     <p>In the post-schema
validation infoset a <xpropref>schema type</xpropref> property is added to the element information item with the <termref def="key-atd">actual type definition</termref> as its value.</p>
    </constraintnote>
    <constraintnote type="sic" id="sic-eltNull">
     <head>Element Null</head>
     <p>If clause 1.2 of <specref ref="cvc-elt"/> above obtains, in the post-schema
validation infoset a <xpropref>null</xpropref> property is added to the element
information item with the value true.</p>
    </constraintnote>
   </div2>
   <div2 id="Complex_Type_Definition_details">
    <head>Complex Type Definition Details</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
&i-attributes;</p></item>
     <item><p>Constraining element information item &i-children; to be empty, or to conform to a specified element-only or mixed content model.</p></item>
     <item><p>Using the mechanisms of <specref ref="Type_Derivation"/> to derive a complex type from another simple or complex type.</p></item>
     <item>
<p>Specifying contributions to the post-schema-validation information set for elements. </p>
</item>
     <item><p>Limiting the ability to derive additional types from a given complex type.</p></item>
     <item><p>Controlling the permission to substitute, in an instance, elements of a derived
type for elements declared in a content model to be of a given complex type.</p></item>
<item><p>Determining <termref def="gloss-sic">post-schema-validation
information set contributions</termref>.</p></item>
</ulist>

<p>A complex type definition schema component has the following
properties:</p>

  <compdef name="Complex Type Definition" ref="Complex_Type_Definition">
   <proplist>
  <propdef id="ct-name" name="name">
    Optional.  An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="ct-target_namespace" name="target namespace">
    Either <termref def="key-null">null</termref> or a namespace URI, as defined in <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="ct-base_type_definition" name="base type definition">
    Either a simple type definition or a complex type definition.
   </propdef>
  <propdef id="derivation_method" name="derivation method">
    One of <pt>extension</pt>, <pt>restriction</pt>, <pt>reproduction</pt>
   </propdef>
   <propdef id="ct-final" name="final">
    A subset of {<pt>extension</pt>, <pt>restriction</pt>, <pt>reproduction</pt>}.
   </propdef>
   <propdef id="ct-abstract" name="abstract">
    A boolean
   </propdef>   <propdef id="ct-attribute_declarations" name="attribute declarations">
    A set of attribute declarations.
   </propdef>
  <propdef id="ct-attribute_wildcard" name="attribute wildcard">
    Optional.  One of <pt>any</pt>; a pair of <pt>not</pt> and a namespace URI
or <termref def="key-null">null</termref>; or a set whose
members are either namespace URIs or <termref def="key-null">null</termref>.
   </propdef>
   <propdef id="content_type" name="content type">One of <pt>empty</pt>, a simple type definition or a pair
consisting of a <termref def="key-contentModel">content model</termref> (I.e a <specref ref="Particle"/>) and one of <pt>mixed</pt>, <pt>element-only</pt>.
   </propdef>
  <propdef id="ct-exact" name="prohibited-substitutions">
    A subset of {<pt>extension</pt>, <pt>restriction</pt>, <pt>reproduction</pt>}.
   </propdef>
    <propdef id="ct-annotation" name="annotation">Optional.  An annotation</propdef>
</proplist>

  </compdef>
<p>Complex types are identified by their <propref ref="ct-name"/> and <propref ref="ct-target_namespace"/>.  Except
for anonymous complex types (those with no <propref ref="ct-name"/>), complex
type definitions must be uniquely identified within an <termref def="key-schema">XML
Schema</termref>.  Complex type <propref ref="ct-name"/>s and <propref ref="ct-target_namespace"/>s
are provided for reference from
instances (see <specref ref="xsi:type"/>), and for use in the <specref ref="declare"/>
(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 ref="ct-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 validated by that definition. The connection between a
  name and a type definition is described in <specref ref="Element_Declaration_details"/>. </p>
</note>
   <p>As described in <specref ref="Type_Derivation"/>, each complex type is derived from a
<propref ref="ct-base_type_definition"/> which is itself either a <specref ref="Simple_Type_Definition"/> or a <specref ref="Complex_Type_Definition"/>.  <propref ref="derivation_method"/> specifies the means of derivation as either <pt>extension</pt> or <pt>restriction</pt> (see <specref ref="Type_Derivation"/>).</p>

<p>A complex type with an empty specification for <propref ref="ct-final"/> can be used as a
<propref ref="ct-base_type_definition"/> for other types derived by any of
extension, restriction or reproduction; the explicit values <pt>extension</pt>,
<pt>restriction</pt> and <pt>reproduction</pt> prevent further
derivations by extension, restriction and reproduction respectively.  If all values are specified, then the complex type is said to be
<termdef id="key-ct-final" term="final"><term>final</term>: no
further derivations are possible. </termdef></p>

<p>A complex type for which <propref ref="ct-abstract"/> is <pt>true</pt> must not appear as the
<propref ref="type_definition"/> of an <specref ref="Element_Declaration"/>, and must not be referenced from an
<specref ref="xsi:type"/> attribute in an instance document;  such abstract complex types can be
used as <propref ref="ct-base_type_definition"/>s, but they are never used directly to validate
element content.</p>

<p><propref ref="ct-attribute_declarations"/> are a set of individual <specref ref="Attribute_Declaration"/>s
to be used for schema-validating the
&i-attributes;
of element information items.  See <specref ref="cvc-complex-type"/>
and <specref ref="cvc-attribute"/> for details of attribute validation.</p>
<p><propref ref="ct-attribute_wildcard"/>s provide a more flexible specification for validation of
attributes not explicitly included in <propref ref="ct-attribute_declarations"/>.
Informally, the specific values
of <propref ref="ct-attribute_wildcard"/> are interpreted as follows:
<ulist><item>
<p><pt>any</pt>: &i-attributes; can include attributes with any qualified or unqualified name.</p>
</item>
<item>
<p>a set whose
members are either namespace URIs or <termref def="key-null">null</termref>: &i-attributes; can
include any attribute(s) from the specified namespace(s).  If <termref def="key-null">null</termref> is included in the set, then any unqualified attributes are (also) allowed.</p>
</item>
<item>
<p><pt>'not'</pt> and a namespace URI: &i-attributes; cannot include attributes from the specified namespace.</p>
</item>
<item>
<p><pt>'not'</pt> and <termref def="key-null">null</termref>: &i-attributes; cannot include
unqualified attributes.</p>
</item></ulist>
See <specref ref="cvc-complex-type"/> and <specref ref="cvc-wildcard-namespace"/> for formal
details of attribute wildcard validation. </p>
<p><propref ref="content_type"/> determines the schema-validation of &i-children; of element information items.  Informally:
<ulist>
<item>
<p>A <propref ref="content_type"/> with the distinguished value <pt>empty</pt> validates elements
with no character or element information item &i-children;.</p>
</item>
<item>
<p>A <propref ref="content_type"/> which is a <specref ref="Simple_Type_Definition"/> validates
elements with character-only &i-children;.</p>
</item>
<item>
<p>An <pt>element-only</pt> <propref ref="content_type"/> validates elements with &i-children; that
conform to the supplied <termref def="key-contentModel">content model</termref>.</p>
</item>
<item>
<p>A <pt>mixed</pt> <propref ref="content_type"/> validates elements whose element information-
children (I.e. specifically ignoring other &i-children; such as character information items)
conform to the supplied <termref def="key-contentModel">content model</termref>.</p>
</item></ulist>
</p>
<p><propref ref="ct-exact"/> determine
whether an element declaration appearing in a <termref def="key-contentModel">
content model</termref> is prevented from additionally
validating elements with an <specref ref="xsi:type"/> attribute that
identifies an <pt>extension</pt>, <pt>restriction</pt> or <pt>reproduction</pt> of the type of the declared element.
If <propref ref="ct-exact"/> is empty,
then all such substitutions are valid.
</p>
<p>See <specref ref="cvc-complex-type"/>
for a formal specification of element content validation.</p>
<p>See <specref ref="declare-type"/> for the XML representation of
complex type definitions and <specref ref="coss-ct"/> for constraints on
complex type definition components as such.</p>
    <constraintnote type="cvc" id="cvc-complex-type">
     <head>Element Children and Attributes Valid</head>
     <p>An element information item is schema valid with respect to a complex type definition if:
      <olist>
       <item>
        <p><propref ref="ct-abstract"/> is false;</p>
       </item>
       <item>
        <olist>
         <item>
        <p>If the <propref ref="content_type"/> is <pt>empty</pt>, the element
information item has no character or element information item &i-children;;</p>
       </item>
       <item>
        <p>If the <propref ref="content_type"/> is  a simple
type definition, the element information item has no element
information item &i-children;, and the string composed of the &i-ccode; of each of the element information item's character information item
&i-children;
in order is schema-valid with respect to that simple type definition as defined by <specref ref="cvc-simple-type"/>;</p>
       </item>
       <item>
        <p>If the <propref ref="content_type"/> is <pt>element-only</pt>, the
element information item has no character information item &i-children; other
than those whose &i-ccode; is defined as a <xtermref href="http://www.w3.org/TR/REC-xml#NT-S">white space</xtermref>
in <bibref ref="ref-xml"/>;</p>
       </item>
       <item>
        <p>If the <propref ref="content_type"/> is <pt>element-only</pt> or
<pt>mixed</pt>, the sequence of the element information item's element
information item &i-children;, if any, taken in order, is schema-valid with
respect to the <propref ref="content_type"/>'s particle, as defined in <specref ref="cvc-particle"/></p>
       </item>
        </olist>
       </item>
       <item>
        <p>For each attribute information item in the element information
item's &i-attrChildren; excepting those whose <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">namespace URI</xpropref> is identical to <code>&XMLSchemaInstanceNS;</code> and whose <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">local name</xpropref> is one of <code>type</code>, <code>nullable</code> or <code>schemaLocation</code>, if
there is among the <propref ref="ct-attribute_declarations"/> one whose
<propref ref="a-name"/> matches the attribute information item's <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">local name</xpropref> and whose <propref ref="a-target_namespace"/> is identical to the attribute information item's <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">namespace URI</xpropref>
         <olist>
          <item>
           <p>the attribute information item is schema-valid with respect to that attribute declaration as defined in <specref ref="cvc-attribute"/>;</p>
          </item>
         </olist>
         otherwise (there is no matching attribute declaration)
         <olist>
          <item>
           <p>there is an <propref ref="ct-attribute_wildcard"/> and the
attribute information item's <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">namespace URI</xpropref> is schema-valid with respect to it as defined in <specref ref="cvc-wildcard-namespace"/>;</p>
<ednote>
<edtext> If there is an unlisted declaration, presumably for a qualified attribute, this implies
that type validity is not checked.  Is this right?</edtext>
</ednote>
          </item>
         </olist>
        </p>
       </item>
       <item>
        <p>Each attribute declaration in the <propref ref="ct-attribute_declarations"/> with a <propref ref="a-min_occurs"/> of <code>1</code> matches one of the attribute information items in the element information item's &i-attrChildren; as per clause 3 above.</p>
       </item>
      </olist>
     </p>
    </constraintnote>
    <constraintnote type="sic" id="sic-attrDefault">
     <head>Attribute Default Value</head>
     <p>For each attribute declaration in the <propref ref="ct-attribute_declarations"/> with a <propref ref="a-min_occurs"/> of <code>0</code> which has a <propref ref="a-value_constraint"/> and does not match one of the attribute information items in the element information item's &i-attrChildren; as per clause 3 of <specref ref="cvc-complex-type"/> above, the post-schema
validation infoset has an attribute information item whose <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">local name</xpropref> is that attribute declaration's <propref ref="a-name"/>
whose <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.attribute">namespace URI</xpropref> is the attribute declaration's <propref ref="a-target_namespace"/> and whose &i-attrChildren; are a list of character information items, one per character
in the declaration's <propref ref="a-value_constraint"/> string, added to the
&i-attributes; of the element information item .</p>
    </constraintnote>

<p>There is a complex type definition version of the <termref def="key-urType">ur-type definition</termref> present in every
schema by definition.  It has the following properties:</p>
    <table border="1" style="margin-left: 2em; margin-right: 2em">
     <thead>
      <tr>
       <th align="left"><B>Complex Type Definition of the Ur-Type</B></th>
      </tr>
     </thead>
     <tbody>
<tr>
<td><table border="0"><thead>
      <tr>
       <th align="left">Property</th>
       <th align="left">Value</th>
      </tr>
     </thead>
     <tbody valign="top">
      <tr>
       <td><propref ref="ct-name"/></td>
       <td>
        Not specified.
       </td>
      </tr>
      <tr>
       <td><propref ref="ct-target_namespace"/></td>
       <td>
<termref def="key-null">null</termref>.
       </td>
      </tr>
      <tr>
       <td><propref ref="ct-base_type_definition"/></td>
       <td>
       Itself.
       </td>
      </tr>
     <tr>
       <td><propref ref="derivation_method"/></td>
       <td>
        <pt>reproduction</pt>
       </td>
      </tr>
      <tr valign="top">
       <td><propref ref="content_type"/></td>
       <td>
        A pair
consisting of <pt>mixed</pt> and a particle with the following properties: <table>
          <tbody valign="top">
          <tr>
           <td><propref ref="term"/></td>
           <td>a <termref def="Wildcard_details">wildcard</termref> with an
<pt>any</pt> <propref ref="namespace_constraint"/>
           </td>
          </tr>
          <tr valign="top">
           <td><propref ref="p-min_occurs"/></td>
           <td>0</td>
          </tr>
           <tr valign="top">
           <td><propref ref="p-max_occurs"/></td>
           <td>*</td>
          </tr>
         </tbody>
         </table>
       </td>
      </tr>
      <tr>
       <td><propref ref="ct-attribute_declarations"/></td>
       <td>
        The empty set.
       </td>
      </tr>
      <tr>
       <td><propref ref="ct-attribute_wildcard"/></td>
       <td>
        <propref ref="namespace_constraint"/> is <pt>any</pt>
       </td>
      </tr>
      <tr>
       <td><propref ref="ct-final"/></td>
       <td>The empty set.
       </td>
      </tr>
      <tr>
       <td><propref ref="ct-exact"/></td>
       <td>
        The empty set.
       </td>
      </tr>
      <tr>
       <td><propref ref="ct-abstract"/></td>
       <td>
        False.
       </td>
      </tr>
     </tbody></table></td>
</tr>
</tbody>
     </table>
    <ednote>
     <edtext>This should be handled with a generic tableau markup</edtext>
    </ednote>
    <p>The <code>mixed</code> content specification together with the
unconstrained wildcard content model and attribute specification produce the defining property for the
complex ur-type definition, namely that <emph>every</emph> complex type definition is
either an extension of a simple type definition or (eventually) a restriction
of the complex ur-type definition: its permissions and requirements are
the least restrictive possible.</p>

   </div2>
   <div2 id="Attribute_Group_Definition_details">
    <head>Attribute Group Definition Details</head>
<p>A schema can name a group of attribute declarations so that they may be incorporated as a
group into complex type definitions.</p>
<p>
Attribute group definitions do not participate in schema-validation as such, but the
<propref ref="ct-attribute_declarations"/> and <propref ref="ct-attribute_wildcard"/> of one or
more complex type definitions may be constructed in whole or part by reference to an attribute group.
Attribute group definitions are provided primarily for reference from the <specref ref="declare"/>
(see <eltref ref="complexType"/> and <eltref ref="attributeGroup"/>).
Thus, attribute group definitions provide a
replacement for some uses of XML's
<termref def="gloss-parameterEntity">parameter entities</termref>.</p>
    <p>The attribute group definition schema component has the
following properties:</p>

  <compdef name="Attribute Group Definition" ref="Attribute_Group_Definition">
   <proplist>
  <propdef id="ag-name" name="name">
    An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="ag-target_namespace" name="target namespace">
    Either <termref def="key-null">null</termref> or a namespace URI, as defined in <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="ag-attribute_declarations" name="attribute declarations">
    A set of attribute declarations.
   </propdef>
  <propdef id="ag-attribute_wildcard" name="attribute wildcard">
    Optional.  One of <pt>any</pt>; a pair of <pt>not</pt> and a namespace URI
or <termref def="key-null">null</termref>; or a set whose
members are either namespace URIs or <termref def="key-null">null</termref>.
   </propdef>
    <propdef id="ag-annotation" name="annotation">Optional.  An annotation</propdef>
</proplist>

  </compdef>

  <p>Attribute groups are identified by their <propref ref="ag-name"/> and <propref ref="ag-target_namespace"/>; attribute group identities must be unique within an <termref def="key-schema">XML Schema</termref>.  See <specref ref="composition-schemaImport"/> for the use of component
identifiers when importing one schema into another.</p>
<p><propref ref="ag-attribute_declarations"/> is a set of attribute declarations specifically identified as
members of the attribute group.</p>
<p><propref ref="ag-attribute_wildcard"/> provides for an attribute wildcard to be included in an
attribute group.
See above under <specref ref="Complex_Type_Definition_details"/> for the
interpretation of
attribute wildcards during validation.</p>
<p>See <specref ref="cvc-complex-type"/> and <specref ref="cvc-wildcard-namespace"/> for formal
details of attribute wildcard validation.
See <specref ref="declare-attributeGroup"/> for the XML representation of
attribute group definitions, and <specref ref="coss-attrGroup"/> for constraints on
attribute group definition components as such.</p>
   </div2>
   <div2 id="Model_Group_Definition_details">
    <head>Model Group Definition Details</head>
<p>A model group definition associates a name and optional annotations with a <specref ref="Model_Group"/>.
By reference to the name, the entire model group can be incorporated by reference into a <propref ref="term"/>.</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
<termref def="gloss-parameterEntity">parameter entities</termref>.
</p>    <p>The model group definition schema component has the following
properties:</p>

  <compdef name="Model Group Definition" ref="Model_Group_Definition">

   <proplist>
  <propdef id="mg-name" name="name">
    An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="mg-target_namespace" name="target namespace">
    Either <termref def="key-null">null</termref> or a namespace URI, as defined in <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="model_group" name="model group">
    A model group.
   </propdef>
    <propdef id="mg-annotation" name="annotation">Optional.  An annotation</propdef>
</proplist>
  </compdef>
<p>Model group definitions are identified by their <propref ref="mg-name"/> and <propref ref="mg-target_namespace"/>; model group identities must be unique within an <termref def="key-schema">XML Schema</termref>.  See <specref ref="composition-schemaImport"/> for the use of component
identifiers when importing one schema into another.</p>
<p>Model group definitions per se do not participate in schema-validation, but the <propref ref="term"/> of
a particle may correspond in whole or in part
to a model group from a model group definition.</p>
<p><propref ref="model_group"/> is the <specref ref="Model_Group"/> for which the model group definition provides a name.</p>

     <p>See <specref ref="declare-namedModelGroup"/> for the XML representation of
model group definitions and <specref ref="coss-groupDef"/> for constraints on model group definition components as such.</p>

   </div2>
   <div2 id="Model_Group_details">
    <head>Model Group Details</head>
    <p>
When the &i-children; of element information items are not constrained
to be <pt>empty</pt> or by reference to a simple type definition
(<specref ref="Simple_Type_Definition_details"/>), the sequence of element
information item &i-children; content may be specified in
more detail with a model group.  Because the <propref ref="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.</p>

    <p>The model group schema component has the following
properties:</p>

  <compdef name="Model Group" ref="Model_Group">
   <proplist>
  <propdef id="compositor" name="compositor">
    One of <pt>all</pt>, <pt>choice</pt> or <pt>sequence</pt>.
   </propdef>
  <propdef id="particles" name="particles">
    A list of particles
   </propdef>
    <propdef id="amg-annotation" name="annotation">Optional.  An annotation</propdef>
</proplist>
  </compdef>
<p><propref ref="compositor"/>determines whether the element
information item &i-children; validated by the model group must:
<ulist>
<item><p>(<pt>sequence</pt>) correspond, in order, to the specified <propref ref="particles"/>;</p>
</item>
<item><p>(<pt>choice</pt>) corresponded to exactly one of the specified <propref ref="particles"/>;</p>
</item>
<item><p>(<pt>all</pt>, (in which case <propref ref="particles"/> is restricted to contain local and global element
declarations, with minOccurs=maxOccurs=1) contain exactly one of each element specified in <propref ref="particles"/>.  The elements can occur in any order.</p>
</item>
</ulist></p>
<p><propref ref="amg-annotation"/>Description to be supplied in a future draft.</p>
<constraintnote type="cvc" id="cvc-model-group">
 <head>Element Sequence Valid</head>
 <p><termdef id="key-partition" term="partition">We define a
<term>partition</term> of a sequence as a sequence of sub-sequences, some or
all of which may be empty, such that concatenating all the sub-sequences yields
the original sequence.</termdef></p>
 <p>A sequence (possibly empty) of element information items is schema-valid with respect to
a model group if
  <olist>
   <item>
    <p>The <propref ref="compositor"/> is <pt>sequence</pt> and there is a
<termref def="key-partition">partition</termref> of the sequence into <code>n</code> sub-sequences where <code>n</code> is the length of <propref ref="particles"/> such that each of the sub-sequences in order is schema-valid
with respect to the corresponding particle in the <propref ref="particles"/> as defined in <specref ref="cvc-particle"/>;</p>
   </item>
  </olist>
  or
  <olist>
   <item>
    <p>The <propref ref="compositor"/> is <pt>choice</pt> and there is a
particle among the <propref ref="particles"/> such that the sequence is
schema-valid with respect to that particle as defined in <specref ref="cvc-particle"/>;</p>
   </item>
  </olist>
  or
  <olist>
   <item>
    <p>The <propref ref="compositor"/> is <pt>all</pt> and there is a
<termref def="key-partition">partition</termref> of the sequence into <code>n</code> sub-sequences where <code>n</code> is the length of <propref ref="particles"/> such that there is a one-to-one mapping between the sub-sequences and the <propref ref="particles"/> where each sub-sequence is schema-valid with respect to the corresponding particle as defined in <specref ref="cvc-particle"/>;</p>
   </item>
  </olist>
 </p>
 <p>Nothing in the above should be understood as ruling out groups whose
<propref ref="particles"/> is empty:  although no sequence can be schema-valid
with respect to such a group whose <propref ref="compositor"/> is
<pt>choice</pt>, the empty sequence <emph>is</emph> schema valid with respect
to empty groups whose <propref ref="compositor"/> is <pt>sequence</pt> or <pt>all</pt>.</p>
</constraintnote>
    <note>
     <p>The above definition is implicitly non-deterministic, and should not be
taken as a recip&eacute; for implementations.  Note in particular that when  <propref ref="compositor"/> is <pt>all</pt>, particles is restricted to a list of local and global element declarations (see <specref ref="coss-modelGroup"/>).   A much simpler implementation is possible for than would arise from a literal interpretation of the definition above; informally, the content is valid when each declared element occurs exactly once, and each is valid with respect to its corresponding declaration.  The elements can occur in arbitrary order.</p>
    </note>
    <ednote>
         <edtext>The above depends on chapter 6 to rule out 'all' except
directly within content type.</edtext>
        </ednote>
<p>See <specref ref="declare-contentModel"/> for the XML representation of
model groups and <specref ref="coss-modelGroup"/> for constraints
on model group components as such.</p>

   </div2>
   <div2 id="Particle_details">
    <head>Particle Details</head>

    <p>As described in <specref ref="Model_Group_details"/>, particles contribute to the definition
of content models.  The particle schema component has the following properties:</p>

  <compdef name="Particle" ref="Particle">
   <proplist>
    <propdef id="p-min_occurs" name="min occurs">A non-negative
integer</propdef>
    <propdef id="p-max_occurs" name="max occurs">Either a non-negative integer
or <pt>*</pt></propdef>
    <propdef id="term" name="term">One of a model group, a wildcard, a local
element declaration or global element declaration together with the following
additional properties:
     <proplist>
      <propdef id="p-value_constraint" name="value constraint">Optional.  A
pair consisting of a string and one of <pt>default</pt>, <pt>fixed</pt>.</propdef>
      <propdef id="p-nullable" name="nullable">A boolean</propdef>
      <propdef id="p-exact" name="disallowed substitutions">A subset of
{<pt>extension</pt>, <pt>restriction</pt>, <pt>equivClass</pt>}.</propdef>
      <propdef id="p-abstract" name="abstract">A boolean</propdef>
      <propdef id="p-annotation" name="annotation">Optional.  An annotation</propdef>
     </proplist>
    </propdef>
   </proplist>

  </compdef>
<p>The following is an informal overview of the properties of a particle.  Formal interpretation of
these properties is found in  <specref ref="cvc-particle"/>.</p>
<p>In general, multiple element
information item &i-children;, possibly with intervening character &i-children; if the content type
is <pt>mixed</pt>, can be validated with respect to a single particle. <propref ref="p-min_occurs"/> determines the minimum number of such element &i-children; that can validly occur.  The number of such children must be greater than or equal to <propref ref="p-min_occurs"/>.  If <propref ref="p-min_occurs"/> is <pt>0</pt>, then occurrence of such children is optional.   </p>
<p>The number of such element &i-children; must be less than or equal to any numeric specification of
<propref ref="p-max_occurs"/>; if <propref ref="p-max_occurs"/> is <pt>*</pt>, then there is no
upper bound on the number of such children.</p>
<p><propref ref="p-nullable"/>, <propref ref="p-exact"/> and <propref ref="p-value_constraint"/>, if
specified, merge with the corresponding properties of the supplied element declaration.</p>
<constraintnote type="cvc" id="cvc-particle">
 <head>Element Sequence Valid (Particle)</head>
 <p>A sequence (possibly empty) of element information items is schema-valid
with respect to a particle if
  <olist>
   <item>
    <p>The length of the sequence is greater than or equal to the <propref ref="p-min_occurs"/>;</p>
   </item>
   <item>
    <p>The length of the sequence is less than or equal to the <propref ref="p-max_occurs"/>;</p>
   </item>
   <item>
    <p>Either
    <olist>
     <item>
      <p>the <propref ref="term"/> is a model group and there is a <termref def="key-partition">partition</termref> of the sequence into sub-sequences such that each sub-sequence is schema-valid with respect to that model group as defined in <specref ref="cvc-model-group"/>;</p>
     </item>
    </olist>
    or
    <olist>
     <item>
      <p>the <propref ref="term"/> is a wildcard and the <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.element">namespace URI</xpropref> of each element
information item in the sequence is schema-valid with respect to the <propref ref="namespace_constraint"/> of the wildcard.</p>
     </item>
    </olist>
     or
    <olist>
     <item>
      <p>the <propref ref="term"/> is an element declaration;</p>
     </item>
      <item>
       <p>for each element
information item in the sequence either
        <olist>
         <item>
          <p>the element declaration is local (i.e. its
<propref ref="scope"/> is not <pt>global</pt>), its <propref ref="e-abstract"/> is false, the element information
item's <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.element">namespace URI</xpropref> is identical to the element declaration's <propref ref="e-target_namespace"/>, 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 ref="e-name"/> and the element information item is schema-valid with respect to the
declaration as defined in <specref ref="cvc-elt"/>;</p>
         </item>
        </olist>
        or
        <olist>
         <item>
          <p>the element declaration is global (i.e. its
<propref ref="scope"/> is <pt>global</pt>), the particle's <propref ref="p-abstract"/> is false, the element declaration's <propref ref="e-abstract"/> is false, the element information
item's <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.element">namespace URI</xpropref> is identical to the element declaration's <propref ref="e-target_namespace"/>, 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 ref="e-name"/> and the element information item is schema-valid with respect to the
element declaration as defined in <specref ref="cvc-elt"/>, with the values of
the particle's <propref ref="p-value_constraint"/>, <propref ref="p-nullable"/>
and <propref ref="p-exact"/> being merged with the corresponding
properties of the element declaration;</p>
         </item>
        </olist>
        or
        <olist>
         <item>
          <p>the element declaration is global (i.e. its
<propref ref="scope"/> is <pt>global</pt>), the particle's <propref ref="p-exact"/> does not contain <pt>equivClass</pt>, the element declaration's <propref ref="e-exact"/> does not contain <pt>equivClass</pt>,
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 URI</xpropref> of the element information item resolve to an element definition, as
defined in <specref ref="src-resolve"/> -- <termdef id="key-eqd" term="equivalent declaration">call this declaration the <term>equivalent declaration</term></termdef>, the <termref def="key-eqd">equivalent declaration</termref> together with the particle's <propref ref="p-exact"/> is validly equivalent to the particle's element declaration as defined in <specref ref="cos-equiv-derived-ok-rec"/> and the element information item is schema-valid with respect to the
<termref def="key-eqd">equivalent declaration</termref> as defined in <specref ref="cvc-elt"/>, with the values of
the particle's <propref ref="p-value_constraint"/>, <propref ref="p-nullable"/>
and <propref ref="p-exact"/> being merged with the corresponding
properties of the <termref def="key-eqd">equivalent declaration</termref>.</p>
         </item>
        </olist>
       </p>
      </item>
    </olist>
    </p>
   </item>
  </olist>
 </p>
</constraintnote>
      <p>
See <specref ref="declare-contentModel"/> for the XML representation of
particles and <specref ref="coss-particle"/> for constraints
on particle components as such.</p>

   </div2>
   <div2 id="Wildcard_details">
    <head>Wildcard Details</head>
    <p>A wildcard provides for validation of element information items dependent on their namespace
URI, but independently
of their local name.  The wildcard schema component has the following properties:</p>
     <compdef name="Wildcard" ref="Wildcard">
   <proplist>
  <propdef id="namespace_constraint" name="namespace constraint">
    One of <pt>any</pt>; a pair of <pt>not</pt> and a namespace URI
or <termref def="key-null">null</termref>; or a set whose
members are either namespace URIs or <termref def="key-null">null</termref>.
   </propdef>
    <propdef id="w-annotation" name="annotation">Optional.  An annotation</propdef>
</proplist>
 </compdef>
    <ednote>
     <edtext>missing the processContents property, and a descriptions of the
processing options for material allowed by an any, i.e. strict (must validate,
find the defs and decls you need or invalid; lax, i.e. validate when you can
find the defs and decls, OK if you can't; skip, i.e. don't try, call it valid
no matter what.</edtext>
    </ednote>
<p><propref ref="namespace_constraint"/> provides for validation of elements that:
<ulist>
<item>
<p>(<pt>any</pt>) have any namespace or are not namespace qualified;</p>
</item>
<item>
<p>(<pt>not</pt> and a namespace URI) have any namespace other than the specified namespace URI, or
are not namespace qualified;</p>
</item>
<item>
<p>(<pt>not</pt> and <termref def="key-null">null</termref>) are namespace qualified;</p>
</item>
<item>
<p>(a set whose
members are either namespace URIs or <termref def="key-null">null</termref>) have any of the
specified namespaces and/or, if <termref def="key-null">null</termref> is included in the set, are unqualified.</p>
</item>
</ulist></p>
    <constraintnote type="cvc" id="cvc-wildcard">
     <head>Element Valid (Wildcard)</head>
     <p><termdef id="cd-allowed-ns" term="allowed namespace">watch this space</termdef></p>
    </constraintnote>
    <constraintnote type="cvc" id="cvc-wildcard-namespace">
     <head>Wildcard allows Namespace URI</head>
     <p>A value which is either a namespace URI or <termref def="key-null">null</termref> is schema valid with respect to a wildcard constraint (the
value of a <propref ref="namespace_constraint"/> or a
<propref ref="ct-attribute_wildcard"/>) if
      <olist>
       <item>
        <p>the constraint is <pt>any</pt>;</p>
       </item>
      </olist>
      or
      <olist>
       <item>
        <p>the constraint is a pair of <pt>not</pt> and a namespace URI, and
the value is not identical to the namespace URI;</p>
       </item>
      </olist>
      or
      <olist>
       <item>
        <p>the constraint is a set, and the value is identical to one of the members of the set.</p>
       </item>
      </olist>
     </p>
    </constraintnote>
     <p>
See <specref ref="declare-openness"/> for the XML representation of
wildcards and <specref ref="coss-wildcard"/> for constraints
on wildcard components as such.</p>
   </div2>
<div2 id="&Constraint;_Definition_details">
    <head>&Constraint; Definition Details</head>
<p>&Constraint; definition components provide for uniqueness and reference constraints with respect
to the contents of multiple elements and attributes.  The &constraint; definition schema component has the following
properties:
</p>   

  <compdef name="&Constraint; Definition" ref="&Constraint;_Definition">

   <proplist>
  <propdef id="c-name" name="name">
    An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="c-target_namespace" name="target namespace">
    Either <termref def="key-null">null</termref> or a namespace URI, as defined in <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="&constraint;_name" name="&constraint; category">
    One of <pt>key</pt>, <pt>keyref</pt> or <pt>unique</pt>.
   </propdef>
  <propdef id="selector" name="selector">
    An XPath expression, as defined in <bibref ref="bib-xpath"/>
   </propdef>
  <propdef id="fields" name="fields">
    An a non-empty list of XPath expressions, as defined in <bibref ref="bib-xpath"/>
   </propdef>
  <propdef id="referenced_key" name="referenced key">
    Required if <propref ref="&constraint;_name"/> is <pt>keyref</pt>, forbidden
otherwise.  A &constraint; definition with <propref ref="&constraint;_name"/>
equal to <pt>key</pt> or <pt>unique</pt>.
   </propdef>
    <propdef id="rc-annotation" name="annotation">Optional.  An annotation</propdef>
</proplist>
  </compdef>
<p>&Constraint; definitions are identified by their <propref ref="c-name"/> and <propref ref="c-target_namespace"/>; &Constraint; definition identities must be unique within an <termref def="key-schema">XML Schema</termref>.  See <specref ref="composition-schemaImport"/> for the use of component
identifiers when importing one schema into another.</p>
<p>Informally, <propref ref="&constraint;_name"/> identifies the &Constraint; definition as playing one of
three roles:
<ulist>
 
<item><p>(<pt>unique</pt>) the &Constraint; definition asserts uniqueness, with respect to the content
identified by <propref ref="selector"/>, of the tuples resulting from evaluation of the <propref ref="fields"/> Xpath(s). </p></item>
 
<item>
<p>(<pt>key</pt>) the &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 &Constraint; definition asserts a correspondence, with respect to the content
identified by <propref ref="selector"/>, of the tuples resulting from evaluation of the <propref ref="fields"/> Xpath(s), with those of the <propref ref="referenced_key"/>. </p></item>
</ulist> </p>
<p>These constraints are specified independently of the types of the
attributes and elements involved, i.e. something declared as of type integer
may also serve as a key, unlike <code>ID</code> and
<code>IDREF</code>.  Each constraint declaration has a name, which exists in a
single symbol space for constraints.</p>
    <p>Overall the augmentations to XML's <code>ID/IDREF</code> mechanism are:</p>
    <ulist>
     <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>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-nullable;</p></item>
     <item>
      <p>The comparison between <pt>keyref</pt> <propref ref="fields"/> and
<pt>key</pt> or <pt>unique</pt> <propref ref="fields"/> is by value equality,
not by string equality, so that a decimal <code>0.5</code> will match a decimal <code>.5</code>.</p>
     </item>
    </ulist>
    <p><propref ref="selector"/> specifies an XPath expression <bibref ref="bib-xpath"/> relative to
instances of the element being declared.  This must identify a node set of subelements (i.e. elements contained within the declared element) to which the constraint applies.</p>
    <p><propref ref="fields"/> specifies XPath expressions relative to each
element selected by a <propref ref="selector"/>.  This must identify
a single node (element or attribute, not necessarily within the selected element) whose content or value, which must be
of a simple type, is used in the constraint.  It is possible to specify an
ordered list of <propref ref="fields"/>s, to cater to multi-field keys,
keyrefs, and uniqueness constraints.
     <note>
      <p>Provision for multi-field keys etc. goes beyond what is supported by <code>xsl:key</code>.</p>
     </note></p>
    <issue id="restrictConstrXPaths">
<p>
XPath expressions can take arbitrarily complicated forms and it is unnecessary to burden
XML Schema implementations with supporting every feature of XPath.  The XPaths
in <propref ref="selector"/> and <propref ref="fields"/> should be restricted to certain specified simple forms.</p>
     <p>The WG has asked the editor to bring forward a proposal.  Here's the
starting point, feedback invited:</p>
     <slist>
      <sitem>|, /, //, .., @QName, QName, *, ancestor::, []</sitem>
      <sitem>or, and, =</sitem>
      <sitem>the not, name and position functions</sitem>
      <sitem>string and number literals</sitem>
      <sitem>prefixes interpreted per in-scope namespace declarations</sitem>
     </slist>
    </issue>
    <issue id="islandValidConstraint">
     <p>What are the interactions between &constraint;s and opportunistic
validation inside wildcards?</p>
    </issue>

<p>A formal description of &Constraint; definition validation is given below in <specref ref="cvc-&constraint;"/></p>

 <constraintnote type="cvc" id="cvc-&constraint;">
  <head>&Constraint; Satisfied</head>
  <p>An element information item is schema-valid with respect to a &constraint; if
   <olist>
    <item>
     <p>The <propref ref="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">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 an
element node;</p>
    </item>
    <item>
     <p>For each node in the <termref def="key-tns">target node set</termref> all of the <propref ref="fields"/>, with that node as the context
node, evaluate to either an empty node-set or a node-set with exactly one
member.  <termdef id="key-ks" term="key-sequence">Call the sequence of the values (as defined in <bibref ref="ref-xsp2"/>) of those node-sets in order the <term>key-sequence</term> of the node</termdef>;
     </p>
    </item>
   </olist>
  </p>
  <p>
   <termdef id="key-qns" term="qualified node set">Call the subset of the <termref def="key-tns">target node set</termref> for
which all the <propref ref="fields"/> evaluate to a node-set with exactly one
member which is an element or attribute node the <term>qualified node set</term></termdef>;</p>
  <p><olist>
    <item>
     <p>The <propref ref="&constraint;_name"/> is <pt>unique</pt>;</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;</p>
    </item>
   </olist>
   or
   <olist>
    <item>
     <p>The <propref ref="&constraint;_name"/> is <pt>key</pt>;</p>
    </item>
    <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;</p>
    </item>
   </olist>
   or
   <olist>
    <item>
     <p>The <propref ref="&constraint;_name"/> is <pt>keyref</pt>;</p>
    </item>
    <item>
     <p>For each member of the <termref def="key-qns">qualified node
set</termref> (call this the <B>keyref member</B>), there must be a member of the <termref def="key-nt">node table</termref> associated with the
<propref ref="referenced_key"/> in the <xpropref>&constraint; table</xpropref>
of the element information item (see <specref ref="sic-key"/>, which must be
understood as logically prior to this clause of this constraint, below) whose
<termref def="key-ks">key-sequence</termref> is equal to the
<B>keyref member's</B> <termref def="key-ks">key-sequence</termref> member for member.</p>
    </item>
    <item>
     <ednote>
      <edtext>The fields cardinality of a keyref must be equal to the fields
cardinality of its [referenced key], checked in chapter 6.</edtext>
     </ednote>
     <ednote>
<edtext>This is simpler (and in one respect, the hyper-uniqueness implied by
the uniqueness requirement built in to the merger of the tables defined below, stronger) recursive descent implied than the apparently agreed design: is it acceptable for
v.1, as I don't see how to do better?</edtext>
</ednote>
    </item>
   </olist>
  </p>
  <ednote>
   <edtext>Check the resolution of the nested domains issue -- is the above
correct wrt that?</edtext>
  </ednote>
 </constraintnote>
 <constraintnote type="sic" id="sic-key">
  <head>&Constraint; Table</head>
  <p><termdef id="key-ec" term="eligible &constraint;">An <term>eligible
&constraint;</term> of an element information item is one such that clauses 2.1.[1-2] or 2.2.[1-3] of <specref ref="cvc-&constraint;"/> obtains
with respect to that item and that constraint,
or such that any of the element information item &i-children; of that item have a
<xpropref>&constraint; table</xpropref> with an entry for that constraint</termdef>.</p>
  <p><termdef id="key-nt" term="node table">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 constraints</termref>, a new
<xpropref>&constraint; table</xpropref> is added to the post-schema-validation
infoset for that element information item, consisting of pairs of &constraint;s
and <termref def="key-nt">node tables</termref>, one for each of the item's
<termref def="key-ec">eligible constraints</termref>, with the <termref def="key-nt">node table</termref> in each pair defined as follows:  There is a member in the <termref def="key-nt">node table</termref>
associated with an <termref def="key-ec">eligible constraint</termref> of an
element information item consisting of a <termref def="key-ks">key-sequence</termref> (call it <B>k</B>) and a node (call it <B>n</B>) if and only if
   <olist>
    <item>
     <p>
   <olist>
    <item>
     <p>There is a member in one of the <termref def="key-nt">node
tables</termref> associated with the <termref def="key-ec">eligible
constraint</termref> in at least one of the <xpropref>&constraint;
tables</xpropref> of the element information item &i-children; of the element
information item whose <termref def="key-ks">key-sequence</termref> is <B>b</B> and whose node is <B>n</B>;</p>
    </item>
   </olist>
  or
   <olist>
    <item>
     <p><B>n</B> is in the <termref def="key-qns">qualified node
set</termref> for the <termref def="key-ec">eligible
constraint</termref> of the element information item with <termref def="key-ks">key-sequence</termref> <B>b</B>.</p>
    </item>
   </olist>
  </p>
    </item>
    <item>
     <p>There is no member in one of the <termref def="key-nt">node
tables</termref> associated with the <termref def="key-ec">eligible
constraint</termref> in any of the <xpropref>&constraint;
tables</xpropref> of the element information item &i-children; of the element
information item whose <termref def="key-ks">key-sequence</termref> is <B>b</B>
and whose node is a node other than <B>n</B>;</p>
    </item>
    <item>
     <p>Some node distinct from <B>n</B> is in the <termref def="key-qns">qualified node
set</termref> for the <termref def="key-ec">eligible
constraint</termref> of the element information item with <termref def="key-ks">key-sequence</termref> <B>b</B>.</p>
    </item>
   </olist>
  </p>
 </constraintnote>
 <ednote>
  <edtext>This is considerably less than transparent.  The intention is to
recursively construct r-c tables at one level by merging the still-unique
members of each corresponding table one level down, if any, with the new
entries arising from evaluating the r-c at this level, if any, throwing out any which conflict.</edtext>
 </ednote>
 
<p>
See <specref ref="declare-key"/> for the XML representation of
&constraint; definitions and <specref ref="coss-&constraint;"/> for constraints
on &constraint; definition components as such.</p>
   </div2>
   <div2 id="Notation_Declaration_details">
    <head>Notation Declaration Details</head>
<ednote><edtext>Cleanup of the descriptive text below, and descriptions of individual properties to be provided in a
future draft.  </edtext></ednote>
    <p>
The notation declaration schema component has the following
properties:</p>

  <compdef name="Notation Declaration" ref="Notation_Declaration">
   <proplist>
  <propdef id="n-name" name="name">
    An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="n-target_namespace" name="target namespace">
    Either <termref def="key-null">null</termref> or a namespace URI, as defined in <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="system_identifier" name="system identifier">
    Optional if <propref ref="public_identifier"/> is present.  A URI reference.
   </propdef>
  <propdef id="public_identifier" name="public identifier">
    Optional if <propref ref="system_identifier"/> is present.  A public identifier, as defined in <bibref ref="ref-xml"/>.
   </propdef>
    <propdef id="n-annotation" name="annotation">Optional.  An annotation</propdef>
</proplist>

  </compdef>
    <p>Notation declarations do not participate in schema-validation as such.
They are referenced in the course of schema-validating strings as members of
the <xtermref href="&XSP2.URI;#NOTATION">NOTATION</xtermref> simple type.</p>
     <p>
See <specref ref="declare-notation"/> for the XML representation of
notation declarations and <specref ref="coss-notation"/> for constraints on
notation declaration components as such.</p>

   </div2>
   <div2 id="Annotation_details">
    <head>Annotation Details</head>
<ednote><edtext>Cleanup of the descriptive text below, and descriptions of individual properties to be provided in a
future draft.  </edtext></ednote>
    <p>The annotation schema component has the following
properties:</p>

  <compdef name="Annotation" ref="Annotation">
   <proplist>
  <propdef id="application_information" name="application information">
    Optional.  An element information item.
   </propdef>
  <propdef id="user_information" name="user information">
    Optional.  An element information item.
   </propdef>
</proplist>
  </compdef>
    <p>Annotations do not participate in schema-validation as such.  Provided
an annotation itself satisfies all relevant <termref def="gloss-cos">Constraints of Schemas</termref> it <emph>cannot</emph> affect the schema-validity of element information items.</p>
      <p>
See <specref ref="declare-annotation"/> for the XML representation of
annotations and <specref ref="coss-annotation"/> for constraints
on annotation components as such.</p>
   </div2>
<div2 id="Simple_Type_Definition_details">
    <head>Simple Type Definition Details</head>
    <p>Simple type definitions provide for constraining character information item &i-children; of element and attribute
information items.
The simple type definition schema component has the following properties:
</p>
      <compdef name="Simple Type Definition" ref="Simple_Type_Definition">

   <proplist>
  <propdef id="st-name" name="name">
    Optional.  An NCName as defined by <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="st-target_namespace" name="target namespace">
    Either <termref def="key-null">null</termref> or a namespace URI, as defined in <bibref ref="ref-xml-namespaces"/>.
   </propdef>
  <propdef id="st-final" name="final">
    A subset of {<pt>enumeration</pt>, <pt>list</pt>, <pt>restriction</pt>, <pt>reproduction</pt>}.
   </propdef>
  <propdef id="st-abstract" name="abstract">
    A boolean
   </propdef>
  <propdef id="st-annotation" name="annotation">Optional.  An annotation</propdef>
  <propdef id="generator" name="variety">
    There are three varieties of simple type definition, each with a distinct set of properties:
         <glist>
          <gitem><label>atomic</label>
<def>
<p>A simple type definition whose members are those of a built-in primitive
simple type, or a subset of those of a built-in
primitive simple type identified by specifying
values for one or more constraining facets.</p>

  <proplist>
  <propdef id="st-primitive_type_definition" name="primitive type definition">
    A built-in primitive simple type definition (or the <termref def="key-urType">ur-type definition</termref>).
   </propdef>
  <propdef id="st-base_type_definition" name="base type definition">
    A simple type definition, which can be the <termref def="key-urType">ur-type definition</termref>.
   </propdef>
  <propdef id="facets" name="facets">
    A set of constraining facets.
   </propdef>
</proplist>
</def>
</gitem>
          <gitem>
           <label>enumeration</label>
           <def>
            <p>A simple type definition for a type whose members are an explicitly enumerated subset of some
other simple type.</p>
   <proplist>
  <propdef id="st-base_type_definition2" name="base type definition">
    A simple type definition.
   </propdef>
  <propdef id="st-strings" name="strings">
    A set of strings from the lexical space of
the <propref ref="st-base_type_definition2"/>.
   </propdef>
</proplist>
           </def>
          </gitem>
          <gitem>
           <label>list</label>
           <def>
            <p>A simple type definition for a type whose members are lists of members of some other
(non-list) simple type.</p>
   <proplist>
<propdef id="st-base_type_definition3" name="base type definition">
    The simple type definition which constrains each element of
the list.
   </propdef>
  </proplist>
           </def>
          </gitem>
         </glist>

   </propdef>
  </proplist>
  </compdef>

   
<p>Simple types are identified by their <propref ref="st-name"/> and <propref ref="st-target_namespace"/>.  Except
for anonymous simple types (those with no <propref ref="st-name"/>), simple
type definitions must be uniquely identified within an <termref def="key-schema">XML
Schema</termref>.  Simple type <propref ref="st-name"/>s and <propref ref="ct-target_namespace"/>s
are provided for reference from
instances (see <specref ref="xsi:type"/>), and for use in the <specref ref="declare"/>
(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 ref="st-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 validated by that definition. The connection between a
  name and a type definition is described in <specref ref="Element_Declaration_details"/> and <specref ref="Attribute_Declaration_details"/>. </p>
</note>
<p>A simple type definition for which <propref ref="st-abstract"/> is <pt>true</pt> must not appear as the
<propref ref="type_definition"/> of an <specref ref="Attribute_Declaration"/>, must not be used as the <propref ref="st-base_type_definition2"/> of an enumeration simple type, must not used as the <propref ref="st-base_type_definition3"/> of a list simple type, and must not be referenced from an
<specref ref="xsi:type"/> attribute in an instance document.</p>

<p><propref ref="generator"/> determines whether the simple type corresponds to an
<pt>atomic</pt>, <pt>enumeration</pt>, or <pt>list</pt> type as defined by &XSP2;. </p>
<p>A simple type with an empty specification for <propref ref="st-final"/> can be used as a
<propref ref="st-base_type_definition"/> for other types derived by restriction; and/or as the 
<propref ref="st-base_type_definition2"/> of an enumeration simple type, and/or as the <propref ref="st-base_type_definition3"/> of a list simple type.  The explicit values <pt>restriction</pt>,
<pt>enumeration</pt> and <pt>list</pt> prevent any or all of those uses respectively.  
</p>
<ednote>
<edtext>Need to describe 'reproduction' value.</edtext>
</ednote>   
<p>As described in <specref ref="Type_Derivation"/>, every <pt>atomic</pt> simple type definition is
a <termref def="key-typeRestriction">restriction</termref> of some other simple
<propref ref="st-base_type_definition"/>, which is itself either a simple type definition or the <termref def="key-urType">ur-type definition</termref>. Each atomic type is ultimately a restriction of (or identical to) exactly one built in simple <propref ref="st-primitive_type_definition"/>.</p>
<p><propref ref="facets"/> for each <pt>atomic</pt> simple type definition are selected from those defined  in
&XSP2; for
the corresponding <propref ref="st-primitive_type_definition"/>.  Therefore, the value
space and lexical space (I.e. the content validated by) any atomic simple type is determined by the
pair {<propref ref="st-primitive_type_definition"/>, <propref ref="facets"/>}. </p>
<p><pt>Enumeration</pt> simple types are <termref def="key-typeRestriction">restriction</termref>s
of the specified <propref ref="st-base_type_definition2"/>;  enumeration types validate only
content that matches one of the specified <propref ref="st-strings"/>.</p>
<p>As specified in &XSP2;, <pt>list</pt> simple types validate whitespace separated tokens, each of
which conforms to the specified <propref ref="st-base_type_definition3"/>.  The base type specified
must not itself be a <pt>list</pt> type, and must be one of the types identified in &XSP2; as a
suitable base for a list simple type.</p>
<ednote>
<edtext>Careful readers will observe that the above specification of list types conflicts 
with the claim in 
"Type Derivation" that all simple types are restrictions of other simple types.  
This anomaly has no effect on the validation of content, but it does affect the
cleanliness of the
hierarchy exposed by a post-schema validation infoset, which includes simple type
definitions derived by list-formation as well as restriction.</edtext>
</ednote>
 <p>Simple type definitions for all the built-in primitive datatypes, namely <pt>string</pt>, <pt>boolean</pt>, <pt>float</pt>,
<pt>double</pt>, <pt>decimal</pt>, <pt>timeInstant</pt>, <pt>timeDuration</pt>,
<pt>recurringInstant</pt>, <pt>binary</pt>, <pt>uri</pt> (see the <xtermref href="&XSP2.URI;#built-in-primitive-datatypes">Primitive
Datatypes</xtermref> section of &XSP2;), as well as for the
<termref def="key-urType">ur-type definition</termref> (as previously described), are present by definition in every schema.  All
are in the XML Schema <propref ref="st-target_namespace"/> (namespace URI <code>&XMLSchemaNS;</code>), have an <pt>atomic</pt> <propref ref="generator"/> with an empty
<propref ref="facets"/> and the <termref def="key-urType">ur-type definition</termref> as
their <propref ref="st-base_type_definition"/> and themselves as <propref ref="st-primitive_type_definition"/>.</p>
<p>Similarly, simple type definitions for all the built-in derived
datatypes (see the <xtermref href="&XSP2.URI;#built-in-derived">Derived
Datatypes</xtermref> section of &XSP2;) are present by definition in every schema, with
properties as specified in &XSP2; and as represented in XML in the <xtermref href="&XSP2.base;/datatypes.xsd">schema for
datatypes</xtermref>
therein.</p>
 <p>There is no separate ur-Type for simple types.  As discussed in
<specref ref="Type_Derivation"/>, the <termref def="key-urType">ur-type definition</termref> functions as a simple type when used as the <termref def="key-baseTypeDefinition">base type definition</termref> for a simple type.</p>
 <constraintnote type="cvc" id="cvc-simple-type">
 <head>String Valid</head>
 <p>A string is schema valid with respect to a simple type definition if
  <olist>
   <item>
    <p>It satisfies the conditions defined in the sub-section of <xtermref href="&XSP2.URI;#built-in-primitive-datatypes">Primitive
Datatypes</xtermref> corresponding to <propref ref="st-primitive_type_definition"/>;</p>
   </item>
   <item>
    <p>If there is a <pt>pattern</pt> facet among <propref ref="facets"/>, it
satisfies the conditions expressed thereby as defined in the <xtermref href="&XSP2.URI;#non-fundamental">Constraining or Non-fundamental facets</xtermref> section of &XSP2;</p>
   </item>
   <item>
    <p>The member of the <propref ref="st-primitive_type_definition"/>'s value space
which it corresponds to the string (as defined in <xtermref href="&XSP2.URI;#built-in-primitive-datatypes">Primitive
Datatypes</xtermref>) satisfies the conditions expressed by all the other
<propref ref="facets"/>, if any, as defined in the <xtermref href="&XSP2.URI;#non-fundamental">Constraining or Non-fundamental facets</xtermref> section of &XSP2;</p>
   </item>
  </olist>
 </p>
</constraintnote>
     <p>See <specref ref="declare-datatype"/> for the XML representation of
simple type definitions and <specref ref="coss-st"/> for constraints on simple
type definition components as such.</p>
   </div2>
  </div1>
  <div1 id="declare">
   <head>XML Representation of Schemas and Schema Components</head>

    <p>The principal purpose of &XSP1; 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, we specify a normative XML representation for schemas which
makes provision for every kind of schema
component.  <termdef id="key-schemaDoc" term="schema document">These may be
gathered together in to a single <term>schema document</term>, i.e. an XML
element information item</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="normative-schemaDTD"/>) and
schema components.  All the element information items in the XML representation
of a schema are in the XML Schema namespace, that is their <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.element">namespace URI</xpropref> is <code>&XMLSchemaNS;</code>.  Although a common way of creating schema documents 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>Throughout the following sections, when we specify that a particular
property
of a schema component corresponds to the &i-value; of some attribute information item or the &i-children; of some element information item,
the value in question is understood to be based on a string consisting of the list, in order, of the
&i-ccode; of each character information item in the &i-attrChildren; of that
attribute information item or in the &i-children; of that element information
item respectively, that string then being interpreted as appropriate to the
defined type of the property in question.</p>
  <p>  When we say that a numeric-valued property of a schema component
corresponds to the &i-value; of some attribute information item, the number in
question is understood to be the base 10 interpretation of string described above.</p>
   <div2 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>.  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 <B>{target namespace}</B>.  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 <B>{target namespace}</B>, see <specref ref="src-composition"/>.</p>
     <reprdef>
      <reprelt eltname="schema"/>
     </reprdef>
     <p>There is no single schema component corresponding to a
<eltref ref="schema"/> element information item, and so no local correspondence of
attributes to properties is specified above.  The <code>blockDefault</code>,
<code>finalDefault</code> and <code>targetNamespace</code> attributes
illustrated above are appealed to in the sub-sections below, 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 <B>{target namespace}</B>.  Most components corresponding to representations within a given <eltref ref="schema"/> element information item will have a <B>{target namespace}</B> which corresponds to the <code>targetNamespace</code> attribute. </p>
     <p>Since the empty string is a legal (relative) URI reference, supplying
an empty string for <code>targetNamespace</code> 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 ref="e-target_namespace"/> is one which has no
<code>targetNamespace</code> attribute specified at all.</p>
     <note><p>The XML namespaces recommendation 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, we apply the target namespace facility uniformly to all
schema components, i.e. not only declarations but also definitions have a <B>{target namespace}</B>.</p>
</note>



      <note role="example">
        <eg xml:space="preserve">&lt;xs:schema
    xmlns:xs="&XMLSchemaNS;
    targetNamespace="http://purl.org/metadata/dublin_core"
    version="M.n"&gt;

  ...

&lt;/xs:schema&gt;
</eg>
        <p>A modest beginning to a schema.</p>
    </note>
     <p>Although the schema above 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 be derived from a (text) document
at all:  it could be built 'by hand' via e.g. a DOM-conformant API.</p>
    <p>Aside from <eltref ref="annotation"/>, which is not named and
corresponds to a <quote>helper</quote> schema component, and <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 may appear in the content of <eltref ref="schema"/> corresponds to
a primary or secondary schema component, and in all cases these are named.  The
sub-sections of <specref ref="declare-typesElementsAttributes"/>
present each such item in turn, setting out the
components to which it may correspond.</p>
</div2>
<div2 id="declare-documentRoot">
  <head>The Document and its Root</head>
  <note>
    <p>We have not so far seen any need to reconstruct the XML 1.0 notion of
      <emph>root</emph>. For the connection from document instances to schemas, see
<specref ref="composition-instances"/> and <specref ref="conformance-schemaValidity"/>.</p>
  </note>
</div2>
<div2 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 may,
but need not, correspond to an explicit schema document). The form
of all such references is a
    <termref def="gloss-QName">QName</termref>.  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"><![CDATA[<xs:schema xmlns:xs="]]>&XMLSchemaNS;<![CDATA["
            xmlns:xhtml="http://www.w3.org/1999/html"
            xmlns="http://www.foo.com"
            targetNamespace="http://www.foo.com">
  . . .

  <xs:element name="elem1" type="Address"/>

  <xs:element name="elem2" type="xhtml:blockquote"/>

  <xs:attribute name="attr1"
                type="xsl:quantity"/>
  . . .
</xs:schema>
]]>
</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>
 <constraintnote type="src" id="src-qname">
  <head>QName Interpretation</head>
  <p>Where the type of an attribute information item in a schema document is
identified below as
<termref def="gloss-QName">QName</termref>, its value is uniformly
interpreted as consisting of a <termdef id="q-local" term="local name"><term>local name</term> consisting of the character information items after the colon, if any, otherwise all the character information items, in the value</termdef>, and of a <termdef id="q-uri" term="namespace URI"><term>namespace URI</term>, derived from its value and the containing element information item's <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.element">in-scope namespaces</xpropref> as follows:</termdef>
  <ulist>
   <item><p>If the value contains a colon, then the <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.namespace-decl">namespace URI</xpropref> of the member of 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-decl">prefix</xpropref> matches the character information items before the colon.  It is an error if no such member is present;</p></item>
   <item><p>otherwise (i.e. the value contains no colon)
         <ulist>
          <item><p>if there is a member of 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-decl">prefix</xpropref> is <termref def="key-null">null</termref>, then its <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.namespace-decl">namespace URI</xpropref>;</p></item>
          <item><p>otherwise <termref def="key-null">null</termref>.</p></item>
         </ulist>
</p></item>
  </ulist>
 </p>
  <p>In the absence of the non-core properties <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.element">in-scope namespaces</xpropref> and/or <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.namespace-decl">namespace URI</xpropref> from the infoset for the schema document in question, processors must reconstruct equivalent information as necessary, using the <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.element">declared namespaces</xpropref> of the containing element information item and its ancestors in the first case and using the namespace declaration in question's <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.namespace-decl">children</xpropref> in the second.</p>
  <ednote>
   <edtext>If the XML Base proposal is adopted before we go to REC, we will
need to account for any changes it makes to the Infoset in this area.</edtext>
  </ednote>
 </constraintnote>
 <constraintnote type="src" id="src-resolve">
  <head>QName resolution</head>
  <p>A string known to be a <xtermref href="&XSP2.URI;#QName">QName</xtermref>
resolves to a schema component of a specified kind if:
   <olist>
    <item>
     <p>that component is contained in the schema which corresponds to the schema
document within which the <xtermref href="&XSP2.URI;#QName">QName</xtermref>
appears (see <specref ref="src-composition"/> for a definition of what a schema contains);</p>
    </item>
    <item>
     <p>its <B>{local name}</B> matches the <termref def="q-local">local
name</termref> of the string;</p>
    </item>
    <item>
     <p>its <B>{namespace URI}</B> is identical to the <termref def="q-uri">namespace URI</termref> of the string.</p>
    </item>
   </olist>
  </p>
 </constraintnote>
 <div3>
  <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 <code>ID</code>:  they are not
unique within a schema, just within a symbol space.  This means that simple
fragment identifiers will not work to reference schema components from outside
the context of schema documents.</p>
    <p>In the long run we expect to provide some mechanism suitable for referencing
schema components as such.  In the mean time, we observe that
<bibref ref="ref-xpointer"/> provides a mechanism which maps well onto our
notion of symbol spaces as it is reflected in the XML representation of schema components.  A fragment identifier of the form
<code>#xpointer(schema/element[@name="person"])</code> will uniquely identify
the representation of a global 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 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
<code>ID</code>, 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>
 </div3>
</div2>
<div2 id="declare-typesElementsAttributes">
<head>XML Representation of Schema 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"/> and <specref ref="normative-schemaDTD"/>.</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 therefor the
correspondence in the abstract, can always be
constructed therefrom.</p>
<div3 id="declare-attribute">
<head>XML Representation of Attribute Declaration Schema Components</head>
<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 may provide
occurrence and default information.  The correspondences between the
properties of the information item and
properties of the component are as follows:</p>
<reprdef>
 <reprelt eltname="attribute"/>
  <reprcomp ref="Attribute_Declaration_details" abstract="Attribute Declaration">
   <reprdep>If <code>minOccurs=maxOccurs=0</code> the item
corresponds to no component at all, otherwise</reprdep>
   <propmap name="a-name">The value of the <code>name</code> &i-attribute;</propmap>
  <propmap name="a-target_namespace">The value of the
<code>targetNamespace</code> &i-attribute; of the parent <eltref ref="schema"/>
element information item, or <termref def="key-null">null</termref> if there is none.</propmap>
 <propmap name="a-simple_type_definition">The simple type definition
corresponding to the <eltref ref="simpleType"/> element information item in the
&i-children;, if present, otherwise the simple type definition resolved to by
the value of the <code>type</code> &i-attribute;, if present, otherwise the
<termref def="key-urType">ur-type definition</termref>.</propmap>
 <propmap name="a-min_occurs">The value of the <code>minOccurs</code>
&i-attribute;, or <code>0</code> if it is absent.</propmap>
 <propmap name="a-max_occurs">The value of the <code>maxOccurs</code>
&i-attribute;, or <code>1</code> if it is absent.</propmap>
 <propmap name="a-value_constraint">If there is a <code>default</code> or a <code>fixed</code>
&i-attribute;, then a pair consisting of the value of that &i-attribute; and
either <pt>default</pt> or <pt>fixed</pt>, as appropriate, otherwise <termref def="key-null">null</termref>.</propmap>
 <propmap name="a-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
&i-children;, if present, otherwise <termref def="key-null">null</termref>.</propmap></reprcomp>
 </reprdef>

<note role="example">
<eg xml:space="preserve"><![CDATA[<attribute name="myAttribute"/>

<attribute name="yetAnotherAttribute" type="integer" minOccurs="1"/>

<attribute name="anotherAttribute" default="42">
 <simpleType basetype="integer">
  <minExclusive value="0"/>
 </simpleType>
</attribute>

<attribute name="stillAnotherAttribute" type="string" fixed="Hello world!"/>]]>
</eg>
<p>Four attributes are declared: one with no explicit
constraints at all; two more each declared by reference to the
built-in simple datatype <code>integer</code>, one required to
be present instances and one with a default and a subrange qualification; and a fourth with a fixed value.</p>
</note>
 <p>The <code>type</code> attribute is used when the attribute can use a
built-in or pre-declared simple type definition.  Otherwise an
anonymous <eltref ref="simpleType"/> is used inline.</p>

<p>The default when no simple type definition is referenced or
provided is the <termref def="key-urType">ur-type definition</termref>, which imposes no constraints at all.</p>
 <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 DTD and schema for schemas, the following must also hold:
   <olist>
    <item>
     <p><code>default</code> and <code>fixed</code> must not both be present;</p>
    </item>
    <item>
     <p><code>type</code> and <eltref ref="simpleType"/> must not both be present;</p>
    </item>
    <item>
     <p>The corresponding attribute declaration must satisfy the conditions set
out in <specref ref="coss-attribute"/>.</p>
    </item>
   </olist>
  </p>
 </constraintnote>

</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 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"/>
 <reprcomp abstract="Element Declaration" ref="Element_Declaration_details">
  <reprdep>
   <p>If the <eltref ref="element"/> element information item has <eltref ref="schema"/> as its parent, the corresponding schema component is as follows:</p>
  </reprdep>
<propmap name="e-name">The value of the <code>name</code> &i-attribute;</propmap>
  <propmap name="e-target_namespace">The value of the
<code>targetNamespace</code> &i-attribute; of the parent <eltref ref="schema"/>
element information item, or <termref def="key-null">null</termref> if there is none.</propmap>
 <propmap name="scope"><pt>global</pt></propmap>
  <propmap name="type_definition">The type definition
corresponding to the <eltref ref="simpleType"/> or <eltref ref="complexType"/> element information item in the
&i-children;, if either is present, otherwise the type definition resolved to by
the value of the <code>type</code> &i-attribute;, otherwise the <propref ref="type_definition"/> of the element declaration resolved to by the value of the <code>equivClass</code> &i-attribute;, if present, otherwise the
<termref def="key-urType">ur-type definition</termref>.</propmap>
  <propmap name="nullable">The value of the <code>nullable</code>
&i-attribute;, if present, otherwise false.</propmap>
  <propmap name="e-value_constraint">If there is a <code>default</code> or a <code>fixed</code>
&i-attribute;, then a pair consisting of the value of that &i-attribute; and
either <pt>default</pt> or <pt>fixed</pt>, as appropriate, otherwise <termref def="key-null">null</termref>.</propmap>
  <propmap name="&constraint;_definitions">A set consisting of the
&constraint;-definitions corresponding to all the <eltref ref="key"/>, <eltref ref="unique"/> and <eltref ref="keyref"/> element information items in the
&i-children;, if any, otherwise the empty set</propmap>
  <propmap name="class_exemplar">the element declaration resolved to by the
value of the
<code>equivClass</code> &i-attribute;, if present, otherwise <termref def="key-null">null</termref></propmap>
  <propmap name="e-exact">A set corresponding to the normalised value of the
<code>block</code> &i-attribute;, if present, otherwise on the value of the
<code>blockDefault</code> &i-attribute; of the parent <eltref ref="schema"/> element
information item, if present, otherwise on the empty string, as follows:
   <glist>
    <gitem>
     <label>the empty string</label>
     <def>
<p>the empty set;</p>
     </def>
    </gitem>
    <gitem>
     <label>
      <code>#all</code>
     </label>
     <def>
      <p><code>{</code><pt>equivClass</pt>, <pt>extension</pt>, <pt>list</pt>,
<pt>restriction</pt>, <pt>reproduction</pt><code>}</code>;</p>
     </def>
    </gitem>
    <gitem>
     <label><emph>otherwise</emph></label>
     <def>
      <p>a set with members drawn from the set above, each being present or
absent depending on whether the string contains an equivalently named
whitespace-delimited substring.</p>
     </def>
    </gitem>
   </glist>
  </propmap>
  <propmap name="e-final">As for <propref ref="e-exact"/> above, but with the
relevant set being <code>{</code><pt>extension</pt>, <pt>restriction</pt>, <pt>reproduction</pt><code>}</code></propmap>
  <propmap name="e-abstract">The value of the <code>abstract</code>
&i-attribute;, if present, otherwise false</propmap>
  <propmap name="e-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
&i-children;, if present, otherwise <termref def="key-null">null</termref></propmap>
</reprcomp>
 <reprcomp abstract="Particle" ref="Particle_details">
  <reprdep>
   <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> &i-attribute; 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>
  </reprdep>
  <propmap name="p-min_occurs">The value of the <code>minOccurs</code>
&i-attribute;, if present, otherwise <code>1</code></propmap>
  <propmap name="p-max_occurs"><code>*</code>, if the <code>maxOccurs</code>
&i-attribute; equals <code>*</code>, otherwise the numeric value of the <code>maxOccurs</code>
&i-attribute;, if present, otherwise the value of the <code>minOccurs</code>
&i-attribute;, if present, otherwise <code>1</code>.</propmap>
  <propmap name="term">The (global) element declaration resolved to by the
value of the <code>ref</code> &i-attribute;</propmap>
  <propmap name="p-value_constraint">As above</propmap>
  <propmap name="p-nullable">As above</propmap>
  <propmap name="p-exact">As above</propmap>
  <propmap name="p-abstract">As above</propmap>
  <propmap name="p-annotation">As above</propmap>
</reprcomp>
 <reprcomp abstract="Particle" ref="Particle_details">
  <reprdep>
   <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> &i-attribute; 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>
  </reprdep>
  <propmap name="p-min_occurs">The value of the <code>minOccurs</code>
&i-attribute;, if present, otherwise <code>1</code></propmap>
  <propmap name="p-max_occurs"><code>*</code>, if the <code>maxOccurs</code>
&i-attribute; equals <code>*</code>, otherwise the numeric value of the <code>maxOccurs</code>
&i-attribute;, if present, otherwise the value of the <code>minOccurs</code>
&i-attribute;, if present, otherwise <code>1</code>.</propmap>
  <propmap name="term">The (locally-scoped) element declaration given below:</propmap>
</reprcomp>
 <reprcomp abstract="Element Declaration" ref="Element_Declaration_details">

<propmap name="e-name">The value of the <code>name</code> &i-attribute;</propmap>
  <propmap name="e-target_namespace"><termref def="key-null">null</termref></propmap>
 <propmap name="scope">If the <eltref ref="element"/> element information item
has <eltref ref="complexType"/> as an ancestor, the complex definition
corresponding to that item, otherwise (the <eltref ref="element"/> element
information item is within a top-level <eltref ref="group"/> definition), <termref def="key-null">null</termref>.</propmap>
  <propmap name="type_definition">As above</propmap>
  <propmap name="nullable">As above</propmap>
  <propmap name="e-value_constraint">As above</propmap>
  <propmap name="&constraint;_definitions">As above</propmap>
  <propmap name="class_exemplar">As above</propmap>
  <propmap name="e-final">As above</propmap>
  <propmap name="e-exact">As above</propmap>
  <propmap name="e-abstract">As above</propmap>
  <propmap name="e-annotation">As above</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).</p>
<p>Locally-scoped declarations always schema-validate element information items
with a <termref def="key-null">null</termref> <xpropref href="http://www.w3.org/TR/xml-infoset#infoitem.element">namespace URI</xpropref>, regardless of the <propref ref="ct-target_namespace"/> of the complex type definition they are contained within.</p>
<p>As noted above the names for <pt>global</pt> 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 type with the same name as a
top-level element.  As with attribute names, the names of locally-scoped
element declarations reside in symbol spaces local to the type definition which contains
them. Note however that type definition names are always top-level names within a
schema, even when they appear in locally-scoped element declarations.</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 exemplar of its equivalence class if it
identifies one, otherwise the <termref def="key-urType">ur-type definition</termref>.</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="myelement" type="mySimpleType"/&gt;

&lt;xs:element name="et0" type="myComplexType"/&gt;

&lt;xs:element name="et1"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:element ref="et0"/>
  . . .
  &lt;xs:attribute ...&gt;. . .&lt;/xs:attribute&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;

&lt;xs:element name="et2"&gt;
 &lt;xs:complexType content="empty"&gt;
  &lt;xs:attribute ...&gt;. . .&lt;/xs:attribute&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;
</eg>
<p>The first two examples above declare elements by reference to a simple and a
complex type definition respectively.  The third and fourth use embedded anonymous complex
type definitions, the first of which in
turn refers to one of the top-level element declarations in its content model.</p>
<eg xml:space="preserve">&lt;xs:element name="contextOne"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:element name="myLocalelement" type="myFirstType"/&gt;
  &lt;xs:element ref="globalelement"/&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;

&lt;xs:element name="contextTwo"&gt;
 &lt;xs:complexType&gt;
  &lt;xs:element name="myLocalelement" type="mySecondType"/&gt;
  &lt;xs:element ref="globalelement"/&gt;
 &lt;/xs:complexType&gt;
&lt;/xs:element&gt;
</eg>
<p>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 1.0.</p>
</note>
  <note role="example">
   <eg xml:space="preserve"><![CDATA[  <xs:complexType name="facet" base="annotated" derivedBy="extension">
    <xs:attribute name="value" minOccurs="1"/>
  </xs:complexType>

  <xs:element name="facet" type="facet" abstract="true"/>

  <xs:element name="encoding" equivClass="facet">
   <xs:complexType base="facet" derivedBy="restriction">
    <xs:attribute name="value" type="encodings"/>
   </xs:complexType>
  </xs:element>

  <xs:element name="period" equivClass="facet">
   <xs:complexType base="facet" derivedBy="restriction">
    <xs:attribute name="value" type="timeDuration"/>
   </xs:complexType>
  </xs:element>

  <xs:complexType name="datatype">
    <xs:element ref="facet" minOccurs="0" maxOccurs="*"/>
    <xs:attribute name="name" type="NCName" minOccurs="0">
    . . .
  </xs:complexType>
]]></eg>
   <p>An example from the schema for datatypes from &XSP2;.  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 exemplar for a class.  Two further
elements are declared, each a member of the <code>facet</code> equivalence
class.  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 class).</p>
  </note>


 <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 DTD and schema for schemas, the following must also hold:
   <olist>
    <item>
     <p><code>default</code> and <code>fixed</code> must not both be present;</p>
    </item>
    <item>
     <p>If the element's parent is <eltref ref="schema"/>, then
     <olist>
      <item>
       <p><code>name</code> must be present;</p>
      </item>
      <item>
       <p><code>minOccurs</code>, <code>maxOccurs</code> and <code>ref</code> must be absent;</p>
      </item>
     </olist>
      otherwise
      <olist>
       <item>
     <p>One of <code>ref</code> or <code>name</code> must be present, but not both;</p>
    </item>
       <item>
        <p><code>equivClass</code> and <code>final</code> must be absent;</p>
       </item>
       <item>
        <p>If <code>ref</code> is present, then all of <eltref ref="complexType"/>,
<eltref ref="simpleType"/>, <code>type</code>, <eltref ref="key"/>,
<eltref ref="unique"/> and <eltref ref="keyref"/> must be absent;</p>
       </item>
      </olist>
     </p>
    </item>
    <item>
     <p><code>type</code> and either <eltref ref="simpleType"/> or <eltref ref="complexType"/> are mutually exclusive;</p>
    </item>
    <item>
     <p>The corresponding particle and/or element declarations must satisfy the conditions set
out in <specref ref="coss-element"/> and <specref ref="coss-particle"/>.</p>
    </item>
   </olist>
  </p>
 </constraintnote>
</div3>

<div3 id="declare-type">
<head>XML Representation of Complex Type Definition Schema Components</head>
<p>The XML representation for a complex type definition schema component is a
<eltref ref="complexType"/> element information item.  It provides validation
information for the &i-attributes; and &i-children; of an element information
item in the form of attribute declarations and a content type.  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="complexType"/>
 <reprelt eltname="attributeGroup"/>
 <reprelt eltname="anyAttribute"/>
 <reprcomp abstract="Complex Type Definition" ref="Complex_Type_Definition_details">
  <propmap name="ct-name">The value of the <code>name</code> &i-attribute; if present, otherwise <termref def="key-null">null</termref></propmap>
  <propmap name="ct-target_namespace">The value of the
<code>targetNamespace</code> &i-attribute; of the <eltref ref="schema"/> ancestor
element information item if present, otherwise <termref def="key-null">null</termref></propmap>
<propmap name="ct-base_type_definition">The type definition resolved to by the
value of the <code>base</code> &i-attribute;, if present, otherwise the simple
<termref def="key-urType">ur-type definition</termref> if the
<code>content</code> &i-attribute; is <pt>textOnly</pt>, otherwise the complex <termref def="key-urType">ur-type definition</termref></propmap>
  <propmap name="derivation_method">If the <code>derivedBy</code> &i-attribute;
is present, the member of the set <code>{</code><pt>extension</pt>, <pt>restriction</pt>, <pt>reproduction</pt><code>}</code> corresponding to its value, otherwise if there are any
&i-children; other than <eltref ref="annotation"/> then <pt>restriction</pt>, otherwise <pt>reproduction</pt></propmap>
<propmap name="ct-abstract">The value of the <code>abstract</code>
&i-attribute;, if present, otherwise false</propmap>
<propmap name="ct-attribute_declarations">The union of the set of attribute
declarations corresponding to the <eltref ref="attribute"/> &i-children; of the
item, if any, with the <propref ref="ag-attribute_declarations"/> of the
attribute groups resolved to by the values of the <code>ref</code>
&i-attribute; of the <eltref ref="attributeGroup"/> &i-children;, if any.  In
the latter case, if the <propref ref="ag-target_namespace"/> of any referenced
group is not identical to the <propref ref="ct-target_namespace"/> of this
type definition, the attribute declarations are not the attribute declarations
from the corresponding <propref ref="ag-attribute_declarations"/> as such, but
distinct attribute declarations sharing all properties with them except for 
<propref ref="a-target_namespace"/>, which has the value of <propref ref="ag-target_namespace"/>s from their original containing group.</propmap>
<propmap name="ct-attribute_wildcard">
 <olist>
  <item>
   <p>If there are no <eltref ref="attributeGroup"/> &i-children; corresponding to attribute groups with non-<termref def="key-null">null</termref> <propref ref="ag-attribute_wildcard"/>s, a value depending on the string value of the <code>namespace</code> &i-attribute; of the <eltref ref="anyAttribute"/> if there is one as follows:
 <glist>
  <gitem>
   <label>##any</label>
   <def>
    <p><pt>any</pt></p>
   </def>
  </gitem>
  <gitem>
   <label>##other</label>
   <def>
    <p>a pair of <pt>not</pt> and the value of the <code>targetNamespace</code> &i-attribute; of the <eltref ref="schema"/> ancestor
element information item if present, otherwise <termref def="key-null">null</termref></p>
   </def>
  </gitem>
  <gitem>
   <label><emph>otherwise</emph></label>
   <def>
    <p>a set whose members are namespace URIs corresponding to the
whitespace-delimited substrings of the string, except
     <ulist>
      <item>
       <p>if one such
substring is <code>##targetNamespace</code>, the corresponding member is the value of the <code>targetNamespace</code> &i-attribute; of the <eltref ref="schema"/> ancestor
element information item if present, otherwise <termref def="key-null">null</termref></p>
      </item>
      <item>
       <p>if one such
substring is <code>##local</code>, the corresponding member is <termref def="key-null">null</termref></p>
      </item>
     </ulist>
    </p>
   </def>
  </gitem>
 </glist> otherwise <termref def="key-null">null</termref>.</p>
  </item>
  <item>
   <p>Otherwise the intensional intersection of a value as defined in (1) above
and all the non-<termref def="key-null">null</termref> <propref ref="ag-attribute_wildcard"/>s of the attribute groups corresponding to the <eltref ref="attributeGroup"/> &i-children;, as defined in <specref ref="cos-aw-intersect"/>.</p>
  </item>
 </olist> 
</propmap>
<propmap name="content_type">
 <olist>
  <item><p>If the <code>content</code> &i-attribute; is <code>empty</code>,
then <pt>empty</pt>;</p></item>
  <item><p>otherwise if the <code>base</code> &i-attribute; is present and
either the type definition resolved to by the
value of the <code>base</code> &i-attribute; is a simple type definition, or it
is a complex type definition whose own <propref ref="content_type"/> is a
simple type definition, then
a simple type definition which restricts that simple type definition with the
facets corresponding to the <eltref ref="minBound"/>, <eltref ref="minExclusive"/>, <eltref ref="minInclusive"/>,
<eltref ref="maxBound"/>, <eltref ref="maxExclusive"/>, <eltref ref="maxInclusive"/>, <eltref ref="precision"/>, <eltref ref="scale"/>, <eltref ref="length"/>, <eltref ref="minlength"/>, <eltref ref="maxlength"/>, <eltref ref="encoding"/>, <eltref ref="period"/>, <eltref ref="enumeration"/> and <eltref ref="pattern"/> &i-children;, if any, as
defined in <specref ref="st-restrict-facets"/>.</p></item>
  <item>
   <p>otherwise if the <code>content</code> &i-attribute; is
<pt>elementOnly</pt> or <pt>mixed</pt>, a pair of that value and a particle
as follows:</p>
   <p><termdef id="key-exg" term="explicit particle">Let the <term>explicit particle</term> be as follows:</termdef>   
    <olist>
     <item>
      <p>If there is exactly one <eltref ref="all"/>, <eltref ref="choice"/> or
<eltref ref="sequence"/> among the &i-children; and no <eltref ref="any"/>,
<eltref ref="group"/> or <eltref ref="element"/> &i-children;, then the particle corresponding to that <eltref ref="all"/>, <eltref ref="choice"/> or
<eltref ref="sequence"/>;</p>
     </item>
     <item>
      <p>otherwise if the <code>content</code> &i-attribute; is
<pt>elementOnly</pt> then a particle whose properties are as follows:
       <glist>
        <gitem>
         <label><propref ref="p-min_occurs"/></label>
         <def>
          <p><code>1</code></p>
         </def>
        </gitem>
        <gitem>
         <label><propref ref="p-max_occurs"/></label>
         <def>
          <p><code>1</code></p>
         </def>
        </gitem>
        <gitem>
         <label><propref ref="term"/></label>
         <def>
          <p>A model group whose <propref ref="compositor"/> is
<pt>sequence</pt> and whose <propref ref="particles"/> is the 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 &i-children;,
in order.</p>
         </def>
        </gitem>
       </glist>
       </p>
     </item>
     <item>
      <p>otherwise if the <code>content</code> &i-attribute; is
<pt>mixed</pt> then a particle whose properties are as follows:
       <glist>
        <gitem>
         <label><propref ref="p-min_occurs"/></label>
         <def>
          <p><code>0</code></p>
         </def>
        </gitem>
        <gitem>
         <label><propref ref="p-max_occurs"/></label>
         <def>
          <p><code>*</code></p>
         </def>
        </gitem>
        <gitem>
         <label><propref ref="term"/></label>
         <def>
          <p>A model group whose <propref ref="compositor"/> is
<pt>choice</pt> and whose <propref ref="particles"/> are as above for the
<pt>elementOnly</pt> case.</p>
         </def>
        </gitem>
       </glist>
       </p>
     </item>
    </olist>
   </p>
   <p>The actual value then depends on the <code>derivedBy</code>
&i-attribute; as follows:
    <olist>
     <item>
      <p>If it is <pt>restriction</pt> or <pt>reproduction</pt>, then the <termref def="key-exg">explicit
particle</termref> itself;</p>
     </item>
     <item>
      <p>If it is <pt>extension</pt>, then if the type definition resolved to
by the value of the <code>base</code> &i-attribute; has a <propref ref="content_type"/> of <pt>empty</pt>, the <termref def="key-exg">explicit
particle</termref> itself, otherwise a particle whose properties are as follows:
       <glist>
        <gitem>
         <label><propref ref="p-min_occurs"/></label>
         <def>
          <p><code>1</code></p>
         </def>
        </gitem>
        <gitem>
         <label><propref ref="p-max_occurs"/></label>
         <def>
          <p><code>1</code></p>
         </def>
        </gitem>
        <gitem>
         <label><propref ref="term"/></label>
         <def>
          <p>A model group whose <propref ref="compositor"/> is
<pt>sequence</pt> and whose <propref ref="particles"/> are the particle of the
the <propref ref="content_type"/> of the type definition resolved to
by the value of the <code>base</code> &i-attribute; followed by the <termref def="key-exg">explicit
particle</termref>.</p>
         </def>
        </gitem>
       </glist>
      </p>
     </item>
     <item>
      <p>If it is absent, then the <termref def="key-exg">explicit
particle</termref> itself (this can only happen if the <code>base</code> is the <termref def="key-urType">ur-type</termref>).</p>
     </item>
    </olist>
   </p>
  </item>
  <item><p>otherwise (the <code>content</code> &i-attribute; is
<code>textonly</code> but there is no <code>base</code> &i-attribute;) the simple
<termref def="key-urType">ur-type definition</termref></p></item>
 </olist>
</propmap>
<propmap name="ct-exact">A set corresponding to the normalised value of the
<code>block</code> &i-attribute;, if present, otherwise on the value of the
<code>blockDefault</code> &i-attribute; of the parent <eltref ref="schema"/> element
information item, if present, otherwise on the empty string, as follows:
   <glist>
    <gitem>
     <label>the empty string</label>
     <def>
<p>the empty set;</p>
     </def>
    </gitem>
    <gitem>
     <label>
      <code>#all</code>
     </label>
     <def>
      <p><code>{</code><pt>extension</pt>, <pt>restriction</pt>, <pt>reproduction</pt><code>}</code>;</p>
     </def>
    </gitem>
    <gitem>
     <label><emph>otherwise</emph></label>
     <def>
      <p>a set with members drawn from the set above, each being present or
absent depending on whether the string contains an equivalently named
whitespace-delimited substring.</p>
      <note>
       <p>Although the <code>blockDefault</code> &i-attribute; of <eltref ref="schema"/> may include the values <pt>equivClass</pt> and <pt>list</pt>, these values are ignored in the determination of <propref ref="ct-exact"/> for type definitions (it <emph>is</emph> used in the determination of <propref ref="e-exact"/> for element declarations)</p>
      </note>
     </def>
    </gitem>
   </glist></propmap>
<propmap name="ct-final">As for <propref ref="ct-exact"/> above</propmap>
  <propmap name="ct-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
&i-children;, if present, otherwise <termref def="key-null">null</termref></propmap>
</reprcomp></reprdef>
<ednote>
 <edtext>base requires derivedBy; attrs unique; facets requires base</edtext>
</ednote>
<stale>

<note role="example">
    <eg xml:space="preserve"><![CDATA[<xs:complexType name="length1" type="decimal"/>
  <xs:minInclusive value="0"/>
 <xs:attribute name="unit" type="NMTOKEN"/>
</xs:complexType>

<xs:element name="width" type="length1"/>

  <width unit="cm">2.54</width>

<xs:complexType name="length2">
 <xs:element name="size">
  <xs:simpleType base="decimal">
   <xs:minInclusive value="0"/>
  </xs:simpleType>
 </xs:element>
 <xs:element name="unit" type="NMTOKEN"/>
</xs:complexType>

<xs:element name="depth" type="length2"/>

  <depth>
   <size>2.54</size><unit>cm</unit>
  </depth>]]>
</eg>
  <p>
    Two approaches to defining a type for length:  one with
character data content constrained by a qualified reference to
    a built-in datatype, and one attribute, the other using two
elements.
</p>
</note>
<p>Note that both the <nt def="nt-datatypeRef">datatypeRef</nt> and the <nt def="nt-typeRef">typeRef</nt> options in
the abstract syntax are realised by the <code>base</code> attribute on the
<code>type</code> element.  <code>base</code> must refer to a simple type
if <code>content</code> is <code>textonly</code>.  The contents of the <code>restrictions</code>
element will be quite different in the two cases, and if the
<code>base</code> refers to a  simple type, no content model is appropriate, so none
of <code>element</code>, <code>group</code> or <code>any</code> are allowed.
The values other than <code>textonly</code> for <code>content</code> express
choices recorded in the abstract syntax in the <nt def="nt-contentModel">contentModel</nt> and
<nt def="nt-richModel">richModel</nt> productions below.</p>
 <p>Careful consideration of the above concrete syntax reveals that
a type need consist of no more than a name, i.e. that
 <code>&lt;type name="anything"/></code> is allowed.  In this case the type
definition constructed has the ur-type as . . .</p>

<p>This section articulates what has only been hinted at above, namely a
considerable increase in the power and expressiveness of schema declarations,
by explaining what was provided for in the abstract syntax in the previous
section, but not explained much if at all at that point:  the potential for
deriving new type definitions on the basis of old ones.  <termdef id="derived" term="derived">We call such a new definition a <term>derived</term> type definition</termdef>, and <termdef id="base" term="base">the old definition it is derived from the <term>base</term> type definition</termdef>.</p>
<ednote><edtext>Noah has duplicated portions of the following paragraph in chapter 2.</edtext></ednote>
<p>We provide two means for deriving type definitions from other type definitions, each of which implies a partial order over the types defined in a
schema:  A
type definition may either <emph>restrict</emph> or <emph>extend</emph> another
type definition.</p>
 <note>
  <p>See <loc href="#type-decl-syntax">previous note on the type definition issue</loc>.</p>
 </note>
<p>The <specref ref="cos-attrg-unique"/> <termref def="gloss-cos">Constraint on Schemas</termref> obtains.</p>
<p>The <specref ref="cos-attrg-ided"/> <termref def="gloss-cos">Constraint on Schemas</termref> obtains.</p>
<p>The <termref def="key-attr-decl-set">attr-decl-set</termref> definition wrt schema-validity obtains.</p>
<p>The <termref def="key-attr-fullname">attr-fullname</termref> definition wrt schema-validity obtains.</p>
<p>The <specref ref="cos-attr-unique"/> <termref def="gloss-cos">Constraint on Schemas</termref> obtains.</p>
<p>The <termref def="key-satisfy-as">satisfy-as</termref> definition wrt schema-validity obtains.</p>
<p>The <specref ref="sic-type"/> <termref def="gloss-sic">Schema Information Set Contribution</termref> obtains.</p>
 <div4 id="declare-embed">
  <head>Deriving type definitions by extension</head>
  <p>A new type complex type can be defined by adding additional content model
particles at the end of the element-only content model of another complex definition
and/or by adding attribute declarations to any type definition.  Members of
a type whose definition is derived in this way, i.e. by extension, will
always contain members of their base type within them
as prefixes.</p>
<p>For the time being, the effective content model of a type definition
derived by extension from another complex type is
composed by appending its <nt def="nt-contentModel">contentModel</nt> to that of the base
definition.  It follows from this that the base definition must be complex
and element-only if the <nt def="nt-contentModel">contentModel</nt> is not
empty.  If it <emph>is</emph> empty, there is no constraint on the nature of the
base definition, which may be simple or complex (thus the <nt def="nt-datatypeRef">simpleTypeRef</nt> above).  In either case, attributes may be added.</p>
  <note>

   <p>The restriction to appending in the case of content-model extension
simplifies application processing in order to cast instances from derived to
base type.  We may liberalise this in future versions, requiring more
complex transformations to effect casting.</p>
  </note>
  <note role="example">
   <eg xml:space="preserve"><![CDATA[<xs:complexType name="personName">
 <xs:element name="title" minOccurs="0"/>
 <xs:element name="forename" minOccurs="0" maxOccurs="*"/>
 <xs:element name="surname"/>
</xs:complexType>

<xs:complexType name="extendedName" base="personName" derivedBy="extension">
 <xs:element name="generation" minOccurs="0"/>
</xs:complexType>

<xs:element name="addressee" type="extendedName"/>

  <addressee>
   <forename>Albert</forename>
   <forename>Arnold</forename>
   <surname>Gore</surname>
   <generation>Jr</generation>
  </addressee>]]></eg>
   <p>A type definition for personal names, and a definition derived by
extension which adds a single element; an element declaration referencing the
derived definition, and a valid instance thereof.</p>
  </note>
 </div4>
<div4 id="declare-supertype">
  <head>Deriving type definitions by restriction</head>
  <p>A new type can be defined by decreasing the possibilities made available by an
existing type definition:  narrowing ranges, removing alternatives, etc.
Restriction is specified bottom up, via <nt def="nt-datatypeRestr">simpleRestrictions</nt> or <nt def="nt-typeRestr">complexRestrictions</nt> in a <nt def="nt-typeSpec">complexTypeSpec</nt>, in either case referring to its <termref def="base">base</termref> definition with a <nt def="nt-typeRef">complexTypeRef</nt>.  Members of a type whose definition is derived in this way, i.e. by restriction, will always be members of their base type as well.</p>
  <p>A definition by restriction will restrict some of the permissions or obligations inherited
therefrom.  This means that
if the <termref def="base">base</termref> definition has text-only content,
the <nt def="nt-datatypeRestr">simpleRestrictions</nt> option must be used, and its facets must each narrow the
corresponding facet of the <termref def="base">base</termref> definition, e.g. by reducing a range or removing
members of an enumeration.</p>
  <p>If the <termref def="base">base</termref> definition has element-only
or mixed content, restricting a content model is also possible via the <nt def="nt-typeRestr">complexRestrictions</nt> option.  In this case each <termref def="term-particle">particle</termref> within the restriction is matched one for one with the corresponding particle in the <termref def="base">base</termref> definition, and in each case a restriction must be effected, e.g. by narrowing the range of <nt def="nt-occurs">occurs</nt>, by reducing the members of a disjunction or by replacing a <nt def="nt-wildcard">wildcard</nt> with a more explicit <termref def="nt-modelElt">particle</termref>.</p>
  <p>In either case, attributes
may be restricted by adding and/or fixing defaults, or by restricting the
attribute's simple type definition.</p>
 <p>The bare <nt def="nt-contentModel">contentModel</nt> option reflects the
fact that type definitions without a base type, consisting simply of a
content model, are interpreted as restricting the ur-type.</p>
  <note role="example">
   <eg xml:space="preserve"><![CDATA[<xs:complexType name="simpleName" base="personName" derivedBy="restriction">
  <xs:element name="title" maxOccurs="0"/>
  <xs:element name="forename" minOccurs="1" maxOccurs="1"/>
</xs:complexType>

<xs:element name="who" type="simpleName"/>

   <who>
    <forename>Bill</forename>
    <surname>Clinton</surname>
   </who>]]></eg>
   <p>A simplified type definition
derived 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 valid instance thereof.</p>
  </note>
 </div4>
 <div4 id="final_and_abstract">
  <head>Controlling derivation</head>
  <p>A type definition can control the extent to which other types may be
derived from it, the ways it may appear in content models and the
import of those appearances.</p>
<p>An <pt>abstract</pt> type definition may not be referenced from a <nt def="nt-modelElt">particle</nt>, nor may it be used in an instance
as the value of <code>xsi:type</code> (see below).</p>
<p>A type definition may prevent its use as a base for derived
definitions by any or all means by declaring itself <nt def="nt-final">final</nt> for the prohibited means.  In the absence of <nt def="nt-final">final</nt> the value of <nt def="nt-finalDefault">finalDefault</nt> from the containing schema is used.</p>
<p>A type definition may declare that it is <nt def="nt-exact">block</nt>:  although not <pt>abstract</pt>,
none-the-less types derived by any or all means from it may not appear
in its place even when an <nt def="nt-element">element</nt> <nt def="nt-modelElt">particle</nt>
naming it would appear to allow this (see below).  In the absence of <nt def="nt-exact">block</nt> the value of <nt def="nt-exactDefault">blockDefault</nt> from the containing schema is used.</p>
 </div4>
   <div4 id="invariant-GI">
    <head>Reinterpreting Content Models</head>
    <p>In the light of type derivation, we propose to elaborate the
significance of <nt def="nt-element">element</nt> when it serves as a <nt def="nt-modelElt">particle</nt>.  An <nt def="nt-element">element</nt> which specifies a type (either locally or by reference) which is the <termref def="base">base</termref> of other types is understood as allowing that type or any of the types derived from it to govern its occurrence in instances.</p>
    <p>This introduces an ambiguity if the
base type is not <code>abstract</code> and/or has a derived type which is
substitutable for another derived type.  This is resolved by requiring instance
elements allowed via in this way which conform to types other than
the base type to
manifest their type using the <code>type</code> attribute from the XML Schema
instance namespace,
e.g. <code>xsi:type</code>.</p>
<p>If either the <nt def="nt-element">element</nt> <nt def="nt-modelElt">particle</nt> or the referenced type definition is <nt def="nt-exact">block</nt> for some or all kind of derivation, then this
elaboration doesn't happen for those derivations, i.e. types derived in those
ways may <emph>not</emph> appear.</p>
    <p>This facility is intended to provide
a good impedence match with the needs of database and object-oriented
programming applications.</p>
    <note role="example">
     <eg xml:space="preserve"><![CDATA[<xs:complexType name="WorldAddress"
      base="po:Address" derivedBy="extension">
 <xs:element name="country" type="string"/>
</xs:complexType>

<xs:complexType name="GermanAddress"
      base="po:WorldAddress" derivedBy="extension">
 <xs:element name="land" type="string/>
</xs:complexType>

<xs:element name="person">
 <xs:complexType>
  . . .
  <xs:element name="address" type="po:Address"/>
 </xs:complexType>
</xs:element>

  <person>
   ...
   <address>
    ...
   </address>
  </person>

  <person>
   <address xsi:type="GermanAddress">
    ...
    <country>Germany</country>
    <land>Saarland</land>
   </address>
  </person>]]></eg>
     <p>Two types derived from an <code>Address</code> complex type are defined, adding first a <code>country</code> and then a <code>land</code> element to its required content.  Two schema-valid instances of an element declared with type <code>Address</code> are shown, one using that type itself, and therefore not requiring disambiguation, and one using the <code>xsi:type</code> attribute to indicate that it is using the <code>GermanAddress</code> type.</p>
    </note>
   </div4></stale>
</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.  It provides for
naming a group of attribute declarations and an attribute wildcard for use in
complex type definitions and other attribute group definitions.  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"/>
 <reprcomp abstract="Attribute Group Definition" ref="Attribute_Group_Definition_details">
  <reprdep><p>When an <eltref ref="attributeGroup"/> appears as a daughter of
<eltref ref="schema"/>, 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></reprdep>
  <propmap name="ag-name">The value of the <code>name</code> &i-attribute;</propmap>
  <propmap name="ag-target_namespace">The value of the
<code>targetNamespace</code> &i-attribute; of the parent <code>schema</code>
element information item.</propmap>
  <propmap name="ag-attribute_declarations">The union of the set of attribute
declarations corresponding to the <eltref ref="attribute"/> &i-children; of the
item, if any, with the <propref ref="ag-attribute_declarations"/> of the
attribute groups resolved to by the values of the <code>ref</code>
&i-attribute; of the <eltref ref="attributeGroup"/> &i-children;, if any.  In
the latter case, if the <propref ref="ag-target_namespace"/> of any referenced
group is not identical to the <propref ref="ag-target_namespace"/> of this
group definition, the attribute declarations are not the attribute declarations
from the corresponding <propref ref="ag-attribute_declarations"/> as such, but
distinct attribute declarations sharing all properties with them except for 
<propref ref="a-target_namespace"/>, which has the value of <propref ref="ag-target_namespace"/>s from their original containing group.</propmap>
<propmap name="ag-attribute_wildcard">As for <propref ref="ct-attribute_wildcard"/> as described in <specref ref="declare-type"/></propmap>
<propmap name="ag-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
&i-children;, if present, otherwise <termref def="key-null">null</termref></propmap>
</reprcomp></reprdef>
<stale>
<note role="example">
<eg xml:space="preserve">&lt;attributeGroup name="myAttrGroup"&gt;
    &lt;attribute .../&gt;
    ...
&lt;/attributeGroup&gt;

&lt;type name="myelement" content="empty"&gt;
    &lt;attributeGroup ref="myAttrGroup"/&gt;
&lt;/type&gt;
</eg>
<p>Define and refer to an attribute group. The effect is as if the attribute
declarations in the group were present in the type definition.</p>
</note>
 <p>The concrete syntax above is the first example of a pattern which will
recur:  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 must be empty.  These two are mutually exclusive, and also conditioned
by context:  the defining form, with a <code>name</code>, must occur at the top
level of a schema, whereas the referring form, with a <code>ref</code>, must
occur within a complex type definition or an attribute group definition.</p>
 <ednote>
<edtext>There needs to be some discussion of what happens in case of name
conflict between attrs as a result of an attr group ref.</edtext>
 </ednote></stale>
</div3>
<div3 id="declare-namedModelGroup">
<head>XML Representation of Model Group Definition Schema Components</head>
<p>This reconstructs another common use of <termref def="gloss-parameterEntity">parameter entities</termref>.</p>
<reprdef>
 <reprelt eltname="group"/> <reprcomp abstract="Model Group Definition" ref="Model_Group_Definition_details">
<reprdep><p>If there is a <code>name</code> &i-attribute; (in which case the
item will have <eltref ref="schema"/> as parent), then the item corresponds to
the a model group definition component with properties as follows:</p></reprdep>
<propmap name="mg-name">The value of the
<code>name</code> &i-attribute;</propmap>

  <propmap name="mg-target_namespace">The value of the
<code>targetNamespace</code> &i-attribute; of the parent <code>schema</code>
element information item.</propmap>
<propmap name="model_group">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 &i-children;,
in order</propmap>
<propmap name="mg-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
&i-children;, if present, otherwise <termref def="key-null">null</termref></propmap>
</reprcomp>
 <reprcomp abstract="Particle" ref="Particle">
  <reprdep><p>Otherwise, the item will have a <code>ref</code> &i-attribute;,
in which case it corresponds to a particle component with properties as follows:</p>
  </reprdep>
  <propmap name="p-min_occurs">The value of the <code>minOccurs</code>
&i-attribute;, if present, otherwise <code>1</code></propmap>
  <propmap name="p-max_occurs"><code>*</code>, if the <code>maxOccurs</code>
&i-attribute; equals <code>*</code>, otherwise the numeric value of the <code>maxOccurs</code>
&i-attribute;, if present, otherwise the value of the <code>minOccurs</code>
&i-attribute;, if present, otherwise <code>1</code>.</propmap>
  <propmap name="term">the value of the <propref ref="model_group"/> of the
model group definition resolved to by the value of the <code>ref</code> &i-attribute;</propmap>
  </reprcomp>
</reprdef>
<stale>
 <p>Groups defined with the <nt def="nt-allGroup">allGroup</nt> option may only
be referenced from a <nt def="nt-modelGroupRef">modelGroupRef</nt> which
constitutes the only <nt def="nt-modelGroup">group</nt> at the top level of a content model.</p>
<note role="example">
<eg xml:space="preserve">&lt;group name="myModelGroup"&gt;
 &lt;element ref="myelement"/&gt;
&lt;/group&gt;

&lt;element name="myelement"&gt;
 &lt;type&gt;
  &lt;group ref="myModelGroup"/&gt;
  &lt;attribute ...&gt;. . .&lt;/attribute&gt;
 &lt;/type&gt;
&lt;/element&gt;

&lt;element name="anotherelement"&gt;
 &lt;type&gt;
  &lt;group order="choice"&gt;
   &lt;element ref="yetAnotherelement"/&gt;
   &lt;group ref="myModelGroup"/&gt;
  &lt;/group&gt;
  &lt;attribute ...&gt;. . .&lt;/attribute&gt;
 &lt;/type&gt;
&lt;/element&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></stale>
</div3>
 <div3 id="declare-contentModel">
<head>XML Representation of Model Group Schema Components</head>

<reprdef>
 <reprelt eltname="all"/>
 <reprelt eltname="choice"/>
 <reprelt eltname="sequence"/>
 <reprcomp abstract="Particle" ref="Particle_details">
  <reprdep>Each of the above items corresponds to a particle containing a model
group, with properties as follows:</reprdep>
<propmap name="p-min_occurs">The value of the <code>minOccurs</code>
&i-attribute;, if present, otherwise <code>1</code></propmap>
  <propmap name="p-max_occurs"><code>*</code>, if the <code>maxOccurs</code>
&i-attribute; equals <code>*</code>, otherwise the numeric value of the <code>maxOccurs</code>
&i-attribute;, if present, otherwise the value of the <code>minOccurs</code>
&i-attribute;, if present, otherwise <code>1</code>.</propmap>
<propmap name="term">A model group as given below</propmap>
</reprcomp><reprcomp abstract="Model Group" ref="Model_Group_details">
<propmap name="compositor">On of <pt>all</pt>, <pt>choice</pt>,
<pt>sequence</pt> depending on the element information item</propmap>
<propmap name="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 &i-children;,
in order</propmap>
<propmap name="amg-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
&i-children;, if present, otherwise <termref def="key-null">null</termref></propmap>
</reprcomp>
</reprdef>
  <stale>
  <p>The <termref def="key-satisfy-cm">satisfy-cm</termref> definition wrt schema-validity obtains.</p>

<p>A content model consisting of an <nt def="nt-elementOnly">elemModel</nt>
alone specifies child elements only.  If the <pt>mixed</pt> qualifier is present,
text may occur <emph>as well as</emph> elements. In either case the
content model consists of a simple grammar governing the allowed types of child
elements and the order in which they must appear. </p>
<p><termdef term="particle" id="term-particle">The grammar for element-only content is built on content model <term>particle</term>s (<nt def="nt-modelElt">particle</nt> above)</termdef>: elements,
groups and wildcards.  A particle provides for some
number of occurrences in an instance of a single element (via
<nt def="nt-elementRef">elementRef</nt> or <nt def="nt-elementDecl">elementDecl</nt>), a group of elements (via
<nt def="nt-modelGroup">group</nt>) or an indirect specification of any of
these (via <nt def="nt-modelGroupRef">modelGroupRef</nt>).</p>
 <p><termdef term="permit" id="term-permit">We say that a <termref def="term-particle">particle</termref> <term>permit</term>s one or more elements or groups if its <pt>minOccurs</pt> is 0</termdef>.<termdef term="require" id="term-require">We say that a <termref def="term-particle">particle</termref> <term>require</term>s one or more elements or groups if its <pt>minOccurs</pt> is greater than 0</termdef>.</p>
<p><termdef id="term-group" term="group">A <term>group</term> is two or more particles plus a <nt def="nt-compositor">compositor</nt></termdef>.  The <nt def="nt-compositor">compositor</nt> for a group specifies for a given
group whether it provides for
 <ulist>
  <item><p>a sequence of the elements <termref def="term-permit">permitted</termref> or
<termref def="term-require">required</termref> by its <termref def="term-particle">particles</termref>;</p></item>
  <item><p>a choice between
the elements <termref def="term-permit">permitted</termref> or
<termref def="term-require">required</termref> by its <termref def="term-particle">particles</termref>;</p></item>
  <item><p>a repeated choice among the elements <termref def="term-permit">permitted</termref> or
<termref def="term-require">required</termref> by its <termref def="term-particle">particles</termref>;</p></item>
  <item><p>a set of the elements <termref def="term-require">required</termref> by its <termref def="term-particle">particles</termref> (this is the case for the implicit <code>all</code> compositor,
which is associated with the <nt def="nt-allGroup">allGroup</nt> production).</p></item>
 </ulist>
These options reconstruct the XML
1.0 <code>,</code> connector, the XML 1.0 <code>|</code> connector, the repeated disjunction of XML 1.0's <xtermref href="http://www.w3.org/TR/REC-xml#NT-Mixed">Mixed</xtermref>
production and the SGML
<code>&amp;</code> connector respectively. In the first case (<code>sequence</code>) all the
elements <termref def="term-permit">permitted</termref> or
<termref def="term-require">required</termref> must appear in the order given in the group; in the second case
(<code>choice</code>), exactly one of the <termref def="term-permit">permitted</termref> or
<termref def="term-require">required</termref> elements must appear in the fourth case (<code>all</code>), all the <termref def="term-require">required</termref> elements,
which are restricted in this case only to unqualified
<nt def="nt-element">element</nt>s with <pt>minOccurs</pt>=<pt>maxOccurs</pt>=1, must appear, but may
appear in any order.  The <code>all</code> compositor may
only appear as the top-level compositor of a content model.</p>
<p>The <nt def="nt-occurs">occurs</nt> specification governs how many times the
material <termref def="term-permit">permitted</termref> or
<termref def="term-require">required</termref> by a <nt def="nt-modelElt">particle</nt> may occur, but note that the components of a group whose <nt def="nt-compositor">compositor</nt> is (implicitly) <pt>all</pt> may not be qualified,
and therefore call for exactly one appearance of the element they identify.</p>
<p>See <specref ref="declare-element"/> for further discussion and examples
of the appearance of <nt def="nt-elementDecl">elementDecl</nt> as one of the
two expansions of
<nt def="nt-element">element</nt> above.</p>
 <p>For the interpretation of
<nt def="nt-wildcard">wildcard</nt> in this context, see
<specref ref="declare-openness"/>.</p>
<ednote>
<edtext>Something about defaults for min and max</edtext>
</ednote>

<p>The <termref def="key-satisfy-eo">satisfy-eo</termref> definition wrt schema-validity obtains.</p>
<p>The <specref ref="cos-elt-consist"/> <termref def="gloss-cos">Constraint on Schemas</termref> obtains.</p>
  <constraintnote type="cos" id="cos-nonambig">
<head>Unambiguous Content Model</head>
<p> For compatibility, it is an error if a content model is such that there
exist element item sequences within which some item can match more than one
occurrence of an <nt def="nt-elementRef">elementRef</nt>,
<nt def="nt-elementDecl">elementDecl</nt> or <nt def="nt-wildcard">wildcard</nt> in the content model. </p>
</constraintnote>
<p>A content model which allows <pt>mixed</pt> content provides for mixing elements with
character data in document instances. The same <nt def="nt-elementOnly">elemModel</nt> mechanism is used for specifying the
grammar of the allowed elements, with the changes that the implicit top-levl
model group has the <code>choice</code> <nt def="nt-compositor">compositor</nt>
and <pt>minOccurs</pt> of 0 and <pt>maxOccurs</pt> of '*', thus ensuring that the default
behaviour is the same as that of XML. </p>


<note role="example">
<eg xml:space="preserve">&lt;type content="mixed"&gt;
 &lt;element ref="name1"/&gt;
 &lt;element ref="name2"/&gt;
 &lt;element ref="name3"/&gt;
&lt;/type&gt;
</eg>
<p>Allows character data mixed with any number of <code>name1</code>,
<code>name2</code> and <code>name3</code> elements.</p>
</note>
<p>The <termref def="key-satisfy-mixed">satisfy-mixed</termref> definition wrt schema-validity obtains.</p>
</stale>
</div3>

   <div3 id="declare-openness">
    <head>XML Representation of Wildcard Schema Components</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.  At a given point in a content model, in
addition to what DTDs provide for we need particles that allow the following:</p>
   <olist>
    <item>
     <p>Any well-formed XML element item: any tag, any namespace, any attributes,
any content, as long as it's well-formed;</p>
    </item>
    <item>
     <p>Any well-formed XML element item, provided it's in some <emph>other</emph>
namespace than the one we're defining a type for;</p>
    </item>
    <item>
     <p>Any well-formed XML element item, provided it's in a specified namespace;</p>
    </item>
    <item>
     <p>Any well-formed XML element item, provided it's from the <emph>same</emph>
namespace as the one we're defining a type for.</p>
    </item>
   </olist>
   <p>Of course, by qualifying one of these with a <B>*</B>, we allow for any
amount of (localised) flexibility in validation.</p>
   <p>Attributes need the same kind of flexibility:  a good-citizen schema
should probably allow any attributes from the <code>xml:</code> namespace, for instance.</p>

    <reprdef>
 <reprelt eltname="any"/>
 <reprcomp abstract="Wildcard" ref="Wildcard_details">
<propmap name="namespace_constraint">[In the obvious way from the
<code>namespace</code> &i-attribute; -- ##other turns in to <pt>not</pt> ##targetNamespace]</propmap>
<propmap name="w-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
&i-children;, if present, otherwise <termref def="key-null">null</termref></propmap>
</reprcomp></reprdef>
    <ednote>
     <edtext>The above not complete yet -- processContents needs to be added to
the wildcard component, and the correspondences above filled in.</edtext>
    </ednote>
    <p>The four alternatives for the <code>namespace</code> attribute
correspond to the four kinds of flexibility listed above.</p>
    <stale><p>All of the above are subject to the same ambiguity constraints
(<specref ref="cos-nonambig"/>) as other
content model particles:  If an instance element could match either an explicit
particle and a wildcard, or one of two wildcards, within the content model of a
type, that model is in error.</p>

    <note role="example"><eg xml:space="preserve"><![CDATA[<xs:any/>

<xs:any namespace="##other"/>

<xs:any namespace="http://www.w3.org/1999/Style/Transform/">

<xs:any namespace="##targetNamespace"/>

<xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/>]]></eg>
    <p>Concrete examples of the four cases listed above, plus one attribute case.</p>
</note></stale>
   </div3>
   <div3 id="declare-key">
    <head>XML Representation of &Constraint; Definition Schema Components</head>
    <p>We supplement the simple uniqueness and reference mechanisms provided by
<code>ID</code> and <code>IDREF</code> in XML 1.0 and SGML with three new kinds
of constraint, for uniqueness, keys and key references.</p>
    <reprdef>
 <reprelt eltname="unique"/>
 <reprelt eltname="key"/>
 <reprelt eltname="keyref"/>
 <reprelt eltname="selector"/>
 <reprelt eltname="field"/>
 <reprcomp abstract="&Constraint; Definition" ref="&Constraint;_Definition_details"><propmap name="c-name">The value of the <code>name</code> &i-attribute;</propmap>
  <propmap name="c-target_namespace">The value of the
<code>targetNamespace</code> &i-attribute; of the parent <code>schema</code>
element information item.</propmap>
<propmap name="&constraint;_name">[per the element involved]</propmap>
<propmap name="selector">[from the <eltref ref="selector"/>]</propmap>
<propmap name="fields">[from the <eltref ref="field"/>s]</propmap>
<propmap name="referenced_key">[only for <eltref ref="keyref"/>, resolved from
<code>refer</code> &i-attribute;]</propmap>
<propmap name="rc-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
&i-children;, if present, otherwise <termref def="key-null">null</termref></propmap>
</reprcomp></reprdef>
    <ednote>
     <edtext>Not complete, above property correspondences need to be filled in.</edtext>
    </ednote>
    <p>The <code>XPathExprApprox</code> simple type referenced above
is defined in <specref ref="normative-schemaSchema"/>.  It is a
permissive approximation to the syntax of XPath expressions as defined
in <bibref ref="bib-xpath"/>, and is <emph>not</emph> an accurate
reconstruction of that syntax.  Its use by reference from other schema
documents is deprecated: In due course a schema for XPath
will be published which includes a simple type definition appropriate
for widespread use.</p>
    <stale><p>The <nt def="nt-unique">unique</nt> and <nt def="nt-key">key</nt> constraints provide for selected
elements to be checked as having locally or globally unique identities.  The
<nt def="nt-keyref">keyref</nt> constraint provides for checking referential consistency with
respect to a declared <nt def="nt-unique">unique</nt> or <nt def="nt-key">key</nt> constraint.</p>
    
    <p>The <nt def="nt-refer">refer</nt> of a <nt def="nt-keyref">keyref</nt>
must match the <nt def="nt-constraintName">constraintName</nt> of a
<nt def="nt-unique">unique</nt> or a <nt def="nt-key">key</nt>.  The number of
<nt def="nt-field">fields</nt> of the <nt def="nt-keyref">keyref</nt> must be
the same as the number of <nt def="nt-field">fields</nt> of the referenced
<nt def="nt-unique">unique</nt> or <nt def="nt-key">key</nt>.  For every
element which is identified in a given scope by the
<nt def="nt-selector">selector</nt> of a <nt def="nt-keyref">keyref</nt>
defined for that scope (call this <B>ref</B>), there must be an element in that
scope identified by the <nt def="nt-selector">selector</nt> of the named
<nt def="nt-unique">unique</nt> or <nt def="nt-key">key</nt> (call this
<B>target</B>) such that the values of the <nt def="nt-field">fields</nt> of
the <nt def="nt-keyref">keyref</nt> evaluated with respect to <B>ref</B>, taken
in order, match the values of the <nt def="nt-field">fields</nt> of the
<nt def="nt-unique">unique</nt> or <nt def="nt-key">key</nt> evaluated with
respect to <B>target</B>.</p>
    <note>
     <p>If reference to a key or unique defined in a scoping element which may
occur more than once is envisaged, then the scoping elements themselves must
have keys (typically with global scope), and the scoped keys must include the
key of their scoping element among their fields.</p>
    </note>
    <note role="example">
     <eg xml:space="preserve"><![CDATA[<xs:element name="state">
  <xs:complexType>
   <xs:element name="stateCode" type="twoLetterCode"/>

    <xs:element name="vehicle">
      <xs:complexType>
       . . .
       <xs:attribute name="regNo" type="integer"/>
      </xs:complexType>
    </xs:element>

    . . .
  </xs:complexType>

</xs:element>

<xs:key name="regKey">
  <xs:selector>.//vehicle[@regNo]</xs:selector>
  <xs:field>@regNo</xs:field>
  <xs:field>ancestor::state/stateCode</xs:field>
      <!-- scope needs to be involved -->
</xs:key>

<xs:element name="person">
 <xs:complexType>
 . . .
  <xs:element name="car">
   <xs:complexType model="empty">
    . . .
    <xs:attribute name="regRef" type="integer"/>
    <xs:attribute name="regState" type="twoLetterCode"/>
   </xs:complexType>
  </xs:element>
 </xs:complexType>

 <xs:keyref name="carRef" refer="regKey">
  <xs:selector>.//car[@regRef]</xs:selector>
   <xs:field>@regRef</xs:field>
   <xs:field>../person/@regState</xs:field>
 </xs:keyref>
</xs:element>]]></eg>
     <p>A <code>state</code> element is defined, which <emph>inter alia</emph>
contains a <code>stateCode</code> descendant and some <code>vehicle</code>
descendants.  A <code>vehicle</code> in turn has a <code>regNo</code> attribute,
which is an integer.  The combination of <code>stateCode</code> and
<code>regNo</code> is asserted to be a <nt def="nt-key">key</nt> for
<code>vehicle</code> within <code>state</code>.  Furthermore, a <code>person</code> element has
inter-alia an empty <code>car</code> element, with <code>regRef</code> and
<code>regState</code> attributes, which are then asserted together to refer to
<code>vehicles</code> via the <code>regKey</code> constraint.</p>
    </note></stale>
   </div3>



<div3 id="declare-notation">
<head>XML Representation of Notation Declaration Schema Components</head>
<p>A notation may be declared by specifying a name and an identifier for the
notation.</p>
 <reprdef>
 <reprelt eltname="notation"/>
 <reprcomp abstract="Notation Declaration" ref="Notation_Declaration_details">
<propmap name="n-name">The value of the
<code>name</code> &i-attribute;</propmap>
  <propmap name="n-target_namespace">The value of the
<code>targetNamespace</code> &i-attribute; of the parent <code>schema</code>
element information item.</propmap>
<propmap name="system_identifier">[from the <code>system</code> &i-attribute;]</propmap>
<propmap name="public_identifier">[from the <code>public</code> &i-attribute;]</propmap>
<propmap name="n-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
&i-children;, if present, otherwise <termref def="key-null">null</termref></propmap>
</reprcomp></reprdef> 
    <ednote>
     <edtext>Not complete, above property correspondences need to be filled in.</edtext>
    </ednote>
<note>
<eg xml:space="preserve">
&lt;notation name="jpeg"
          public="image/jpeg" system="viewer.exe" /&gt;

&lt;element name="picture"&gt;
 &lt;type base="binary" derivedBy="extension"&gt;
  &lt;attribute name="pictype" type="NOTATION"/&gt;
 &lt;/type&gt;
&lt;/element&gt;

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

</note>
</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.</p>
 <reprdef>
 <reprelt eltname="annotation"/>
 <reprcomp abstract="Annotation" ref="Annotation_details">
<propmap name="application_information">[from the <eltref ref="appinfo"/> &i-children;]</propmap>
<propmap name="user_information">[from the <eltref ref="documentation"/> &i-children;</propmap>
</reprcomp></reprdef><ednote>
     <edtext>Not complete, above property correspondences need to be filled in.</edtext>
    </ednote>
 <p><propref ref="user_information"/> is intended for human consumption, <propref ref="application_information"/> for automatic processing.  In both cases, provision is made for an optional URI reference to supplement the local information.  Schema validation does <emph>not</emph> involve dereferencing these URIs, when present.  In the case of <propref ref="user_information"/>, indication may be given as to the identity of the (human) language used in the contents, using the <code>xml:lang</code> attribute.</p>
</div3>
 <div3 id="declare-datatype">
  <head>XML Representation of Simple Type Definition Schema Components</head>
<p>See <bibref ref="ref-xsp2"/></p>

  
  <stale><p>&XSP1; incorporates the simple type definition mechanisms defined by
    &XSP2; in order to express constraints on strings which constitute the
&i-attrChildren; of attribute information items and the &i-children; of element
information items which have no element information item &i-children;.</p><reprdef>
 <reprelt eltname="simpleType"/>
 <reprcomp abstract="Simple Type Definition" ref="Simple_Type_Definition_details">
  <propmap name="st-name">The value of the <code>name</code> &i-attribute;</propmap>
  <propmap name="st-target_namespace">The value of the
<code>targetNamespace</code> &i-attribute; of the parent <code>schema</code>
element information item.</propmap>
<propmap name="st-final"></propmap>
<propmap name="st-abstract"></propmap>
<propmap name="st-annotation">The annotation corresponding to the <eltref ref="annotation"/> element information item in the
&i-children;, if present, otherwise <termref def="key-null">null</termref></propmap>
<propmap name="generator"></propmap>
<propmap name="st-primitive_type_definition"></propmap>
<propmap name="st-base_type_definition"></propmap>
<propmap name="facets"></propmap>
<propmap name="st-base_type_definition2"></propmap>
<propmap name="st-strings"></propmap>
<propmap name="st-base_type_definition3"></propmap>
</reprcomp></reprdef><p>The production for <nt def="nt-facet">facet</nt> above serves to indicate where this
    chapter connects with &XSP2;, and the concrete syntax
displayed below is copied from there.  All facets are optional and may appear in any order
within the <code>datatype</code> element.  The <nt def="nt-datatypeRef">simpleTypeRef</nt> in the <nt def="nt-datatypeSpec">simpleTypeSpec</nt> identifies the simple type on which the
one being defined is based:  infinite regress is avoided because &XSP2;
provides a set of built-in <emph>ab initio</emph> simple types.</p>
  <p>The other productions provide for using simple types once they have been
    defined, see below under <nt def="nt-typeDefn">typeDefn</nt> and
    <nt def="nt-attrDecl">attribute</nt>.</p>
  <p>As explained in <specref ref="refSchemaConstructs"/>, the use of <termref def="gloss-QName">QName</termref> allows for the referenced
definition to be located in some other schema.</p>
 <p>An <pt>abstract</pt> type cannot itself be used as the type of an attribute
or element.</p>
 <p>A simple type definition can rule itself out as the base of type
derivations, by declaring itself <nt def="nt-final">final</nt>.</p>
  <note role="example">
    <eg xml:space="preserve"><![CDATA[<xs:simpleType name="posInt" base="integer"/>
 <xs:minExclusive value="0"/>
</xs:simpleType>

<xs:attribute name="foo" type="posInt"/>

<xs:attribute name="baz" type="integer"/>

<xs:attribute name="fontSize" type="xsl:quantity"
           fixed="12pt"/>]]></eg>
<p>The first <code>attribute</code> example references
      the definition above it. The second references a datatype pre-defined by
      &XSP2;. The third references a datatype in an (imaginary) XSL schema and fixes
      its value.</p>
</note>

 <note>
  <p>See <loc href="#type-decl-syntax">previous note on the type definition issue</loc>.</p>
 </note>
<p>The <termref def="key-satisfy-dt">satisfy-dt</termref> definition wrt schema-validity obtains.</p>
<p>The <specref ref="sic-datatype"/> <termref def="gloss-sic">Schema Information Set Contribution</termref> obtains.</p></stale>
  <constraintnote type="src" id="st-restrict-facets">
   <head>Simple Type Restriction (Facets)</head>
   <p>A simple type definition restricts another simple type definition with a
set of facets if: watch this space.</p>
  </constraintnote>
</div3>
</div2>
</div1>
   <div1 id="composition">
    <head>Schema Access and Composition</head>
<p>This chapter defines the mechanisms by which we establish the necessary precondition for establishing schema-validity, namely access to one or more schemas. This chapter also describes in detail related mechanisms for using in
one schema, definitions and declarations from another. </p>
<p>Chapter 6 provides a formal definition of schema-validation. Here we set out
in detail the 3-layer architecture implied by the preceding chapters which
prepares for that formal definition and relates it
to XML documents and WWW-situated processes. This layering is provided to
maximise the range of environments in which this specification can be applied,
and to minimise the need for modifications to this specification as new
standards and conventions for Web interoperability are developed. The layers
are: </p>
<olist>
  <item><p>The schema-validation 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 validate an instance element information item. Layer 2, which is
primarily defined in Chapter 4, 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. </p>
<p>We note that improved or alternative conventions for Web interoperability can
be standardised in the future without reopening this recommendation. For
example, the W3C is currently considering initiatives to standardise 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>

<div2 id="layer1">
<head>Layer 1: Summary of the schema-validation core </head>
<p>The fundamental purpose of the schema-validation core is to define schema-validatity for a single
element information item and its descendants with respect to a specified
complex type
definition. All processors are required to implement this core predicate in a
manner which conforms exactly to this specification. </p>
<p>Schema-validity is defined with reference to schema (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
validation.  This is not a circular definition, but rather a
<emph>post facto</emph> observation:  no element information item can
be schema-valid unless all the components required by any aspect of
its (potentially recursive) validation 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 the
complete component
set.</p>
<p>Processors have the option to assemble ( and perhaps to optimise or pre-compile) the entire schema prior to the start of a validation 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 definitions and declarations
  transitively required to complete a validation;</p></item>
  <item><p>that no definition or declaration changes once it has been located;</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 validation to differ from that which would have
  been obtained from the same schema components acquired in bulk.</p></item></ulist>
<note><p> the validation core is defined in terms of the schema components
comprising a complete component set; no mention is made of the schema definition
syntax (i.e. <eltref ref="schema"/>). Although many processors will acquire
schemas in this format, others may operate on compiled representations, on a
programmatic representation as exposed in some programming language, etc.
</p></note>
<p><termdef id="schema-valid" term="schema-valid">The fundamental <term>schema-valid</term> predicate
applies to an <xtermref href="">element information item</xtermref> (<B>EII</B>) and
a complex type definition against the background of a schema.</termdef></p>
 <ednote>
  <edtext>We need to add more to this now that we've allowed partial processing
under &lt;any/></edtext>
 </ednote>
<p>The obligation of a schema-aware processor as far as the schema-validation
core is concerned is to implement the definition of <termref def="schema-valid">schema-valid</termref>. The
choice of <B>EII</B>, as well as the determination of the complex type
definition and schema is not specified at layer 1.</p>
<p>The <termref def="schema-valid">schema-valid</termref> predicate is defined recursively, and e.g. streaming
processors may implement it in a way that augments the schema during
processing in response to encountering new namespaces. The implication of the
invariants expressed above is that <termref def="schema-valid">schema-valid</termref> must be implemented so
that the <emph>same</emph> validation outcome is given in such cases as would be given if the initial invocation of
<termref def="schema-valid">schema-valid</termref> was re-performed
with the final schema replacing the one initially employed. </p>
</div2>
<div2 id="layer2">
<head>Layer 2: Schema definitions in XML</head>
<p>This is described in <specref ref="declare"/>, which defines an
XML representation for type definitions and element declarations and so on,
specifying their target namespace and collecting them into schema documents.</p>
<note><p> The two following sections relate to assembling the complete component set for validation 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>
<ednote><edtext> "schemaLocation" really belongs at layer 3 . . .</edtext></ednote>
<div3 id="compound-schema">
<head>Assembling a schema for a single namespace from multiple schema definition documents</head>
 <reprdef>
 <reprelt eltname="include"/>
</reprdef>
<stale><p>We provide the following mechanism for assembling a complete component
set from several <code>&lt;schema&gt;</code> elements: </p>
<p>A <code>&lt;schema&gt;</code> element may contain one or more
<code>&lt;include&gt;</code> elements. The <code>&lt;include&gt;</code> element has a required
attribute, <code>"schemaLocation"</code>, consisting of one or more URI references, which must resolve
to another <code>&lt;schema&gt;</code> element, whose <code>"targetNamespace"</code> attribute
must be identical to the containing <code>&lt;schema&gt;</code> element's
<code>"targetNamespace"</code>. The schema derived from a <code>&lt;schema&gt;</code> then
consists of all the components it contains and all the components contained by
any schema it includes, recursively. </p>
<p>It is not an error for the same URI reference to be 'included' more
than once, but only the first inclusion is effective.
</p>
<p>It <emph>is</emph> an error for a component to be multiply defined -- see below.</p>
<note> <p> The "schemaLocation" attribute properly belongs at layer 3, and its use in this case is similar to its uses on other elements described in the next section.</p></note>
<ednote><edtext>Basing identity of schema definition on identity of URI reference as above and in 4.2.2 below is clearly less than ideal.  Do we want to try to include a clause allowing processors with good evidence that the same schema definition resource has been acquired by two different means (e.g. one absolute and one relative URI reference) to ignore one of them?</edtext></ednote></stale>
</div3>
<div3 id="composition-schemaImport">
<head>References to schema components across namespaces</head>
<p>As described in <specref ref="concepts-data-model"/>, every global schema component is associated with
a target namespace (or, explicitly, with none).  In this section we set out
the exact mechanism and syntax in the XML form of
schema definition by which a reference to a foreign component is made, that is, a component with a different target namespace from that of the referring component.</p>
<p>We require not only a means
of addressing such foreign components but also a signal to schema-aware processors that a
schema document contains such preferences and differentiates two subtly
different cases:</p>
 <reprdef>
 <reprelt eltname="import"/>
</reprdef>
<stale><ulist>
<item><p>We add a <B>QName</B> ab initio datatype;</p></item>
<item><p>We declare the <code>"ref"</code> attribute on <code>&lt;group&gt;</code>, <code>&lt;element&gt;</code> and
 <code>&lt;attributeGroup&gt;</code>, the <code>"type"</code> attribute on
<code>&lt;element&gt;</code> and <code>&lt;attribute&gt;</code> and the <code>"base"</code> attribute on <code>&lt;type&gt;</code> and <code>&lt;datatype&gt;</code> to
 be of type <B>QName</B>.  Use of prefixes in such attributes is governed by
 the normal rules for <B>QName</B>s, i.e. that there must be a namespace
 declaration for the prefix in scope;</p></item>
<item><p>We provide the <code>&lt;import&gt;</code> element, which must appear at the
 beginning of schema documents to identify namespaces used in external
 references, i.e. those whose prefix or lack of it identifies them as coming
from a different namespace than the enclosing schema's target namespace.  It has a required attribute <code>"namespace"</code>
 which indicates that the schema document contains one or more
 qualified references to schema components in that namespace (via one
 or more prefixes declared with namespace declarations in the normal
 way, see above), and an optional attribute <code>"schemaLocation"</code>.  When
 only the <code>"namespace"</code> attribute is present, the schema author is
 leaving the identification of the schema to the instance, via the
 mechanisms described below.  When a <code>"schemaLocation"</code> attribute is
 present, it <emph>must</emph> contain a single URI reference which the schema
 author warrants will resolve to a schema document containing the
 component(s) referred to in the imported namespace.</p>
<note> <p> The "schemaLocation" attribute properly belongs at layer 3, and its use in this case is similar to its uses on other elements described in the next section.</p></note>
<note>
<p>The treatment of references as QNames 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 a schema
<emph>or</emph> the schema declaration and definition elements themselves must
be explicitly qualified.</p>
</note>
</item>
</ulist>
<note><p> This design is a compromise:  We've decided the pun of</p>
<eg xml:space="preserve">&lt;schema xmlns="http://www.w3.org/1999/XMLSchema"
        xmlns:html="http://www.w3.org/1999/XHTML">
 &lt;html:p>[Some documentation for my schema]&lt;/html:p>

 . . .

 &lt;type name="myType">
  &lt;element ref="html:p" minOccurs="0"/>
  . . .
 &lt;/type>
&lt;/schema>
</eg>
<p>
is actually OK, <emph>provided</emph> you declare the html namespace as imported
('mentioned' as well as 'used', if you will):
</p>
<eg xml:space="preserve">
  &lt;import namespace="http://www.w3.org/1999/XHTML"/>
</eg>
</note>
<p> It is an error if the <code>&lt;import&gt;</code>'s <code>"namespace"</code> and the imported schema's
target namespace are not the same. [?]</p>
<p>
It is not an error for the same URI reference to be 'imported' more
than once, but only the first import is effective.
</p>
<p>It is an error if a <code>"schemaLocation"</code> attribute in an instance
associates a different URI reference from one associated with the
same namespace in a schema.
</p>
<p>
It is an error to provide more than one
definition/declaration for the same component type within the same
target namespace: this is true regardless of whether the
definitions/declarations occur in the same schema document, or in
separate schema documents referenced via one or more parallel or
nested <code>&lt;include&gt;</code>s or two or more nested <code>&lt;import&gt;</code>s.
</p></stale>
 <constraintnote id="src-composition" type="src">
  <head>Schema Composition</head>
  <p>The schema which corresponds to a schema document (that is, a <eltref ref="schema"/> element information item) contains all the primary
and secondary schema components which correspond to the immediate element
information item &i-children; of that schema document, together with any
primary or secondary components which are:
   <olist>
    <item>
     <p>contained in a schema identified by an <eltref ref="include"/> element
information item from among the &i-children; of that schema document;</p>
    </item>
   </olist>
   or
   <olist>
    <item>
     <p>contained in a schema identified by an <eltref ref="import"/> element
information item from among the &i-children; of that schema document;</p>
    </item>
   </olist>
  </p>
  <stale>
    <olist><item>
     <p>necessary to allow the resolution of some <xtermref href="&XSP2.URI;#QName">QName</xtermref> which appears as the value of an attribute somewhere within that schema document;</p>
    </item></olist></stale>
 </constraintnote>
</div3></div2>
<div2 id="composition-instances">
<head>Layer 3: Web-interoperability</head>
<p>Layers 1 and 2 provide a framework for validation and XML definition of schemas in a broad variety of environments. Over time, we expect that a range
of standards and conventions will 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>
<note><p> The core validation architecture requires that the complete
component set of
appropriate declarations for each global element and attribute be
available. This requires may involve both resolving both
instance->schema and schema->schema references. As observed above, we anticipate
that the precise mechanisms for resolving such references will evolve over time.
In support of such evolution, we have attempted to observe the design principle that references from
one schema to another use mechanisms that directly parallel those used to
reference a schema from an instance document.</p></note>
<div3 id="schema-repr">
<head>Standards for representation and retrieval of schema definitions on the Web </head>
<p>For interoperability, schema definitions like all other Web resources are identified by
URI and retrieved using the standard mechanisms of the Web (e.g. http, https,
etc.) Schema definitions on the Web must be part of documents with the mime type <code>text/xml</code>, and are represented in the
standard XML schema definition form described by layer two (I.e. as <code>&lt;schema&gt;</code>
elements). </p>
<note><p> there will often be times when a schema definition will be a
complete XML 1.0 document with a root element of <code>&lt;schema&gt;</code>. There will be
other occasions in which <code>&lt;schema&gt;</code> elements will be contained in other
documents, perhaps referenced using fragment and/or Xpointer notation.
</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 validation. This
section introduces a set of normative conventions to facilitate interoperability
for instance documents and schemas retrieved and validated from the Web.</p>
<note><p> As discussed above in <specref ref="layer2"/>, other non-Web mechanisms for delivering schemas for validation may exist, but are outside the scope of this recommendation.</p></note>
<p>The validation mechanisms of <specref ref="layer1"/> specify that <termref def="schema-valid">schema-valid</termref>
applies to an element information item to be validated, and the type
to be used to
validate it. Documents on the Web can be validated in their entirety, from the
document root element, or else individual elements can be selectively validated.
</p>
<p>Processors on the Web are free to attempt validation against arbitrary
complete component sets (as defined in <specref ref="layer1"/>) and against any type. However, it
is useful to have a common convention for determining a complete component set, and
an initial type. For this purpose, we require that for general-purpose schema-aware processors (i.e. those not specialised to one or a fixed set of pre-determined schemas), unless directed otherwise by a user the element information
item to be validated is either the document element of an information
set, or the local root of a new namespace-governed region within an
information set. </p>
<p>To determine the type declaration to be used for the validation in these cases, the
processor is required to retrieve a schema document with a "targetNamespace"
identical to the
namespace URI, if any, of the element information item to be
validated.   Again, unless directed otherwise, the processor must
locate within that schema a global element declaration with an NCName matching
that of the element information item to be validated. The processor must ensure that both the
element declaration, and the type declaration used in that element declaration,
are included in the complete component set for the validation. The type thus
identified is the type used for validation of the element information item.  The composition of the complete component set for validation is governed by  <specref ref="layer2"/> above.</p>
<p>The means used to locate appropriate schema document(s) are processor and
application dependent, subject to a following requirements: </p>
<ulist>
  <item><p>Schemas are represented on the Web in the form specified by Chapter 3.</p></item>
  <item><p>The author of a document uses namespace declarations to indicate the intended
interpretation of names appearing therein; there may not be a schema
retrievable via the namespace URI.  Processors should not attempt to dereference namespace URIs unless explicitly directed to do so.
</p>
<note><p> Experience suggests that it is not in general safe or desirable from
a performance point of view to dereference NS URIs as a matter of course.  User community and/or consumer/provider agreements may establish conventions which make this a sensible strategy:  This recommendation allows but does not require this.  Users are always free to supply namespace URIs 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 warrents that some or
all of the document is schema-valid per that schema, we provide the
<code>"schemaLocation"</code> attribute (in the XML Schema namespace) to record
this fact with pairs of URI references (one for the namespace URI, and
one for the schema definition).</p>
<p>Again, unless directed otherwise general-purpose schema-aware processors must attempt to dereference each schema URI in the
value of "schemaLocation" to obtain a schema, whose target namespace
must be identical to the namespace it appears in conjunction with, if any.
Failure to
  dereference the URI, failure to locate a valid document of mime type
  text/xml, failure to find a <code>&lt;schema&gt;</code> or mismatch of the targetNamespace URI is an error. </p></item>
<item>  <p><code>"schemaLocation"</code> attributes can occur on any element participating in a
  validation, and all such attributes must be processed as if they had occurred at the validation root. According to the rules of
  <specref ref="layer1"/>, the complete component set can be lazily assembled, but is otherwise
  stable throughout a validation. Although schema location attributes can occur
  on any element, and can be processed incrementally as discovered, their effect
  is essentially global to the validation. Definitions and declarations remain
  in effect beyond the scope of the element on which the binding is declared.
  </p></item>
</ulist>
<note>  <p> The issue of the value space for QNames, in particular in the case of prefixes with no declaration, needs to be carefully elucidated in the Datatype draft.</p></note>
  <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/Style/Transform"
            xmlns:html="http://www.w3.org/1999/XHTML"
            xmlns:xsi="http://www.w3.org/1999/XMLSchema/instance"
            xsi:schemaLocation="http://www.w3.org/1999/Style/Transform
                                http://www.w3.org/1999/Style/Transform/xslt.xsd
                                http://www.w3.org/1999/XHTML
                                http://www.w3.org/1999/XHTML/xhtml.xsd"
</eg>
<note>  <p> the namespace URIs 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, 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>
  <ednote><edtext>Need to worry about the 'no namespace' case -- what do I put in "schemaLocation" if I don't declare _any_ namespaces?</edtext></ednote>
<ednote><edtext>We've left ourselves with no way in a component which _does_ have a target namespace to refer to a component with none.</edtext></ednote>
</div3>
</div2>

</div1>
<div1 id="conformance">
<head>Conformance *</head>
<ednote><edtext>This section is incomplete</edtext></ednote>
<issue id="error-behavior">
<p> This draft includes extensive discussion of conformance and validity
checking, but the distinction between invalidity and schema errors is not
clearly drawn, nor is the significance of either defined. In future, we must
clarify rules for both.</p>
</issue>
<div2 id="conformance-schemaValidity">
<head>Schema Validity *</head>
<stale><note><p>This section is in the process of being redrafted, and is not
guaranteed to be coherent yet.   The material after the <emph>stale below
here</emph> editorial note is in many cases out of sync with the material above
in sections 3 and 4.</p>
<slist>
<sitem id="nt-appinfo"/>
<sitem id="nt-attrDecl"/>
<sitem id="nt-attributeGroupRef"/>
<sitem id="nt-compositor"/>
<sitem id="nt-contentModel"/>
<sitem id="nt-datatypeDefn"/>
<sitem id="nt-datatypeRef"/>
<sitem id="nt-datatypeRestr"/>
<sitem id="nt-datatypeSpec"/>
<sitem id="nt-element"/>
<sitem id="nt-elementDecl"/>
<sitem id="nt-elementName"/>
<sitem id="nt-elementOnly"/>
<sitem id="nt-elementRef"/>
<sitem id="nt-exactDefault"/>
<sitem id="nt-final"/>
<sitem id="nt-finalDefault"/>
<sitem id="nt-generalConstraint"/>
<sitem id="nt-import"/>
<sitem id="nt-key"/>
<sitem id="nt-keyref"/>
<sitem id="nt-modelElt"/>
<sitem id="nt-modelGroupRef"/>
<sitem id="nt-occurs"/>
<sitem id="nt-typeDefn"/>
<sitem id="nt-typeRef"/>
<sitem id="nt-typeSpec"/>
<sitem id="nt-wildcard"/>
<sitem id="nt-allGroup"/>
<sitem id="nt-attributeGroupDefn"/>
<sitem id="nt-constraintName"/>
<sitem id="nt-contentType"/>
<sitem id="nt-elementSpec"/>
<sitem id="nt-equivClassRef"/>
<sitem id="nt-exact"/>
<sitem id="nt-facet"/>
<sitem id="nt-field"/>
<sitem id="nt-include"/>
<sitem id="nt-info"/>
<sitem id="nt-modelGroup"/>
<sitem id="nt-preamble"/>
<sitem id="nt-refer"/>
<sitem id="nt-richModel"/>
<sitem id="nt-schemaVersion"/>
<sitem id="nt-selector"/>
<sitem id="nt-targetNamespace"/>
<sitem id="nt-typeRestr"/>
<sitem id="nt-unique"/>
<sitem id="nt-xmlSchemaRef"/>
</slist>
<p>We use the terms <emph>schema</emph> and
<emph>type definition</emph> and perhaps others in more careful way than has been the case
heretofore, reserving them for abstract datatypes with content as per the
abstract syntax, as opposed to XML elements per the concrete syntax.  This
change will have to be reflected upwards in due course.</p>
</note>
<p>We approach the definition of schema validity one step at a time. In the
definitions below we deal primarily in terms of information sets, rather than
the documents which give rise to them: see <bibref ref="ref-xmlinfo"/> for
definitions of <pt>XML information set</pt> and <pt>information item</pt>.
Please note that the formal definitions below are explicitly <emph>not</emph>
couched in processing terms: they describe properties of an information set,
but do <emph>not</emph> tell you how to check an information set to see if it
has those properties.</p>
 <p>Schema-validity is first and foremost a property of element information
items with respect to type definitions and schemas.  This recommendation does not cover
all aspects of how the type definitions and schemas are identified, but it
<emph>does</emph> specify quite carefully what it means to be schema-valid once
you've got them.</p>
 <p>First we define our terms:</p>
 <p><termdef term="EII" id="fd-EII">An <term>EII</term> is an
element information item from an XML information set which conforms to <bibref ref="ref-xmlinfo"/> with Namespace processing.</termdef></p>
 <p><termdef term="TNS" id="fd-TNS">A <term>TNS</term> (for Target Namespace
Set) is a set, possibly empty, of namespace names, all denoting the same namespace</termdef>.</p>
 <p><termdef term="schema" id="fd-schema">A <term>schema</term> is a set of
named type definitions and element declarations, each associated with a <termref def="fd-TNS">TNS</termref></termdef>.</p>
 <p><termdef id="fd-type-def" term="type definition">A <term>type
definition</term> is a <termref def="fd-TNS">TNS</termref> and either a complex <term>type definition</term> as defined by the <nt def="nt-typeDefn">typeDefn</nt> production or a simple <term>type definition</term> as defined by the <nt def="nt-datatypeDefn">datatypeDefn</nt> production</termdef>.</p>
 <p><termdef term="schema-valid" id="fd-schema-valid">An <termref def="fd-EII">EII</termref> is <term>schema-valid</term> with respect to a <termref def="fd-type-def">type definition</termref> and a set of <termref def="fd-schema">schemas</termref> if and only if</termdef>:
 <ulist>
  <item>
   <p>The <termref def="fd-type-def">type definition</termref> is simple
and</p>
  </item>
  <item><p>the <termref def="fd-EII">EII</termref>'s attribute set is empty and</p></item>
  <item>
   <p>the <termref def="fd-EII">EII</termref>'s content list contains no element information items and</p>
  </item>
  <item>
   <p>the string formed by concatenating the characters of each of the
character information items in the <termref def="fd-EII">EII</termref>'s content list, if any, or else the
empty string, is an <termref def="fd-stype-instance">instance</termref> of the
<termref def="fd-effective-stype">effective stype</termref> defined by
the simple <termref def="fd-type-def">type definition</termref>'s
<nt def="nt-datatypeDefn">datatypeDefn</nt> with respect to the set of
<termref def="fd-schema">schemas</termref>.</p>
  </item>
 </ulist>
 or
 <ulist>
  <item><p>The <termref def="fd-type-def">type definition</termref> is complex
(use the name <B>ECT</B> for the <termref def="fd-effective-ctype">effective ctype</termref> as defined by
the complex <termref def="fd-type-def">type definition</termref>'s
<nt def="nt-typeDefn">typeDefn</nt> with respect to the set of
<termref def="fd-schema">schemas</termref>) and</p></item>
  <item><p>the <termref def="fd-EII">EII</termref>'s attribute set is an
instance of <B>ECT</B>'s <termref def="fd-attr-set">attribute set</termref> and</p></item>
  <item><p>the sequence of information items consisting of the element
information items and character
information items in the <termref def="fd-EII">EII</termref>'s content list is
an instance of <B>ECT</B>'s <termref def="fd-content-type">content
type</termref> with respect to the <termref def="fd-type-def">type definition</termref>'s <termref def="fd-TNS">TNS</termref>
and the set of
<termref def="fd-schema">schemas</termref>.</p></item>
 </ulist>
 </p>
 <p><termdef id="fd-effective-stype" term="effective stype">The
<term>effective stype</term> of a <nt def="nt-datatypeDefn">datatypeDefn</nt> with respect to a set of
<termref def="fd-schema">schemas</termref> is [TBFI]</termdef>.</p>
 <p><termdef id="fd-stype-instance" term="instance">A string is an
<term>instance</term> of an <termref def="fd-effective-stype">effective
stype</termref> if and only if [TBFI]</termdef></p>
 <p><termdef id="fd-effective-ctype" term="effective ctype">The
<term>effective ctype</term> of a <nt def="nt-typeDefn">typeDefn</nt> with respect to a set of
<termref def="fd-schema">schemas</termref> is [TBFI]</termdef>.  <termdef id="fd-attr-set" term="attribute set">We refer to the set of all attribute declarations in an <termref def="fd-effective-ctype">effective
ctype</termref> as its <term>attribute set</term></termdef>.  <termdef id="fd-content-type" term="content type">We refer to the simple type or content model in an <termref def="fd-effective-ctype">effective
ctype</termref> as its <term>content type</term></termdef></p>
 <p><termdef id="fd-ctype-attr-instance" term="instance">A sequence of element
and
information items is an
<term>instance</term> of an <termref def="fd-effective-ctype">effective
ctype</termref>'s <termref def="fd-content-type">content type</termref> with
respect to a <termref def="fd-TNS">TNS</termref> and a set of
<termref def="fd-schema">schemas</termref> if and only if [TBFI]</termdef></p>
 <ednote>
<edtext>The formal nature of a complex type is slightly different to that of a
simple type.  A simple type is a 3-tuple of value space, lexical space and
facets.  A value space is a (possibly infinite) set of values, a lexical space
is a (possibly infinite) set of strings.  A complex type is a (possibly
infinite) set of element information items.  These items form equivalence
classes as a result of the optionality of some properties of information items:
a pair of information items whose required properties are equivalent are
themselves equivalent.  A complex type is defined by a set of constraints which
must be satisfied by every member of that type.</edtext>
</ednote>
 <ednote>
<edtext>We can either think in terms of shallow validity, which only requires a
type definition, and checks that all attribute II and daughter EII names are as
they should be, and full (recursive) validity in which the types of those
attribute IIs and daughter EIIs are also checked.  Alas because of element
references in content models the schema set parameterises BOTH of those, I was
hoping shallow was just a matter for the type. . .</edtext>
</ednote>
 </stale>
<stale><p>First we have to get to the schema(s) involved. This is slightly tricky, as
not all namespace declarations will resolve to schemas, and not everything that
purports to be a schema will be one.</p>
<p><termdef id="key-nominate" term="nominate">A URI is said to
<term>nominate</term> a schema if it resolves to an element item in the
information set of a well-formed XML 1.0 document whose local name is
<code>schema</code> and whose namespace item's URI identifies either
</termdef></p>
<p>
<ulist>
<item>
<p>this specification or one of its successors,</p>
</item>
<item>
<p>the XML Schema 1.0 DTD (or the equivalent DTD from a successor to this
specification)</p>
</item>
</ulist> or
<ulist>
<item>
<p>The XML Schema 1.0 schema (or the equivalent schema from a successor to this
specification).</p>
</item>
</ulist></p>
<p><termdef id="key-suc-res" term="resolve successfully">A URI is said to
<term>resolve successfully</term> to a schema if it <termref def="key-nominate">nominates</termref> a schema, and the element item it
resolves to represents an XML schema, that is: </termdef></p>
<p>
<ulist>
<item>
<p>If it were the document element item of an information set corresponding to
an XML document whose DOCTYPE identified the XML Schema 1.0 DTD (or the
equivalent DTD from a successor to this specification) as its DTD, that
document would be valid per XML 1.0; </p>
</item>
<item>
<p>it and its descendants satisfy all <termref def="gloss-cos">Constraints on
Schemas</termref> stated in this specification. </p>
</item>
</ulist></p>
<p><termdef id="key-schema-ready" term="schema-ready">An element item is
<term>schema-ready</term> if the URI of any of its namespace declaration items
which <termref def="key-nominate">nominates</termref> a schema
<termref def="key-suc-res">resolves successfully</termref> to a
schema.</termdef></p>
<p><termdef id="key-doc-schema-ready" term="schema-ready">A document is
<term>schema-ready</term> if every element item anywhere in its information set
is <termref def="key-schema-ready">schema-ready</termref>.</termdef></p>
<p>Note that this means that documents with <emph>no</emph> namespace
declarations, or only namespace declarations which do not
<termref def="key-nominate"> nominate</termref> schemas are none-the-less
<termref def="key-doc-schema-ready">schema-ready</termref>.</p>
<p><termdef id="key-schema-governed" term="schema-governed">We say an element
item is <term>schema-governed</term> if its name is in a namespace, and the URI
of the information item for that namespace <termref def="key-suc-res">resolves
successfully</termref> to a schema.</termdef></p>
<p><termdef id="key-schema-root" term="schema root">We use the name
<term>schema root</term> for any element item which is
<termref def="key-schema-governed">schema-governed</termref> and which is
either</termdef>
<ulist>
<item>
<p>the document element</p>
</item>
</ulist> or
<ulist>
<item>
<p>the daughter of an element which is <emph>not</emph>
<termref def="key-schema-governed">schema-governed</termref>.</p>
</item>
</ulist> </p>
 <ednote>
<edtext>All this has to go, now that we don't provide for entity definition or
substitution.</edtext></ednote>
<p>The provision within &XSP1; of a mechanism for defining
<termref def="gloss-parsedEntity">parsed entities</termref> presents problems
for the relationship between schema-validity and XML 1.0 well-formedness, since
references to entities declared only in a schema are undefined from the XML 1.0
perspective. Strictly speaking, a well-formed XML document may contain
references to undefined entities only if it is declared as
<code>standalone="no"</code> and contains either an external subset
or one or more references to external parameter entities in their internal
subset. We get around this by <termdef id="key-nearly-wf" term="nearly well-formed">defining a <term>nearly well-formed</term> XML
document to be one which either is well-formed per XML 1.0, or which fails to
be well-formed only because of undefined general entity references, but which
would be well-formed if it were <code>standalone="no"</code> and
identified an external subset.</termdef> We consider this justified on the
grounds that the use of a namespace declaration which refers to a schema
functions rather as an external subset, and from the XML 1.0 perspective such a
reference almost of necessity renders the document non-standalone when
schema-validation is applied.</p>
<p> <termdef id="key-epic" term="string-infoset-in-context">We use the name
<term>string-infoset-in-context</term> for the XML 1.0 information set items
arising from the interpretation of a string in the context of a particular
point in an XML 1.0 information set.</termdef></p>
<p><termdef id="key-effective-item" term="effective element item">The
<term>effective element item</term> of an element item (call this <pt>OEI</pt>)
is an element item whose</termdef>
<ulist>
<item>
<p>name and namespace items (if any) are the same as those of <pt>OEI</pt>;</p>

</item>
<item>
<p>attribute item names and namespace items (if any) are the same as those of
<pt>OEI</pt>;</p>
</item>
<item>
<p>attribute value items are the respective value items of <pt>OEI</pt>'s
attribute items with the <termref def="key-epic">string-infoset-in-context</termref> of the declared expansion of
every <termref def="gloss-RUE">RUE</termref> in those values replacing those
<termref def="gloss-RUE">RUEs</termref>; </p>
</item>
<item>
<p>children based on the children of <pt>OEI</pt> as follows:
<ulist>
<item>
<p>Character, PI and comment child items carried over unchanged;</p>
</item>
<item>
<p>Element child items replaced with their respective
<termref def="key-effective-item">effective element items</termref>;</p>
</item>
<item>
<p><termref def="gloss-RUE">RUE</termref> child items replaced by the
<termref def="key-epic">string-infoset-in-context</termref> of their declared
expansions, with any <termref def="gloss-RUE">RUE</termref> or element item in
that <termref def="key-epic">string-infoset-in-context</termref> itself being
recursively replaced per this or the above definition respectively.</p>
</item>
</ulist></p>
</item>
</ulist></p>
<p>The <specref ref="svc-embedded-RUE"/> <termref def="gloss-cvc">Schema Validity Constraint</termref> obtains.</p>
<p>The <specref ref="svc-unqual-RUE"/> <termref def="gloss-cvc">Schema Validity Constraint</termref> obtains.</p>
<p>Note that the above constraints and definition mean that in error-free
documents, <emph>all</emph> element items, even ones which are not
<termref def="key-schema-governed">schema-governed</termref>, have well-defined
<termref def="key-effective-item">effective element items</termref>.</p>
<p><termdef id="key-schema-valid" term="schema-valid">A document is
<term>schema-valid</term> if and only if:</termdef></p>
<olist>
<item>
<p>It is <termref def="key-nearly-wf">nearly-well-formed</termref>; </p>
</item>
<item>
<p>It is <termref def="key-doc-schema-ready">schema-ready</termref>;</p>
</item>
<item>
<p>Every <termref def="key-schema-root">schema root</termref> element item in
the set of element items consisting of the <termref def="key-effective-item">effective element item</termref> of the document
element item in the document's information set and all the element items
anywhere inside that <termref def="key-effective-item">effective element
item</termref>, is <termref def="key-ind-valid">independently valid</termref>.
</p>
</item>
</olist>
<note>
<p>The validity of all other <termref def="key-schema-governed">schema-governed</termref> element items follows from
(3) above by the recursive nature of the <termref def="gloss-cvc">Schema-validity Constraint</termref> referenced there.</p>
</note>
<note>
<p>It is intentional that the above definition labels as
<termref def="key-schema-valid">schema-valid</termref> a document with
<emph>no</emph> namespace declarations or with only namespace declarations
which do <emph>not</emph> <termref def="key-nominate">nominate</termref>
schemas.</p>
</note>
<p>Note that there is no requirement that the <termref def="key-schema-root">schema root</termref> mentioned above be the root of its
document, or that schemas be the roots of <emph>their</emph> documents, or that
schema and <termref def="key-schema-root">schema root</termref> be in
<emph>different</emph> documents. Accordingly, it is possible for a single
<termref def="key-schema-valid">schema-valid</termref> document to contain both
a schema and the material which it validates.</p>
<p>The interaction between XML 1.0 DTDs and XML Schemas is complex but clear:
</p>
<ulist>
<item>
<p>A document may be well-formed, (DTD) invalid and schema-valid all at the
same time; </p>
</item>
<item>
<p>If document has a DTD which includes parsed entity declarations, the
schema-validation process may well apply to material whose original home was in
those entities (internal or external); </p>
</item>
<item>
<p>Where or not a document has a DTD, the (XML 1.0) infoset we're
schema-validating may well include 'RUE items', that is, references
to unknown entities, unknown, that is, as far as the definitions of XML 1.0 are
concerned. As long as the document's schema provides declarations
for these 'undefined' entities, it still may be
<termref def="key-schema-valid">schema-valid</termref>. </p>
</item>
</ulist>
<note>
<p>The above is silent on whether schema-valid documents must be
Namespace-conforming. </p>
</note>
<p><termdef term="augmented information set" id="key-aug-infoset">The
<term>augmented information set</term> of a <termref def="key-schema-valid">schema-valid</termref> document is the information set
rooted in the <termref def="key-effective-item">effective element
item</termref> of its document element, augmented by all the information items
described in any <termref def="gloss-sic">Schema Information Set
Contributions</termref> which apply to any information items anywhere within
it.</termdef></p></stale>
</div2>
 <div2 id="conformance-missing">
  <head>Missing Sub-components</head>
  <ednote>
 <edtext>Something about uniform treatment of missing sub-components needed.</edtext>
</ednote>
 </div2>
<div2 id="conformance-details">
 <head>Detailed Validity Constraints on Schema Components *</head>
 <div3 id="coss-attribute">
  <head>Attribute Declaration Constraints</head>
  <p>All attribute declarations (see <specref ref="Attribute_Declaration_details"/>) must satisfy the following constraints.</p>
  <constraintnote type="cos" id="a-props-correct">
   <head>Attribute Declaration Properties Correct</head>
   <olist>
    <item>
     <p>The values of the properties of an attribute declaration must be as described in
the property tableau in
<specref ref="Attribute_Declaration_details"/>, modulo the impact of <specref ref="conformance-missing"/>;</p>
    </item>
    <item>
     <p><propref ref="a-min_occurs"/> must not be <code>1</code> if <propref ref="a-max_occurs"/> is <code>0</code>;</p>
    </item>
    <item>
     <p>if there is a <propref ref="a-value_constraint"/>, its string must be
schema-valid with respect to the <propref ref="a-simple_type_definition"/>.</p>
    </item>
   </olist>

  </constraintnote>
  <constraintnote type="cos" id="no-xmlns">
   <head><code>xmlns</code> Not Allowed</head>
   <p>The <propref ref="a-name"/> of an attribute declaration must not match <code>xmlns</code>.</p>
<note>
<p>The <propref ref="a-name"/> of an attribute is an <termref def="gloss-NCName">NCName</termref>, which implicitly
prohibits namespace declarations of the form <code>xmlns:*</code></p>
</note>
  </constraintnote>
 </div3>
 <div3 id="coss-element">
  <head>Element Declaration Constraints</head>
  <constraintnote type="cos" id="e-props-correct">
   <head>Element Declaration Properties Correct</head>
   <p>All element declarations (see <specref ref="Element_Declaration_details"/>) must satisfy the following constraint:</p>
   <olist>
    <item>
     <p>The values of the properties of an element declaration must be 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 ref="e-value_constraint"/>, its string must be
schema-valid with respect to the <propref ref="type_definition"/> as defined in <specref ref="cos-valid-default"/>;</p>
    </item>
    <item>
     <p>If there is an <propref ref="class_exemplar"/>, the <propref ref="type_definition"/> of the element declaration must
be validly derived from the <propref ref="type_definition"/> of the <propref ref="class_exemplar"/> given the value of the <propref ref="e-final"/> of the <propref ref="class_exemplar"/>, as defined in <specref ref="cos-ct-derived-ok"/> (if the <propref ref="type_definition"/> is complex) or <specref ref="cos-st-derived-ok"/> (if the <propref ref="type_definition"/> is simple).
     </p>
    </item>
   </olist>
  </constraintnote>
  <p>The following constraint notes define relations appealed to elsewhere in this specification.</p>
  <constraintnote id="cos-valid-default" type="cos">
   <head>Element Default Valid (Immediate)</head>
   <p>A string is a valid default with respect to a type definition if
    <olist>
     <item>
      <p>The type definition is a simple type definition, and the string is
schema-valid with respect to that definition as defined by <specref ref="cvc-simple-type"/></p>
     </item>
    </olist>
    or
    <olist>
     <item>
      <p>The type definition is a complex type definition whose <propref ref="content_type"/> is a simple type definition, and the string is
schema-valid with respect to that simple type definition as defined by <specref ref="cvc-simple-type"/></p>
     </item>
    </olist>
    or
    <olist><item>
      <p>The type definition is a complex type definition whose <propref ref="content_type"/> is <pt>mixed</pt>, and the <propref ref="content_type"/>'s particle is <termref def="cd-emptiable">emptiable</termref> as defined by <specref ref="cos-group-emptiable"/>.</p>
     </item></olist>
   </p>
  </constraintnote>
  <constraintnote id="cos-equiv-derived-ok-rec" type="cos">
   <head>Equivalence Class OK (Transitive)</head>
   <p>An element declaration together with an blocking constraint (a subset of
<code>{}</code>, the value of a <propref ref="p-exact"/>) is validly equivalent
to another element declaration if: watch this space</p>
  </constraintnote>
 </div3>
 <div3 id="coss-&constraint;">
  <head>&Constraint; Definition Constraints</head>
 </div3>
 <div3 id="coss-attrGroup">
  <head>Attribute Group Definition Constraints</head>

    <constraintnote type="cos" id="agd-cos-unique">
    <head>Unique Attribute Declaration (Group)</head>
    <p>Two distinct members of an attribute group's <propref ref="ag-attribute_declarations"/> may not contain both <propref ref="a-name"/>s which match and <propref ref="a-target_namespace"/>s which are identical.</p>
  </constraintnote>
  <constraintnote id="cos-aw-intersect" type="cos">
   <head>Attribute Wildcard Intersection</head>
   <p>An attribute wildcard value is the intensional intersection of two or
more other such values if [based on the obvious interpretation of <pt>any</pt> as the
universal set, <pt>not</pt> as set complement].</p>
  </constraintnote>
 </div3>
 <div3 id="coss-wildcard">
  <head>Wildcard Constraints</head>
 </div3>
 <div3 id="coss-groupDef">
  <head>Model Group Definition Constraints</head>
 </div3>
 <div3 id="coss-modelGroup">
  <head>Model Group Constraints</head>
  
</div3>
 <div3 id="coss-notation">
  <head>Notation Constraints</head>
 </div3>
 <div3 id="coss-annotation">
  <head>Annotation Constraints</head>
 </div3>
 <div3 id="coss-particle">
  <head>Particle Constraints</head>
  <constraintnote type="cos" id="p-props-correct">
   <head></head>
   <p>If <propref ref="p-max_occurs"/> is not <code>*</code>, that is, it has a
numeric value, then
    <olist>
     <item>
     <p><propref ref="p-min_occurs"/> must not be greater than <propref ref="p-max_occurs"/>;</p>
    </item>
    <item>
     <p><propref ref="p-max_occurs"/> must greater than or equal to 1;</p>
    </item>
    </olist>
   </p>
  </constraintnote>
  <constraintnote type="cos" id="cos-modelgroup">
   <head>Particle Valid</head>
   <p><termdef id="cd-model-extension" term="valid extension">watch this space</termdef>
   <termdef id="cd-model-restriction" term="valid restriction">watch this space</termdef></p>
  </constraintnote>

 <constraintnote id="cos-group-emptiable" type="cos">
  <head>Particle Emptiable</head>
  <p><termdef id="cd-emptiable" term="emptiable">watch this space</termdef></p>
 </constraintnote>
 </div3>
 <div3 id="coss-ct">
  <head>Complex Type Definition Constraints</head>
  <constraintnote type="cos" id="cos-ct-extends">
     <head>Derivation Valid (Extension)</head>
     <p>If the <propref ref="derivation_method"/> is <pt>extension</pt>:
      <ulist>
       <item>
        <p>If the <propref ref="ct-base_type_definition"/> is a complex type
definition:
         <olist>
          <item>
           <p>The <propref ref="ct-final"/> of the <propref ref="ct-base_type_definition"/> must not contain <pt>extension</pt></p>
          </item>
          <item>
           <p>Its <propref ref="ct-attribute_declarations"/> must be a subset
of the <propref ref="ct-attribute_declarations"/> of the complex type
definition itself, that is, for every attribute declaration in the
<propref ref="ct-attribute_declarations"/> of the
<propref ref="ct-base_type_definition"/>, there must be an attribute
declaration in the <propref ref="ct-attribute_declarations"/> of the complex
type definition itself with the same <propref ref="a-name"/>,
<propref ref="a-target_namespace"/> and
<propref ref="a-simple_type_definition"/>;</p>
          </item>
          <item>
           <p>The <propref ref="content_type"/> of the complex type itself
must not be a simple type definition;</p>
          </item>
          <item>
           <p>Either the <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/> must be empty, or the <propref ref="content_type"/> of the complex type definition itself must specify a particle and</p>
           <ulist>
            <item>
             <p>both <propref ref="content_type"/>s must be <pt>mixed</pt>
or both must be <pt>element-only</pt>;</p>
            </item>
           </ulist>
           <p>and</p>
           <ulist>
            <item>
             <p>the particle of the complex type definition must be a
<termref def="cd-model-extension">valid extension</termref> of the <propref ref="ct-base_type_definition"/>'s particle, as defined in <specref ref="cos-modelgroup"/>.</p>
            </item>
           </ulist>
           <ednote>
            <edtext>Should we allow mixed as an extension of e-o if e-o is a disjunction?</edtext>
           </ednote>
          </item>
          </olist>
        </p>
       </item>
       <item>
        <p>If the <propref ref="ct-base_type_definition"/> is a simple type
definition, the <propref ref="content_type"/> must be the same simple type
definition.</p>
        <ednote>
         <edtext>We do not currently provide for a schema author to foreclose
deriving a complex type from a simple type.  Should we?</edtext>
        </ednote>
       </item>
      </ulist>
      <termdef id="cd-ct-extension" term="valid extension">If this
constraint holds of a complex type definition, we say it is a <term>valid
extension</term> of its <propref ref="ct-base_type_definition"/>.</termdef>
     </p>
    </constraintnote>
    <constraintnote type="cos" id="derivation-ok-restriction">
    <head>Derivation Valid (Restriction, Complex)</head>
    <p>If the <propref ref="derivation_method"/> is <pt>restriction</pt>:
     <ulist>
      <item>
       <p>The <propref ref="ct-base_type_definition"/> must be a complex type
definition whose <propref ref="ct-final"/> does not contain <pt>restriction</pt>;</p>
      </item>
      <item>
       <p>For each attribute declaration in the <propref ref="ct-attribute_declarations"/>:
        <ulist>
         <item>
          <p> there must be an attribute declaration with the same <propref ref="a-name"/> and <propref ref="a-target_namespace"/> in the
<propref ref="ct-attribute_declarations"/> of the <propref ref="ct-base_type_definition"/> of whose <propref ref="a-simple_type_definition"/> the attribute in question's <propref ref="a-simple_type_definition"/> must be a <termref def="cd-st-restriction">valid restriction</termref> as defined in
<specref ref="cos-st-restricts"/>.</p>
         </item>
        </ulist>
        or
        <ulist>
         <item>
          <p>the <propref ref="ct-base_type_definition"/> must have an <propref ref="ct-attribute_wildcard"/> and the <propref ref="a-target_namespace"/> of the attribute in question must be one of its <termref def="cd-allowed-ns">allowed namespace</termref>s, as defined in <specref ref="cvc-wildcard"/>.</p>
         </item>
        </ulist>
       </p>
      </item>
      <item>
       <p>Either
        <ulist>
         <item>
          <p>the <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/> is a simple type
definition and the <propref ref="content_type"/> of the complex type itself
is a simple type definition which is a <termref def="cd-st-restriction">valid
restriction</termref> thereof as defined in <specref ref="cos-st-restricts"/></p>
         </item>
        </ulist>
        or
        <ulist>
         <item>
          <p>The <propref ref="content_type"/> of the complex type itself
is <pt>empty</pt> and either the <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/> is also <pt>empty</pt> or has a particle which is <termref def="cd-emptiable">emptiable</termref> as defined in <specref ref="cos-group-emptiable"/>.</p>
         </item>
        </ulist>
        or
        <ulist>
         <item>
          <p>The <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/> is <pt>mixed</pt> or the <propref ref="content_type"/> of the complex type definition itself is <pt>element-only</pt>; the particle of the complex type definition itself is a <termref def="cd-model-restriction">valid restriction</termref> of the particle of the <propref ref="content_type"/> of the <propref ref="ct-base_type_definition"/> as defined in <specref ref="cos-modelgroup"/>.</p>
         </item>
        </ulist>
        </p>
      </item>

</ulist> <termdef id="cd-ct-restriction" term="valid restriction">If this
constraint holds of a complex type definition, we say it is a <term>valid
restriction</term> of its <propref ref="ct-base_type_definition"/>.</termdef>
  </p>
  </constraintnote>
    <note>
     <p>Any complex type definition constructed from an XML representation as
specified in <specref ref="declare-type"/> is guaranteed to satisfy whichever
of the above two constraints is appropriate given the nature of its <propref ref="ct-base_type_definition"/>.</p>
    </note>
  <constraintnote id="cos-ct-derived-ok" type="cos">
   <head>Type Derivation OK (Complex)</head>
   <p>A complex type definition is validly derived from a type definition given
a subset of <code>{??fix this??}</code> if:
    <olist>
     <item>
      <p>The are the same type definition</p>
     </item>
    </olist>
or watch this space.</p>
  </constraintnote>
 </div3>
 <div3 id="coss-st">
  <head>Simple Type Definition Constraints</head>
  <constraintnote type="cos" id="cos-st-restricts">
<head>Derivation Valid (Restriction, Simple)</head>
<p><termdef id="cd-st-restriction" term="valid
restriction">watch this space</termdef></p>
</constraintnote>
    <constraintnote id="cos-st-derived-ok" type="cos">
   <head>Type Derivation OK (Simple)</head>
   <p>A simple type definition is validly derived from a simple type definition given
a subset of <code>{??fix this??}</code> if:
    <olist>
     <item>
      <p>The are the same type definition</p>
     </item>
    </olist>
    or
    watch this space.</p>
  </constraintnote>
 </div3>
 <div3>
  <head>The Schema *</head>
<stale>
  <constraintnote type="cos" id="cos-unique">
    <head>Unique Definition</head>
    <p>The same <termref def="gloss-NCName">NCName</termref> must not appear in
      two definitions or declarations of the same type.</p>
  </constraintnote></stale>
 </div3>
 <div3>
  <head>References to Schema Components *</head>
<stale>
  <constraintnote type="cos" id="cos-cons-import">
  <head>Consistent Import</head>
  <p>The URI for the namespace determined by a <termref def="gloss-QName">QName</termref> used to reference a schema component must either be the <nt def="nt-targetNamespace">targetNamespace</nt> URI of the containing schema, or
    must be declared in an <specref ref="composition-schemaImport"/> of the current
    schema.</p>
</constraintnote>

  <p role="fdv"><termdef id="key-identify" term="identify">A <B>...Ref</B>
  <term>identifies</term> a <B>...Spec</B> provided there is a definition or
  declaration of that <B>...Spec</B> in the appropriate schema whose
  <termref def="gloss-NCName">NCName</termref> matches the
  <termref def="gloss-NCName">NCName</termref> of the <B>...Ref</B>'s
  <B>...Name</B>. If there is no <!--<nt def="nt-schemaRef">schemaRef</nt>--> in the
  <B>...Name</B>, the appropriate schema is the current schema or a schema it
  <termref def="key-eventually-include">eventually includes</termref>; if there
  is a <!--<nt def="nt-schemaRef">schemaRef</nt>-->, the URI contained in or abbreviated
  by it must <termref def="key-suc-res">resolve successfully</termref> to a
  schema, which is then the appropriate schema</termdef>.</p></stale>
</div3>
 <div3>
  <head>Types, Elements and Attributes *</head>
  <div4>
   <head>Datatypes *</head>
<stale>
   <p role="fdv"><termdef id="key-satisfy-dt" term="dt-satisfy">A string (possibly empty)
  <term>dt-satisfies</term> a <nt def="nt-datatypeSpec">datatypeSpec</nt> and an
  optional <nt def="nt-datatypeRestr">datatypeRestriction</nt> if</termdef>
<ulist>
  <item>
    <p>The string is a valid instance of the datatype defined by that
      <nt def="nt-datatypeSpec">datatypeSpec</nt>, as restricted by the
      <nt def="nt-datatypeRestr">datatypeRestriction</nt>'s <nt def="nt-facet">facet</nt>s (if present) (see &XSP2;
      for a definition of when a string is a valid instance of a (possibly
      restricted) <nt def="nt-datatypeSpec">datatypeSpec</nt>); </p>
  </item>
</ulist>
and
<ulist>
  <item>
    <p>If there is a <nt def="nt-datatypeRestr">datatypeRestriction</nt> and it
      includes a <pt>fixed</pt>, the string matches that fixed value. </p>
  </item>
</ulist>
</p>
   <constraintnote type="sic" id="sic-datatype">
  <head>Datatype Info</head>
  <p>When a string <termref def="key-satisfy-dt">dt-satisfies</termref> a
    <nt def="nt-datatypeRef">datatypeRef</nt> and an optional
    <nt def="nt-datatypeRestr">datatypeRestriction</nt>, the containing attribute or
    element information item will be augmented to indicate the
    <nt def="nt-datatypeSpec">datatypeSpec</nt> and the <nt def="nt-facet">facet</nt>s (if any) which it satisfied.</p>
</constraintnote></stale>
</div4>
  <div4>
   <head>Type Definition *</head>
<stale>
   <constraintnote type="cos" id="cos-attrg-unique">
<head>Attribute Group Unique</head>
<p>The same <nt def="nt-attributeGroupDefn">attributeGroupDefn</nt> must not be
  referenced by two or more <nt def="nt-attributeGroupRef">attributeGroupRef</nt>s in the
  same <nt def="nt-typeSpec">typeSpec</nt>.</p>
</constraintnote>
  <constraintnote type="cos" id="cos-attrg-ided">
<head>Attribute Group Identified</head>
<p>Every <nt def="nt-attributeGroupRef">attributeGroupRef</nt> in an
  <nt def="nt-typeSpec">typeSpec</nt> must <termref def="key-identify">identify</termref> an <nt def="nt-attributeGroupDefn">attributeGroupDefn</nt>.</p>
</constraintnote>
   <p role="fdv"><termdef id="key-attr-decl-set" term="attribute declaration set">The
<term>attribute declaration set</term> of an <nt def="nt-typeSpec">typeSpec</nt> consists of all its
effective(stale) <nt def="nt-attrDecl">attributes</nt> together with all the <nt def="nt-attrDecl">attributes</nt> contained in the <nt def="nt-attributeGroupDefn">attribute groups</nt> <termref def="key-identify">identified</termref> by any <nt def="nt-attributeGroupRef">attributeGroupRefs</nt> it contains.</termdef></p>
  <p role="fdv"><termdef id="key-attr-fullname" term="full name of an attribute declaration">The <term>full name</term> of an
<nt def="nt-attrDecl">attribute</nt> in an <termref def="key-attr-decl-set">attribute declaration set</termref> is its
<termref def="gloss-NCName">NCName</termref> plus its <!--<nt def="nt-schemaName">schemaName</nt>-->, i.e. if it appeared directly in the
<nt def="nt-typeSpec">typeSpec</nt>, the empty string, if it was
inherited or if it came from an
<nt def="nt-attributeGroupDefn">attribute group</nt>, then the <!--<nt def="nt-schemaName">schemaName</nt> from the <nt def="nt-schemaRef">schemaRef</nt>--> which <termref def="key-identify">identified</termref> the relevant <nt def="nt-typeSpec">typeSpec</nt> or <nt def="nt-attributeGroupDefn">attribute group</nt> respectively, if any, otherwise the
empty string.</termdef></p>
  <constraintnote type="cos" id="cos-attr-unique">
<head>Attribute Locally Unique</head>
<p>The same <termref def="key-attr-fullname">full name</termref> must not
  appear more than once in any <nt def="nt-typeSpec">typeSpec</nt>'s
  <termref def="key-attr-decl-set">attribute declaration set</termref>.</p>
</constraintnote>
<p role="fdv"><termdef id="key-satisfy-as" term="arch-satisfy">An element item
<term>a-satisfies</term> an <nt def="nt-typeSpec">typeSpec</nt> if
the element item's attribute items taken together as a set
<termref def="key-satisfy-attrs">attrs-satisfy</termref> the
<nt def="nt-typeSpec">typeSpec</nt>'s
<termref def="key-attr-decl-set">attribute declaration set</termref>, and
either </termdef>
<ulist>
<item>
  <p>The <nt def="nt-typeSpec">typeSpec</nt>'s
    <nt def="nt-contentType">contentType</nt> is a <nt def="nt-datatypeRef">datatypeRef</nt>, the <nt def="nt-datatypeRef">datatypeRef</nt> <termref def="key-identify">identifies</termref> a <nt def="nt-datatypeSpec">datatypeSpec</nt>, the element item contains only
    comment, processing instruction and character information items and the string
    formed by concatenating the characters of each of the character information
    item children, if any, or else the empty string, <termref def="key-satisfy-dt">dt-satisfies</termref> that <nt def="nt-datatypeSpec">datatypeSpec</nt> as qualified by the
    <nt def="nt-datatypeRef">datatypeRef</nt>'s <nt def="nt-datatypeRestr">datatypeRestriction</nt> if any;</p>
</item>
</ulist>
or
<ulist>
<item>
  <p>the <nt def="nt-contentType">contentType</nt> is a
    <nt def="nt-contentModel">contentModel</nt>, and the sequence of character and
    element items contained by the element item <termref def="key-satisfy-cm">model-satisfies</termref> its effective(stale) <nt def="nt-contentModel">contentModel</nt>.</p>
</item>
</ulist>
</p>
  <constraintnote type="sic" id="sic-type">
<head>Type Info</head>
<p>When an element item <termref def="key-satisfy-as">a-satisfies</termref> a
  <nt def="nt-typeSpec">typeSpec</nt>, that element information item
  will be augmented to indicate the <nt def="nt-typeSpec">typeSpec</nt>
  which it satisfied.</p>
</constraintnote></stale>
  </div4>
  <div4>
   <head>Attribute Declaration *</head>
<stale>
  <p role="fdv"><termdef id="key-attr-satisfy" term="attr-satisfy">An attribute item
<term>attr-satisfies</term> an <nt def="nt-attrDecl">attribute</nt> if
</termdef>
<ulist>
<item>
<p>The <nt def="nt-attrDecl">attribute</nt> contains no <nt def="nt-datatypeRef">datatypeRef</nt> and the attribute item's value
string <termref def="key-satisfy-dt">dt-satisfies</termref> the default
<nt def="nt-datatypeSpec">datatypeSpec</nt> for attributes</p>
</item>
</ulist>
or
<ulist>
<item>
<p>the <nt def="nt-attrDecl">attribute</nt>'s <nt def="nt-datatypeRef">datatypeRef</nt> <termref def="key-identify">identifies</termref> a <nt def="nt-datatypeSpec">datatypeSpec</nt> and the attribute item's value
string <termref def="key-satisfy-dt">dt-satisfies</termref> that
<nt def="nt-datatypeSpec">datatypeSpec</nt> as qualified by the
<nt def="nt-datatypeRef">datatypeRef</nt>'s <nt def="nt-datatypeRestr">datatypeRestriction</nt> if any</p>
</item>
</ulist>
where the attribute item's value consists of only character information
items and by its "value string" is meant the string formed by
concatenating the characters of each of those character information item
children, if any, or else the empty string.
</p>
  <p role="fdv"><termdef id="key-satisfy-attrs" term="attrs-satisfy">The attribute items of
an element item <term>attrs-satisfy</term> an <termref def="key-attr-decl-set">attribute declaration set</termref> if</termdef>
<ulist>
<item>
<p><B>1)</B> for each attribute item either</p>
<ulist>
<item>
<p><B>1a) </B>there is an <nt def="nt-attrDecl">attribute</nt> in the
  <termref def="key-attr-decl-set">attribute declaration set</termref> whose
  <termref def="key-attr-fullname">full name</termref> consists of an
  <termref def="gloss-NCName">NCName</termref> which matches the attribute
  item's name and either</p>
<ulist>
  <item>
    <p><B>1a1) </B>the attribute item has no namespace and the
      <nt def="nt-attrDecl">attribute</nt>'s <termref def="key-attr-fullname">full name</termref> has no <!--<nt def="nt-schemaName">schemaName</nt>--></p>
  </item>
</ulist>
<p>or</p>
<ulist>
  <item>
    <p><B>1a2) </B>the attribute item's namespace and the
      <nt def="nt-attrDecl">attribute</nt>'s <termref def="key-attr-fullname">full name</termref>'s <!--<nt def="nt-schemaName">schemaName</nt>--> are identical</p>
  </item>
</ulist>
<p>and the attribute item <termref def="key-attr-satisfy">attr-satisfies</termref> the declaration</p>
</item>
</ulist>
<p>or</p>
<ulist>
<item>
<p><B>1b) </B>the <nt def="nt-typeSpec">typeSpec</nt> being
  <termref def="key-satisfy-as">a-satisfied</termref> by the attribute
  item's parent element item is <pt>open</pt></p>
</item>
</ulist>
</item>
</ulist>
and
<ulist>
<item>
<p><B>2) </B>every <nt def="nt-attrDecl">attribute</nt> in the
<termref def="key-attr-decl-set">attribute declaration set</termref> which is
<pt>required</pt> is used to <termref def="key-attr-satisfy">attr-satisfy</termref> an attribute item in the context
of (1a) above</p>
</item>
</ulist>
</p>
   <constraintnote type="sic" id="sic-attr-default">
<head>Attribute Value Default</head>
<p>For every <nt def="nt-attrDecl">attribute</nt> in the
<termref def="key-attr-decl-set">attribute declaration set</termref>
<emph>not</emph> used to <termref def="key-attr-satisfy">attr-satisfy</termref>
an attribute item in the context of (1a) above which has a
<nt def="nt-datatypeRef">datatypeRef</nt> which has a <pt>default</pt>, an
attribute item with the default value is added to the parent element item.</p>
</constraintnote></stale>
</div4>
  <div4>
   <head>Element Content Model *</head>
<stale>
     <p role="fdv"><termdef id="key-satisfy-cm" term="model-satisfies">A sequence of character
and element items (call this <pt>CESeq</pt>) <term>model-satisfies</term> an
effective(stale) <nt def="nt-contentModel">contentModel</nt> if</termdef>
<ulist>
<item>
<p>the sequence is empty and the effective(stale) <nt def="nt-contentModel">contentModel</nt> is <pt>empty</pt>;</p>
</item>
<item>
<p>the effective(stale)
<nt def="nt-contentModel">contentModel</nt> is <pt>any</pt> and every element
item in <pt>CESeq</pt> is <termref def="key-ind-valid">independently
valid</termref>, and for every element item in <pt>CESeq</pt> such that the
schema which its namespace item resolves to is not the current schema there is
an <nt def="nt-import">import</nt> whose <!--<nt def="nt-schemaName">schemaName</nt>--> is identical to that element item's namespace
item's <pt>URI</pt> and that <nt def="nt-import">import</nt> must either
be <pt>allElements</pt> or contain an <nt def="nt-elementRef">elementRef</nt> whose <pt>NCName</pt> matches that
element item's name;</p>
</item>
<item>
<p>the effective(stale)
<nt def="nt-contentModel">contentModel</nt> is <pt>mixed</pt>
and every element item in <pt>CESeq</pt> <termref def="key-satisfy-mixed">mixed-satisfies</termref> the
effective(stale) <pt>mixed</pt>
</p>
</item>
</ulist>
or
<ulist>
<item>
<p>the effective(stale)
<nt def="nt-contentModel">contentModel</nt> is <termref def="nt-elementOnly">elementOnly</termref> and the only character items in
<pt>CESeq</pt> are whitespace character items and the sub-sequence of
<pt>CESeq</pt> consisting of all the element items therein
<termref def="key-satisfy-eo">eo-satisfies</termref> the
effective(stale) <termref def="nt-elementOnly">elementOnly</termref>.</p>
</item>
</ulist>
</p></stale>
  </div4>
  <div4>
   <head>Mixed Content *</head>
<stale>
   <constraintnote type="cos" id="cos-et-reuse">
<head>Element Unique in Mixed</head>
<p>A given <termref def="gloss-NCName">NCName</termref> must not appear two or
more times among the <nt def="nt-elementDecl">elementDecl</nt>s and
<nt def="nt-elementRef">elementRef</nt>s with no <!--<nt def="nt-schemaRef">schemaRef</nt>s;--> a given <nt def="nt-elementName">elementName</nt> must not appear two or more times
among the <nt def="nt-elementRef">elementRef</nt>s.</p>
</constraintnote>
   <p role="fdv"><termdef id="key-satisfy-mixed" term="mixed-satisfy">An element item
<term>mixed-satisfies</term> a <pt>mixed</pt> if</termdef>
<ulist>
<item>
<p>the <pt>mixed</pt> contains an <nt def="nt-elementRef">elementRef</nt> which the element item
<termref def="key-satisfy-etr">ref-satisfies</termref></p>
</item>
</ulist>
or
<ulist>
<item>
<p>the <pt>mixed</pt> contains an <nt def="nt-elementDecl">elementDecl</nt> whose <termref def="gloss-NCName">NCName</termref> matches the element item's name, in
which case the element item must <termref def="key-satisfy-ed">e-satisfy</termref> that <nt def="nt-elementDecl">elementDecl</nt></p>
</item>
</ulist>
or
<ulist>
<item>
<p>the <nt def="nt-typeSpec">typeSpec</nt> which
effectively (stale) contains the
<pt>mixed</pt> is <pt>open</pt> and the element item is
<termref def="key-ind-valid">independently valid</termref>.</p>
</item>
</ulist>
</p></stale>
</div4>
  <div4>
   <head>Element-only Content *</head>
<stale>
   <p role="fdv"><termdef id="key-satisfy-eo" term="elementOnly-satisfy">A sequence of element
items <term>elementOnly-satisfies</term> an effective(stale) <nt def="nt-elementOnly">elementOnly</nt>
if</termdef>
<ulist>
<item>
<p>it is possible to trace out a path through the content model, obeying the
<nt def="nt-compositor">compositor</nt> and <nt def="nt-occurs">occurs</nt>
specifications and accepting each element item in the sequence with an
<nt def="nt-elementRef">elementRef</nt> or <nt def="nt-elementDecl">elementDecl</nt> in the content model. Accepting
an element item from the sequence with an <nt def="nt-elementRef">elementRef</nt> requires that it
<termref def="key-satisfy-etr">ref-satisfy</termref> that
<nt def="nt-elementRef">elementRef</nt>; accepting an element item with
an <nt def="nt-elementDecl">elementDecl</nt> requires that the
<nt def="nt-elementDecl">elementDecl</nt>'s
<termref def="gloss-NCName">NCName</termref> matches the element item's
name, in which case the element item must <termref def="key-satisfy-ed">e-satisfy</termref> that <nt def="nt-elementDecl">elementDecl</nt>.</p>
</item>
</ulist>
<note>
<p>The above definition of elementOnly-satisfy does not explicitly incorporate the
modifications required when the containing type is <emph>open</emph>, as
set out at the end of (stale??), but it should be
understood as doing so.</p>
</note>
</p>
<constraintnote type="cos" id="cos-elt-consist">
<head>Element Consistency</head>
<p>A given <termref def="gloss-NCName">NCName</termref> must not appear both
among the <nt def="nt-elementDecl">elementDecl</nt>s and among the
<nt def="nt-elementRef">elementRef</nt>s with no <!--<nt def="nt-schemaRef">schemaRef</nt>-->s, or more than once among the
<nt def="nt-elementDecl">elementDecl</nt>s.</p>
</constraintnote>
<note>
<p>Note that the above permits repeated use of the same
<nt def="nt-elementRef">elementRef</nt>, analogous to DTD usage.</p>
</note>
<note><p>EDITORS: Add a COS for the checking of valid pairs of minOccurs and maxOccurs.</p>
</note></stale>
  </div4>
  <div4>
   <head>Element Declaration *</head>
<stale>
   <p role="fdv"><termdef id="key-elt-fullname" term="full name of an element declaration">The <term>full name</term> of a
top-level <nt def="nt-elementDecl">elementDecl</nt> is its
<termref def="gloss-NCName">NCName</termref> plus its <!--<nt def="nt-schemaName">schemaName</nt>-->, i.e. if it appeared directly in the
current schema or an <nt def="nt-include">include</nt>, the empty string, if it
was <nt def="nt-import">imported</nt>, then the <!--<nt def="nt-schemaName">schemaName</nt>--> of that <nt def="nt-import">import</nt>,
which must <termref def="key-suc-res">successfully resolved</termref> to its
containing schema.</termdef></p>
  <p role="fdv"><termdef id="key-satisfy-ed" term="e-satisfy">An element item
<term>e-satisfies</term> an <nt def="nt-elementDecl">elementDecl</nt>
if the <nt def="nt-elementDecl">elementDecl</nt></termdef>:
<ulist>
<item>
<p>contains an <nt def="nt-typeSpec">typeSpec</nt> directly, and the
element item <termref def="key-satisfy-as">a-satisfies</termref> that
<nt def="nt-typeSpec">typeSpec</nt>;</p>
</item>
</ulist>
or
<ulist>
<item>
<p>the <nt def="nt-typeRef">typeRef</nt> alternative is used in that
<nt def="nt-elementDecl">elementDecl</nt> and it
<termref def="key-identify">identifies</termref> an <nt def="nt-typeSpec">typeSpec</nt> and the element item
<termref def="key-satisfy-as">a-satisfies</termref> that
<nt def="nt-typeSpec">typeSpec</nt>.</p>
</item>
</ulist>
</p>
   <constraintnote type="cos" id="cos-local-global">
<head>Nested May Not Be Global</head>
<p>An <nt def="nt-elementSpec">elementSpec</nt> in a nested
<nt def="nt-elementDecl">elementDecl</nt> must not be <pt>global</pt>.
</p>
</constraintnote>
  <constraintnote type="cos" id="cos-respect-global">
<head>Cannot Shadow Global</head>
<p>If a top-level <nt def="nt-elementSpec">elementSpec</nt> is
<pt>global</pt>, then the <termref def="gloss-NCName">NCName</termref> of its
<nt def="nt-elementDecl">elementDecl</nt> must not be redeclared by any
nested <nt def="nt-elementDecl">elementDecl</nt> in the same schema or
any schema it <termref def="key-eventually-include">eventually
includes</termref>.</p>
</constraintnote>
   <p role="fdv"><termdef id="key-ind-valid" term="independently valid">An element item is
<term>independently valid</term> if there is a top-level
<nt def="nt-elementDecl">elementDecl</nt> whose
<termref def="gloss-NCName">NCName</termref> matches its name in the schema its
namespace item resolves to (or a schema that schema
<termref def="key-eventually-include">includes</termref>, in which case see the
definition of <termref def="key-identify">identify</termref> for details on
which declaration is used if there is more than one), and the element item must
<termref def="key-satisfy-ed">e-satisfy</termref> that
<nt def="nt-elementDecl">elementDecl</nt>.</termdef></p>
  <p role="fdv"><termdef id="key-satisfy-etr" term="ref-satisfies">An element item
<term>ref-satisfies</term> an <nt def="nt-elementRef">elementRef</nt>
if</termdef>
<ulist>
<item>
<p> the <nt def="nt-elementRef">elementRef</nt>
<termref def="key-identify">identifies</termref> an
<nt def="nt-elementDecl">elementDecl</nt> whose
<termref def="gloss-NCName">NCName</termref> matches the element item's
name and either</p>
<ulist>
<item>
<p>the <nt def="nt-elementDecl">elementDecl</nt>'s
<termref def="key-elt-fullname">full name</termref> has no
<!--<nt def="nt-schemaName">schemaName</nt>-->, in which case the element item's
namespace must be the same as its parent's namespace</p>
</item>
</ulist>
<p>or</p>
<ulist>
<item>
<p>the element item's namespace and the <nt def="nt-elementDecl">elementDecl</nt>'s
<termref def="key-elt-fullname">full name</termref>'s
<!--<nt def="nt-schemaName">schemaName</nt>--> are identical</p>
</item>
</ulist>
<p>in which case the element item must also <termref def="key-satisfy-ed">e-satisfy</termref> the <nt def="nt-elementDecl">elementDecl</nt>.</p>
</item>
</ulist>
or
<ulist>
<item>
<p> the <nt def="nt-elementRef">elementRef</nt>
<termref def="key-identify">identifies</termref> an
<nt def="nt-elementDecl">elementDecl</nt> (call this <pt>ETD1</pt>), the element
item is <termref def="key-ind-valid">independently valid</termref> and the <nt def="nt-elementDecl">elementDecl</nt> whereby it is independently validated
contains or identifies an <nt def="nt-typeSpec">typeSpec</nt> which
refines (stale) the <nt def="nt-typeSpec">typeSpec</nt> contained in
or identified by ETD1.</p>
</item>
</ulist>
<note>
<p>The last clause above is <emph>much</emph> too complex, it needs to be split
apart and built up in stages. It is this which allows elements based on
refining types to appear in place of those based on their ancestors.</p>
</note>
</p></stale>
  </div4>
 </div3>
 <div3>
  <head>Type Refinement *</head>
<stale>
  <constraintnote id="cos-refine-ok" type="cos">
<head>Allowed Refinements</head>
<p>a type must not declare another type as its basetype if the
latter has been declared <pt>final</pt>.</p>
</constraintnote></stale>
 </div3>
 <div3>
  <head>Import Restrictions *</head>
<stale>
  <constraintnote type="cos" id="cos-ref-schema">
<head>Refer to Schema</head>
<p>The URI associated with a <!--<nt def="nt-schemaRef">schemaRef</nt>--> in any of
the productions above must <termref def="key-suc-res"> successfully
resolve</termref> to a schema. </p>
</constraintnote>
  <constraintnote type="cos" id="cos-find-name">
<head>Name Consistently Defined</head>
<p>The <termref def="gloss-NCName">NCName</termref> in each of the above
productions must identify a declaration or definition of the corresponding
class (element, type, etc.) </p>
</constraintnote>
  <constraintnote type="svc" id="svc-use-unexported">
<head>Use Only Exported Defns</head>
<p>It is not an error for a schema to explicitly import a construct which has
not been exported. However, it is an error for a schema to attempt to use such
construct. </p>
</constraintnote></stale>
 </div3>
 <div3>
  <head>Schema Inclusion *</head>
<stale>
  <constraintnote type="cos" id="cos-ident-ref">
<head>Preorder Priority for Included Definitions</head>
<p>When using a <B>...Ref</B> to <termref def="key-identify">identify</termref>
a <B>...Spec</B>, if there is no appropriate matching declaration or definition
in the current schema, but there is more than one
<termref def="key-eventually-include">eventually included</termref> schema
which contains an appropriate matching declaration or definition, the
<B>...Spec</B> whose declaration or definition occurs first in a preorder
traversal of the <termref def="key-eventually-include">eventually
included</termref> schemas is the one <termref def="key-identify">identified</termref>.</p>
</constraintnote>

  <p role="fdv"><termdef term="directly include" id="key-directly-include">A schema
<term>directly includes</term> another schema if the first schema has an
<nt def="nt-include">include</nt> and the URI contained in or abbreviated by
the <!--<termref def="nt-schemaRef">schemaRef</termref>--> of that
<nt def="nt-include">include</nt> <termref def="key-suc-res">resolves
successfully</termref> to the second schema</termdef>.</p>
  <p role="fdv"><termdef id="key-eventually-include" term="eventually include">A schema
<term>eventually includes</term> another schema if the first schema
<termref def="key-directly-include">directly includes</termref> the second, or
if the first schema <termref def="key-directly-include">directly
includes</termref> some other schema which itself
<termref def="key-eventually-include">eventually includes</termref> the
second.</termdef></p></stale>
</div3>
 <div3>
  <head>Schema Validity *</head>
<stale>
  <constraintnote id="svc-embedded-RUE" type="svc">
<head>Expansions Schema-Ready</head>
<p>Any element item anywhere within the <termref def="key-epic">string-infoset-in-context</termref> replacing an RUE child per
the above must be <termref def="key-schema-ready">schema-ready</termref>.</p>
</constraintnote>
  <constraintnote type="svc" id="svc-unqual-RUE">
<head>Ungoverned RUE</head>
<p><termref def="gloss-RUE">RUEs</termref> must not appear in element items
which are not <termref def="key-schema-governed">schema-governed</termref>,
that is in the values of attributes of or as children of such elements.</p>
</constraintnote></stale>
   </div3>
 </div2>
<div2 id="conformance-processorResponsibilities">
<head>Responsibilities of Schema-aware processors *</head><stale>
<note>
<p>This section has fallen out of alignment with the rest of the specification,
but is included none-the-less to give a feeling for how this section will
eventually look: the details should <emph>not</emph> be taken too seriously.
</p>
</note>
<p>Each step in the following presupposes the successful outcome of the
previous step.</p>
<p>A conforming XML Schema processor must: </p>
<olist>
<item>
<p>Test for XML 1.0 well-formedness;</p>
</item>
<item>
<p>Construct the XML 1.0 information set. This will include identifying and
distinguishing all namespace declarations and uses, and expanding any entity
references whose XML 1.0 declarations are accessible;</p>
</item>
<item>
<p>Starting from the root, traverse the information set in pre-order until an
element information item with a namespace declaration which refers to an
accessible schema is found;</p>
</item>
<item>
<p>Schema-validate the information set subtree rooted at that element
information item using that schema, i.e.
<ulist>
<item>
<p>Schema-validate the resulting information set, as described in
<specref ref="conformance-schemaValidity"/>;</p>
</item>
<item>
<p>Expand the information set per all <termref def="gloss-sic">Schema
Information Set Contribution</termref>s encountered
<ulist>
<item>
<p>for each namespace: its prefixes and URI, and access to a schema
corresponding to that URI. </p>
</item>
<item>
<p>for each element: its name (URI+GI), its content, its datatype or type,
its attributes </p>
</item>
<item>
<p>for each attribute: its name, its value(s), its datatype, and whether its
presence is required on an element. </p>
</item>
<item>
<p>for each datatype: its names, its heritage (or type lattice), its value
space, its refinable facets. </p>
</item>
<item>
<p>for data: its datatype (and type lattice), whether its presence is
required, and its lexical constraints. </p>
</item>
<item>
<p>for each type: its name, its content model or datatype, its heritage
(or type lattice), its attributes, and whether it is open/closed or can be
refined. </p>
</item>
<item>
<p>for each element: its name, its datatype or type or content model,
its attributes, and whether it is open/closed or can be refined. </p>
</item>
<item>
<p>for each model: whether it is any, empty, mixed, or a group of one or more
elements -- in which case, the grammar of the group, and whether it is
open/closed or can be refined. </p>
</item>
</ulist> </p>
</item>
</ulist> </p>
</item>
<item>
<p>Go back to (3) above and continue traversing, starting with the successor in
document order to the item just schema-validated, unless there is no successor;
</p>
</item>
<item>
<p> Provide for an external processing system to have access to the combined
information set: document instance plus schema information.</p>
</item>
</olist>
<note>
<p>Note that the schema contribution to the information set above is meant to
be suggestive only at this point, until we've articulated all the
<termref def="gloss-sic">Schema Information Set Contribution</termref>s in the
preceding sections.</p>
</note></stale>
</div2>
</div1>
</body>

<back>
<div1 id="normative-schemaSchema">
<head>(normative) Schema for Schemas</head>
<p>The XML Schema definition for &XSP1; itself is presented here as normative
part of the specification, and as an illustrative example of the XML Schema in
defining itself with the very constructs that it defines. 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>
<p>Since an &XSP1; is an XML document, it has optional XML and doctype
declarations that are provided here for completeness. The root
<code>schema</code> element defines a new schema. Since this is a schema for
&XSP1;, the <code>targetNamespace</code> references the XML Schema namespace itself.</p>
<eg xml:space="preserve" text="structures.xsd,txt"/>
<note>
<p>And that is the end of the schema for &XSP1;.</p>
</note>


</div1>
<div1 id="normative-schemaDTD">
<head>(normative) DTD for Schemas</head>
<p>The DTD for &XSP1; is given below.  Note there is <emph>no</emph>
implication here the <code>schema</code> must be the root element of a document.</p>
<eg xml:space="preserve" text="structures.dtd,txt"/>
</div1>
<div1 id="normative-glossary">
<head>Glossary (normative) *</head>

<ednote>
<edtext>The Glossary has barely been started. An XSL macro will be used to
collect definitions from throughout the spec and gather them here for easy
reference.</edtext>
</ednote>

<glist>
<gitem>
<label>abstract syntax</label>
<def>
<p><termdef id="gloss-abstractSyntax" term="abstract syntax">the<term>abstract
syntax</term> of the XML Schema Definition Language is ...</termdef></p>
</def>
</gitem>
<gitem>
<label>aggregate datatype</label>
<def>
<p><termdef term="aggregate datatype" id="gloss-aggregateDatatype">an
<term>aggregate datatype</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>type</label>
<def>
<p><termdef term="type" id="gloss-type">an <term>type</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>type reference</label>
<def>
<p><termdef term="type reference" id="gloss-typeReference">an
<term>type reference</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>'all' content model group</label>
<def>
<p><termdef term="&apos;all&apos; content model group" id="gloss-all">the
<term>'all' content model group</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>'any' content</label>
<def>
<p><termdef term="&apos;any&apos; content" id="gloss-anyContent">the
<term>'any' content</term> specification ...</termdef></p>
</def>
</gitem>
<gitem>
<label>atomic datatype</label>
<def>
<p><termdef term="atomic datatype" id="gloss-atomicDatatype">an <term>atomic
datatype</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>attribute</label>
<def>
<p><termdef term="attribute" id="gloss-attribute">an <term>attribute</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>attribute group</label>
<def>
<p><termdef term="attribute group" id="gloss-attributeGroup">an <term>attribute
group</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>'choice' content model group</label>
<def>
<p><termdef term="&apos;choice&apos; content model group" id="gloss-choice">the
<term>'choice' content model group</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>composition</label>
<def>
<p><termdef term="composition" id="gloss-composition"><term>composition</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>concrete syntax</label>
<def>
<p><termdef term="concrete syntax" id="gloss-concreteSyntax">the <term>concrete
syntax</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>constraint</label>
<def>
<p><termdef term="constraint" id="gloss-constraint">a <term>constraint</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>content</label>
<def>
<p><termdef term="content" id="gloss-content"><term>content</term> is</termdef>
</p>
</def>
</gitem>
<gitem>
<label>context</label>
<def>
<p><termdef term="context" id="gloss-context">a <term>context</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>datatype</label>
<def>
<p><termdef term="datatype" id="gloss-datatype">an <term>datatype</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>datatype reference</label>
<def>
<p><termdef term="datatype reference" id="gloss-datatypeReference">an
<term>datatype reference</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>default value</label>
<def>
<p><termdef term="default value" id="gloss-defaultValue">a <term>default
value</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>document</label>
<def>
<p><termdef term="document" id="gloss-document">a <term>document</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>element</label>
<def>
<p><termdef term="element" id="gloss-element">an <term>element</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>element content</label>
<def>
<p><termdef term="element content" id="gloss-elementContent"><term>element
content</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>element reference</label>
<def>
<p><termdef term="element reference" id="gloss-elementTypeReference">an
<term>element reference</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>'empty' content</label>
<def>
<p><termdef term="&apos;empty&apos; content" id="gloss-emptyContent">the
<term>'empty' content</term> specification ...</termdef></p>
</def>
</gitem>
<gitem>
<label>export</label>
<def>
<p><termdef term="export" id="gloss-schemaExport">to <term>export</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>export control</label>
<def>
<p><termdef term="export control" id="gloss-exportControl">an <term>export
control</term></termdef></p>
</def>
</gitem>
<gitem>
<label>external entity</label>
<def>
<p><termdef term="external entity" id="gloss-externalEntity">an <term>external
entity</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>facet</label>
<def>
<p><termdef term="facet" id="gloss-facet">a <term>facet</term> is</termdef></p>

</def>
</gitem>
<gitem>
<label>fixed value</label>
<def>
<p><termdef term="fixed value" id="gloss-fixedValue">a <term>fixed
value</term></termdef></p>
</def>
</gitem>
<gitem>
<label>fragment</label>
<def>
<p><termdef term="fragment" id="gloss-fragment">a <term>fragment</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>import</label>
<def>
<p><termdef term="import" id="gloss-schemaImport">to <term>import</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>include</label>
<def>
<p><termdef term="include" id="gloss-schemaInclude">to <term>include</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>information set</label>
<def>
<p><termdef term="information set" id="gloss-infoSet">an <term>information
set</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>instance</label>
<def>
<p><termdef term="instance" id="gloss-instance">an <term>instance</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>markup</label>
<def>
<p><termdef term="markup" id="gloss-markup"><term>markup</term> is</termdef>
</p>
</def>
</gitem>
<gitem>
<label>'mixed' content</label>
<def>
<p><termdef term="&apos;mixed&apos; content" id="gloss-mixedContent">the
<term>'mixed' content</term> specification ...</termdef></p>
</def>
</gitem>
<gitem>
<label>model</label>
<def>
<p><termdef term="model" id="gloss-model">a <term>model</term> is</termdef></p>

</def>
</gitem>
<gitem>
<label>model group</label>
<def>
<p><termdef term="model group" id="gloss-modelGroup">a <term>model group</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>model group reference </label>
<def>
<p><termdef term="model group reference" id="gloss-modelGroupReference">a
<term>model group reference</term> is</termdef></p>
</def>
</gitem>
 <gitem>
  <label>null</label>
  <def>
   <p><termdef id="key-null" term="null">A distinguished empty value for properties of schema components in the
abstract schema data model.</termdef></p>
  </def>
 </gitem>
<gitem>
<label>RUE</label>
<def>
<p><termdef term="RUE" id="gloss-RUE"><term>RUE</term> is short for
<emph>reference to undefined entity information item</emph> as defined in
<bibref ref="ref-xmlinfo"/></termdef></p>
</def>
</gitem>
<gitem>
<label>NCName</label>
<def>
<p><termdef term="NCName" id="gloss-NCName">an <term>NCName</term> is a name
with no colon, as defined in
<bibref ref="ref-xml-namespaces"/>. Appears in all the definition and
declaration productions of this specification.</termdef> </p>
</def>
</gitem>
<gitem>
<label>QName</label>
<def>
<p><termdef term="QName" id="gloss-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 in this specification, this refers to the
simple type <xtermref href="&XSP2.URI;#QName">QName</xtermref> as defined in <bibref ref="ref-xsp2"/>.</termdef> </p>
</def>
</gitem>
<gitem>
<label>namespace</label>
<def>
<p><termdef term="namespace" id="gloss-namespace">a <term>namespace</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>notation</label>
<def>
<p><termdef term="notation" id="gloss-notation">a <term>notation</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>object model</label>
<def>
<p><termdef term="object model" id="gloss-objectModel">an <term>object
model</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>occurrence</label>
<def>
<p><termdef term="occurrence" id="gloss-occurrence"><term>occurrence</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>parameter entity</label>
<def>
<p><termdef term="parameter entity" id="gloss-parameterEntity">a
<term>parameter entity</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>preamble</label>
<def>
<p><termdef term="preamble" id="gloss-schemaPreamble">a <term>preamble</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>presence</label>
<def>
<p><termdef term="presence" id="gloss-presence"><term>presence</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>refinement</label>
<def>
<p><termdef term="refinement" id="gloss-refinement"><term>refinement</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>document root</label>
<def>
<p><termdef term="document root" id="gloss-documentRoot">the <term>document
root</term> is ...</termdef></p>
</def>
</gitem>
<gitem>
<label>scope</label>
<def>
<p><termdef term="scope" id="gloss-scope"><term>scope</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>'sequence' content model group </label>
<def>
<p><termdef term="&apos;sequence&apos; content model group" id="gloss-sequenceGroup">the <term>'sequence' content model
group</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>structure</label>
<def>
<p><termdef term="structure" id="gloss-structure"><term>structure</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>symbol space</label>
<def>
<p><termdef term="symbol space" id="gloss-symbolSpace">a <term>symbol
space</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>text entity</label>
<def>
<p><termdef term="parsed entity" id="gloss-parsedEntity">a <term>parsed
entity</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>unparsed entity</label>
<def>
<p><termdef term="unparsed entity" id="gloss-unparsedEntity">an <term>unparsed
entity</term> is</termdef></p>
</def>
</gitem>
<gitem>
<label>validation</label>
<def>
<p><termdef term="validation" id="gloss-validation"><term>validation</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>vocabulary</label>
<def>
<p><termdef term="vocabulary" id="gloss-vocabulary">a <term>vocabulary</term>
is</termdef></p>
</def>
</gitem>
<gitem>
<label>well-formedness</label>
<def>
<p><termdef term="well-formedness" id="gloss-wellFormedness"><term>well-formedness</term> is</termdef></p>
</def>
</gitem>
</glist>
</div1>
<div1 id="normative-references">
<head>References (normative) *</head>
<blist>
 <bibl id="bib-camb-comm" key="Cambridge Communiqu&eacute;"><emph>The
Cambridge Communiqu&eacute;</emph>, Ralph Swick
and Henry S. Thompson, editors, 7 October 1999.  See <loc href="http://www.w3.org/TR/schema-arch">http://www.w3.org/TR/schema-arch</loc></bibl>
<bibl id="ref-dcd" key="DCD"> <emph>Document
Content Description for XML (DCD)</emph>, Tim Bray et al. W3C, 10 August 1998.
See <loc href="http://www.w3.org/TR/NOTE-dcd">http://www.w3.org/TR/NOTE-dcd
</loc> </bibl>
<bibl id="ref-ddml" key="DDML"> <emph>Document
Definition Markup Language</emph>. See
<loc href="http://www.w3.org/TR/NOTE-ddml">http://www.w3.org/TR/NOTE-ddml
</loc> </bibl>
 <bibl id="bib-expo" key="XML Schema: Exposition"><emph>XML Schema:
Exposition</emph>, David C. Fallside, ed.  See <loc href="&XSP0.base;/">&XSP0.base;/</loc></bibl>
<bibl id="ref-html-4" key="HTML-4"> <emph>HTML 4.0
Specification</emph>, Dave Raggett et al. W3C, 1998. See
<loc href="http://www.w3.org/TR/REC-html40/">http://www.w3.org/TR/REC-html40/</loc> </bibl>
<bibl id="ref-iso-11404" key="ISO-11404"> <emph>ISO
11404 -- Information Technology -- Programming Languages, their environments
and system software interfaces -- Language-independent datatypes</emph>,
ISO/IEC 11404:1996(E).</bibl>
<bibl id="ref-iso-1808" key="RFC-1808"> RFC
1808,<emph>Relative Uniform Resource Locators</emph>. Internet Engineering Task
Force. See <loc href="http://www.ietf.org/rfc/rfc1808.txt">http://www.ietf.org/rfc/rfc1808.txt
</loc> </bibl>
<bibl id="ref-sox" key="SOX"> <emph>Schema for
Object-oriented XML</emph>, Matt Fuchs, et al. W3C, 1998. See
<loc href="http://www.w3.org/Submission/1998/15/">http://www.w3.org/Submission/1998/15/
</loc> </bibl>
<bibl id="ref-sox-1.1" key="SOX-1.1"> <emph>Schema
for Object-oriented XML</emph>, Version 1.1, Matt Fuchs, et al. W3C, 1999. See
???</bibl>
<bibl id="ref-uri" key="URI"> <emph>Uniform
Resource Identifiers (URI): Generic Syntax and Semantics</emph>. See
<loc href="http://www.ics.uci.edu/~fielding/url/draft-fielding-uri-syntax-01.txt">http://www.ics.uci.edu/~fielding/url/draft-fielding-uri-syntax-01.txt</loc> </bibl>
<bibl id="ref-url" key="URL"> RFC
1738,<emph>Uniform Resource Locators (URL)</emph>. Internet Engineering Task
Force. See <loc href="http://www.ietf.org/rfc/rfc1738.txt">http://www.ietf.org/rfc/rfc1738.txt
</loc> </bibl>
<bibl id="ref-urn" key="URN"> RFC 2141,<emph>URN
Syntax</emph>. Internet Engineering Task Force. See
<loc href="http://www.ietf.org/rfc/rfc2141.txt">http://www.ietf.org/rfc/rfc2141.txt
</loc> </bibl>
<bibl id="ref-wai-pageauth" key="WAI-PAGEAUTH">
<emph>WAI Accessibility Guidelines: Page Authoring</emph>, Gregg Vanderheiden
et al. W3C, 14-Apr-1998. See <loc href="http://www.w3.org/TR/WAI-WEBCONTENT/">http://www.w3.org/TR/WAI-WEBCONTENT/</loc> </bibl>
<bibl id="ref-webarch-extlang" key="WEBARCH-EXTLANG"> <emph>Web Architecture: Extensible Languages</emph>, Tim
Berners-Lee and Dan Connolly. W3C, 10 Feb 1998. See
<loc href="http://www.w3.org/TR/NOTE-webarch-extlang">http://www.w3.org/TR/NOTE-webarch-extlang
</loc> </bibl>
<bibl id="ref-websgml" key="WEBSGML">
<emph>Proposed TC for WebSGML Adaptations for SGML</emph>, C. F. Goldfarb, ed.,
14 June 1997. See <loc href="http://www.sgmlsource.com/8879rev/n1929.htm">http://www.sgmlsource.com/8879rev/n1929.htm
</loc> </bibl>
<bibl id="ref-xsp2" key="XML Schemas: Datatypes">
<emph>XML Schema Part 2: Datatypes</emph>, Paul V. Biron and Ashok
Malhotra, eds.  See <loc href="&XSP2.URI;.html">&XSP2.URI;.html</loc> </bibl>
<bibl id="ref-xsreq" key="XML Schema Requirements">
<emph>XML Schema Requirements </emph>, Ashok Malhotra and Murray Maloney, ed.,
W3C, 15 February 1999. See <loc href="http://www.w3.org/TR/NOTE-xml-schema-req">http://www.w3.org/TR/NOTE-xml-schema-req
</loc> </bibl>
<bibl id="ref-xdr" key="XDR"> <emph>XML-Data
Reduced</emph>, Frankston, Charles, and Henry S. Thompson, ed. 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 id="ref-xlink" key="XLink"> <emph>XML Linking
Language (XLink)</emph>, Eve Maler and Steve DeRose, W3C, 3 March 1998. See
<loc href="http://www.w3.org/TR/xlink/">http://www.w3.org/TR/WD-xlink</loc>
</bibl>
<bibl id="ref-xml" key="XML"> <emph>Extensible
Markup Language (XML) 1.0</emph>, Tim Bray, et al. W3C, 10 February 1998. See
<loc href="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</loc>
</bibl>
<bibl id="ref-xsl" key="XSLT"> <emph>Extensible
Stylesheet Language Transformations</emph>, James Clark, W3C, 21 April 1999.
See <loc href="http://www.w3.org/TR/1999/WD-xslt-19990421">http://www.w3.org/TR/1999/WD-xslt-19990421</loc>
</bibl>
<bibl 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 id="ref-xmlinfo" key="XML-Infoset">XML Information Set (public WD),
David Megginson et al., W3C, 1999. See
<loc href="http://www.w3.org/TR/xml-infoset">http://www.w3.org/TR/xml-infoset</loc>
</bibl>
<bibl id="ref-xml-namespaces" key="XML-Namespaces">
Namespaces in XML, Tim Bray et al., W3C, 1998. See
<loc href="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/WD-xml-names/</loc> </bibl>
<bibl id="ref-xpointer" key="XPointer"> <emph>XML
Pointer Language (XPointer)</emph>, Eve Maler and Steve DeRose, W3C, 3 March
1998. See <loc href="http://www.w3.org/TR/xptr">http://www.w3.org/TR/xptr</loc> </bibl>
 <bibl id="bib-xpath" key="XPath"><emph>XML Path Language</emph>, James Clark
and Steve DeRose, editors, 16 November 1999.  See <loc href="http://www.w3.org/TR/xpath">http://www.w3.org/TR/xpath</loc></bibl>
<bibl id="ref-xschema" key="XSchema"> <emph>XSchema
Specification</emph>, Simon St. Laurent, Ronald Bourret, John Cowan, et al.,
Version 1.0, Draft, 18 October 1998. See
<loc href="http://www.simonstl.com/xschema/spec/xscspecv4.htm">http://www.simonstl.com/xschema/spec/xscspecv4.htm
</loc> For more general information, consult
<loc href="http://purl.oclc.org/NET/xschema">http://purl.oclc.org/NET/xschema
</loc> </bibl>
</blist>
</div1>
<div1 id="acknowledgments">
<head>Acknowledgements (non-normative)</head>
 <p>The following have contributed material to this draft:</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>
 </slist>
<p>The editors acknowledge the members of the XML Schema Working Group, the members of other W3C Working Groups, and industry experts in other
forums who have contributed directly or indirectly to the process or content of
creating this document. The Working Group is particularly grateful to Lotus
Development Corp. and IBM for providing teleconferencing facilities.</p>
 <p>The current members of the XML Schema Working Group are:</p>
<orglist>
<member>
 <name>David Beech</name>
 <affiliation>Oracle Corp.</affiliation>
</member>
<member>
 <name>Paul V. Biron</name>
 <affiliation>Health Level Seven</affiliation>
</member>
<member>
 <name>Allen Brown</name>
 <affiliation>Microsoft</affiliation>
</member>
<member>
 <name>Greg Bumgardner</name>
 <affiliation>Rogue Wave Software</affiliation>
</member>
<member>
 <name>Lee Buck</name>
 <affiliation>Extensibility</affiliation>
</member>
<member>
 <name>Dean Burson</name>
 <affiliation>Lotus Development Corporation</affiliation>
</member>
<member>
 <name>Charles E. Campbell</name>
 <affiliation>Informix</affiliation>
</member>
<member>
 <name>Peter Chen</name>
 <affiliation>Bootstrap Alliance and LSU</affiliation>
</member>
<member>
 <name>David Cleary</name>
 <affiliation>Progress Software</affiliation>
</member>
<member>
 <name>Dan Connolly</name>
 <affiliation>W3C</affiliation>
 <role>staff contact</role>
</member>
<member>
 <name>Andrew Eisenberg</name>
 <affiliation>Progress Software</affiliation>
</member>
<member>
 <name>Rob Ellman</name>
 <affiliation>Calico Commerce</affiliation>
</member>
<member>
 <name>David Ezell</name>
 <affiliation>Hewlett Packard Company</affiliation>
</member>
<member>
 <name>David Fallside</name>
 <affiliation>IBM</affiliation>
</member>
<member>
 <name>Matthew Fuchs</name>
 <affiliation>Commerce One</affiliation>
</member>
<member>
 <name>Paul Grosso</name>
 <affiliation>ArborText, Inc</affiliation>
</member>
<member>
 <name>Dave Hollander</name>
 <affiliation>CommerceNet</affiliation>
 <role>co-chair</role>
</member>
<member>
 <name>Mary Holstege</name>
 <affiliation>Calico Commerce</affiliation>
</member>
<member>
 <name>Jane Hunter</name>
 <affiliation>Distributed Systems Technology Centre (DSTC Pty Ltd)</affiliation>
</member>
<member>
 <name>Renato Iannella</name>
 <affiliation>Distributed Systems Technology Centre (DSTC Pty Ltd)</affiliation>
</member>
 <member>
  <name>Rick Jelliffe</name>
  <affiliation>Academia Sinica</affiliation>
 </member>
 <member>
  <name>Dianne Kennedy</name>
  <affiliation>Graphic Communications Association</affiliation>
 </member>
<member>
 <name>Setrag Khoshafian</name>
 <affiliation>Technology Deployment International (TDI)</affiliation>
</member>
<member>
 <name>Setrag Khoshafian</name>
 <affiliation>Technology Deployment International (TDI)</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>Eve Maler</name>
 <affiliation>Sun Microsystems</affiliation>
</member>
<member>
 <name>Ashok Malhotra</name>
 <affiliation>IBM</affiliation>
</member>
<member>
 <name>Murray Maloney</name>
 <affiliation>Commerce One</affiliation>
</member>
<member>
 <name>John McCarthy</name>
 <affiliation>Lawrence Berkeley National Laboratory</affiliation>
</member>
<member>
 <name>Noah Mendelsohn</name>
 <affiliation>Lotus Development Corporation</affiliation>
</member>
<member>
 <name>Don Mullen</name>
 <affiliation>Extensibility</affiliation>
</member>
<member>
 <name>Murata Makoto</name>
 <affiliation>Xerox</affiliation>
</member>
<member>
 <name>Frank Olken</name>
 <affiliation>Lawrence Berkeley National Laboratory</affiliation>
</member>
 <member>
  <name>Dave Peterson</name>
  <affiliation>Graphic Communications Association</affiliation>
 </member>
<member>
 <name>Mark Reinhold</name>
 <affiliation>Sun Microsystems</affiliation>
</member>
<member>
 <name>Shriram Revankar</name>
 <affiliation>Xerox</affiliation>
</member>
<member>
 <name>Jonathan Robie</name>
 <affiliation>Software AG</affiliation>
</member>
 <member>
  <name>Lew Shannon</name>
  <affiliation>NCR</affiliation>
 </member>
<member>
 <name>C. M. Sperberg-McQueen</name>
 <affiliation>W3C</affiliation>
 <role>co-chair</role>
</member>
<member>
 <name>Henry S. Thompson</name>
 <affiliation>University of Edinburgh</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>Priscilla Walmsley</name>
 <affiliation>XMLSolutions</affiliation>
</member>
<member>
 <name>Norm Walsh</name>
 <affiliation>ArborText, Inc</affiliation>
</member>
<member>
 <name>Aki Yoshida</name>
 <affiliation>SAP AG</affiliation>
</member>
</orglist>
 <p>The XML Schema Working Group has benefited in its work from the
participation and contributions of a number of people not currently
members of the Working Group, including
in particular those named below.  Affiliations given are those current at
the time of their work with the WG.
</p>
 <orglist>
<member>
 <name>Paula Angerstein</name>
 <affiliation>Vignette Corporation</affiliation>
</member>
 <member>
  <name>Gabe Beged-Dov</name>
  <affiliation>Rogue Wave Software</affiliation>
 </member>
<member>
 <name>Dean Burson</name>
 <affiliation>Lotus Development Corporation</affiliation>
</member>
 <member>
  <name>George Feinberg</name>
  <affiliation>Object Design</affiliation>
 </member>
 <member>
  <name>Charles Frankston</name>
  <affiliation>Microsoft</affiliation>
 </member>
 <member>
  <name>Ernesto Guerrieri</name>
  <affiliation>Inso</affiliation>
 </member>
 <member>
  <name>Michael Hyman</name>
  <affiliation>Microsoft</affiliation>
 </member>
<member>
 <name>Janet Koenig</name>
 <affiliation>Sun Microsystems</affiliation>
</member>
 <member>
  <name>Chris Olds</name>
  <affiliation>Wall Data</affiliation>
 </member>
 <member>
  <name>William Shea</name>
  <affiliation>Merrill Lynch</affiliation>
 </member>
 <member>
  <name>Ralph Swick</name>
  <affiliation>W3C</affiliation>
 </member>
 <member>
  <name>Tony Stewart</name>
  <affiliation>Rivcom</affiliation>
 </member>
 </orglist>
</div1>
<div1>
<head>Tabulation of changes</head>
<eg>
<![CDATA[
$Log: structures.xml,v $
Revision 1.46.1.48.2.3  2000/02/25 02:14:44  ht
more link fixes

Revision 1.46.1.48.2.2  2000/02/25 02:07:27  ht
link fixes

Revision 1.46.1.48.2.1  2000/02/25 01:12:09  ht
Merge in pre-publication edits

Revision 1.46.1.48  2000/02/24 23:03:55  ht
fixed examples brutally
spell check
rushed through stubs for all propmaps

Revision 1.46.1.47  2000/02/24 21:42:27  ht
exact->value, work on groups

Revision 1.46.1.46  2000/02/24 12:28:05  ht
noah's most recent additions
work on attributes, make content type a particle, not a group (oops)

Revision 1.46.1.45  2000/02/23 18:08:54  ht
ur-type consistency
more on complex type in c6
stubs for all props in c6
derivationChoice/Set/exactSet fussing

Revision 1.46.1.44  2000/02/23 10:06:31  ht
integrate work from Noah on ur-type cleanup, ed note removal

Revision 1.46.1.43  2000/02/22 23:10:27  ht
try identity-c for reference-c

Revision 1.46.1.42  2000/02/22 17:51:30  ht
Handle some ednotes, remove some stale in-doc issues
turn the rhetoric for chapter 4 around, so elements in repr are on
top, elaborate the reprdef content model accordingly
Finish off (?) <element> and associated src and cos

Revision 1.46.1.41  2000/02/21 17:45:45  ht
add latest from Noah,
more structure in <reprdef> to allow one elt->many components

Revision 1.46.1.40  2000/02/18 19:05:17  ht
minor cleanup for Plenary notice,
start on <element> element,
rename source to base

Revision 1.46.1.39  2000/02/18 12:27:22  ht
work on XML repr of attributes, QName stuff
incorporate Eve's and Noah's edits of yesterday

Revision 1.46.1.38  2000/02/17 10:10:07  ht
integrated changes from eve,
added names to annotations property (oops)

Revision 1.46.1.37  2000/02/16 22:10:45  ht
add annotations to every component,
start seriously on Chapter 4

Revision 1.46.1.36  2000/02/16 13:24:53  ht
integrate (with minor mods) updates from eve,
full (but complex) spec. for keyref validation

Revision 1.46.1.35  2000/02/15 14:12:02  ht
merged in edits to c.1 from eve

Revision 1.46.1.34  2000/02/14 17:59:37  ht
some ref-constr work, cleaned up some ednotes

Revision 1.46.1.33.2.1  2000/02/15 13:44:11  ht
noah's contributions of 14 Feb

Revision 1.46.1.33  2000/02/14 14:51:12  ht
working on particles vs. equiv classes

Revision 1.46.1.32  2000/02/14 12:07:05  bu
cvcs for model group, particle and wildcard

Revision 1.46.1.31  2000/02/14 08:46:52  ht
more from Noah

Revision 1.46.1.30  2000/02/12 18:10:47  ht
noahs next edits integrated, responded to

Revision 1.46.1.29  2000/02/12 16:53:52  ht
got defaults sorted out for element decls

Revision 1.46.1.28  2000/02/11 12:56:00  aqw
Integrate from Noah, add comments, value constraint for complex types, clarify language about LDG

Revision 1.46.1.27  2000/02/11 11:03:06  ht
Noah working on element decl

Revision 1.46.1.26  2000/02/10 15:00:50  aqw
another pass over 3.2, finished I think

Revision 1.46.1.25  2000/02/10 11:11:47  ht
appropriate noah's additions

Revision 1.46.1.23  2000/02/09 16:32:06  aqw
update terminology per some f2f votes, begin working through chapter 3, add null processing to element decl

Revision 1.46.1.22  2000/02/08 23:20:24  ht
fix bogus eg embedding

Revision 1.46.1.21  2000/01/27 19:09:32  aqw
a bit more cleanup of composition chapter, everybody has at least stub
properties, got field and selectors in barely, lots more <stale>
wrapping.

Revision 1.46.1.20  2000/01/27 16:00:13  aqw
began to mark non-restructured sections, some cleanup of composition

Revision 1.46.1.19  2000/01/27 10:57:14  aqw
Michael's and Noah's general editorial suggestions
Try reference-constraint for key, unique, keyref

Revision 1.46.1.18  2000/01/26 23:18:30  aqw
example reprdef, full set of reprdef stubs

Revision 1.46.1.17  2000/01/26 13:12:16  aqw
Another minor reordering in chapter 2
Brief expositions added to each subsection in chapter 2
QName reference validation stuff

Revision 1.46.1.16  2000/01/25 22:29:38  bu
final cross-references added to Chapter 3 stubs, some sics

Revision 1.46.1.15  2000/01/25 17:45:11  aqw
some work on references/QNames

Revision 1.46.1.14  2000/01/25 16:13:50  aqw
restructuring for parallelism, with lots of stubs, now complete?

Revision 1.46.1.13  2000/01/24 18:06:22  aqw
more re-ordering of chapter 3, preliminary cvcs for attr and elt decls

Revision 1.46.1.12  2000/01/22 11:11:06  aqw
detail work on complex type def details

Revision 1.46.1.11  2000/01/20 17:40:01  aqw
working seriously on complex type defn details

Revision 1.46.1.10  2000/01/20 11:25:29  aqw
move simple type to end of each section
start work on complex type defn for real in Chap. 3
introduce <eltref>.

Revision 1.46.1.9  2000/01/19 17:10:18  aqw
remove all remaining scraps == abstract syntax
cosmetic changes in chap.1
begin adding more details in chap.3

Revision 1.46.1.8  2000/01/19 15:52:07  aqw
restructure compdef and reprdef for better control

Revision 1.46.1.7  2000/01/18 17:59:00  aqw
moving towards auto-generated paradigms

Revision 1.46.1.6  2000/01/15 18:13:20  aqw
revised approach to reprdef

Revision 1.46.1.5  2000/01/15 12:56:03  aqw
new chaps 2 and 3 complete in outline
Starting on 4.[attr grp defn] as prototype for XML repr spec

Revision 1.46.1.4  2000/01/12 23:02:17  ht
Moved component type details from Chap 2 to Chap 3

Revision 1.46.1.3  2000/01/12 21:18:22  ht
replaced [prop] with <propdef>, <propref> and <xpropref>

Revision 1.46.1.2  2000/01/12 18:04:37  aqw
Finished drastic pruning and rewrite of Chapter 2
Now propose to move all the formal definitions to the new Chapter 3:
Schema Components, with sections called e.g. Attribute Declarations:
details or some such

Revision 1.46.1.1  2000/01/12 12:44:56  aqw
begin major reorg: component exposition started

Revision 1.46  2000/01/10 11:57:56  aqw
Fold in non-publ-related changes in 19991217 publication version (1.45.1.6)
Experiment with moving major examples out-of-line

Revision 1.45.1.6  1999/12/17 16:14:53  ht
one more link

Revision 1.45.1.5  1999/12/17 15:35:47  ht
reorder prevloc

Revision 1.45.1.4  1999/12/17 14:50:25  ht
link fixes

Revision 1.45.1.3  1999/12/17 14:46:51  ht
additional status prose

Revision 1.45.1.2  1999/12/17 13:33:11  ht
PWD status prose and link fixes

Revision 1.45.1.1  1999/12/17 12:26:37  ht
towards PWD

Revision 1.45.1.6  1999/12/17 16:14:53  ht
one more link

Revision 1.45.1.5  1999/12/17 15:35:47  ht
reorder prevloc

Revision 1.45.1.4  1999/12/17 14:50:25  ht
link fixes

Revision 1.45.1.3  1999/12/17 14:46:51  ht
additional status prose

Revision 1.45.1.2  1999/12/17 13:33:11  ht
PWD status prose and link fixes

Revision 1.45.1.1  1999/12/17 12:26:37  ht
towards PWD

Revision 1.45  1999/12/17 12:06:05  ht
eacute

Revision 1.44  1999/12/17 11:51:45  ht
make all example quotes double
some changes merged from pre-Nov-publ branch (1.15.1...)

Revision 1.43  1999/12/17 10:59:16  ht
minor fix in schema wrt keys

Revision 1.42  1999/12/16 15:48:08  ht
fix some refs, incorporate up-to-date schema and DTD

Revision 1.41  1999/12/16 15:40:05  aqw
describe exact, final and abstract on elements

Revision 1.40  1999/12/16 09:44:11  aqw
minor editorial

Revision 1.39  1999/12/14 16:22:46  aqw
various QName fixes

Revision 1.38  1999/12/10 18:01:42  ht
remove * where status has changed

Revision 1.37  1999/12/10 16:14:10  aqw
renaming attrGroup, elemOnly, integrate DTD and schema

Revision 1.36  1999/12/10 16:08:05  aqw
more on BRM, add an wildcard ambiguity issue

Revision 1.35  1999/12/10 10:07:35  ht
merge in new-design branch

Revision 1.34  1999/12/10 09:38:42  ht
minor orphan changes

Revision 1.33  1999/12/08 20:06:52  aqw
added prose for BRM

Revision 1.32  1999/12/03 15:49:25  ht
fix status text

Revision 1.31  1999/12/03 14:54:16  aqw
ht version confusion

Revision 1.30  1999/12/03 14:48:41  aqw
Outline inclusion of BRM proposal
Implemented QName aspect of composition decision

Revision 1.29.1.6  1999/12/08 20:04:26  aqw
describe impact of exact for equiv classes, remove substitutabiliity section

Revision 1.29.1.5  1999/12/06 23:15:09  ht
add stars, no standalone

Revision 1.29.1.4  1999/12/06 22:50:02  aqw
add equiv classes, up-to-date DTD and schema

Revision 1.29.1.3  1999/12/03 19:37:27  ht
Fill in 3.6.3, controlling derivation, including mod agreed with Allen
wrt type tolerance.

Revision 1.29.1.2  1999/12/03 15:55:38  aqw
cleanup new proposal stuff for preliminary release

Revision 1.29.1.1  1999/12/02 22:55:36  aqw
begin serious work on integrating new type derivation proposal

Revision 1.29  1999/12/02 19:05:00  aqw
resolve ! issue in <any namespace='...'> in favour of ##
remove private exploratory hierarchy rewrite

Revision 1.28  1999/12/02 11:36:27  aqw
merge in DTD and schema for internal point release

Revision 1.27  1999/12/02 11:09:36  aqw
composition tf integrates, validates nearly ok

Revision 1.26  1999/12/01 15:43:23  aqw
integrating composition tf . . .

Revision 1.25  1999/11/22 14:14:59  aqw
integrate tentative type construction compromise

Revision 1.24  1999/11/12 17:00:41  ht
Incorporate minimal null support

Revision 1.23  1999/11/11 11:19:11  ht
add issues per 1999-11-04 telcon vote

Revision 1.22  1999/11/11 11:11:51  ht
include dtd and schema

Revision 1.21.1.1  1999/11/22 14:03:55  aqw
try out type construction compromise

Revision 1.21  1999/11/05 00:48:14  aqw
note about status vis a vis forthcoming issues from minutes

Revision 1.20  1999/11/04 23:46:57  aqw
remove element classes per WG vote

Revision 1.19  1999/11/03 21:39:47  aqw
fix editors list and acks
typoes spotted by DBeech

Revision 1.18  1999/11/03 15:49:26  aqw
Implement chair's instructions wrt WG poll closed 1999-10-30:
 * re-integrate named model groups
 * change details of implicit openness
 * remove entities, not notations

Revision 1.17  1999/11/02 23:37:35  aqw
merge refinement proposal into mainline preparatory to implementing poll results


Revision 1.16  1999/11/02 21:32:25  aqw
remove entity definitions and related material (e.g. notations)

Revision 1.15  1999/10/27 13:28:58  ht
Fix some (all?) syntax paradigms, examples
Include bug-fixed .xsd and .dtd

Revision 1.14  1999/10/27 10:48:01  ht
Incorporate up-to-date schema and DTD, completing concrete syntax changes
Parameterise paths/dates to facilitate release process

Revision 1.13.1.15  1999/10/26 16:23:30  ht
a bit more on validity

Revision 1.13.1.14  1999/10/25 14:37:31  ht
Begin to try to fill in validity section on basis of
schema-valid(EII,type,schemaSet) minimalist approach

Revision 1.13.1.13  1999/10/19 18:42:13  ht
added xsd:type to text, changed status

Revision 1.13.1.12  1999/10/18 19:46:12  aqw
Added concrete syntax, prose and examples to 3.6, new section on the
hierarchy and restrictions

Revision 1.13.1.11  1999/10/18 15:28:16  aqw
Included lots in 3.5 and 3.6, editting it in to shape

Revision 1.13.1.10  1999/10/18 13:55:23  aqw
correct and corresponding DTD and Schema included
text from new design included in 3.5 and 3.6 for editting

Revision 1.13.1.9  1999/10/18 11:39:01  aqw
light pass over section 2, cleaning up 'type' terminology
minor fixups in 3.4

Revision 1.13.1.8  1999/10/17 22:05:19  aqw
first pass through 3.4 complete

Revision 1.13.1.7  1999/10/16 22:12:03  aqw
element classes

Revision 1.13.1.6  1999/10/16 19:02:51  aqw
attribute finished, also attrGroup

Revision 1.13.1.5  1999/10/16 17:53:28  aqw
finished (?) with complex types, on to attributes

Revision 1.13.1.4  1999/10/16 11:52:07  aqw
still working on complex type

Revision 1.13.1.3  1999/10/15 16:38:31  aqw
more work on 'type'

Revision 1.13.1.1  1999/10/15 11:46:18  ht
on the way to matching new refinement proposal

Revision 1.13  1999/10/09 10:49:40  ht
correct headline date

Revision 1.12  1999/10/05 09:56:19  ht
Preliminary implementation of A3 and A7 (ampConnector and richerMixed)
votes.  Moving towards a parallel syntax for elementDecl/Ref and
groupDefn/Ref.

Concrete syntax paradigms, examples, DTD and Schema NOT up-to-date

Revision 1.11  1999/09/27 16:31:07  ht
merge simple back to main branch

Revision 1.10.2.38  1999/09/27 16:29:02  ht
return to xmlschema-current as base

Revision 1.10.2.37  1999/09/24 16:40:22  ht
add comments archive pointer

Revision 1.10.2.36  1999/09/24 16:38:23  ht
link housekeeping, move TF reports bibliography to separate appendix

Revision 1.10.2.35  1999/09/24 13:44:27  ht
final (?) housekeeping before publication

Revision 1.10.2.34  1999/09/23 18:48:51  ht
changes to front matter in preparation for public WD
ponter to Simple TF included

Revision 1.10.2.33  1999/09/23 13:32:15  ht
up-to-date pointer to refinement TF report

Revision 1.10.2.32  1999/09/23 13:00:22  ht
typo in db entity

Revision 1.10.2.31  1999/09/23 12:59:04  ht
per suggestions from Ashok, some rewording of summary of Composition
TF, added issue regarding priority of instance->schema alternatives

Revision 1.10.2.30  1999/09/22 14:02:35  ht
typo in correction to 4.1

Revision 1.10.2.29  1999/09/22 13:58:39  ht
edits implementing Noah's comments

Revision 1.10.2.28  1999/09/22 08:07:07  ht
add verbatim change log at end
----------------------------
revision 1.10.2.27
date: 1999/09/21 16:26:11;  author: ht;  state: Exp;  lines: +4 -4
added Id: to title for now
----------------------------
revision 1.10.2.26
date: 1999/09/21 16:06:08;  author: ht;  state: Exp;  lines: +42 -244
replaced composition tf report with a summary and a pointer
----------------------------
revision 1.10.2.25
date: 1999/09/21 14:11:50;  author: aqw;  state: Exp;  lines: +495 -111
some dates, up-to-date DTD and Schema for schemas
----------------------------
revision 1.10.2.24
date: 1999/09/21 10:50:37;  author: ht;  state: Exp;  lines: +18 -3
supply missing content model for 'attribute' in concrete syntax
paradigm
----------------------------
revision 1.10.2.23
date: 1999/09/21 10:37:51;  author: aqw;  state: Exp;  lines: +21 -20
define/declare consistency pass
----------------------------
revision 1.10.2.22
date: 1999/09/20 13:08:36;  author: aqw;  state: Exp;  lines: +47 -49
track datatype content model changes,
minor wording
----------------------------
revision 1.10.2.21
date: 1999/09/16 14:55:17;  author: ht;  state: Exp;  lines: +136 -14
header disclaimer, graveyards rescued to discharge references
----------------------------
revision 1.10.2.20
date: 1999/09/16 14:25:01;  author: aqw;  state: Exp;  lines: +274 -1541
rip out all of 3.5, all of 4, install 'Draft Proposal' in 4
----------------------------
revision 1.10.2.19
date: 1999/09/16 12:08:59;  author: aqw;  state: Exp;  lines: +107 -143
Clean up import/include/export, references in particular
Add archetypeRef to content models, minimally
New example of datatype+attr
----------------------------
revision 1.10.2.18
date: 1999/09/15 22:06:29;  author: aqw;  state: Exp;  lines: +26 -3
Two clarifications following discussion with Andrew
1) what it would take to remove the two symbol spaces problem
2) How <archetype> allows either datatypeRef or contentType
----------------------------
revision 1.10.2.17
date: 1999/09/15 20:30:49;  author: aqw;  state: Exp;  lines: +114 -105
change date, incorporate edited dtd
----------------------------
revision 1.10.2.16
date: 1999/09/15 19:52:39;  author: aqw;  state: Exp;  lines: +90 -76
Encorporate/respond to Eve Maler's suggested edits
----------------------------
revision 1.10.2.15
date: 1999/09/13 16:14:12;  author: aqw;  state: Exp;  lines: +306 -335
Finish consistency pass through 3.4
Brutal 'element type' -> element
----------------------------
revision 1.10.2.14
date: 1999/09/09 14:22:29;  author: aqw;  state: Exp;  lines: +53 -56
cleanup pass, down to 3.3
----------------------------
revision 1.10.2.13
date: 1999/09/08 18:23:47;  author: ht;  state: Exp;  lines: +41 -41
more type back to archetype
----------------------------
revision 1.10.2.12
date: 1999/09/08 18:03:06;  author: aqw;  state: Exp;  lines: +214 -216
put archetype back in, imperfectly, I expect
----------------------------
revision 1.10.2.11
date: 1999/09/07 21:50:36;  author: bu;  state: Exp;  lines: +124 -63
fix paradigm contexts, extend example, consolidate example in appendix
----------------------------
revision 1.10.2.10
date: 1999/09/07 16:54:39;  author: aqw;  state: Exp;  lines: +514 -521
syntax paradigms now properly distributed, I think
----------------------------
revision 1.10.2.9
date: 1999/09/07 15:53:06;  author: ht;  state: Exp;  lines: +5 -8
fixed minor validity errors
----------------------------
revision 1.10.2.8
date: 1999/09/07 15:31:58;  author: aqw;  state: Exp;  lines: +288 -285
working on integrating syntax paradigms
----------------------------
revision 1.10.2.7
date: 1999/09/07 09:44:57;  author: aqw;  state: Exp;  lines: +630 -33
added ALL concrete syntax boxes at once
----------------------------
revision 1.10.2.6
date: 1999/09/06 14:55:04;  author: ht;  state: Exp;  lines: +35 -2
added one e: syntax exposition
----------------------------
revision 1.10.2.5
date: 1999/09/02 15:28:27;  author: ht;  state: Exp;  lines: +6 -6
fix URLs for self, a bit
----------------------------
revision 1.10.2.4
date: 1999/09/02 12:53:34;  author: aqw;  state: Exp;  lines: +108 -95
Added not-status-quo marks, changed e.g. String to string
----------------------------
revision 1.10.2.3
date: 1999/09/01 17:02:14;  author: aqw;  state: Exp;  lines: +587 -977
integration of 2.3 from simple
more renaming
----------------------------
revision 1.10.2.2
date: 1999/08/23 15:32:16;  author: aqw;  state: Exp;  lines: +730 -248
Modified simple integration to give preliminary consistency
----------------------------
revision 1.10.2.1
date: 1999/08/22 17:44:40;  author: aqw;  state: Exp;  lines: +317 -260
Textual integration of Simple update of 1999-08-13
----------------------------
revision 1.10
date: 1999/07/20 19:47:27;  author: ht;  state: Exp;  lines: +5 -5
branches:  1.10.2;
fixed dates, dangling reference
----------------------------
revision 1.9
date: 1999/07/19 09:31:26;  author: ht;  state: Exp;  lines: +34 -38
David Beech: updated definition of "Schema" following WG and IG email
discussion.  Changed "Schemata" to "Schemas" except where directly
quoted from Requirements doc.  Clarified in 2.5 that elements and
attributes have separate symbol spaces (public comment).  Fixed
assorted typos.
----------------------------
revision 1.8
date: 1999/06/23 10:00:31;  author: aqw;  state: Exp;  lines: +1 -1
fix Id:
----------------------------
revision 1.7
date: 1999/06/23 09:51:15;  author: aqw;  state: Exp;  lines: +28 -28
Restrict content model of 'all' in schema and dtd, change entities for
point releases
----------------------------
revision 1.6
date: 1999/06/23 09:10:01;  author: aqw;  state: Exp;  lines: +147 -187
pushed &amp; down to lowest level, fixed incoherent validity
definition in 6.2.3.7 to agree with the note which follows.  Wrapped
validation text from 3.4 in appropriately named div4's
----------------------------
revision 1.5
date: 1999/06/21 16:31:59;  author: aqw;  state: Exp;  lines: +569 -551
Really moved validity-oriented definitions to 6.3 (previous revision
was just housekeeping)
----------------------------
revision 1.4
date: 1999/06/21 16:25:21;  author: aqw;  state: Exp;  lines: +45 -36
moved validity-oriented definitions to 6.3
----------------------------
revision 1.3
date: 1999/06/21 12:25:21;  author: aqw;  state: Exp;  lines: +3540 -3650
Low-level: Normalise line ends, quotes
Editorial: Move all constraintnotes to new separate section
----------------------------
revision 1.2
date: 1999/05/27 14:13:54;  author: aqw;  state: Exp;  lines: +2 -2
fix stylesheet and dtd urls to local versions
----------------------------
revision 1.1
date: 1999/05/23 16:51:11;  author: ht;  state: Exp;
branches:  1.1.1;
Initial revision
]]></eg>
</div1>
<div1 id="openIssues">
<head>Open Issues</head>
<p>A tabulation of open issues flagged above follows:</p>
</div1>
</back>
</spec>
