<?xml version='1.0'?>
<?xml:stylesheet type='text/xsl' href='xmlschema.msxsl'?>
<!-- $Id: structures.xml,v 1.15.1.11 1999/11/05 17:19:14 aqw 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 "<emph>XML Schemas: Datatypes</emph>">
   <!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">
 ]>
<spec xmlns:e='http://www.jclark.com/XSLT/ElementSyntax'>
  <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.15.1.11 1999/11/05 17:19:14 aqw 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='xmlspec-19990429.dtd'>DTD</loc>, <loc href='xmlschema.xsl'>XSL
stylesheet</loc> (Oct PR version)
and <loc href='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.URI;.html'>&XSP1.URI;.html</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/1999/05/06-xmlschema-1/'>http://www.w3.org/1999/05/06-xmlschema-1/</loc>
    <loc href='http://www.w3.org/TR/1999/WD-xmlschema-1-19990924/'>http://www.w3.org/TR/1999/WD-xmlschema-1-19990924/</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 W3C Working Draft for review by members of the W3C and other interested parties in the general public.</p> 
      <p>It has been reviewed by the XML Schema Working Group and the Working
        Group has agreed to its publication. Note that not that all sections of the
        draft represent the current consensus of the WG. Different sections of the
        specification may well command different levels of consensus in the WG. Public
        comments on this draft will be instrumental in the WG&apos;s deliberations.</p>
      
   <p>Please review and send comments to
        
<loc href='http://lists.w3.org/Archives/Public/www-xml-schema-comments/'>www-xml-schema-comments@w3.org</loc>
(<loc href='http://lists.w3.org/Archives/Public/www-xml-schema-comments/'>archive</loc>).   
       </p>
 
      <p>This draft incorporates only minor changes from the previous
version, mostly in the area of content model features:  see <specref ref='declare-elementOnly'/>, <specref ref='declare-mixedContent'/> and <specref ref='declare-element'/>.</p>
      <p>Three major components of this document are marked below as
out-of-date and/or under construction:  major efforts by task forces
from within the WG are still underway with respect to these, and their
reports are linked from this draft.  We felt it was important to
present this work to the public, in keeping with our obligation to
produce drafts for public inspection and comment on a regular basis,
despite the "Under Construction" signs posted below.</p>
     <p>Sections which are <emph>not</emph> the status quo, that is on 
which the working group has not yet reached consensus, are marked with an
asterisk (<B>*</B>) at the end of the section title.
But <emph>please note</emph> that <emph>all</emph> the facilities described herein are in a preliminary state of design.
        The Working Group anticipates substantial changes, both in the mechanisms
        described herein, and in additional functions yet to be described. The present
        version should not be implemented except as a check on the design and to allow
        experimentation with alternative designs. <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> is part 1 of a two-part draft
        of the specification for the XML Schema definition language. This document
        proposes 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).</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 &XSP1;, including
        an introduction to schema constraints, types, schema composition, and symbol
        spaces. The abstract and concrete syntax of &XSP1; are introduced, along with
        other terminology used throughout the specification. </p>
      <p>Chapter 3 <specref ref='declare'/> reconstructs the core functionality
        of XML 1.0, plus a number of extensions, in line with our stated requirements
        <bibref ref='ref-xsreq'/>. This chapter discusses the declaration and use of
        datatypes, archetypes, element, content models, attributes, attribute
        groups, model groups, refinement, entities and notations.</p>
      <p>Chapter 4 presents <specref ref='composition'/>, including the
        validation of namespace qualified instance documents, import, inclusion and
        export of declarations and definitions, schema paths, access to schemas, and
        related rules for schema-based validity. </p>
      <p>Chapter 5 is a placeholder for <specref ref='doc'/>, which will
        eventually provide a standardized means for including documentation in the
        definition of a schema. </p>
      <p>Chapter 6 discusses <specref ref='conformance'/>, including the rules
        by which instance documents are validated, and responsibilities of schema-aware
        processors. </p>
      <p>The normative addenda include a <specref ref='normative-schemaDTD'/>
        and a <specref ref='normative-schemaSchema'/>, which is an XML Schema schema
        for &XSP1;, a <specref ref='normative-glossary'/> [not yet written] and
        <specref ref='normative-references'/>. Non-normative appendixes include a
        <specref ref='sampleSchema'/> and <specref ref='acknowledgments'/>. </p>
      <div2 id='intro-docConventions'>
        <head>Documentation Conventions</head>
        <p>This Working Draft document was produced using an
          <bibref ref='ref-xml'/> DTD and an <bibref ref='ref-xsl'/> stylesheet.</p>
        <p>The following highlighting is used to present technical material in
          this document: </p>
        <p> <termdef id='key-sampledef' term='term'>A <term>term</term> is
          something we use a lot</termdef>. </p>

        <scrap lang='ebnf' id='example'>

          <head>Sample Abstract Syntax Production</head>
          <prod id='nt-left' role='prefig'>
            <lhs>left</lhs>
            <rhs>right1 right2</rhs>
          </prod>

        </scrap>

       <e:element-syntax name='example'>
        <e:in-category name='sample-concrete-syntax-paradigm'/>
        <e:attribute name='attribute'>
         <e:data-type name='NMTOKEN'/>
        </e:attribute>
        <e:attribute name='required-attribute' required='yes'>
         <e:data-type name='ID'/>
        </e:attribute>
        <e:sequence>
         <e:element name='daughter1'/>
         <e:element name='daughter2' repeat='zero-or-more'/>
        </e:sequence>
       </e:element-syntax>
        <note role='example'>
          <p>A non-normative example illustrating use of the schema language,
            or a related instance. </p>
          <eg xml:space='preserve'>&lt;schema name='http://www.muzmo.com/XMLSchema/1.0/mySchema' &gt;</eg>
          <p>And an explanation of the example.</p>
      </note>
      <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 shared among the editorial team.</edtext>
      </ednote>

      <note>
        <p>General comments directed to all readers. </p>
      </note>
    </div2>
    <div2 id='intro-purpose'>
      <head>Purpose</head>
      <p>The purpose of &XSP1; is to provide an inventory of XML markup
        constructs with which to write schemas. </p>
      <p>The purpose of an &XSP1; schema is to define and describe a class of
        XML documents by using these constructs to constrain and document the meaning,
        usage and relationships of their constituent parts: datatypes, elements and
        their content, attributes and their values, entities and their contents and
        notations. Schema constructs may also provide for the specification of additional
        information such as default values. Schemas are intended to document their own
        meaning, usage, and function through a common documentation vocabulary. 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 will allow 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'>
      <head>Relationship To Other Work</head>
      <p>The definition of &XSP1; is a part of the
        <loc href='http://www.w3.org/XML/Activity.html'>W3C XML Activity</loc>. It is
        in various ways related to other ongoing parts of that Activity and other W3C
        WGs </p>
      <glist>
        <gitem>
          <label>XML Datatype Language</label>
          <def>
            <p>&XSP1; has a dependency on the data typing mechanisms defined in
              its companion <bibref ref='ref-xsp2'/>, published simultaneously with this
              recommendation. </p>
          </def>
        </gitem>
        <gitem>
          <label>Document Object Model </label>
          <def>
            <p>&XSP1; has not yet identified requirements or dependencies. </p>

          </def>
        </gitem>
        <gitem>
          <label>HTML </label>
          <def>
            <p>&XSP1; has a requirement to support modularization of HTML. </p>

          </def>
        </gitem>
        <gitem>
          <label>Internationalization Working Group </label>
          <def>
            <p>We are in regular contact with the WG, and they are
providing input to our discussions.</p>
          </def>
        </gitem>
        <gitem>
          <label>RDF Schema </label>
          <def>
            <p>&XSP1; has not yet documented requirements or dependencies. </p>
<ednote>
<edtext>Need to reference Cambridge Communique as soon as it's published.</edtext>
</ednote>
          </def>
        </gitem>
        <gitem>
          <label>WAI </label>
          <def>
            <p>&XSP1; has a requirement to support accessibility. </p>
          </def>
        </gitem>
        <gitem>
          <label>XML Information Set </label>
          <def>
            <p>&XSP1; has significant dependencies on
              <bibref ref='ref-xmlinfo'/>.</p>
            <p>&XSP1; defines its own <termref def='gloss-sic'>Information Set
              Contributions</termref>.</p>
            <p>&XSP1; will have requirements for subsequent Information Set
              Working Drafts.</p>
          </def>
        </gitem>
        <gitem>
          <label>XML Linking WG </label>
          <def>
            <p>&XSP1; has not yet identified requirements or dependencies. </p>

          </def>
        </gitem>
        <gitem>
          <label>XML Syntax </label>
          <def>
            <p>&XSP1; must interoperate with XML 1.0 and subsequent revisions.
            </p>
          </def>
        </gitem>
        <gitem>
          <label>XSL WG </label>
          <def>
            <p>&XSP1; has a requirement to support dimensions and aggregate
              datatypes. </p>
          </def>
        </gitem>
      </glist>
    </div2>
    <div2 id='intro-terminology'>
      <head>Terminology</head>
      <p>The terminology used to describe &XSP1; is defined in the body of this
        specification. The terms defined in the following list are used in building
        those definitions and in 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>
        <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>
        <gitem>
          <label><termdef id='key-match' term='match'><term>match</term></termdef> </label>
          <def>
            <p>(Of strings or names:) Two strings or names being compared must
              be character for character the same. </p>
          </def>
        </gitem>
        <gitem>
          <label><termdef id='key-identical' term='identical'>identical</termdef></label>
          <def>
            <p>(Of <pt>URI</pt>s or <nt def='nt-schemaName'>schemaName</nt>s:)
              <emph>identical</emph>, according to the rules for identity in
              <bibref ref='ref-xml-namespaces'/>.</p>
          </def>
        </gitem>
      </glist>
    </div2>
  </div1>
  <div1 id='concepts'>
    <head>Conceptual Framework</head>
    <p> This specification uses a number of terms that are common to many of
      the fields of endeavor that have influenced the development of XML Schema.
      Unfortunately, it is often the case that these terms do not have the same
      definitions in all of those fields. This section attempts to provide
      definitions of terms as they are used to describe the conceptual framework, and
      the remainder of the specification.</p>
    <div2 id='concepts-kindsOfDocs'>
      <head>Kinds of XML Documents</head>
      <p>Since XML schemas are themselves specified as XML documents or elements within documents, it is
        useful to clarify the relationships between certain kinds of XML documents and elements:
      </p>
      <glist>
        <gitem>
          <label><termdef id='key-instance' term='Instance'><term>Instance</term></termdef> </label>
          <def>
            <p>An XML element information item which conforms to some schema.
See <bibref ref='ref-xmlinfo'/> for a discussion of information items:  in
brief, <termdef term='element information item' id='eltInfoItem'>an
<term>element information item</term> is the component of an infoset which
corresponds to an element.  From it other information items are accessible,
including attributes, namespace declaration and content.</termdef>
See <specref ref='composition-instances'/> and
<specref ref='conformance-schemaValidity'/> for the means by which an instance
identifies the schema(s) to which it conforms. Note we will often speak loosely
about an (XML) instance document, but this is just shorthand for <emph>element
information item associated with the document element of an XML
document</emph>.  Similarly, we will often speak of elements when we mean
<emph>element information item</emph>.</p>
          </def>
        </gitem>
        <gitem>
          <label><termdef id='key-schema' term='Schema'><term>XML Schema</term></termdef> </label>
          <def>
            <p>An XML element information item which, along with its descendants, satisfies all the 
              Constraints on Schemas in this specification.  An XML Schema establishes a set of rules
              for constraining the structure and articulating the information
set of XML document instances.</p>
          </def>
        </gitem>
      </glist>
      <p>Note that it is possible to specify a schema to which
        schemas themselves must conform, and this is given in
        <specref ref='normative-schemaSchema'/>. An XML 1.0 DTD to which schemas
        must conform is also provided in
        <specref ref='normative-schemaDTD'/>. </p>
      <p>Any schema is <emph>ipso facto</emph> an element information item. It
follows that the rules specified herein for
        validity apply to all of the following kinds of XML element information items:
        <ulist>
          <item>
            <p>Elements that are not schemas;</p>
          </item>
          <item>
            <p>Schemas applicable to documents that are not schemas;</p>
          </item>
          <item>
            <p>The schema applicable to schemas. </p>
          </item>
        </ulist> Likewise, rules for schemas in general apply to the particular schema 
        for schemas, which is an instance conforming to itself.</p>
    </div2>
    <div2 id='concepts-schemaConstraints'>
      <head>On schemas, 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>Three kinds of normative statements about the impact of &XSP1;
        components on instances are distinguished in this specification:</p>
      <glist>
        <gitem>
          <label><termdef id='gloss-cos' term='Constraint on Schemas'><term>Constraint on Schemas</term></termdef>
          </label>
          <def>
            <p>Constraints on the form and content of schemas themselves, above
              and beyond those expressed in <specref ref='normative-schemaSchema'/>; </p>
          </def>
        </gitem>
        <gitem>
          <label><termdef id='gloss-svc' term='Schema-Validity Constraint'><term>Schema-Validity
            Constraint</term></termdef> </label>
          <def>
            <p>Constraints on the form and content of instances, which the instances must satisfy to
              be <termref def='key-schema-valid'>schema-valid</termref>; </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 instance information sets which follow
              as a consequence of schema-validation. </p>
          </def>
        </gitem>
      </glist>
      <note>
        <p><termref def='gloss-sic'>Schema Information Set
          Contribution</termref>s are not as new as might at first appear: XML 1.0
          validation augments the XML 1.0 information set in similar ways, e.g. by
          providing values for attributes not present in instances, and by implicitly
          exploiting type information for normalization or access, e.g. consider the
          effect of <code>NMTOKENS</code> on attribute whitespace, and the semantics of
          <code>ID</code> and <code>IDREF</code>. By including <termref def='gloss-sic'>Schema Information Set Contribution</termref>s, we are trying
          to make explicit something XML 1.0 left implicit.</p>
      </note>
      <p>&XSP1; not only reconstructs the DTD constraints of XML 1.0 using XML
        instance syntax, it also adds the ability to define new kinds of constraints.
        For example, although the author of an XML 1.0 DTD may declare an element type
        as containing character data, elements, or mixed content, there is no mechanism
        with which to constrain the contents of elements to only character data of a
        particular form, such as only integers in a specified range. </p>
      <p>This specification supports the expression of just such constraints by
        including in the mechanism for the declaration of elements the option of
        specifying that its contents must consist of a valid string expression of a
        particular datatype. A number of other mechanisms are added which improve the
        expressive power, usability and maintainability of schemas as a means to
        defining the structure of XML documents. </p>
    </div2>
    <div2 id='concepts-types'>
     <head>Schemas, Types and Elements</head>
 <p>The purpose of a schema is to identify a set of components for use in XML documents
and to provide the rules for their correct combination.
 </p>
 <p>
The schema language is itself a set of elements and attributes. We will describe these, and show how they are used. But first, a quick example of an XML document.
</p>
<note role='example'><eg xml:space='preserve'><![CDATA[<?xml version='1.0'?>
<PurchaseOrder orderDate="1999-05-20">
    <shipTo type="US">
        <name>Alice Smith</name>
        <street>123 Maple Street</street>
        <city>Mill Valley</city>
        <state>CA</state>
        <zip>90952</zip>
    </shipTo>
    <shipDate>1999-05-25</shipDate>
    <comment>Get these things to me in a hurry, my lawn is going wild!</comment>
    <Items>
        <Item pno="333-333">
            <productName>Lawnmower, model BUZZ-1</productName>
            <quantity>1</quantity>
            <price>148.95</price>
            <comment>Please confirm this is the electric model</comment>
        </Item>
        <Item pno="444-444">
            <productName>Baby Monitor, model SNOOZE-2</productName>
            <quantity>1</quantity>
            <price>39.98</price>
        </Item>
    </Items>
</PurchaseOrder>]]></eg></note>
 <p>The purchase order consists of a main element with several subordinate
elements. Most of the subelements have simple atomic types such as <code>string</code> or
<code>date</code>, drawn from the repertoire of built-in datatypes defined in <bibref ref='ref-xsp2'/>, but some are complex. We use the <code>archetype</code> element
when declaring elements which allow elements in their content and/or may carry attributes. For example, we can define an archetype called <code>Address</code> as follows:
</p>
 <note role='example'><eg xml:space='preserve'><![CDATA[<archetype name="Address" >
    <element name="name"   type="string" />
    <element name="street" type="string" />
    <element name="city"   type="string" />
    <element name="state"  type="string" />
    <element name="zip"    type="number" />
    <attribute name="type" type="string" />
</archetype>]]></eg><p>The consequence of this definition is that an element whose 
type is declared to be <code>Address</code>
must consist of five elements and may have one attribute. Though
each has a distinct name, four of the elements and the attribute will simply contain a string in
a document instance while one will contain a number.
</p></note>
     <p>If we're going to use the same element in a number of places, we can
declare it once and refer to it by name elsewhere:</p>
     <note role='example'>
      <eg xml:space='preserve'><![CDATA[<element name="comment" type="string" />]]></eg>
      <p>This declaration restricts the <code>comment</code> element to text
content and no attributes.</p>
     </note>
  <p>
We can define a <code>PurchaseOrderType</code> for our
<code>PurchaseOrder</code> element, referring to the definitions of <code>Address</code> and <code>comment</code> as above, as:
</p>
 <note role='example'><eg xml:space='preserve'><![CDATA[<archetype name="PurchaseOrderType">
    <element name="shipTo"    type="Address" />
    <element name="shipDate"  type="date" />
    <element ref="comment" minOccurs='0' />
    <element name="Items"     type="Items" />
    <attribute name="orderDate" type="date" />
</archetype>]]></eg><p>The <code>shipDate</code> element daughter of
<code>PurchaseOrderType</code> is declared
above as having an atomic type, as in the
<code>Address</code> example above.  The <code>comment</code> daughter is
declared by reference to a global element declaration.  Similarly, the <code>shipTo</code>
and <code>Items</code> daughters are declared as having complex types which must be
defined elsewhere in the current schema.   The <code>comment</code> daughter and the
<code>orderDate</code> attribute are optional, the others are obligatory.
</p>
</note>
 <issue id='type-decl-syntax'>
  <p>Further integration of the concrete syntax for type definitions is
desireable, e.g. by using 'type' for both archetypes and and
datatypes, but the details of a consistent and clear way to do this
have not yet been agreed.</p></issue>

<p>Since an element declaration's <code>type</code> can identify either a datatype or an archetype, and there are separate symbol spaces for these two, the
possibility of ambiguity arises.  This is resolved in favour of the archetype, e.g. even if a datatype called <code>Address</code> existed (either
builtin or user-defined), the above declaration for <code>shipTo</code> would
refer to the user-defined archetype of that name.</p> 
     <issue id='note-two-sses'>
      <p>The separation of the datatype and archetype name symbol spaces is
primarily motivated by the decision to allow unqualified reference to the <emph>ab
initio</emph> and built-in datatypes.  Should this decision be reversed, as was
suggested in the report of the simplification Task Force, then the unification of the
two symbol spaces could proceed with minimal negative impact.  The potential for
error which arises from unexpected shadowing of an old datatype by a new
archetype would be removed.</p>
     </issue>
 <p>
<termdef term='definition' id='nt-definition'>A <term>definition</term> creates a new archetype or datatype</termdef>; <termdef id='nt-declaration' term='declaration'>a <term>declaration</term> enables the appearance in a
document instance of an element or attribute with a specific name and type</termdef>. In the schema,
we see both the definition of several types, and also several elements and
attributes declared
as usages of these types. For example, <code>Address</code> is defined to be an
archetype, while within the definition of <code>Address</code> we see five
declarations of elements and one attribute declaration. These declarations are
not themselves types, but rather an association between a name and constraints
which govern the appearance of that name in documents governed by the containing schema.</p>
 <p>
In the case of attribute declarations, the constraints are on the allowed
value, always by reference to a datatype:
</p>
 <note role='example'>
<eg xml:space='preserve'><![CDATA[<attribute name="orderDate" type="date" />]]></eg>
</note>
 <p>In the case of element declarations, the constraints are on the allowed
content and attributes, by reference to an archetype <emph>or</emph> a datatype (in which
case no attributes are allowed):
</p>
 <note role='example'><eg xml:space='preserve'><![CDATA[<element name="shipTo" type="Address" />
<element name="comment" type="string" />
]]></eg><p>Because <code>Address</code> is defined in the schema to have
certain elements as its content and to allow a certain attribute, any
<code>shipTo</code> element appearing in an instance must include those
elements and may have that attribute, while any <code>comment</code> element
may not have
any attributes, but any text content.</p></note>
 <p>As well as naming a datatype or archetype in an attribute or element
declaration, we can embed the type definition immediately within the
element declaration:</p>
     <note role='example'>
      <eg xml:space='preserve'><![CDATA[<archetype name='Items'>
 <element name='Item' minOccurs='0' maxOccurs='*'>
  <archetype>
   <element name='productName' type='string' />
   <element name='quantity' type='integer'>
    <minExclusive>0</minExclusive>
   </element>
   <element name='price' type='number' />
   <element ref='comment' minOccurs='0' />
  </archetype>
 </element>
</archetype>]]></eg>
      <p>Here not only is the archetype of the <code>Item</code> element given
in line, but also the datatype referenced by its
<code>quantity</code> daughter (the built-in <code>integer</code> datatype) is
also qualified inline by adding a subrange constraint.</p>
     </note>
   <p>Taken together the examples above constitute a complete schema for the
initial <code>PurchaseOrder</code> example instance.  They are drawn together
in a single complete schema in <specref ref='sampleSchema'/>.</p>
     
    </div2>
    <div2 id='concepts-schemaComponents'>
      <head>Schemas and their component parts</head>
      <p>The next chapter <specref ref='declare'/> sets out the &XSP1; approach
        to schemas and formal definitions of their component parts. Here we informally
        summarize the key constructs used in defining schemas. A 'Yes' in the
        'Name apears in instances?' column indicates that the name will appear in instances --
        other names are for schema use only. </p>
      <table border='solid' cellpadding='5' cellspacing='0' width='100%'>
        <tbody>
          <tr>
            <th align='left' valign='top' rowspan='1' colspan='1'> &XSP1;
              Feature </th>
            <th align='left' valign='top' rowspan='1' colspan='1'> Purpose
            </th>
            <th align='left' valign='top' rowspan='1' colspan='1'> Named? </th>
           <th align='left' valign='top' rowspan='1' colspan='1'>Name appears
in instances?</th>

          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'><specref ref='declare-schema'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> A wrapper element
              containing all the definitions and declarations comprising a schema.
            </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Yes </td>
           <td valign='top'>No</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'><specref ref='declare-datatype'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> An atomic type
              (content constraint), such as 'integer', that applies to character
              data in an instance document, whether it appears as an attribute value or the
              contents of an element. The mechanisms for defining datatypes are set out
              elsewhere, in &XSP2;. </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Yes </td>
           <td valign='top'>No</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'><specref ref='declare-archetype'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> A complete
              set of constraints for elements in instance documents, applying to both
              contents and attributes. </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Yes </td>
           <td valign='top'>No</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'>
              <specref ref='declare-element'/></td>
            <td align='left' valign='top' rowspan='1' colspan='1'> An
              association between a name for an element and a type. An element
              declaration for 'A' is comparable to a DTD declaration
              <code>&lt;!ELEMENT A .....&gt;</code>.</td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Yes (local
              or global) </td>
           <td valign='top'>Yes</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'><specref ref='declare-attribute'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> An
              association between a name for an attribute and a datatype, together with
              occurrence constraints such as 'required' or 'default'. The
              association is local to its surrounding archetype.</td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Yes (local)
              </td>
           <td valign='top'>Yes</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'> Content type
              </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Either a
              datatype or a content model. A content type applies to the contents of elements
              in an instance document (but not their attribute values). It provides a
              unifying abstraction for the constraints which apply to the contents of
              elements, but introduces no additional features. </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> No </td>
           <td valign='top'>No</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'><specref ref='declare-contentModel'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> A
constraint that applies to the contents of elements in an instance
              document. Content models do not include attribute declarations.</td>
            <td align='left' valign='top' rowspan='1' colspan='1'> No </td>
           <td valign='top'>No</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'>
              <specref ref='declare-elementOnly'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Components
              for constructing content models which allow only element content. Includes
              facilities for grouping and sequencing, as well as for declaration of and
              reference to elements. </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> No (but see
              below) </td>
           <td valign='top'>No</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'>
              <specref ref='declare-attributeGroup'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> An
              association between a name and a reusable collection of attribute declarations.
              </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Yes </td>
           <td valign='top'>No</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'><specref ref='declare-namedModelGroup'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Model groups
              are part of the content model building block abstraction, but are unnamed and
              cannot be referenced for reuse. A named model group is an association between a
              name and a model group, allowing for reuse.</td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Yes </td>
           <td valign='top'>No</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'><specref ref='declare-refinement'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> One
              archetype may be defined as refining one or more other archetypes, acquiring
              content type and/or attributes therefrom.</td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Yes </td>
           <td valign='top'>No</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'><specref ref='composition-schemaImport'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Extends the
              current schema with definitions and/or declarations from elsewhere,
              retaining the association with their origin.</td>
            <td align='left' valign='top' rowspan='1' colspan='1'> No </td>
           <td valign='top'>No</td>
          </tr>
          <tr>
            <td align='left' valign='top' rowspan='1' colspan='1'><specref ref='composition-schemaInclude'/> </td>
            <td align='left' valign='top' rowspan='1' colspan='1'> Integrates
              definitions and/or declarations from elsewhere into the schema being
              defined, as if they had been defined locally.</td>
            <td align='left' valign='top' rowspan='1' colspan='1'> No </td>
           <td valign='top'>No</td>
          </tr>
        </tbody>
      </table>
    </div2>
    <div2 id='concepts-nameSymbolSpaces'>
      <head>Names and Symbol Spaces</head>
      <p>As indicated in the third column of the tables above, most of the
        components listed have names, which provide for references within the
        schema, and sometimes from one schema to another. For example, an attribute
        declaration can refer to a named datatype, such as 'integer'. A
        content model can refer to an element, and so on. </p>
      <p>If all such names were assigned from the same 'pool', then
        it would be impossible to have e.g. a datatype named 'integer' and an
        element with the name 'integer' in the same schema.
        <termdef id='key-symbolSpace' term='symbol space'>Accordingly we introduce the
        idea of a <term>symbol space</term> (avoiding 'name space' to avoid
        confusion with 'Namespaces in XML' <bibref ref='ref-xml-namespaces'/>).</termdef></p>
      <p>There is a single distinct symbol space within a given schema for each
        of the abstractions named above other than 'Attribute' and
        'element': within a given symbol space, names are unique, but
        the same name may appear in more than one symbol space without conflict. In
        particular note that the same name can refer to both a type and an
        element, without conflict or necessary relation between the two. </p>
      <p>Attributes and local element declarations are special, in that
        every archetype defines its own attribute symbol space and local element symbol 
        space, which are distinct from each other.  In addition, top-level elements
        (whose declarations are not contained within an archetype definition) reside in 
        their own symbol space.
        </p>
    </div2>
    <div2 id='declare-syntaxes'>
      <head>Abstract and Concrete Syntax</head>
      <p>&XSP1; is presented here primarily in the form of an
        <termdef id='key-abstractSyntax' term='abstract syntax'> <term>abstract
        syntax</term>, which provides a formal specification of the information
        provided for each declaration and definition in the schema language. </termdef>
        The abstract syntax is presented using a simplified BNF. Defined terms are to
        the left. Their components are to the right, with a small amount of
        meta-syntax: ()s for grouping, | to separate alternatives, ? for optionality, *
        and + for iteration. Terms in italics are primitives, not expanded here, either
        because they are defined elsewhere (e.g. <pt>URI</pt>, defined by
        <bibref ref='ref-uri'/>) or because they can only be grounded once a concrete
        syntax is decided on (e.g. <pt>choice</pt>). </p>
      <p>An abstract syntax production prefixed with a number in brackets (e.g.
        [3]) is normative; other abstract syntax is either for purposes of explanation,
        or is a duplicate (for convenience) of a normative definition to be found
        elsewhere.</p>
      <p>The abstract syntax illustrates the expressive power of the language,
        and the relationships among its component parts. The abstract syntax can be
        used to evaluate the expressive power of &XSP1;, but not its look and feel. In
        particular, please note that neither ordering within or between productions or
        choice of names is significant, and that any particular concrete syntax is not
        constrained by these.</p>
      <p>The <termdef id='key-concreteSyntax' term='concrete syntax'><term>concrete syntax</term> of &XSP1;, the exact
        element and attribute names used in a schema</termdef>, are a key feature of
        its proposed design. The concrete syntax is the form in which the schema
        language is used by schema authors. Though its elements and attributes are
        often different from the terms of the abstract syntax BNF, the features and
        expressive power of the two are congruent. The concrete syntax profoundly
        affects the convenience and usability of the schema language. </p>
      <p>We include a preliminary concrete syntax in this draft, via examples, paradigms
        and in <specref ref='normative-schemaSchema'/> and
        <specref ref='normative-schemaDTD'/>. Unlike the previous version, in
which the intention was to
        stay quite close to the abstract syntax, in this version we have begun
to take convenience and clarity into account. </p>
    </div2>
  </div1>
  <div1 id='declare'>
   <head>Schema Definitions and Declarations</head>
    <p>The principal purpose of &XSP1; is to provide a means for defining
      schemas that constrain the contents of instances and augment the
      information sets thereof. </p>
    <div2 id='declare-schema'>
      <head>The Schema</head>
      <p>A schema contains some preamble information and a set of definitions
        and declarations. </p>

      <scrap lang='ebnf' id='RuleSet.XS3'>

        <head>Schema top level</head>
        <prod id='nt-schema'>
          <lhs>schema</lhs>
          <rhs xml:space='preserve'><nt def='nt-preamble'>preamble</nt> <nt def='nt-dds'>dds</nt>*
          </rhs>
        </prod>
        <prod id='nt-dds'>
          <lhs>dds</lhs>
          <rhs xml:space='preserve'><nt def='nt-datatypeDefn'>datatypeDefn</nt> |
            <nt def='nt-archetypeDefn'>archetypeDefn</nt> | <nt def='nt-elementDecl'>elementDecl</nt> | <nt def='nt-attrGroupDefn'>attrGroupDefn</nt> | <nt def='nt-modelGroupDefn'>modelGroupDefn</nt> | <nt def='nt-notationDecl'>notationDecl</nt> | <nt def='nt-entityDecl'>entityDecl</nt></rhs>
        </prod>
        <prod id='nt-preamble'>
          <lhs>preamble</lhs>
          <rhs xml:space='preserve'><nt def='nt-xmlSchemaRef'>xmlSchemaRef</nt> <nt def='nt-targetNamespace'>targetNamespace</nt> <nt def='nt-schemaVersion'>schemaVersion</nt> <nt def='nt-model'>model</nt> <nt def='nt-export'>export</nt>? <nt def='nt-import'>import</nt>?
            <nt def='nt-include'>include</nt>?</rhs>
        </prod>
        <prod id='nt-xmlSchemaRef'>
          <lhs>xmlSchemaRef</lhs>
          <rhs xml:space='preserve'><pt>URI</pt> </rhs>
        </prod>
        <prod id='nt-targetNamespace'>
          <lhs>targetNamespace</lhs>
          <rhs><pt>URI</pt></rhs>
        </prod>
        <prod id='nt-schemaVersion'>
          <lhs>schemaVersion</lhs>
          <rhs xml:space='preserve'><pt>string-value</pt> </rhs>
        </prod>
        <prod id='nt-model'>
          <lhs>model</lhs>
          <rhs xml:space='preserve'><pt>open</pt> | <pt>refinable</pt> | <pt>closed</pt> </rhs>
        </prod>

      </scrap>
      <p><nt def='nt-preamble'>preamble</nt> consists of an
        <nt def='nt-xmlSchemaRef'>xmlSchemaRef</nt> specifying the URI for &XSP1;; the
        <nt def='nt-targetNamespace'>targetNamespace</nt> specifying the URI of
the namespace which this schema is about; and a <nt def='nt-schemaVersion'>schemaVersion</nt> specification for private version
        documentation purposes and version management.</p>
     <p>See <specref ref='composition'/> for discussion of schemas, instances
and namespaces.</p>
     <ednote>
      <edtext>The whole matter of instance/schema connections is still under
discussion:  the WG has not reached consensus in this area.  The referenced
section does give some indication of where our thinking in this area is going.</edtext>
     </ednote>


<e:element-syntax name='schema'>
 <e:in-category name='root'/>
 <e:attribute name='model'>
  <e:constant value='open'/>
  <e:constant value='refinable'/>
  <e:constant value='closed'/>
 </e:attribute>
 <e:attribute name='targetNS'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='version'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='xmlns'>
  <e:constant value='&XMLSchemaNS;'/>
 </e:attribute>
 <e:sequence>
 <e:element name='import' repeat='zero-or-more'/>
 <e:element name='include' repeat='zero-or-more'/>
 <e:element name='export' repeat='zero-or-one'/>
 <e:choice repeat='zero-or-more'>
  <e:element name='attrGroup'/>
  <e:element name='comment'/>
  <e:element name='datatype'/>
  <e:element name='element'/>
  <e:element name='externalEntity'/>
  <e:element name='group'/>
  <e:element name='notation'/>
  <e:element name='textEntity'/>
  <e:element name='archetype'/>
  <e:element name='unparsedEntity'/>
 </e:choice>
</e:sequence>
</e:element-syntax>
<e:element-syntax name='comment'>
 <e:in-category name='top-level'/>
 <e:text/>
</e:element-syntax>


      <note role='example'>
        <eg xml:space='preserve'>
&lt;!DOCTYPE schema
          PUBLIC '-//W3C//DTD XML Schema Version 1.0//EN'
          SYSTEM '&XSP1.URI;.dtd' &gt;

&lt;schema targetNS='http://purl.org/metadata/dublin_core'
        version='M.n'
        xmlns='&XMLSchemaNS;'&gt;

  ...

&lt;/schema&gt;
</eg>
        <p>Note that the abstract syntax <nt def='nt-xmlSchemaRef'>xmlSchemaRef</nt> is
          realised via a default namespace declaration in the concrete syntax.</p>
    </note>
     <p>Although the schema above is a complete XML document,  <code>schema</code>
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>The schema's <nt def='nt-model'>model</nt> property is discussed in
      <specref ref='declare-refinement'/>. The schema's <nt def='nt-export'>export</nt>, <nt def='nt-import'>import</nt> and
      <nt def='nt-include'>include</nt> properties are discussed in
      <specref ref='composition'/>.</p>
    <p>The schema's declarations and definitions, discussed in detail in
      <specref ref='declare'/>, provide for the creation of new schema components:
    </p>

    <scrap lang='ebnf' id='RuleSet.XS4'>

      <head>Summary of Definitions and Declarations</head>
      <prod id='nt-datatypeDefn2' role='prefig'>
        <lhs>datatypeDefn</lhs>
        <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-datatypeSpec'>datatypeSpec</nt> </rhs>

      </prod>
      <prod id='nt-archetypeDefn2' role='prefig'>
        <lhs>archetypeDefn</lhs>
        <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-archetypeSpec'>archetypeSpec</nt> </rhs>
      </prod>
      <prod id='nt-elementDecl2' role='prefig'>
        <lhs>elementDecl</lhs>
        <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-elementSpec'>elementSpec</nt> </rhs>
      </prod>
      <prod id='nt-modelGroupDefn2' role='prefig'>
        <lhs>modelGroupDefn</lhs>
        <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-modelGroupSpec'>modelGroupSpec</nt> </rhs>
      </prod>
      <prod id='nt-attrGroupDefn2' role='prefig'>
        <lhs>attrGroupDefn</lhs>
        <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-attrGroupSpec'>attrGroupSpec</nt> </rhs>
      </prod>
      <prod id='nt-entityDecl2' role='prefig'>
        <lhs>entityDecl</lhs>
        <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-entitySpec'>entitySpec</nt> </rhs>
      </prod>
      <prod id='nt-notationDecl2' role='prefig'>
        <lhs>notationDecl</lhs>
        <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-notationSpec'>notationSpec</nt> </rhs>

      </prod>

    </scrap>

    <note role='example'>
      <p>The following illustrates the basic model for declaring or defining all &XSP1;
        components:</p>
      <eg xml:space='preserve'>
 &lt;datatype name='myDatatype'&gt;
  ...
 &lt;/datatype&gt;

 &lt;archetype name='myType'&gt;
  ...
 &lt;/archetype&gt;

 &lt;element name='myElement'&gt;
  ...
 &lt;/element&gt;

 &lt;attrGroup name='myAttrGroup'&gt;
  ...
 &lt;/attrGroup&gt;

 &lt;group name='myModelGroup'&gt;
  ...
 &lt;/group&gt;

 &lt;notation name='myNotation' ... /&gt;

 &lt;textEntity name='myTextEntity'&gt;
  ...
 &lt;/textEntity&gt;

 &lt;externalEntity name='myExternalEntity' ... /&gt;

 &lt;unparsedEntity name='myUnparsedEntity' ... /&gt;

&lt;/schema&gt;
</eg>
      <p>When creating a component, we establish an association between its name
        and the specification for that component. Each new component therefore
        creates a new entry in the symbol space for that kind of component. </p>
  </note>
  <p>The <specref ref='cos-unique'/> <termref def='gloss-cos'>Constraint on Schemas</termref> obtains.</p>
  <issue id='no-evolution'>
    <p> This draft does not deal with the requirement "for addressing the
      evolution of schemata" (see <bibref ref='ref-xsreq'/>).</p>
  </issue>
</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 Constructs</head>
  <p> Uniform means are provided for reference to a broad variety of schema
    constructs, both within a single schema and to features imported (<specref ref='composition-schemaImport'/>) from external schemas. The name used to
    reference any component of &XSP1; from within a schema consists of an
    <termref def='gloss-NCName'>NCName</termref> and an optional
    <nt def='nt-schemaRef'>schemaRef</nt>, a reference to an external
    <termref def='key-schema'>schema</termref>. In a few
    cases, some qualification may be added to a reference: this is made clear as
    the individual reference forms are introduced below. </p>

  <scrap lang='ebnf' id='RuleSet.XS2'>

    <head>Example: Component Names and References</head>
    <prod id='nt-schemaRef'>
      <lhs>schemaRef</lhs>
      <rhs xml:space='preserve'>(<nt def='nt-schemaAbbrev'>schemaAbbrev</nt> |
        <nt def='nt-schemaName'>schemaName</nt>)</rhs>
    </prod>
    <prod id='nt-schemaAbbrev'>
      <lhs>schemaAbbrev</lhs>
      <rhs><pt>NCName</pt></rhs>
    </prod>
    <prod id='nt-schemaName'>
      <lhs>schemaName</lhs>
      <rhs><pt>URI</pt></rhs>
    </prod>
   <prod id='nt-typeRef2' role='prefig'>
      <lhs>typeRef</lhs>
      <rhs xml:space='preserve'><nt def='nt-archetypeRef'>archetypeRef</nt> | <nt def='nt-datatypeRef'>datatypeRef</nt></rhs>
    </prod>
    <prod id='nt-datatypeRef2' role='prefig'>
      <lhs>datatypeRef</lhs>
      <rhs xml:space='preserve'><nt def='nt-datatypeName'>datatypeName</nt> <nt def='nt-datatypeQual'>datatypeQual</nt></rhs>
    </prod>
    <prod id='nt-datatypeName2' role='prefig'>
      <lhs>datatypeName</lhs>
      <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
    </prod>
    <prod id='nt-archetypeRef2' role='prefig'>
      <lhs>archetypeRef</lhs>
      <rhs><nt def='nt-archetypeName'>typeName</nt></rhs>
    </prod>
    <prod id='nt-archetypeName2' role='prefig'>
      <lhs>archetypeName</lhs>
      <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
    </prod>
    <prod id='nt-elementRef2' role='prefig'>
      <lhs>elementRef</lhs>
      <rhs xml:space='preserve'><nt def='nt-elementName'>elementName</nt> </rhs>
    </prod>
    <prod id='nt-elementName2' role='prefig'>
      <lhs>elementName</lhs>
      <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
    </prod>
    <prod id='nt-attrGroupRef2' role='prefig'>
      <lhs>attrGroupRef</lhs>
      <rhs xml:space='preserve'><nt def='nt-attrGroupName'>attrGroupName</nt> <nt def='nt-attrGroupQual'>attrGroupQual</nt></rhs>
    </prod>
    <prod id='nt-attrGroupName2' role='prefig'>
      <lhs>attrGroupName</lhs>
      <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
    </prod>
    <prod id='nt-modelGroupRef2' role='prefig'>
      <lhs>modelGroupRef</lhs>
      <rhs><nt def='nt-modelGroupName'>modelGroupName</nt></rhs>
    </prod>
    <prod id='nt-modelGroupName2' role='prefig'>
      <lhs>modelGroupName</lhs>
      <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
    </prod>
    <prod id='nt-entityRef2' role='prefig'>
      <lhs>entityRef</lhs>
      <rhs><nt def='nt-entityName'>entityName</nt></rhs>
    </prod>
    <prod id='nt-entityName2' role='prefig'>
      <lhs>entityName</lhs>
      <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
    </prod>
    <prod id='nt-notationRef2' role='prefig'>
      <lhs>notationRef</lhs>
      <rhs><nt def='nt-notationName'>notationName</nt></rhs>
    </prod>
    <prod id='nt-notationName2' role='prefig'>
      <lhs>notationName</lhs>
      <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
    </prod>

  </scrap>

  <p>The abstract syntax above characterizes the reference mechanisms used in this
    specification.</p>
  <note role='example'>
    <eg xml:space='preserve'>
&lt;element name='elem1' type='Address'/&gt;

&lt;element name='elem2' type='BLOCKQUOTE' schemaAbbrev='XHTML'/&gt;

&lt;attribute name='attr1'
              type='quantity' schemaName='http://www.w3.org/xsl.xsd'/&gt;
</eg>
    <p>The first of these is a local reference, the other two refer to schemas
      elsewhere. The <code>BLOCKQUOTE</code> example assumes
      the <nt def='nt-schemaAbbrev'>schemaAbbrev</nt> <code>XHTML</code> has been
      declared for import; the <code>template</code> example
      similarly assumes that the given (imaginary as of this writing) URL has been
      declared for import. See <specref ref='composition-schemaImport'/> for a
      discussion of importing.</p>
</note>
<p>The <specref ref='cos-cons-import'/> <termref def='gloss-cos'>Constraint on Schemas</termref> obtains.</p>
<p>The <specref ref='cos-ref-oneway'/> <termref def='gloss-cos'>Constraint on Schemas</termref> obtains.</p>
<p>The <termref def='key-identify'>identify</termref> definition wrt schema-validity obtains.</p>
 <p>The
  <specref ref='cos-ident-ref'/> <termref def='gloss-cos'>Constraint on
  Schemas</termref> also obtains.</p>
</div2>
<div2 id='declare-typesElementsAttributes'>
<head>Types, Elements and Attributes</head>
<p>Like XML 1.0 DTDs, &XSP1; provides facilities for constraining the contents
  of elements and the values of attributes, and for augmenting the information
  set of instances, e.g. with defaulted values and type information.
  <termdef id='SC' term='SC'>We refer hereafter to the combination of schema
  constraints and information set contributions with the abbreviation
  <term>SC</term></termdef>. Compared to DTDs, &XSP1; provides for a richer set
  of <termref def='SC'>SC</termref>s, and improved capabilities for sharing
  <termref def='SC'>SC</termref>s across sets of elements and attributes.</p>

<div3 id='declare-datatype'>
  <head>Datatype Definition</head>
  <p>We start with <termdef id='key-datatype' term='datatype'>the simple
    datatypes whose expression in XML documents consists entirely of character
    data. As in the current draft of &XSP2;, wherever we speak of
    <term>datatype</term>s in this draft, we shall mean these simple
    datatypes.</termdef></p>

  <scrap lang='ebnf' id='RuleSet.XS5'>

    <head>Datatypes</head>
    <prod id='nt-datatypeDefn'>
      <lhs>datatypeDefn</lhs>
      <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-datatypeSpec'>datatypeSpec</nt> </rhs>
    </prod>
    <prod id='nt-datatypeSpec'>
      <lhs>datatypeSpec</lhs>
      <rhs>
        <com>[defined by XML Schemas: Datatypes]</com>
        <nt def='nt-exportControl'>exportControl</nt>?</rhs>
    </prod>
    <prod id='nt-datatypeQual'>
      <lhs>datatypeQual</lhs>
      <rhs><nt def='nt-specialize'>specialize</nt>?
        <nt def='nt-valueConstraint'>valueConstraint</nt>?</rhs>
    </prod>
    <prod id='nt-specialize'>
      <lhs>specialize</lhs>
      <rhs><nt def='nt-facet'>facet</nt>+</rhs>
    </prod>
    <prod id='nt-facet'>
      <lhs>facet</lhs>
      <rhs>
        <com>is defined by XML Schemas: Datatypes. It might be a range
          restriction, length constraint, etc.</com> </rhs>
    </prod>
    <prod id='nt-valueConstraint'>
      <lhs>valueConstraint</lhs>
      <rhs xml:space='preserve'><pt>default</pt> | <pt>fixed</pt> </rhs>
    </prod>
    <prod id='nt-datatypeRef'>
      <lhs>datatypeRef</lhs>
      <rhs xml:space='preserve'><nt def='nt-datatypeName'>datatypeName</nt> <nt def='nt-datatypeQual'>datatypeQual</nt></rhs>
    </prod>
    <prod id='nt-datatypeName'>
      <lhs>datatypeName</lhs>
      <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>? </rhs>
    </prod>
    <prod id='nt-schemaRef2' role='prefig'>
      <lhs>schemaRef</lhs>
      <rhs xml:space='preserve'>(<nt def='nt-schemaAbbrev'>schemaAbbrev</nt> |
        <nt def='nt-schemaName'>schemaName</nt>)</rhs>
    </prod>
    <prod id='nt-schemaAbbrev2' role='prefig'>
      <lhs>schemaAbbrev</lhs>
      <rhs><pt>NCName</pt></rhs>
    </prod>
    <prod id='nt-schemaName2' role='prefig'>
      <lhs>schemaName</lhs>
      <rhs><pt>URI</pt></rhs>
    </prod>

  </scrap>

  <p>&XSP1; incorporates the datatype specification mechanisms defined by
    <bibref ref='ref-xsp2'/> in order to express <termref def='SC'>SC</termref>s on
    attribute values and the contents of elements consisting entirely of character data. </p>
  <p>The production for <nt def='nt-datatypeSpec'>datatypeSpec</nt> above serves to indicate where this
    chapter connects with &XSP2;.  <nt def='nt-exportControl'>exportControl</nt> is
    defined in <specref ref='composition-schemaExport'/>.  The concrete syntax
displayed below is copied from <bibref ref='ref-xsp2'/>.  Most of the elements
are for specifying facets:  they are all optional and may appear in any order
after the <code>basetype</code> element.</p>
  <p>The other productions provide for using datatypes once they have been
    defined, see below under <nt def='nt-contentType'>contentType</nt> and
    <nt def='nt-attrDecl'>attribute</nt>.</p>
  <p>We assume that it is appropriate to allow for some local specialization of
    datatypes at the point of use, and provide for that here (<nt def='nt-specialize'>specialize</nt>). </p>
  <p>As explained in <specref ref='refSchemaConstructs'/>, a
<nt def='nt-schemaRef'>schemaRef</nt>, if included, allows for the referenced
definition to be located in some other schema.</p>
<e:element-syntax name='datatype'>
 <e:in-category name='top-level'/>
 <e:attribute name='export'>
  <e:constant value='true'/>
  <e:constant value='false'/>
 </e:attribute>
 <e:attribute name='name'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:sequence>
  <e:element name='basetype'/>
  <e:choice repeat='zero-or-more'>
   <e:choice>
    <e:element name='minExclusive'/>
    <e:element name='minInclusive'/>
   </e:choice>
   <e:choice>
    <e:element name='maxExclusive'/>
    <e:element name='maxInclusive'/>
   </e:choice>
   <e:sequence repeat='zero-or-one'>
    <e:element name='maxAbsoluteValue'/>
    <e:element name='minAbsoluteValue'/>
   </e:sequence>
   <e:element name='encoding'/>
   <e:element name='enumeration'/>
   <e:element name='length'/>
   <e:element name='maxLength'/>
   <e:element name='pattern'/>
   <e:element name='period'/>
   <e:element name='precision'/>
   <e:element name='scale'/>
  </e:choice>
 </e:sequence>
</e:element-syntax>
 <e:element-syntax name='basetype'>
 <e:in-category name='datatype'/>
 <e:attribute name='name' required='yes'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaAbbrev'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaName'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:empty/>
</e:element-syntax>
 <e:element-syntax name='minExclusive'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
 <e:element-syntax name='minInclusive'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax> 
 <e:element-syntax name='maxExclusive'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
 <e:element-syntax name='maxInclusive'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
 <e:element-syntax name='minAbsoluteValue'>
 <e:in-category name='other'/>
 <e:text/>
</e:element-syntax> 
 <e:element-syntax name='maxAbsoluteValue'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
 <e:element-syntax name='encoding'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
<e:element-syntax name='enumeration'>
 <e:in-category name='datatype'/>
  <e:element name='literal' repeat='one-or-more'/>
</e:element-syntax>
<e:element-syntax name='literal'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
<e:element-syntax name='length'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
<e:element-syntax name='maxLength'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
 <e:element-syntax name='pattern'>
 <e:in-category name='datatype'/>
  <e:element name='lexical' repeat='one-or-more'/>
</e:element-syntax>
 <e:element-syntax name='lexical'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
 <e:element-syntax name='period'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
<e:element-syntax name='precision'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>
<e:element-syntax name='scale'>
 <e:in-category name='datatype'/>
 <e:text/>
</e:element-syntax>

  <note role='example'>
    <eg xml:space='preserve'><![CDATA[<datatype name='posInt'>
 <basetype name='integer'/>
 <minExclusive>0</minExclusive>
</datatype>

<attribute name='foo' type='posInt'/>

<attribute name='baz' type='integer'/>

<attribute name='fontSize' type='quantity'
           schemaName='http://www.w3.org/xsl.xsd'
           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>
</div3>
<div3 id='declare-archetype'>
<head>Archetype Definition</head>
<p><termdef id='archetype' term='archetype'><term>Archetype</term> specifications
  gather together all <termref def='SC'>SC</termref>s pertinent to elements in
  instance documents, their attributes and their contents.</termdef> They are
  called archetypes because there may be more than one element declaration that shares
  the same <termref def='SC'>SC</termref>s (see
  <specref ref='declare-element'/>), and which therefore can be constrained
  by a common archetype. </p>

<scrap lang='ebnf' id='RuleSet.XS6'>

  <head>Archetypes</head>
 <prod id='nt-archetypeDefn'>
  <lhs>archetypeDefn</lhs>
  <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-archetypeSpec'>archetypeSpec</nt></rhs>
 </prod>
  <prod id='nt-archetypeSpec'>
    <lhs>archetypeSpec</lhs>
    <rhs xml:space='preserve'><nt def='nt-refinement'>refinement</nt>* <nt def='nt-contentType'>contentType</nt> ( <nt def='nt-attrDecl'>attribute</nt> |
      <nt def='nt-attrGroupRef'>attrGroupRef</nt> )* <nt def='nt-model'>model</nt>
      <nt def='nt-exportControl'>exportControl</nt></rhs>
  </prod>
  <prod id='nt-contentType'>
    <lhs>contentType</lhs>
    <rhs xml:space='preserve'><nt def='nt-datatypeRef'>datatypeRef</nt> | <nt def='nt-contentModel'>contentModel</nt> | <nt def='nt-modelGroupRef'>modelGroupRef</nt></rhs>
  </prod>
  <prod id='nt-model2' role='prefig'>
    <lhs>model</lhs>
    <rhs xml:space='preserve'><pt>open</pt> | <pt>refinable</pt> | <pt>closed</pt> </rhs>
  </prod>
  <prod id='nt-archetypeRef'>
    <lhs>archetypeRef</lhs>
    <rhs xml:space='preserve'><nt def='nt-archetypeName'>archetypeName</nt> </rhs>
  </prod>
  <prod id='nt-archetypeName'>
    <lhs>archetypeName</lhs>
    <rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
  </prod>
<prod id='nt-refinement'>
<lhs>refinement</lhs>
<rhs><nt def='nt-archetypeRef'>typeRef</nt></rhs>
</prod>

</scrap>

<p>The first three productions above provide the basic structure of the
  specification, and the last two provide for reference to the things specified. But note
  that the name of an archetype is not <emph>ipso facto</emph> the name of
  elements whose appearance in instances will be associated with the
  <termref def='SC'>SC</termref>s of that archetype. The connection between an element
  name and an archetype is made by an <nt def='nt-elementDecl'>elementDecl</nt>, see below. </p>
<p>Alongside <specref ref='declare-attribute'/> for permitted attributes,
  <termref def='SC'>SC</termref>s for contents are specified in an archetype (<nt def='nt-contentType'>contentType</nt>). For elements which may contain only
  character data, this is by
  reference to a <specref ref='declare-datatype'/>. Note that doing this by way
  of <nt def='nt-datatypeRef'>datatypeRef</nt> allows for specialization and even
  defaulting in a manner similar to attribute values. For other kinds of
  elements, an <specref ref='declare-contentModel'/> is required. </p>
<issue id='elt-default'>
  <p>The extension of defaulting to element content is tentative. </p>
</issue>

<e:element-syntax name='archetype'>
 <e:in-category name='top-level'/>
 <e:attribute name='content'>
  <e:constant value='textOnly'/>
  <e:constant value='mixed'/>
  <e:constant value='elemOnly'/>
  <e:constant value='empty'/>
  <e:constant value='any'/>
 </e:attribute>
 <e:attribute name='default'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='fixed'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='model'>
  <e:constant value='open'/>
  <e:constant value='refinable'/>
  <e:constant value='closed'/>
 </e:attribute>
 <e:attribute name='name'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='order'>
  <e:constant value='choice'/>
  <e:constant value='seq'/>
  <e:constant value='all'/>
  <e:constant value='many'/>
 </e:attribute>
 <e:attribute name='schemaAbbrev'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaName'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='type'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:sequence>
  <e:element name='refines' repeat='zero-or-more'/>
  <e:choice>
   <e:choice repeat='zero-or-more'>
    <e:element name='element'/>
    <e:element name='group'/>
   </e:choice>
   <e:element name='datatypeQual' repeat='zero-or-one'/>
  </e:choice>
  <e:choice repeat='zero-or-more'>
   <e:element name='attrGroupRef'/>
   <e:element name='attribute'/>
  </e:choice>
 </e:sequence>
</e:element-syntax>
<e:element-syntax name='datatypeQual'>
 <e:in-category name='archetype'/>
 <e:choice repeat='zero-or-more'>
  <e:choice>
   <e:element name='minExclusive'/>
   <e:element name='minInclusive'/>
  </e:choice>
  <e:choice>
   <e:element name='maxExclusive'/>
   <e:element name='maxInclusive'/>
  </e:choice>
  <e:sequence repeat='zero-or-one'>
   <e:element name='maxAbsoluteValue'/>
   <e:element name='minAbsoluteValue'/>
  </e:sequence>
  <e:element name='encoding'/>
  <e:element name='enumeration'/>
  <e:element name='length'/>
  <e:element name='maxLength'/>
  <e:element name='pattern'/>
  <e:element name='period'/>
  <e:element name='precision'/>
  <e:element name='scale'/>
 </e:choice>
</e:element-syntax>
<e:element-syntax name='refines'>
 <e:in-category name='archetype'/>
 <e:attribute name='name' required='yes'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaAbbrev'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaName'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:empty/>
</e:element-syntax>
<note role='example'>
    <eg xml:space='preserve'><![CDATA[<archetype name='length1' type='number'/>
 <minInclusive>0</minInclusive>
 <attribute name='unit' type='NMTOKEN'/>
</archetype>

<element name='width' type='length1'/>

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

<archetype name='length2'>
 <element name='size' type='number'>
  <minInclusive>0</minInclusive>
 </element>
 <element name='unit' type='NMTOKEN'/>
</archetype>

<element name='depth' type='length2'/>

  <depth>
   <size>2.54</size><unit>cm</unit>
  </depth>]]>
</eg>
  <p>
    Two approaches to defining an archetype 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>The way in which the concrete syntax defined and illustrated above realises the abstract syntax is
not straightforward, because it is optimised to make simple cases simple.  The
<code>datatypeQual</code> option is allowed only if a <code>type</code>
attribute is present.  Similarly, the <code>schemaName</code> or 
<code>schemaAbbrev</code>, the <code>default</code> and the
<code>fixed</code> attributes are allowed only if a <code>type</code> attribute
is present.  Finally, if a <code>type</code> attribute is present, it must
reference a datatype, and the <code>content</code> attribute must be
<code>textOnly</code> (or absent, in which case it defaults to
<code>textOnly</code>).  This is to handle the main alternation in the abstract
syntax for <nt def='nt-contentType'>contentType</nt>, which allows <emph>either</emph>
(possibly locally qualified) reference to a datatype <emph>or</emph> a
content model.</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-archetype'/> <termref def='gloss-sic'>Schema Information Set Contribution</termref> obtains.</p>
</div3>
<div3 id='declare-attribute'>
<head>Attribute Declaration</head>
<p>Attribute declarations associate a name (which will appear as an attribute
in start tags in instances) with <termref def='SC'>SC</termref>s for the
presence and value thereof. </p>

<scrap lang='ebnf' id='RuleSet.XS7'>

<head>Attributes</head>
<prod id='nt-attrDecl'>
<lhs>attribute</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-datatypeRef'>datatypeRef</nt>?
<pt>required</pt> <nt def='nt-exportControl'>exportControl</nt></rhs>
</prod>
<prod id='nt-datatypeRef3' role='prefig'>
<lhs>datatypeRef</lhs>
<rhs xml:space='preserve'><nt def='nt-datatypeName'>datatypeName</nt> <nt def='nt-datatypeQual'>datatypeQual</nt></rhs>
</prod>
<prod id='nt-datatypeQual2' role='prefig'>
<lhs>datatypeQual</lhs>
<rhs><nt def='nt-specialize'>specialize</nt>? <nt def='nt-valueConstraint'>valueConstraint</nt>?</rhs>
</prod>
<prod id='nt-valueConstraint2' role='prefig'>
<lhs>valueConstraint</lhs>
<rhs xml:space='preserve'><pt>default</pt> | <pt>fixed</pt> </rhs>
</prod>
<prod id='nt-datatypeName3' role='prefig'>
<lhs>datatypeName</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>? </rhs>
</prod>
<prod id='nt-schemaRef3' role='prefig'>
<lhs>schemaRef</lhs>
<rhs xml:space='preserve'>(<nt def='nt-schemaAbbrev'>schemaAbbrev</nt> | <nt def='nt-schemaName'>schemaName</nt>)</rhs>
</prod>

</scrap>

<note>
<p>The <nt def='nt-datatypeRef'>datatypeRef</nt> productions are
repeated here for easy reference.</p>
</note>
<p>Attribute declarations provide for: </p>
<ulist>
<item>
<p>Requiring instances to have attributes; </p>
</item>
<item>
<p>Constraining attribute values to express a datatype.</p>
</item>
</ulist>
 <e:element-syntax name='attribute'>
 <e:in-category name='other'/>
 <e:attribute name='default'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='fixed'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='maxOccurs' required='yes'>
  <e:constant value='1'/>
 </e:attribute>
 <e:attribute name='minOccurs'>
  <e:constant value='0'/>
  <e:constant value='1'/>
 </e:attribute>
 <e:attribute name='name' required='yes'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaAbbrev'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaName'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='type'>
  <e:constant value='string'/>
 </e:attribute>
 <e:choice repeat='zero-or-more'>
  <e:choice>
   <e:element name='minExclusive'/>
   <e:element name='minInclusive'/>
  </e:choice>
  <e:choice>
   <e:element name='maxExclusive'/>
   <e:element name='maxInclusive'/>
  </e:choice>
  <e:sequence repeat='zero-or-one'>
   <e:element name='maxAbsoluteValue'/>
   <e:element name='minAbsoluteValue'/>
  </e:sequence>
  <e:element name='encoding'/>
  <e:element name='enumeration'/>
  <e:element name='length'/>
  <e:element name='maxLength'/>
  <e:element name='pattern'/>
  <e:element name='period'/>
  <e:element name='precision'/>
  <e:element name='scale'/>
 </e:choice>
</e:element-syntax>
<note role='example'>
<eg xml:space='preserve'><![CDATA[<attribute name='myAttribute'/>

<attribute name='anotherAttribute' type='integer' default='42'>
 <minExclusive>0</minExclusive>
</attribute>

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

<attribute name='stillAnotherAttribute' type='string' fixed='Hello world!'/>]]>
</eg>
<p>Four attributes are declared: one with no explicit
<termref def='SC'>SC</termref>s at all; two declared by reference to a built-in
datatype, one with a default and a subrange qualification and one required to
be present in instances; and one with a fixed value.</p>
</note>
 <p>The
<code>maxOccurs</code> attribute is <code>FIXED</code> at 1 for all attributes.
Consistent with this, <code>minOccurs</code> can only be 0 or 1.</p>
<p>When attribute declarations are used in an archetype specification, each
archetype provides its own symbol space for attribute names. E.g. an attribute
named <code>title</code> within one archetype need not have the same
<nt def='nt-datatypeRef'>datatypeRef</nt> as one declared within another
archetype.</p>
<p>The <termref def='key-attr-satisfy'>attr-satisfy</termref> definition wrt schema-validity obtains.</p>
<issue id='default-attr-datatype'>
<p>What <emph>is</emph> the default attribute <nt def='nt-datatypeSpec'>datatypeSpec</nt>?</p>
</issue>
<p>The <termref def='key-satisfy-attrs'>satisfy-attrs</termref> definition wrt schema-validity obtains.</p>
<p>The <specref ref='sic-attr-default'/> <termref def='gloss-sic'>Schema Information Set Contribution</termref> obtains.</p>
<issue id='namespace-declare'>
<p>We've got a problem with namespace declarations: they're not
attributes at the infoset level, so they can appear without compromising
validity, <emph>except</emph> if there is a fixed or required declaration, and defaults
should have the apparently desired effect.  I.e., if a schema declares an
attribute whose name is <code>xmlns</code> with a default or fixed value, does
it change the infoset?  Or if we allow QNames as such to be declared, <code>xmlns:foo</code>.</p>
</issue>
</div3>
<div3 id='declare-attributeGroup'>
<head>Attribute Group Definition *</head>
<p>&XSP1; can name a group of attributes so that they may be incorporated as a
whole into archetype definitions: </p>

<scrap lang='ebnf' id='RuleSet.XS8'>

<head>Attribute groups</head>
<prod id='nt-attrGroupDefn'>
<lhs>attrGroupDefn</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-attrGroupSpec'>attrGroupSpec</nt></rhs>
</prod>
<prod id='nt-attrGroupSpec'>
<lhs>attrGroupSpec</lhs>
<rhs><nt def='nt-attrDecl'>attribute</nt>* <nt def='nt-exportControl'>exportControl</nt></rhs>
</prod>
<prod id='nt-attrGroupRef'>
<lhs>attrGroupRef</lhs>
<rhs xml:space='preserve'><nt def='nt-attrGroupName'>attrGroupName</nt> <nt def='nt-attrGroupQual'>attrGroupQual</nt></rhs>
</prod>
<prod id='nt-attrGroupName'>
<lhs>attrGroupName</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
</prod>
<prod id='nt-attrGroupQual'>
<lhs>attrGroupQual</lhs>
<rhs><nt def='nt-attrDecl'>attribute</nt></rhs>
</prod>

</scrap>

<p>Attribute group definitions provide a construct to replace some uses of
<termref def='gloss-parameterEntity'>parameter entities</termref>. </p>
<e:element-syntax name='attrGroup'>
 <e:in-category name='top-level'/>
 <e:attribute name='export'>
  <e:constant value='true'/>
  <e:constant value='false'/>
 </e:attribute>
 <e:attribute name='name' required='yes'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:choice repeat='one-or-more'>
  <e:element name='attrGroupRef'/>
  <e:element name='attribute'/>
 </e:choice>
</e:element-syntax>
<e:element-syntax name='attrGroupRef'>
 <e:in-category name='archetype'/>
 <e:attribute name='name' required='yes'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaAbbrev'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaName'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:empty/>
</e:element-syntax>

<note role='example'>
<eg xml:space='preserve'>&lt;attrGroup name='myAttrGroup'&gt;
    &lt;attribute .../&gt;
    ...
&lt;/attrGroup&gt;

&lt;archetype name='myelement' content='empty'&gt;
    &lt;attrGroupRef name='myAttrGroup'/&gt;
&lt;/archetype&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 archetype definition.</p>
</note>
 <ednote>
  <edtext>There needs to be a Constraint on Schema which constrains the attributes
which appear with an attrGroupRef: the name is the same as one of the attributes
in the group, datatype and defaulting preserves substitutability, etc.</edtext>
 </ednote>
 <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>
</div3>
<div3 id='declare-contentModel'>
<head>Element Content Model</head>
<p>When content of elements is not constrained by reference to a datatype
(<specref ref='declare-datatype'/>), it can have any, empty, element-only or
mixed content. In the latter cases, the form of the content is specified in
more detail. </p>

<scrap lang='ebnf' id='RuleSet.XS9'>

<head>Content model</head>
<prod id='nt-contentModel'>
<lhs>contentModel</lhs>
<rhs xml:space='preserve'><pt>any</pt> | <pt>empty</pt> |
<nt def='nt-richModel'>richModel</nt></rhs>
</prod>

</scrap>

<p>A content model constrains the element content of an archetype specification:
it says nothing about attributes. </p>


<p>Content models do not have names, but appear as a part of the definition of
an archetype, which does have a name. Model <emph>groups</emph> can be named
and used by name, see below.</p>
<p>The <termref def='key-satisfy-cm'>satisfy-cm</termref> definition wrt schema-validity obtains.</p>
</div3>

<div3 id='declare-elementOnly'>
<head>Rich Content Models</head>
<p>A content model identified with only an <nt def='nt-elemOnly'>elemModel</nt>
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>

<scrap lang='ebnf' id='RuleSet.XS10'>

<head>Rich content model</head>
 <prod id='nt-richModel'>
  <lhs>richModel</lhs>
  <rhs xml:space='preserve'><nt def='nt-elemOnly'>elemModel</nt> <pt>mixed</pt>?</rhs>
 </prod>
<prod id='nt-elemOnly'>
<lhs>elemModel</lhs>
<rhs xml:space='preserve'><nt def='nt-allGroup'>allGroup</nt> | <nt def='nt-modelElt'>modelElt</nt></rhs>
</prod>
<prod id='nt-modelElt'>
<lhs>modelElt</lhs>
<rhs xml:space='preserve'><nt def='nt-occurs'>occurs</nt> ( <nt def='nt-modelGroup'>group</nt> | <nt def='nt-element'>element</nt> | <nt def='nt-archetypeRef'>archetypeRef</nt> )</rhs>
</prod>
<prod id='nt-occurs'>
<lhs>occurs</lhs>
<rhs xml:space='preserve'><pt>minOccurs</pt> <pt>maxOccurs</pt></rhs>
</prod>
<prod id='nt-modelGroup'>
<lhs>group</lhs>
<rhs xml:space='preserve'><nt def='nt-modelGroupRef'>modelGroupRef</nt> | <nt def='nt-anonModelGroup'>anonModelGroup</nt></rhs>
</prod>
 <prod id='nt-element'>
  <lhs>element</lhs>
  <rhs xml:space='preserve'><nt def='nt-elementRef'>elementRef</nt> | <nt def='nt-elementDecl'>elementDecl</nt></rhs>
 </prod>
 <prod id='nt-allGroup'>
  <lhs>allGroup</lhs>
  <rhs xml:space='preserve'><nt def='nt-restrictedElt'>restrictedElt</nt> <nt def='nt-restrictedEltSeq'>restrictedEltSeq</nt></rhs>
 </prod>
 <prod id='nt-restrictedElt'>
  <lhs>restrictedElt</lhs>
  <rhs xml:space='preserve'><nt def='nt-element'>element</nt> | <nt def='nt-archetypeRef'>archetypeRef</nt></rhs>
 </prod>
 <prod id='nt-restrictedEltSeq'>
  <lhs>restrictedEltSeq</lhs>
  <rhs xml:space='preserve'><nt def='nt-restrictedElt'>restrictedElt</nt> <nt def='nt-restrictedEltSeq'>restrictedEltSeq</nt>?</rhs>
 </prod>
 <prod id='nt-anonModelGroup'>
  <lhs>anonModelGroup</lhs>
  <rhs xml:space='preserve'><nt def='nt-compositor'>compositor</nt> <nt def='nt-modelElt'>modelElt</nt> <nt def='nt-modelEltSeq'>modelEltSeq</nt></rhs>
 </prod>
<prod id='nt-compositor'>
<lhs>compositor</lhs>
<rhs xml:space='preserve'><pt>sequence</pt> | <pt>choice</pt> | <pt>many</pt></rhs>
</prod>
<prod id='nt-modelEltSeq'>
<lhs>modelEltSeq</lhs>
<rhs xml:space='preserve'><nt def='nt-modelElt'>modelElt</nt> <nt def='nt-modelEltSeq'>modelEltSeq</nt>?</rhs>
</prod>
</scrap>
 <issue id='namedTypeInModel'>
  <p>Symmetry suggests we might allow an <nt def='nt-archetypeDefn'>archetypeDefn</nt> to appear in a content model,
provided it's named.</p>
 </issue>
<p>The grammar for element-only content is built on model elements (<nt def='nt-modelElt'>modelElt</nt> above): elements,
groups and archetype references.  A model element 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-anonModelGroup'>anonModelGroup</nt> or <nt def='nt-modelGroupRef'>modelGroupRef</nt>) or an archetype reference (via <nt def='nt-archetypeRef'>archetypeRef</nt>).</p>
<p>A group is two or more model
elements plus a <nt def='nt-compositor'>compositor</nt>.  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 its model elements;</p></item>
  <item><p>a choice between
its model elements;</p></item>
  <item><p>a set of its model elements which must appear
in instances (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>
  <item><p>a repeated choice between its model elements.</p></item>
 </ulist>
These options reconstruct the XML
1.0 <code>,</code> connector, the XML 1.0 <code>|</code> connector, the SGML
<code>&amp;</code> connector and the repeated disjunction of XML 1.0's <xtermref href='http://www.w3.org/TR/REC-xml#NT-Mixed'>Mixed</xtermref>
production respectively. In the first case (<code>sequence</code>) all the
model elements must appear in the order given in the group; in the second case
(<code>choice</code>), exactly one of the model elements must appear in the
element content; in the third case (<code>all</code>), all the model elements,
which are restricted in this case only to unqualified
<nt def='nt-element'>element</nt>s, must appear in the element content, but may
appear in any order; in the fourth case (<code>many</code>), any number of the
model elements 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
instance material allowed by a <nt def='nt-modelElt'>modelElt</nt> may occur at
that point in the grammar, but note that the components of a group whose <nt def='nt-compositor'>compositor</nt> is (implicitly) 'all' 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-archetypeRef'>archetypeRef</nt> in this context, see
<specref ref='declare-refinement'/>.</p>

<e:element-syntax name='group'>
 <e:in-category name='archetype'/>
 <e:attribute name='collection'>
  <e:constant value='no'/>
  <e:constant value='list'/>
 </e:attribute>
 <e:attribute name='maxOccurs'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='minOccurs'>
  <e:constant value='1'/>
 </e:attribute>
 <e:attribute name='name'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='order'>
  <e:constant value='choice'/>
  <e:constant value='seq'/>
  <e:constant value='all'/>
  <e:constant value='many'/>
 </e:attribute>
 <e:attribute name='ref'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaAbbrev'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaName'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:choice repeat='zero-or-more'>
  <e:element name='element'/>
  <e:element name='group'/>
 </e:choice>
</e:element-syntax>
<!-- Omit example for now - mostly covered in chapter 2.

<note role='example'>
<eg xml:space='preserve'>&lt;elementTypeRef name='paragraph'/&gt;

&lt;sequence&gt;
 &lt;elementRef name='name1'/&gt;
 &lt;elementRef name='name2' prefix='HTML'/&gt;
&lt;/sequence&gt;

&lt;choice minOccurs='3' maxOccurs='9'&gt;
 &lt;elementRef name='name1'/&gt;
 &lt;elementRef name='name2'/&gt;
&lt;/choice&gt;

&lt;all minOccurs='3'&gt;
 &lt;elementRef name='name1'/&gt;
 &lt;elementRef name='name2'/&gt;
&lt;/all&gt;

&lt;choice&gt;
 &lt;all&gt;
  &lt;elementRef name='name1'/&gt;
  &lt;elementRef name='name2'/&gt;
 &lt;/all&gt;
 &lt;all&gt;
  &lt;elementRef name='name3'/&gt;
  &lt;elementRef name='name4'/&gt;
 &lt;/all&gt;
&lt;/choice&gt;</eg>
<p>A minimal model which simply requires a <code>paragraph</code> (the default
is <code>minOccurs=maxOccurs=1</code>; a sequence of two elements (one from
another schema); between 3 and 9 elements, each a choice between two; at least
three pairs, in any order; one of two pairs, the elements <emph>in</emph> the
chosen pair in any order. </p>
</note>

-->

<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>
<p>The <specref ref='cos-nonambig'/> <termref def='gloss-cos'>Constraint on Schemas</termref> obtains.</p>
<issue id='still-unambig'>
<p>Should this compatibility constraint be preserved?</p>
</issue>
</div3>
 <div3 id='declare-mixedContent'>
<head>Mixed Content</head>
<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-elemOnly'>elemModel</nt> mechanism is used for specifying the
grammar of the allowed elements, with the one change that the default for <nt def='nt-compositor'>compositor</nt> is
changed to <code>many</code> for elements and
groups at the top level of the content model, ensuring that the default
behaviour is the same as that of XML. </p>


<note role='example'>
<eg xml:space='preserve'>&lt;archetype content='mixed'&gt;
 &lt;element ref='name1'/&gt;
 &lt;element ref='name2'/&gt;
 &lt;element ref='name3'/&gt;
&lt;/archetype&gt;
</eg>
<p>Allows character data mixed with any number of <code>name1</code>,
<code>name2</code> and <code>name3</code> elements.</p>
</note>
<issue id='noEmptyReqd'>
 <p>We need to make the <nt def='nt-elemOnly'>elemModel</nt> rhs optional, to
allow for <pt>mixed</pt> with no elements specified == our minimum commitment
model.  This in turn would allow us if we chose to get rid of an explicit
<pt>empty</pt> flag:  just specify <code>elemOnly</code> and no model.</p>
 <p>We could then get rid of <pt>any</pt> as well, given other mechanisms for
controlled openness we're contemplating.</p>
</issue>
<p>The <termref def='key-satisfy-mixed'>satisfy-mixed</termref> definition wrt schema-validity obtains.</p>
</div3>
<div3 id='declare-namedModelGroup'>
<head>Named Model Group *</head>
<p>This reconstructs another common use of <termref def='gloss-parameterEntity'>parameter entities</termref>.</p>

<scrap lang='ebnf' id='RuleSet.XS12'>

<head>Named model groups</head>
<prod id='nt-modelGroupDefn'>
<lhs>modelGroupDefn</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-modelGroupSpec'>modelGroupSpec</nt></rhs>
</prod>
<prod id='nt-modelGroupSpec'>
<lhs>modelGroupSpec</lhs>
<rhs xml:space='preserve'>( <nt def='nt-allGroup'>allGroup</nt> | <nt def='nt-modelGroup'>group</nt> | <nt def='nt-element'>element</nt> | <nt def='nt-archetypeRef'>archetypeRef</nt> ) <nt def='nt-exportControl'>exportControl</nt></rhs>
</prod>
<prod id='nt-modelGroupRef'>
<lhs>modelGroupRef</lhs>
<rhs><nt def='nt-modelGroupName'>modelGroupName</nt></rhs>
</prod>
<prod id='nt-modelGroupName'>
<lhs>modelGroupName</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
</prod>

</scrap>
 <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>
<e:element-syntax name='group'>
 <e:in-category name='top-level'/>
 <e:attribute name='collection'>
  <e:constant value='no'/>
  <e:constant value='list'/>
 </e:attribute>
 <e:attribute name='maxOccurs'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='minOccurs'>
  <e:constant value='1'/>
 </e:attribute>
 <e:attribute name='name'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='order'>
  <e:constant value='choice'/>
  <e:constant value='seq'/>
  <e:constant value='all'/>
  <e:constant value='many'/>
 </e:attribute>
 <e:attribute name='ref'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaAbbrev'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaName'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:choice repeat='zero-or-more'>
  <e:element name='element'/>
  <e:element name='group'/>
 </e:choice>
</e:element-syntax>
<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;archetype&gt;
  &lt;group ref='myModelGroup'/&gt;
  &lt;attribute ...&gt;. . .&lt;/attribute&gt;
 &lt;/archetype&gt;
&lt;/element&gt;

&lt;element name='anotherelement'&gt;
 &lt;archetype&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;/archetype&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>
</div3>
<div3 id='declare-element'>
<head>Element Declaration</head>
<p>An <termdef id='key-element' term='element declaration'><term>element
declaration</term> associates an element name with a
type</termdef>, either by reference or by incorporation. </p>

<scrap lang='ebnf' id='RuleSet.XS13'>

<head>Element declaration</head>
<prod id='nt-elementDecl'>
<lhs>elementDecl</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-elementSpec'>elementSpec</nt></rhs>
</prod>
<prod id='nt-elementSpec'>
<lhs>elementSpec</lhs>
<rhs xml:space='preserve'>( <nt def='nt-typeRef'>typeRef</nt> | <nt def='nt-archetypeSpec'>archetypeSpec</nt> | <nt def='nt-archetypeSpec'>datatypeSpec</nt>) <nt def='nt-exportControl'>exportControl</nt> <pt>global</pt>?</rhs>
</prod>
 <prod id='nt-typeRef'>
  <lhs>typeRef</lhs>
  <rhs xml:space='preserve'><nt def='nt-archetypeRef'>archetypeRef</nt> |
<nt def='nt-datatypeRef'>datatypeRef</nt></rhs>
    </prod>
<prod id='nt-elementRef'>
<lhs>elementRef</lhs>
<rhs xml:space='preserve'><nt def='nt-elementName'>elementName</nt> </rhs>
</prod>
<prod id='nt-elementName'>
<lhs>elementName</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>? </rhs>
</prod>

</scrap>

<p>An element declaration associates a name with a
specification. This name will appear in tags in instance
documents; the specification provides <termref def='SC'>SC</termref>s on
the form of elements tagged with the given name. An element 
declaration whose <nt def='nt-elementSpec'>elementSpec</nt> is an
<nt def='nt-archetypeSpec'>archetypeSpec</nt> is comparable to an 
<code>&lt;!ELEMENT ...&gt;</code> declaration in an XML 1.0 DTD. </p>
<p><nt def='nt-elementSpec'>elementSpec</nt> not only allows for
element declarations to associate a name with an <nt def='nt-archetypeSpec'>archetypeSpec</nt> (by reference or inclusion), but also
allows the reference or specification to be for a datatype, with the
implication that no attributes are allowed in instances and the
text-only content will be constrained appropriately.</p>
<p><nt def='nt-elementRef'>elementRef</nt> and <nt def='nt-elementName'>elementName</nt> provide for top-level element declarations to be referenced by
name from content models. </p>
<p>As noted above element names are in a separate
<termref def='key-symbolSpace'>symbol space</termref> from the symbol spaces for
the names of types, so there can (but need
not be) an archetype or datatype with the same name as a top-level element.</p>
 <p>In the case of ambiguity of type reference, that is when the <termref def='nt-typeRef'>typeRef</termref> option is used and there are both a
datatype and an archetype of the referenced name in the relevant schema, the
ambiguity is resolved in favour of the archetype.</p>
 <note>
  <p>See <loc href='#note-two-sses'>previous note on the ambiguity issue</loc>.</p>
 </note>
<p>The <termref def='key-elt-fullname'>elt-fullname</termref> definition wrt schema-validity obtains.</p>
<p>An <nt def='nt-elementDecl'>elementDecl</nt> may appear both at the top
level of a schema and within
a <nt def='nt-modelElt'>modelElt</nt>. See above (<specref ref='declare-elementOnly'/> and <specref ref='declare-mixedContent'/>) for
where this is allowed. This declares a locally-scoped association between an
element name and a type. As with attribute names, locally-scoped
element names reside in symbol spaces local to the archetype that defines
them. Note however that archetype and datatype names are always top-level names within a
schema, even when associated with locally-scoped element names.</p>
<note>
<p>It is not yet clear whether a type defined implicitly by the
appearance of a <nt def='nt-archetypeSpec'>archetypeSpec</nt> or <nt def='nt-datatypeSpec'>datatypeSpec</nt> directly within
an <nt def='nt-elementSpec'>elementSpec</nt>, or by the use of a <nt def='nt-typeRef'>typeRef which refers to a datatype, </nt> will have an implicit
name, or if so what that name would be.</p>
</note>
<e:element-syntax name='element'>
 <e:in-category name='top-level'/>
 <e:attribute name='archRef'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='default'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='export'>
  <e:constant value='true'/>
  <e:constant value='false'/>
 </e:attribute>
 <e:attribute name='fixed'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='maxOccurs'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='minOccurs'>
  <e:constant value='1'/>
 </e:attribute>
 <e:attribute name='name'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='ref'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaAbbrev'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='schemaName'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='type'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:choice repeat='zero-or-one'>
 <e:element name='archetype'/>
 <e:element name='datatype'/>
</e:choice>
</e:element-syntax>
<note role='example'>
<eg xml:space='preserve'>&lt;element name='myelement' type='myDatatype'/&gt;

&lt;element name='et0' type='myType'/&gt;

&lt;element ref='et1'/>

&lt;element name='et1'&gt;
 &lt;archetype order='all'&gt;
  &lt;element . . . /&gt;
  . . .
  &lt;attribute ...&gt;. . .&lt;/attribute&gt;
 &lt;/archetype&gt;
&lt;/element&gt;

&lt;element name='et2'&gt;
 &lt;archetype content='any'/&gt;
&lt;/element&gt;

&lt;element name='et3'&gt;
 &lt;archetype content='empty'&gt;
  &lt;attribute ...&gt;. . .&lt;/attribute&gt;
 &lt;/archetype&gt;
&lt;/element&gt;

&lt;element name='et4'&gt;
 &lt;archetype order='choice'&gt;
  &lt;element . . . /&gt;
  . . .
  &lt;attribute ...&gt;. . .&lt;/attribute&gt;
 &lt;/archetype&gt;
&lt;/element&gt;

&lt;element name='et5'&gt;
 &lt;archetype order='seq'&gt;
  &lt;element . . . /&gt;
  . . .
  &lt;attribute ...&gt;. . .&lt;/attribute&gt;
 &lt;/archetype&gt;
&lt;/element&gt;

&lt;element name='et6'&gt;
 &lt;archetype model='open' content='mixed'/&gt;
&lt;/element&gt;

</eg>
<p>A pretty complete set of alternatives. Note the last one is intended to be
equivalent to the idea sometimes called WFXML, for Well-Formed XML: it allows
<emph>any</emph> content at all, whether defined in the current schema or not,
and <emph>any</emph> attributes.</p>
<eg xml:space='preserve'>&lt;element name='contextOne'&gt;
 &lt;archetype order='seq'&gt;
  &lt;element name='myLocalelement' type='myFirstType'/&gt;
  &lt;element ref='globalelement'/&gt;
 &lt;/archetype&gt;
&lt;/element&gt;

&lt;element name='contextTwo'
 &lt;archetype order='seq'&gt;
  &lt;element name='myLocalelement' type='mySecondType'/&gt;
  &lt;element ref='globalelement'/&gt;
 &lt;/archetype&gt;
&lt;/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>
<p>The <specref ref='cos-local-global'/> <termref def='gloss-cos'>Constraint on Schemas</termref> obtains.</p>
<p>The <specref ref='cos-respect-global'/> <termref def='gloss-cos'>Constraint on Schemas</termref> obtains.</p>
<p>The <termref def='key-satisfy-ed'>satisfy-ed</termref> definition wrt schema-validity obtains.</p>
<p>The <termref def='key-ind-valid'>ind-valid</termref> definition wrt schema-validity obtains.</p>
<p>The <termref def='key-satisfy-etr'>satisfy-etr</termref> definition wrt schema-validity obtains.</p>
</div3>
</div2>
<div2 id='declare-refinement'>
<head>Archetype Refinement *</head>
<note>
<p>This chapter 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.</p>
</note>
<p>We provide for the refinement of archetypes defined in a schema. An
archetype definition may identify one or more other archetypes from which it
specifies the creation of a (joint) refinement. </p>
<note>
 <p>The balance of this chapter has been withdrawn, pending further discussion
in the WG.  A Task Force created from within the WG has investigated a range of
issues and options for implementing the desired functionality, as called for in
the <bibref ref='ref-xsreq'/>.  The Task Force has produced a
report <bibref ref='ref-refine-tf'/>, which will form the basis of a design to be filled in here.</p>
</note>
<div3>
 <head>Graveyard for stale syntax, here to avoid breaking IDREFs
elsewhere *</head>
<p><termdef id='key-refine' term='refine'>an archetype AT1 is said to
<term>refine</term> an archetype AT2 if and only if AT1 is declared to refine
either AT2 or (recursively) some archetype that refines AT2</termdef>.
<termdef id='key-ancestor' term='ancestor'>AT2 is then said to be an
<term>ancestor</term> of AT1. </termdef>
<termdef id='key-effective' term='effective'>The <term>effective</term>
constraints are the union of the explicit and the acquired</termdef>.</p></div3>
</div2>
<div2 id='declare-entity'>
<head>Entities and Notations *</head>

<scrap lang='ebnf' id='RuleSet.XS15'>

<head>Entities and notations</head>
<prod id='nt-entityDecl'>
<lhs>entityDecl</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-entitySpec'>entitySpec</nt></rhs>
</prod>
<prod id='nt-entitySpec'>
<lhs>entitySpec</lhs>
<rhs xml:space='preserve'>( <nt def='nt-textEntitySpec'>textEntitySpec</nt> |
<nt def='nt-externalEntitySpec'>externalEntitySpec</nt> |
<nt def='nt-unparsedEntitySpec'>unparsedEntitySpec</nt> )
<nt def='nt-exportControl'>exportControl</nt>?</rhs>
</prod>
<prod id='nt-textEntitySpec'>
<lhs>textEntitySpec</lhs>
<rhs><pt>string-value</pt></rhs>
</prod>
<prod id='nt-externalEntitySpec'>
<lhs>externalEntitySpec</lhs>
<rhs xml:space='preserve'><nt def='nt-systemID'>systemID</nt> <nt def='nt-publicID'>publicID</nt>?
exportControl?</rhs>
</prod>
<prod id='nt-unparsedEntitySpec'>
<lhs>unparsedEntitySpec</lhs>
<rhs xml:space='preserve'><nt def='nt-systemID'>systemID</nt> <nt def='nt-notationRef'>notationRef</nt> <nt def='nt-publicID'>publicID</nt>?
<nt def='nt-exportControl'>exportControl</nt>?</rhs>
</prod>
<prod id='nt-entityRef'>
<lhs>entityRef</lhs>
<rhs><nt def='nt-entityName'>entityName</nt></rhs>
</prod>
<prod id='nt-entityName'>
<lhs>entityName</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
</prod>
<prod id='nt-notationDecl'>
<lhs>notationDecl</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-notationSpec'>notationSpec</nt></rhs>
</prod>
<prod id='nt-notationSpec'>
<lhs>notationSpec</lhs>
<rhs xml:space='preserve'><nt def='nt-systemID'>systemID</nt> <nt def='nt-notationRef'>notationRef</nt> <nt def='nt-publicID'>publicID</nt>?
<nt def='nt-exportControl'>exportControl</nt>?</rhs>
</prod>
<prod id='nt-systemID'>
<lhs>systemID</lhs>
<rhs><pt>URI</pt></rhs>
</prod>
<prod id='nt-publicID'>
<lhs>publicID</lhs>
<rhs>
<com>see <bibref ref='ref-xml'/></com></rhs>
</prod>
<prod id='nt-notationRef'>
<lhs>notationRef</lhs>
<rhs><nt def='nt-notationName'>notationName</nt></rhs>
</prod>
<prod id='nt-notationName'>
<lhs>notationName</lhs>
<rhs xml:space='preserve'><pt>NCName</pt> <nt def='nt-schemaRef'>schemaRef</nt>?</rhs>
</prod>

</scrap>

<div3 id='declare-internalParsedEntity'>
<head>Internal Parsed Entity Declaration *</head>
<p>Internal parsed entities are a feature of XML that enables reuse of text
fragments by direct reference in an instance document. </p>
<p>In &XSP1; documents, internal parsed entities are declared by using the
<nt def='nt-textEntitySpec'>textEntitySpec</nt> production. </p>

<e:element-syntax name='textEntity'>
 <e:in-category name='top-level'/>
 <e:attribute name='export' required='yes'>
  <e:constant value='true'/>
  <e:constant value='false'/>
 </e:attribute>
 <e:attribute name='name' required='yes'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:text/>
</e:element-syntax>
<note>
<eg xml:space='preserve'>
&lt;textEntity name='flavor'&gt;Fresh mint&lt;/textEntity'&gt;
</eg>
<p><code>flavor</code> can now be used in an entity reference in instances of
the containing schema.</p>
</note>
<p>See <specref ref='conformance-schemaValidity'/> for <termref def='SC'>SC</termref>s covering entities and entity references. </p>
</div3>
<div3 id='declare-externalParsedEntity'>
<head>External Parsed Entity Declaration *</head>
<p>External parsed entities are a feature of XML that offers a method for
including well-formed XML document fragments, including text and markup, by
direct reference to the storage object of the parsed entity. </p>
<p>In schemas, external parsed entities are declared by using the
<nt def='nt-externalEntitySpec'>externalEntitySpec</nt> production. </p>

<e:element-syntax name='externalEntity'>
 <e:in-category name='top-level'/>
 <e:attribute name='export' required='yes'>
  <e:constant value='true'/>
  <e:constant value='false'/>
 </e:attribute>
 <e:attribute name='name' required='yes'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='notation' required='yes'>
  <e:constant value='XML'/>
 </e:attribute>
 <e:attribute name='public'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='system' required='yes'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:empty/>
</e:element-syntax><note>
<eg xml:space='preserve'>
&lt;externalEntity name='FrontMatter'
                system='FrontMatter.xml' /&gt;
&lt;externalEntity name='Chapter1'
                system='chapter1.xml' /&gt;
&lt;externalEntity name='Chapter2'
                system='Chapter2.xml' /&gt;
&lt;externalEntity name='BackMatter'
                system='BackMatter.xml' /&gt;
</eg>
<p>These four external entities represent the supposed contents of a book:</p>
<eg xml:space='preserve'>
&lt;book&gt;
  &amp;FrontMatter;
  &amp;Chapter1;
  &amp;Chapter2;
  &amp;BackMatter;
&lt;/book&gt;
</eg>
<p>In an instance, the external entities take their familiar XML form. The
processor expands the entities for their content.</p>

</note>
<p>Again, See <specref ref='conformance-schemaValidity'/> for <termref def='SC'>SC</termref>s covering entities and entity references.</p>
</div3>
<div3 id='declare-unparsedEntity'>
<head>Unparsed Entity Declaration *</head>
<p>External unparsed entities are a feature of XML that offers a baroque method
for including binary data by indirect reference to both the storage object and
the the notation type of the unparsed entity. In schemas, external parsed
entities may be declared by using the <nt def='nt-unparsedEntitySpec'>unparsedEntitySpec</nt> production. </p>
<e:element-syntax name='unparsedEntity'>
 <e:in-category name='top-level'/>
 <e:attribute name='export' required='yes'>
  <e:constant value='true'/>
  <e:constant value='false'/>
 </e:attribute>
 <e:attribute name='name' required='yes'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='notation' required='yes'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='public'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='system' required='yes'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:empty/>
</e:element-syntax>
<note>
<eg xml:space='preserve'>
&lt;unparsedEntity name='SKU-5782-pic'
                system='http://www.vendor.com/SKU-5782.jpg'
                notation='JPEG' /&gt;</eg>
<eg xml:space='preserve'>
&lt;picture location='SKU-5782-pic'/&gt;
</eg>
<p>The picture element carries an attribute which is (presumably) governed by
the unparsed entity declaration.</p>

</note>
<p>The <specref ref='svc-attr-entity'/> <termref def='gloss-svc'>Schema Validity Constraint</termref> obtains.</p>
<issue id='unparsed-entity-gaps'>
<p> There are lots of gaps and little problems in this design for unparsed
entities.</p>
</issue>
</div3>
<div3 id='declare-notation'>
<head>Notation Declaration *</head>
<p>A notation may be declared by specifying a name and an identifier for the
notation. A notation may be referenced by name in a schema as part of an
external entity declaration.</p>
<e:element-syntax name='notation'>
 <e:in-category name='top-level'/>
 <e:attribute name='export' required='yes'>
  <e:constant value='true'/>
  <e:constant value='false'/>
 </e:attribute>
 <e:attribute name='name' required='yes'>
  <e:data-type name='NMTOKEN'/>
 </e:attribute>
 <e:attribute name='public' required='yes'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:attribute name='system'>
  <e:data-type name='CDATA'/>
 </e:attribute>
 <e:empty/>
</e:element-syntax>
<note>
<eg xml:space='preserve'>
&lt;notation name='jpeg'
          public='image/jpeg' system='viewer.exe' /&gt;

&lt;element name='picture&gt;
 &lt;archetype&gt;
  &lt;attribute name='entity' type='NOTATION'/&gt;
 &lt;/archetype&gt;
&lt;/element&gt;
</eg>
<eg xml:space='preserve'>
&lt;picture entity='SKU-5782-pic'/&gt;
</eg>
<p>The notation need not ever be mentioned in the instance document.</p>

</note>
<issue id='unparsed-entity-attributes'>
<p>We need to synchronise with XML Schemas: Datatypes regarding how we declare
attributes as unparsed entities!</p>
</issue>
</div3>
</div2>
</div1>
<div1 id='composition'>
<head>Schema Composition and Namespaces *</head>
<div2>
<head>Introduction and TF report summary *</head>
<p>This chapter describes facilities to provide for validation of
namespace-qualified instance document elements and attributes, and potentially
(subject to enhancements to the Namespaces recommendation), entities and
notations. </p>
<note>
<p>'Namespaces in XML' <bibref ref='ref-xml-namespaces'/> provides an
enabling framework for modular composition of schemas. From that document: </p>

</note>
<p> <quote><emph>We envision applications of Extensible Markup Language (XML)
where a single XML document may contain elements and attributes (here referred
to as a 'markup vocabulary') that are defined for and used by
multiple software modules. One motivation for this is modularity; if such a
markup vocabulary exists which is well-understood and for which there is useful
software available, it is better to re-use this markup rather than re-invent
it. </emph></quote> <quote><emph>Such documents, containing multiple markup
vocabularies, pose problems of recognition and collision. Software modules need
to be able to recognize the tags and attributes which they are designed to
process, even in the face of 'collisions' occurring when markup
intended for some other software package uses the same element or
attribute name. </emph></quote> <quote><emph>These considerations require that
document constructs should have universal names, whose scope extends beyond
their containing document. This specification describes a mechanism, XML Schema
namespaces, which accomplishes this. </emph> </quote></p>
<p>&XSP1; provides facilities to enable declaration and modular composition of
schemas.</p>
<p>The balance of this section as it appeared in the previous public WD has been withdrawn, pending further discussion
in the WG.  A Task Force created from within the WG has investigated a range of
issues and options for implementing the desired functionality.  The Task Force has produced a
report <bibref ref='ref-schema-comp-tf'/>, which will form the basis of a design to be filled in here.</p>
 <ednote>
  <edtext>I've chosen to include here a brief summary of the
expected TF report, addressing the instance->schema connection issue, on the
grounds that confusion is rampant in the rest of the world wrt this issue, and
we will benefit both ourselves and others by signalling our thinking here as
soon as possible.</edtext>
 </ednote>
<p>The TF report recommends a layered approach, where the base layer
simply addresses the process of schema validation where the element
information item to be validated and the schema to validate it with
are known.  The second layer discusses mechanisms by which
processors may locate schemas, but emphasises that this is always in 
the end an processor- and environment-dependent process.  The following candidate
mechanisms are identified:
<ulist>
<item><p>The namespace URI of the item to be validated is dereferenced and yields
 a schema;</p></item>
<item><p>The namespace URI of the item to be validated is dereferenced
and yields a package.  A standard property
of the package tells what kind of package it is and hence how
to go about getting schema info out of it.  We anticipate a great range of
flexibility in the structuring and content of packages: schemas will certainly
not be the only thing in them.  All that matters to us is that we can get a schema
<emph>out</emph> of them;</p></item>
<item><p>A URI is provided via a pre-defined attribute from the XML Schema
namespace, which is dereferenced and yields a schema (or a package);</p></item>
<item><p>The namespace URI of the item to be validated is looked up via a
catalogue or other binding mechanism, either locally or remotely, and yields a
schema (or a package).</p></item></ulist>
</p>
 <issue id='schema-search-ordered'>
  <p>It is worth noting that the TF has not reached consensus on whether the
above list should be understood as ordered, that is, in the case where more
than one is viable, should we identify a precedence.</p>
 </issue>
</div2>
<div2>
  <head>Graveyard for stale syntax, here to avoid breaking IDREFs
elsewhere *</head>
<div3 id='composition-schemaExport'>
<head>Exporting Schema Constructs</head>

<scrap lang='ebnf' id='RuleSet.XS16'>

<head>Export</head>
<prod id='nt-export'>
<lhs>export</lhs>
<rhs><nt def='nt-allDatatypes'>allDatatypes</nt>? <nt def='nt-allArchetypes'>allArchetypes</nt>? <nt def='nt-allElementTypes'>allElements</nt>? <nt def='nt-allModelGroups'>allModelGroups</nt>? <nt def='nt-allAttributeGroups'>allAttributeGroups</nt>? <nt def='nt-allEntities'>allEntities</nt>? <nt def='nt-allNotations'>allNotations</nt>?</rhs>
</prod>
<prod id='nt-allDatatypes'>
<lhs>allDatatypes</lhs>
<rhs><pt>boolean</pt></rhs>
</prod>
<prod id='nt-allArchetypes'>
<lhs>allArchetypes</lhs>
<rhs><pt>boolean</pt></rhs>
</prod>
<prod id='nt-allElementTypes'>
<lhs>allElements</lhs>
<rhs><pt>boolean</pt></rhs>
</prod>
<prod id='nt-allModelGroups'>
<lhs>allModelGroups</lhs>
<rhs><pt>boolean</pt></rhs>
</prod>
<prod id='nt-allAttributeGroups'>
<lhs>allAttributeGroups</lhs>
<rhs><pt>boolean</pt></rhs>
</prod>
<prod id='nt-allEntities'>
<lhs>allEntities</lhs>
<rhs><pt>boolean</pt></rhs>
</prod>
<prod id='nt-allNotations'>
<lhs>allNotations</lhs>
<rhs><pt>boolean</pt></rhs>
</prod>
<prod id='nt-exportControl' role='prefig'>
<lhs>exportControl</lhs>
<rhs xml:space='preserve'><pt>boolean</pt> </rhs>
</prod></scrap>
</div3>
<div3 id='composition-schemaImport'>
<head>Schema Import</head>
<scrap lang='ebnf' id='RuleSet.XS18'>

<head>Import</head>
<prod id='nt-import'>
<lhs>import</lhs>
<rhs xml:space='preserve'><nt def='nt-schemaAbbrev'>schemaAbbrev</nt> <nt def='nt-schemaName'>schemaName</nt> <nt def='nt-importRestrictions'>importRestrictions</nt>? </rhs>
</prod>

</scrap></div3>
<div3 id='composition-importRestrictions'>
<head>Import Restrictions</head>
<scrap lang='ebnf' id='RuleSet.XS19'>

<head>Import restrictions</head>
<prod id='nt-importRestrictions'>
<lhs>importRestrictions</lhs>
<rhs xml:space='preserve'><nt def='nt-allDatatypes'>allDatatypes</nt>? <nt def='nt-allArchetypes'>allArchetypes</nt>? <nt def='nt-allElementTypes'>allElements</nt>? <nt def='nt-allModelGroups'>allModelGroups</nt>? <nt def='nt-allAttributeGroups'>allAttributeGroups</nt>? <nt def='nt-allEntities'>allEntities</nt>? <nt def='nt-allNotations'>allNotations</nt>? <nt def='nt-component'>component</nt>*</rhs>
</prod>
 <prod id='nt-component'>
  <lhs>component</lhs>
  <rhs xml:space='preserve'><nt def='nt-componentName'>componentName</nt> <nt def='nt-componentType'>componentType</nt></rhs>
 </prod>
 <prod id='nt-componentName'>
  <lhs>componentName</lhs>
  <rhs><pt>NCName</pt></rhs>
 </prod>
 <prod id='nt-componentType'>
  <lhs>componentType</lhs>
  <rhs xml:space='preserve'><pt>datatype</pt> | <pt>archetype</pt> |
<pt>element</pt> | <pt>attrGroup</pt> | <pt>group</pt> | <pt>entity</pt> | <pt>notation</pt></rhs>
 </prod>

</scrap></div3>
<div3 id='composition-schemaInclude'>
<head>Schema Inclusion</head>
<scrap lang='ebnf' id='RuleSet.XS20'>

<head>Include</head>
<prod id='nt-include'>
<lhs>include</lhs>
<rhs xml:space='preserve'><nt def='nt-schemaRef'>schemaRef</nt> <nt def='nt-allDatatypes'>allDatatypes</nt>? <nt def='nt-allArchetypes'>allArchetypes</nt>? <nt def='nt-allElementTypes'>allElements</nt>? <nt def='nt-allModelGroups'>allModelGroups</nt>? <nt def='nt-allAttributeGroups'>allAttributeGroups</nt>? <nt def='nt-allEntities'>allEntities</nt>? <nt def='nt-allNotations'>allNotations</nt>? <nt def='nt-component'>component</nt>*</rhs>
</prod>

</scrap>
</div3>
<div3 id='composition-instances'>
<head>Associating Instance Document Constructs with Corresponding Schemas
</head>
</div3>
 </div2>
</div1>
<div1 id='doc'>
<head>Documenting schemas *</head>
<note>
<p>Documentation facilities have purposely been left out of this draft of the
XML Schema Definition Language specification. The editors chose to concentrate
on other topics. It is anticipated that explanation elements will be provided
for within any of the Schema elements. Their purpose is to encapsulate
documentation for the elements within which they are contained. Elements for
narrative exposition at the top level of a schema have also been proposed.</p>
</note>
<p>Proposals for XML Schema documentation include defining a custom set of
elements, allowing any content at all, allowing all or part of
<bibref ref='ref-html-4'/>, DocBook or TEI. There are good arguments for each
of these proposals.</p>
<p>The Working Group must identify its requirements and constraints.</p>
</div1>
<div1 id='conformance'>
<head>Conformance -- OUT OF DATE *</head>
<issue id='error-behavior'>
<p> This draft includes extensive discussion of conformance and validity
checking, but rules for dealing with errors are missing. In future, we must
distinguish <termref def='key-error'>error</termref>s from
<termref def='key-fatalError'>fatal error</termref>s, and clarify rules for
dealing with both.</p>
</issue>
<div2 id='conformance-schemaValidity'>
<head>Schema Validity *</head>
<note><p>This section is <emph>not</emph> up to date or in sync with
the rest of the document, but is included
here to avoid breaking huge numbers of references</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>item</pt>, <pt>RUE</pt> and <pt>information set</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>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>
<issue id='namespace-declaration-items'>
<p>Namespace items associated with namespace declarations have disappeared from
the most recent version <bibref ref='ref-xmlinfo'/>. Several WGs need them, we
expect they'll be back, otherwise we can reconstruct what we need from
element and attribute namespace items alone with some effort.</p>
</issue>
<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>
<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-svc'>Schema Validity Constraint</termref> obtains.</p>
<p>The <specref ref='svc-unqual-RUE'/> <termref def='gloss-svc'>Schema Validity Constraint</termref> obtains.</p>
<p>The <specref ref='svc-RUE-declared'/> <termref def='gloss-svc'>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-svc'>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>
</div2>
<div2 id='conformance-details'>
 <head>Detailed validity constraints and definitions *</head>
 <div3>
  <head>The Schema *</head>
  <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>
 </div3>
 <div3>
  <head>References to Schema Constructs *</head>
  <constraintnote type='cos' id='cos-cons-import'>
  <head>Consistent Import</head>
  <p>A <nt def='nt-schemaAbbrev'>schemaAbbrev</nt> or <nt def='nt-schemaName'>schemaName</nt> in a <nt def='nt-schemaRef'>schemaRef</nt>
    must be declared in an <specref ref='composition-schemaImport'/> of the current
    schema, and the <termref def='gloss-NCName'>NCName</termref> qualified by that
    <nt def='nt-schemaRef'>schemaRef</nt> must be an import (<specref ref='composition-importRestrictions'/>) of the appropriate type per that
    declaration.</p>
</constraintnote>
  <constraintnote type='cos' id='cos-ref-oneway'>
  <head>One Reference Only</head>
  <p>The concrete syntax uses <code>schemaAbbrev</code> and
    <code>schemaName</code> attributes to realise <nt def='nt-schemaName'>schemaName</nt>. It is an error for both these attributes
    to appear on the same element in a 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></div3>
 <div3>
  <head>Types, Elements and Attributes *</head>
  <div4>
   <head>Datatypes *</head>
   <constraintnote type='cos' id='cos-builtin'>
  <head>Avoid Built-ins</head>
  <p>The <termref def='gloss-NCName'>NCName</termref> must not be the same as
    the name of any of the built-in datatypes (see <bibref ref='ref-xsp2'/>).</p>
</constraintnote>
   <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-datatypeQual'>datatypeQual</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 specialized by the
      <nt def='nt-datatypeQual'>datatypeQual</nt>'s <nt def='nt-specialize'>specialize</nt> (if present) (see <bibref ref='ref-xsp2'/>
      for a definition of when a string is a valid instance of a (possibly
      specialized) <nt def='nt-datatypeSpec'>datatypeSpec</nt>); </p>
  </item>
</ulist>
and
<ulist>
  <item>
    <p>If there is a <nt def='nt-datatypeQual'>datatypeQual</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-datatypeQual'>datatypeQual</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-specialize'>specialize</nt> (if any) which it satisfied.</p>
</constraintnote></div4>
  <div4>
   <head>Archetype Definition *</head>
   <constraintnote type='cos' id='cos-attrg-unique'>
<head>AttrGroup Unique</head>
<p>The same <nt def='nt-attrGroupDefn'>attrGroupDefn</nt> must not be
  referenced by two or more <nt def='nt-attrGroupRef'>attrGroupRef</nt>s in the
  same <nt def='nt-archetypeSpec'>archetypeSpec</nt>.</p>
</constraintnote>
  <constraintnote type='cos' id='cos-attrg-ided'>
<head>AttrGroup Identified</head>
<p>Every <nt def='nt-attrGroupRef'>attrGroupRef</nt> in an
  <nt def='nt-archetypeSpec'>archetypeSpec</nt> must <termref def='key-identify'>identify</termref> an <nt def='nt-attrGroupSpec'>attrGroupSpec</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-archetypeSpec'>archetypeSpec</nt> consists of all its
<termref def='key-effective'>effective</termref> <nt def='nt-attrDecl'>attributes</nt> together with all the <nt def='nt-attrDecl'>attributes</nt> contained in the <nt def='nt-attrGroupSpec'>attrGroupSpecs</nt> <termref def='key-identify'>identified</termref> by any <nt def='nt-attrGroupRef'>attrGroupRefs</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-archetypeSpec'>archetypeSpec</nt>, the empty string, if it was
acquired by <nt def='nt-refinement'>refinement</nt> or if it came from an
<nt def='nt-attrGroupSpec'>attrGroupSpec</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-archetypeSpec'>archetypeSpec</nt> or <nt def='nt-attrGroupSpec'>attrGroupSpec</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-archetypeSpec'>archetypeSpec</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-archetypeSpec'>archetypeSpec</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-archetypeSpec'>archetypeSpec</nt>'s
<termref def='key-attr-decl-set'>attribute declaration set</termref>, and
either </termdef>
<ulist>
<item>
  <p>The <nt def='nt-archetypeSpec'>archetypeSpec</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-datatypeQual'>datatypeQual</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 <termref def='key-effective'>effective</termref> <nt def='nt-contentModel'>contentModel</nt>.</p>
</item>
</ulist>
</p>
<issue id='sic-elt-default'>
<p>The above definitions do not provide for handling a default on an
  archetype's datatypeRef. Preferred solution: empty element items
  <emph>ipso facto</emph> satisfy datatypeRefs with defaults and are augmented
  with the default value. This would have the consequence that you cannot provide
  the empty string as the explicit value of an element item if it's governed
  by a datatypeRef with a default.</p>
</issue>
  <constraintnote type='sic' id='sic-archetype'>
<head>Archetype Info</head>
<p>When an element item <termref def='key-satisfy-as'>a-satisfies</termref> a
  <nt def='nt-archetypeSpec'>archetypeSpec</nt>, that element information item
  will be augmented to indicate the <nt def='nt-archetypeSpec'>archetypeSpec</nt>
  which it satisfied.</p>
</constraintnote>
  </div4>
  <div4>
   <head>Attribute Declaration *</head>
  <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-datatypeQual'>datatypeQual</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 <termref def='nt-schemaName'>schemaName</termref></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 <termref def='nt-schemaName'>schemaName</termref> are <termref def='key-identical'>identical</termref></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-archetypeSpec'>archetypeSpec</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></div4>
  <div4>
   <head>Element Content Model *</head>
     <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
<termref def='key-effective'>effective</termref> <nt def='nt-contentModel'>contentModel</nt> if</termdef>
<ulist>
<item>
<p>the sequence is empty and the <termref def='key-effective'>effective</termref> <nt def='nt-contentModel'>contentModel</nt> is <pt>empty</pt>;</p>
</item>
<item>
<p>the <termref def='key-effective'>effective</termref>
<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 <termref def='key-identical'>identical</termref> 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 <termref def='key-effective'>effective</termref>
<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
<termref def='key-effective'>effective</termref> <pt>mixed</pt>
</p>
</item>
</ulist>
or
<ulist>
<item>
<p>the <termref def='key-effective'>effective</termref>
<nt def='nt-contentModel'>contentModel</nt> is <termref def='nt-elemOnly'>elemOnly</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
<termref def='key-effective'>effective</termref> <termref def='nt-elemOnly'>elemOnly</termref>.</p>
</item>
</ulist>
</p>
  </div4>
  <div4>
   <head>Mixed Content *</head>
   <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-archetypeSpec'>archetypeSpec</nt> which
<termref def='key-effective'>effectively</termref> 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>
<issue id='mixed-change-current-schema'>
<p>There's an implicit change in current schema in the definition of
satisfy-mixed above which should be made explicit.</p>
</issue>
</p>
</div4>
  <div4>
   <head>Element-only Content *</head>
   <p role='fdv'><termdef id='key-satisfy-eo' term='elemOnly-satisfy'>A sequence of element
items <term>elemOnly-satisfies</term> an <termref def='key-effective'>effective</termref> <nt def='nt-elemOnly'>elemOnly</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 elemOnly-satisfy does not explicitly incorporate the
modifications required when the containing archetype is <emph>open</emph>, as
set out at the end of <specref ref='declare-refinement'/>, 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>
  <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> or
<nt def='nt-elementDecl'>elementDecl</nt> in the content model. </p>
</constraintnote>
  </div4>
  <div4>
   <head>Element Declaration *</head>
   <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-archetypeSpec'>archetypeSpec</nt> directly, and the
element item <termref def='key-satisfy-as'>a-satisfies</termref> that
<nt def='nt-archetypeSpec'>archetypeSpec</nt>;</p>
</item>
</ulist>
or
<ulist>
<item>
<p>the <nt def='nt-archetypeRef'>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-archetypeSpec'>archetypeSpec</nt> and the element item
<termref def='key-satisfy-as'>a-satisfies</termref> that
<nt def='nt-archetypeSpec'>archetypeSpec</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 <termref def='key-identical'>identical</termref></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-archetypeSpec'>archetypeSpec</nt> which <termref def='key-refine'>refines</termref> the <nt def='nt-archetypeSpec'>archetypeSpec</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 archetypes to appear in place of those based on their ancestors.</p>
</note>
</p>
  </div4>
 </div3>
 <div3>
  <head>Archetype Refinement *</head>
  <constraintnote id='cos-refine-ok' type='cos'>
<head>Allowed Refinements</head>
<p>An archetype must not refine one or more other archetypes unless all of the
latter have been declared with either <pt>open</pt> or <pt>refinable</pt>
(explicitly or by default: the default for <nt def='nt-model'>model</nt> on any
archetype which does not explicitly specify one is provided by the
<nt def='nt-model'>model</nt> of the <nt def='nt-schema'>schema</nt> itself,
which in turn defaults to <pt>closed</pt> for compatibility). The same archetype
must not be referenced more than once in the <nt def='nt-refinement'>refinement</nt>s list. </p>
</constraintnote>
 </div3>
 <div3>
  <head>Entities and Notations *</head>
  <constraintnote type='svc' id='svc-attr-entity'>
<head>Attribute is Entity</head>
<p>When an attribute value is interpreted as a reference to an unparsed entity
[How?!], the attribute value must <termref def='key-identify'>identifies</termref> an <nt def='nt-unparsedEntitySpec'>unparsedEntitySpec</nt> (note that no
<nt def='nt-schemaRef'>schemaRef</nt> can be specified in this case); the
<termref def='gloss-NCName'>NCName</termref> of the <nt def='nt-notationRef'>notationRef</nt> of that <nt def='nt-unparsedEntitySpec'>unparsedEntitySpec</nt> must
<termref def='key-identify'>identify</termref> a <nt def='nt-notationSpec'>notationSpec</nt>; the resource specified by the
<nt def='nt-systemID'>systemID</nt> and <nt def='nt-publicID'>publicID</nt>
attribute must be available. </p>
</constraintnote>
 </div3>
 <div3>
  <head>Import Restrictions *</head>
  <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, archetype, 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>
 </div3>
 <div3>
  <head>Schema Inclusion *</head>
  <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></div3>
 <div3>
  <head>Schema Validity *</head>
  <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>
  <constraintnote type='svc' id='svc-RUE-declared'>
<head>RUE Entity Declared</head>
<p>For every <termref def='gloss-RUE'>RUE</termref> appearing in a
<termref def='key-schema-governed'>schema-governed</termref> element, there
must be a parsed entity declaration in the referenced schema whose name matches
the name of the <termref def='gloss-RUE'>RUE</termref>. </p>
</constraintnote>
 </div3>
 </div2>
<div2 id='conformance-processorResponsibilities'>
<head>Responsibilities of Schema-aware processors *</head>
<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>Expand the information set by replacing the remaining entity references as
described in <specref ref='conformance-schemaValidity'/>; </p>
</item>
<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 archetype,
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 archetype: 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 archetype 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>
</div2>
<div2 id='conformance-lexical'>
<head>Lexical representation *</head>
<note>
<p>The editors did not get to this.</p>
</note>
</div2>
<div2 id='conformance-infoSet'>
<head>Information set *</head>
<note>
<p>The editors did not get to this.</p>
</note>
</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>targetNS</code> references the XML Schema namespace itself, and specifies that this
is version "&XSP1.version;".</p>
<p>In the following definition of the <code>schema</code> element, the
<nt def='nt-preamble'>preamble</nt> is realised with attributes corresponding
to <nt def='nt-targetNamespace'>targetNamespace</nt>, <nt def='nt-schemaVersion'>schemaVersion</nt> and <nt def='nt-model'>model</nt>,
and a sequence of nested elements for <nt def='nt-import'>import</nt>,
<nt def='nt-export'>export</nt> and <nt def='nt-include'>include</nt>. The
<code>xmlns</code> attribute corresponds to <nt def='nt-xmlSchemaRef'>xmlSchemaRef</nt>. The
<code>schema</code>'s definitions and declarations are represented by
<code>datatype</code>, <code>archetype</code>, <code>element</code>,
<code>attribute</code>, <code>attrGroup</code>, <code>group</code>,
<code>textEntity</code>, <code>externalEntity</code>,
<code>unParsedEntity</code> and <code>notation</code>.</p>
<eg xml:space='preserve'><![CDATA[<?xml version='1.0'?>
<!-- XML Schema schema for XML Schemas: Part 1: Structures -->
<!-- Id: structures.xsd,v 1.7 1999/10/27 13:25:46 ht Exp  -->
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA ]]>&iso.doc.date;<![CDATA[//EN"
                        "structures.dtd">

<schema  xmlns=']]>&XMLSchemaNS;<![CDATA[' targetNS=']]>&XMLSchemaNS;<![CDATA[' version='0.6'>

  <!-- The datatype element and all of its members are defined
       in XML Schema: Part 2: Datatypes -->

 <include
  schemaName=']]>&XSP2.URI;<![CDATA[.xsd'/>

  <!-- The NCName datatype is widely used for the names of components -->

  <datatype name='NCName'><basetype name='NMTOKEN'/> </datatype>

  <!-- The public datatype is used for entities and notations -->

  <datatype name='public'><basetype name='string'/> </datatype>

  <!-- schema element -->

  <element name='schema'>
    <archetype>
      <element ref='import' minOccurs='0' maxOccurs='*'/>
      <element ref='include' minOccurs='0' maxOccurs='*'/>
      <element ref='export' minOccurs='0'/>
      <group order='choice' minOccurs='0'>
	<element ref='comment'/>
        <element ref='datatype'/>
        <element ref='archetype'/>
        <element ref='element'/>
        <element ref='attrGroup'/>
        <element ref='group'/>
        <element ref='textEntity'/>
        <element ref='externalEntity'/>
        <element ref='unparsedEntity'/>
        <element ref='notation'/>
      </group>
    <attribute name='targetNS' type='uri'/>
    <attribute name='version' type='string'/>
    <attribute name='xmlns' type='uri'
               default=']]>&XMLSchemaNS;<![CDATA['/>
    <attribute name='model' type='NCName' default='closed'>
      <enumeration>
       <literal>open</literal>
       <literal>refinable</literal>
       <literal>closed</literal>
      </enumeration>
     </attribute>
    </archetype>
  </element>

  <!-- comment element -->

  <element name='comment' type='string'/>

  <!-- ################################################ -->
  <!-- Toplevel and named: Fundamental archetypes,
       used hereafter to build the schema. -->
  <!-- A toplevel specifies an export control in addition to a name. -->
  <!-- ################################################ -->

  <!-- named archetype -->

  <archetype name='named' model='refinable'>
    <attribute name='name' type='NCName'/>
  </archetype>

  <!-- toplevel archetype  -->

  <archetype name='toplevel' model='refinable'>
    <refines name='named'/>
    <attribute name='export' type='boolean'/>
  </archetype>

  <!-- ################################################ -->
  <!-- ######### Toplevel elements #################### -->
  <!-- ################################################ -->
  <!-- The datatype definition element is defined in
       XML Schema Part 2: Datatypes.  -->

  <!-- qualifiable archetype
       For references which may be to components of other schemas.
       reference and typeRef are sub-types of qualifiable -->

  <archetype name='qualifiable' model='refinable'>
    <attribute name='schemaName' type='uri'/>
    <attribute name='schemaAbbrev' type='NCName'/>
  </archetype>
   
  <!-- reference archetype
       refines and attrGroupRef are kinds of reference -->

  <archetype name='reference' model='refinable'>
    <refines name='qualifiable'/>
    <attribute name='name' type='NCName'/>
  </archetype>

  <!-- for types (group and element) which use ref instead of name -->

  <archetype name='ref' model='refinable'>
    <refines name='qualifiable'/>
    <attribute name='ref' type='NCName'/>
  </archetype>

  <!-- typeRef archetype -->
  <!-- 'element', 'archetype' and 'attribute' are all kinds of typeRef  -->

  <archetype name='typeRef' model='refinable'>
    <refines name='qualifiable'/>
    <attribute name='type' type='NCName'/>
    <attribute name='default' type='string'/>
    <attribute name='fixed' type='string'/>
  </archetype>

  <!-- modelGroup archetype -->
  <!-- modelGroup, group and archetype are all kinds of modelGroup -->

  <archetype name='modelGroup' model='refinable'>
   <attribute name='order' default='seq'>
    <enumeration>
      <literal>choice</literal>
      <literal>seq</literal>
      <literal>all</literal>
      <literal>many</literal>
     </enumeration>
   </attribute>
  </archetype>

  <!-- modelElt archetype -->
  <!-- the abstract class of all model elements:
        groups, elements and modelGroupRefs -->
  <archetype name='modelElt' model='refinable'>
    <attribute name='minOccurs' type='non-negative-integer' default='1'/>
    <attribute name='maxOccurs' type='string'/> <!-- allows '*', so integer
                                                       won't do -->
  </archetype>

  <!-- The archetype element refines the toplevel, typeRef and
       modelGroup archetypes.
       It may include a refines element that specifies the archetype(s)
       that is is based on, and either a datatypeQual or a model,
       followed by any number of attribute and attrGroupRef elements.  -->
  <!-- archetype element -->

  <element name='archetype'>
    <archetype>
      <refines name='toplevel'/>
      <refines name='typeRef'/>
      <refines name='modelGroup'/>
      <element ref='refines' minOccurs='0' maxOccurs='*'/>
    <group order='choice'>
        <element archRef='modelElt' minOccurs='0' maxOccurs='*'/>
        <element ref='datatypeQual' minOccurs='0'/>
      </group>
     <group order='choice'  minOccurs='0' maxOccurs='*'>
      <element ref='attribute'/>
      <element ref='attrGroupRef'/>
     </group>
      <attribute name='content' default='elemOnly'>
       <enumeration>
        <literal>elemOnly</literal>
        <literal>textOnly</literal>
        <literal>mixed</literal>
        <literal>empty</literal>
        <literal>any</literal>
      </enumeration>
    </attribute>
    <attribute name='model' type='NCName'>
      <!-- default comes from schema model -->
      <enumeration>
       <literal>open</literal>
       <literal>refinable</literal>
       <literal>closed</literal>
      </enumeration>
     </attribute>
    </archetype>
  </element>

  <!-- refines element -->

  <element name='refines'>
    <archetype content='empty'>
     <refines name='reference'/>
    </archetype>
  </element>


  <!-- The element element refines the toplevel and typeRef archetype.
       It can be used either at the toplevel to define an element-type binding
       globally,
       or within a content model to either reference a globally-defined
       element or archetype or declare an element-type binding locally.
       The ref/archRef forms are not allowed at the top level -->
  <!-- element element -->

  <element name='element'>
    <archetype order='choice'>
    <refines name='toplevel'/>
    <refines name='ref'/>
    <refines name='typeRef'/>
    <refines name='modelElt'/>
        <element ref='datatype'/>
        <element ref='archetype'/>
    </archetype>
  </element>

  <!-- The group element refines the toplevel, modelElt, reference
          and modelGroup archetypes. -->
  <!-- group element -->

  <element name='group'>
   <archetype>
    <refines name='toplevel'/>
    <refines name='ref'/>
    <refines name='modelElt'/>
    <refines name='modelGroup'/>
    <element archRef='modelElt' minOccurs='0' maxOccurs='*'/>
   </archetype>
  </element>

  <!-- The datatypeQual archetype provides for modifying datatypes
       referenced from attribute declarations and archetype
       definitions.
       The 'facets' group is defined in the datatype schema.
       It is realised by the datatypeQual element and refined by the
       attribute element -->

  <archetype name='datatypeQual' order='many'>
   <group ref='facets'/>
  </archetype>

  <!-- The datatypeQual element realises the datatypeQual archetype -->

  <element name='datatypeQual' type='datatypeQual'/>

  <!-- the attribute element declares attributes -->
  <element name='attribute'>
   <archetype>
    <refines name='datatypeQual'/>
    <refines name='typeRef'/>
    <refines name='named'/>
    <attribute name='minOccurs' type='non-negative-integer' default='0'>
      <enumeration>
       <literal>0</literal>
       <literal>1</literal>
      </enumeration>
    </attribute>
    <attribute name='maxOccurs' type='integer' fixed='1'/>
   </archetype>
  </element>

  <!-- attrGroup element -->
  <element name='attrGroup'>
    <archetype>
    <refines name='toplevel'/>
      <group order='choice' minOccurs='1' maxOccurs='*'>
      <element ref='attribute'/>
      <element ref='attrGroupRef'/>
     </group>
    </archetype>
  </element>

  <!-- The attrGroupRef element refines the reference archetype.  -->
  <!-- attrGroupRef element -->
  <element name='attrGroupRef'>
    <archetype>
     <refines name='reference'/>
    </archetype>
  </element>

  <!-- The textEntity element refines the toplevel archetype.
        It provides for string content to specify the entity value.  -->
  <!-- textEntity element -->

  <element name='textEntity'>
    <archetype type='string'>
      <refines name='toplevel'/>
    </archetype>
  </element>

  <!-- The externalRef archetype provides for specification
       of a uri, an optional public identifier, and a notation attribute.
       It refines the toplevel archetype -->

  <archetype name='externalRef' model='refinable' content='empty'>
    <refines name='toplevel'/>
    <attribute name='system' type='uri' minOccurs='1'/>
    <attribute name='public' type='public'/>
  </archetype>

  <!-- the typedExternalRef adds a required notation to an external ref -->
  <archetype name='typedExternalRef' model='refinable'>
    <refines name='externalRef'/>
    <attribute name='notation' type='NOTATION' minOccurs='1'/>
  </archetype>

  <!-- The externalEntity and unparsedEntity elements are
       based on the typedExternalRef archetype. -->
  <!-- externalEntity element -->

  <element name='externalEntity'>
    <archetype>
    <refines name='typedExternalRef'/>
    <attribute name='notation' fixed='XML'/>
   </archetype>
  </element>

<!-- unparsedEntity element -->
  <element name='unparsedEntity'>
    <archetype>
    <refines name='typedExternalRef'/>
   </archetype>
  </element>

  <!-- The notation element refines the externalRef archetype. -->
  <element name='notation'>
    <archetype>
    <refines name='externalRef'/>
   </archetype>
  </element>

  <!-- ################################################ -->
  <!-- import, export and include -->
  <!-- The import, export and include elements all refine the
       restrictions archetype, whose attributes can be used
       to enable or disable import and export restrictions.
       Within import and include elements, references to the
       components of foreign schemas control their importation
       or inclusion, respectively.  -->
  <!-- The import and include elements both refine external -->
  <!-- ################################################ -->

  <archetype name='restrictions' model='refinable'>
    <attribute name='datatypes' type='boolean' default='true'/>
    <attribute name='archetypes' type='boolean' default='true'/>
    <attribute name='elements' type='boolean' default='true'/>
    <attribute name='attrGroups' type='boolean' default='true'/>
    <attribute name='modelGroups' type='boolean' default='true'/>
    <attribute name='entities' type='boolean' default='true'/>
    <attribute name='notations' type='boolean' default='true'/>
  </archetype>

  <archetype name='external' order='choice' model='refinable'>
      <refines name='restrictions'/>
      <element ref='component' minOccurs='0' maxOccurs='*'/>
    <attribute name='schemaName' minOccurs='1' type='uri'/>
  </archetype>

<!-- component element, used in external -->

  <element name='component'>
   <archetype content='empty'>
    <attribute name='name' type='NCName' minOccurs='1'/>
    <attribute name='type' minOccurs='1'>
     <enumeration>
      <literal>datatype</literal>
      <literal>archetype</literal>
      <literal>element</literal>
      <literal>attrGroup</literal>
      <literal>modelGroup</literal>
      <literal>entity</literal>
      <literal>notation</literal>
     </enumeration>
    </attribute>
   </archetype>
  </element>

  <!-- import element  -->

  <element name='import'>
    <archetype>
      <refines name='external'/>
      <attribute name='schemaAbbrev' minOccurs='1' type='NCName'/>
    </archetype>
  </element>

  <!-- export element  -->

  <element name='export'>
    <archetype content='empty'>
    <refines name='restrictions'/>
    </archetype>
  </element>

  <!-- include element  -->

  <element name='include' type='external'/>

  <!-- ################################################ -->
  <!-- notations for use within XML Schema schemas      -->
  <!-- ################################################ -->  
  <notation name='XMLSchemaStructures' 
            public='structures'
            system=']]>&XSP1.URI;<![CDATA[.xsd'/>
  <notation name='XML'
            public='REC-xml-19980210'
            system='http://www.w3.org/TR/1998/REC-xml-19980210'/>
</schema>
]]>
</eg>
<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'>
<![CDATA[<!-- DTD for XML Schemas: Part 1: Structures -->
<!-- Id: structures.dtd,v 1.9 1999/10/27 13:26:12 ht Exp  -->
<!ELEMENT schema ((import*, include*, export?,  
                  (comment | datatype | archetype | element   
                  | attrGroup | group | notation 
                  | textEntity | externalEntity | unparsedEntity)* ))>
<!ATTLIST schema
                 targetNS    CDATA       #IMPLIED
                 version     CDATA       #IMPLIED
                 xmlns       CDATA       ']]>&XMLSchemaNS;<![CDATA['
                 model      (open|refinable|closed) 'closed' >

<!ELEMENT import (component*) >

<!ATTLIST import
                 schemaAbbrev     NMTOKEN      #REQUIRED 
                 schemaName       CDATA        #REQUIRED 
                 datatypes        (true|false) 'true'  
                 archetypes       (true|false) 'true'  
                 elements         (true|false) 'true'  
                 attrGroups       (true|false) 'true'  
                 groups           (true|false) 'true'  
                 entities         (true|false) 'true'  
                 notations        (true|false) 'true' >

<!ELEMENT component EMPTY >
<!ATTLIST component name NMTOKEN #REQUIRED
                    type (datatype|archetype|element|attrGroup|group|
                          entity|notation) #REQUIRED>

<!ELEMENT export EMPTY >
<!ATTLIST export 
                 datatypes        (true|false) 'true'  
                 archetypes       (true|false) 'true'  
                 elements         (true|false) 'true'  
                 attrGroups       (true|false) 'true'  
                 groups           (true|false) 'true'  
                 entities         (true|false) 'true'  
                 notations        (true|false) 'true' >

<!ELEMENT include (component*) >

<!ATTLIST include
                 schemaName       CDATA        #REQUIRED 
                 datatypes        (true|false) 'true'  
                 archetypes       (true|false) 'true'  
                 elements         (true|false) 'true'  
                 attrGroups       (true|false) 'true'  
                 groups           (true|false) 'true'  
                 entities         (true|false) 'true'  
                 notations        (true|false) 'true' >


<!-- -->
<!-- comments contain text -->
<!-- -->
<!ELEMENT comment (#PCDATA) >

<!-- The datatype element is defined in XML Schema: Part 2: Datatypes -->

<!ENTITY % xs-datatypes PUBLIC "-//W3C//DTD XMLSCHEMA datatypes ]]>&iso.doc.date;<![CDATA[//EN"
                     ']]>&XSP2.URI;.dtd<![CDATA[' >
%xs-datatypes;

<!-- -->
<!-- an archetype is a named content type specification with attribute 
     declarations-->
<!-- -->

<!ELEMENT archetype (refines*,
                     ((element|group)*|datatypeQual?),
                     (attribute|attrGroupRef)*)>
                           
<!-- note that datatypeQual only if type attr present -->

<!ATTLIST archetype
          name      NMTOKEN     #IMPLIED
          content   (textOnly|mixed|elemOnly|empty|any) 'elemOnly'
          model     (open|refinable|closed) #IMPLIED
          order     (choice|seq|all|many)    #IMPLIED
          type      NMTOKEN     #IMPLIED
          default   CDATA       #IMPLIED
          fixed     CDATA       #IMPLIED
          schemaAbbrev    NMTOKEN    #IMPLIED
          schemaName      CDATA      #IMPLIED >

<!-- Note that schemaAbbrev/Name, default|fixed only if type,
     type iff content='textOnly', in which case must name a datatype -->
<!-- Note that if order is 'all', group/groupRef is not allowed -->
<!-- If order is 'all', minOccurs==maxOccurs==1 on element -->
<!-- Default for order is 'seq' unless content='mixed', in which
     case it's 'many' -->

<!ELEMENT refines EMPTY>
<!ATTLIST refines
                 name            NMTOKEN    #REQUIRED
                 schemaAbbrev    NMTOKEN    #IMPLIED
                 schemaName      CDATA      #IMPLIED >

<!-- -->
<!-- an element is declared by either:
 a name and a type (either nested or referenced via the type attribute)
or:
 a ref to an existing element declaration -->   
<!-- -->
<!ELEMENT element ((archetype|datatype)?)>
<!-- archetype or datatype only if no type|ref|archRef attribute -->
<!-- ref|archRef not allowed at top level -->
<!ATTLIST element
            name        NMTOKEN      #IMPLIED
            ref         NMTOKEN      #IMPLIED
            archRef     NMTOKEN      #IMPLIED
            type        NMTOKEN      #IMPLIED
            schemaAbbrev    NMTOKEN    #IMPLIED
            schemaName      CDATA      #IMPLIED 
            minOccurs   CDATA        '1'
            maxOccurs   CDATA        #IMPLIED
            export      (true|false) 'true'
	    default   CDATA      #IMPLIED 
            fixed     CDATA      #IMPLIED>
<!-- type, ref and archRef are mutually exclusive.  schemaName/Abbrev applies
     to whichever is there, not allowed if neither.
     If name is absent, ref is required -->
<!-- maxOccurs defaults to 1 or minOccurs, whichever is greater -->

<!ELEMENT group (element|group)*>
<!ATTLIST group
            name        NMTOKEN          #IMPLIED
            export      (true|false) 'true'
            collection  (no|list)        'no'
            minOccurs   CDATA            '1'
            maxOccurs   CDATA            #IMPLIED
	    order       (choice|seq|all|many) 'seq' 
            ref         NMTOKEN          #IMPLIED
            schemaAbbrev NMTOKEN         #IMPLIED
            schemaName  CDATA            #IMPLIED>

<!-- Three different functions:  as a named group definition, as an
     anonymous grouping in a model and as a reference to a named group -->

<!-- Name and export only at top level.
    Name and ref are mutually exclusive, as
    are ref and content  -->
<!-- Note that if order is 'all', group is not allowed inside.
     If order is 'all' THIS group must be or be referenced alone at
     the top level of a content model -->
<!-- If order is 'all', minOccurs==maxOccurs==1 on element -->

<!-- the entity reference below is discharged in datatypes.dtd -->
<!ELEMENT datatypeQual (%facets;)*>

<!-- -->
<!-- an attribute declaration names an attribute specification -->
<!-- -->
<!ELEMENT attribute (%facets;)*>
<!ATTLIST attribute
          name      NMTOKEN    #REQUIRED
          schemaAbbrev      NMTOKEN    #IMPLIED
          schemaName   CDATA      #IMPLIED
	  type      CDATA      'string'
	  maxOccurs CDATA      #FIXED '1'
	  minOccurs (0|1)      '0'
	  default   CDATA      #IMPLIED 
          fixed     CDATA      #IMPLIED>

<!-- an attrGroup is a named collection of attribute decls -->
<!ELEMENT attrGroup (attribute | attrGroupRef)+ >
<!ATTLIST attrGroup
                 name        NMTOKEN     #REQUIRED
                 export     (true|false) 'true' >

<!ELEMENT attrGroupRef EMPTY >
<!ATTLIST attrGroupRef 
                 name      NMTOKEN    #REQUIRED
                 schemaAbbrev    NMTOKEN    #IMPLIED
                 schemaName CDATA      #IMPLIED >

<!--  -->
<!-- Entities and notations in XML Schema -->
<!--  -->

<!-- a textEntity can be referenced in documents of this type -->
<!ELEMENT textEntity (#PCDATA) >
<!ATTLIST textEntity
                 name        NMTOKEN     #REQUIRED
                 export      (true|false) #FIXED 'true' >

<!-- an externalEntity can be referenced in documents of this type -->
<!ELEMENT externalEntity EMPTY >
<!ATTLIST externalEntity
                 name        NMTOKEN     #REQUIRED
                 export     (true|false) #FIXED 'true' 
                 public      CDATA       #IMPLIED
                 system      CDATA       #REQUIRED
                 notation    NMTOKEN     #FIXED 'XML'>

<!-- declares notation to be a 1st class element or entity content types -->
<!ELEMENT notation EMPTY >
<!ATTLIST notation
                 name        NMTOKEN     #REQUIRED
                 export     (true|false) #FIXED 'true'
                 public      CDATA       #REQUIRED
                 system      CDATA       #IMPLIED>

<!-- an unparsedEntity can be referenced in documents of this type  -->
<!ELEMENT unparsedEntity EMPTY >
<!ATTLIST unparsedEntity
                 name        NMTOKEN     #REQUIRED
                 export     (true|false) #FIXED 'true'
                 public      CDATA       #IMPLIED
                 system      CDATA       #REQUIRED
                 notation    NMTOKEN     #REQUIRED >

<!NOTATION XMLSchemaStructures PUBLIC 'structures'
           ']]>&XSP1.URI;<![CDATA[.xsd' >
<!NOTATION XML PUBLIC 'REC-xml-1998-0210'
               'http://www.w3.org/TR/1998/REC-xml-19980210' >
]]>
</eg>

</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>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 namespace qualification, 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>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='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='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://ds.internic.net/rfc/rfc1808.txt'>http://ds.internic.net/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://ds.internic.net/rfc/rfc1738.txt'>http://ds.internic.net/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://ds.internic.net/rfc/rfc2141.txt'>http://ds.internic.net/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/WD-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/WD-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/WD-xptr'>http://www.w3.org/TR/WD-xptr
</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='tfr'>
<head>Task Force Reports (non-normative) *</head>
<div2>
<head>Composition TF Report</head>
<blist>
<bibl id='ref-schema-comp-tf' key='Composition TF Report'>
<emph>XML Schema Composition Task Force Report: Partial draft</emph>,
Noah Mendelsohn, Henry S. Thompson.  See <loc href='composition-tf.html'>&XSP1.base;/composition-tf.html</loc></bibl>
</blist>
</div2>
<div2>
<head>Refinement TF Report</head>
<blist>
<bibl id='ref-refine-tf' key='Refinement TF Report'>
<emph>Refinement Task Force Report</emph>,
Eve Maler, Ashok Malhotra, and Allen Brown eds.  See <loc href='refinement-tf.html'>&XSP1.base;/refinement-tf.html</loc></bibl>
</blist>
</div2>
<div2>
<head>Simple TF Background</head>
<blist>
<bibl id='ref-simple-back' key='Simple TF Background'> <emph>Proposal by the "Simple Syntax" Taskforce</emph>, David Fallside et al.  See <loc href='simple-background.html'>&XSP1.base;/simple-background.html</loc></bibl>
</blist>
</div2>
<div2>
<head>Simple TF Proposal</head>
<blist>
<bibl id='ref-simple-prop' key='Simple TF Proposal'> <emph>XML Schema
Part 1: Structures - Proposed Updates from Simplification Task
Force</emph>, David Fallside et al.  See <loc href='simple-proposal.html'>&XSP1.base;/simple-proposal.html</loc></bibl>
</blist>
</div2>
</div1>
<div1 id='acknowledgments'>
<head>Acknowledgments (non-normative) *</head>
 <p>The following have contributed material to this draft:</p>
 <slist>
  <sitem>Andrew Layman, Microsoft</sitem>
  <sitem>David Fallside, IBM</sitem>
  <sitem>Scott Lawrence, Agranat Systems</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>Paula Angerstein</name>
 <affiliation>Vignette Corporation</affiliation>
</member>
<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>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 Technology</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 Technology</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>Janet Koenig</name>
 <affiliation>Sun Microsystems</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>ArborText, Inc.</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>Priscilla Walmsley</name>
 <affiliation>XMLSolutions</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>Gabe Beged-Dov</name>
  <affiliation>Rogue Wave Software</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>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 id='sampleSchema'>
<head>Sample Schema (non-normative) *</head>
<note>
<p>An example of a full blown schema, for the <code>PurchaseOrder</code>
example from <specref ref='concepts-types'/>:</p>
<eg xml:space='preserve'>
<![CDATA[<schema targetNS='http://www.myOrg.com/bob/PurchaseOrder' xmlns=']]>&XMLSchemaNS;<![CDATA['>

 <element name='PurchaseOrder' type='PurchaseOrderType'/>

 <element name='comment' type='string'/>

 <archetype name='PurchaseOrderType'>
  <element name='shipTo' type='Address'/>
  <element name='shipDate' type='date'/>
  <element ref='comment' minOccurs='0'/>
  <element name='Items' type='Items'/>
  <attribute name='orderDate' type='date'/>
 </archetype>

 <archetype name='Address'>
  <element name='name' type='string'/>
  <element name='street' type='string'/>
  <element name='city' type='string'/>
  <element name='state' type='string'/>
  <element name='zip' type='number'/>
  <attribute name='type' type='string'/>
 </archetype>

 <archetype name='Items'>
  <element name='Item' minOccurs='0' maxOccurs='*'>
   <archetype>
    <element name='productName' type='string'/>
    <element name='quantity'>
     <datatype>
      <basetype name='integer'/>
      <minExclusive>0</minExclusive>
     </datatype>
    </element>
    <element name='price' type='number'/>
    <element ref='comment' minOccurs='0'/>
   </archetype>
  </element>
 </archetype>

</schema>]]>
</eg>
</note>
</div1>
<div1>
<head>Tabulation of changes *</head>
<eg>
<![CDATA[
$Log: structures.xml,v $
Revision 1.15.1.11  1999/11/05 17:19:14  aqw
typo in stylesheet name

Revision 1.15.1.10  1999/11/05 15:41:53  aqw
fix some more dates -> entref, remove some more ../'s

Revision 1.15.1.9  1999/11/05 15:12:55  aqw
oops, move DTD down a level too

Revision 1.15.1.8  1999/11/05 15:05:28  aqw
just before PWD: fix some uses of ...base; entities, remove Id:, make
resource pointers same level, not ../, to accommodate Hugo's release
directory structure

Revision 1.15.1.7  1999/11/04 23:42:26  aqw
one last link fix

Revision 1.15.1.6  1999/11/04 22:03:50  aqw
more last-minute link fixes

Revision 1.15.1.5  1999/11/04 21:35:44  aqw
adjust URLs, membership, status

Revision 1.15.1.4  1999/11/03 21:32:52  aqw
example fixed per David Beech suggestion

Revision 1.15.1.3  1999/11/03 21:19:05  aqw
more on editors and acks
fix some typos courtesy of David Beech

Revision 1.15.1.2  1999/11/03 20:21:03  aqw
editor emails

Revision 1.15.1.1  1999/11/03 19:52:45  aqw
editor and author fixes for PWD

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  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: structures.xml,v 1.15.1.11 1999/11/05 17:19:14 aqw Exp $ 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: structures.xml,v 1.15.1.11 1999/11/05 17:19:14 aqw Exp $
----------------------------
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>
