<?xml version='1.0'?>
<?xml:stylesheet type='text/xsl' href='XMLspec-19990503.msxsl'?>
<!DOCTYPE spec PUBLIC "-//HST//DTD Specification::19990423//EN" "xmlspec-19990429.dtd" [
   <!ENTITY SchemaWG "W3C XML Schema Working Group">
   <!ENTITY XSP1 "<emph>XML Schema: Structures</emph>">
   <!ENTITY XSP2 "<emph>XML Schemas: Datatypes</emph>">
   <!ENTITY draft.year "1999">
   <!ENTITY draft.month "May">
   <!ENTITY draft.day "6">
   <!ENTITY doc.date "&draft.day; &draft.month; &draft.year;">
   <!ENTITY w3c.doc.date "&draft.day;-&draft.month;-&draft.year;">
   <!ENTITY draft.YY "1999">
   <!ENTITY draft.MM "05">
   <!ENTITY draft.DD "06">
   <!ENTITY iso.doc.date "&draft.YY;&draft.MM;&draft.DD;">
   <!ENTITY draft.base "http://www.w3.org/&draft.YY;/&draft.MM;/&draft.DD;">
   <!ENTITY WD-XSP1 "structures">
   <!ENTITY XSP1.base "&draft.base;-xmlschema-1/">
   <!ENTITY XSP1.URI "&XSP1.base;&WD-XSP1;">
   <!ENTITY XSP1.version "0.4">
   <!ENTITY WD-XSP2 "datatypes">
   <!ENTITY XSP2.base "&draft.base;-xmlschema-2/">
   <!ENTITY XSP2.URI "&XSP2.base;&WD-XSP2;">
   <!ENTITY doc.audience "and external review.">
   <!ENTITY doc.distribution "For distribution">
 ]>
<spec> 
  <header> 
    <title>XML Schema Part 1: Structures</title>
    <version>&XSP1.version;</version> 
    <w3c-designation></w3c-designation> 
    <w3c-doctype>W3C Working Draft</w3c-doctype> 
    <pubdate> 
      <day>&draft.day;</day> 
      <month>&draft.month;</month> 
      <year>&draft.year;</year> 
    </pubdate> 
    <publoc> <loc href="&XSP1.base;">&XSP1.base;</loc><loc
      href="&XSP1.URI;.xml">&XSP1.URI;.xml</loc> <loc
      href="&XSP1.URI;.html">&XSP1.URI;.html</loc> <loc
      href="&XSP1.URI;.xsd">&XSP1.URI;.xsd</loc> <loc
      href="&XSP1.URI;.dtd">&XSP1.URI;.dtd</loc> 
    </publoc> 
    <latestloc><loc href="http://www.w3.org/TR/xmlschema-1/">http://www.w3.org/TR/xmlschema-1/</loc> 
    </latestloc> 
    <authlist> 
      <author> 
        <name>David Beech</name> 
        <affiliation>Oracle</affiliation> 
        <email href="mailto:dbeech@us.oracle.com">dbeech@us.oracle.com</email> 
      </author> 
      <author> 
        <name>Scott Lawrence</name> 
        <affiliation>Agranat Systems</affiliation> 
        <email href="mailto:lawrence@agranat.com">lawrence@agranat.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</affiliation> 
        <email
         href="mailto:noah_mendelsohn@lotus.com">noah_mendelsohn@lotus.com</email> 
      </author> 
      <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> 
    </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>
        </p> 
      <p>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 &quot;work in progress&quot;. </p> 
    </status> 
    <abstract>
      <p><emph> XML Schema: Structures</emph> is part one 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-05-03: MCM: Updated schema and DTD. Package and test. 
        </sitem> 
        <sitem>1999-05-03 Integration of final editors&apos; 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 &apos;schema&apos;; suggested modifications to
          3.4.9/10 and 3.5 </sitem> 
        <sitem>1999-04-39: HST : integrated DB&apos;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 &apos;schema&apos;; suggested modifications to
          3.4.9/10 and 3.5 </sitem> 
        <sitem>1999-04-23: HST : Got all productions sorted using
          &apos;nt&apos; 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 structural part (&XSP1;) of the XML Schema definition language is
        a distillation of eight months of work by the &SchemaWG;, including four weeks
        of intensive work by a group of five editors. This Working Draft draws heavily
        on the work of <bibref ref="ref-dcd"/>, <bibref ref="ref-ddml"/>,
        <bibref ref="ref-sox"/>, <bibref ref="ref-xdr"/> and
        <bibref ref="ref-xml-data"/>. Requirements for &XSP1; can be found in
        <bibref ref="ref-xsreq"/>.</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 types, 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"/> and
        <specref ref="normative-references"/>. Non-normative appendixes include a
        <specref ref="sampleSchema"/> and acknowledgments [<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>

        <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=&apos;http://www.muzmo.com/XMLSchema/1.0/mySchema.xsd&apos; &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 implicit
        information such as default values. Schemas are intended to document their own
        meaning, usage, and function through a common documentation vocabulary. </p> 
      <p>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. </p> 
      <p>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>See
              <loc
               href="http://www.w3.org/XML/Group/1999/03/xml-schema-i18n-notes">http://www.w3.org/XML/Group/1999/03/xml-schema-i18n-notes
                </loc> </p> 
          </def> 
        </gitem> 
        <gitem> 
          <label>RDF Schema </label>
          <def> 
            <p>&XSP1; has not yet documented requirements or dependencies. </p>
            
          </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, it is
        useful to clarify the relationships between certain kinds of XML documents: 
      </p> 
      <glist> 
        <gitem> 
          <label><termdef id="key-instance"
            term="Instance"><term>Instance</term></termdef> </label>
          <def> 
            <p>An XML document whose structure conforms to some schema. See
              <specref ref="composition-instances"/> for the means by which an instance
              identifies the schema(s) to which it conforms. </p> 
          </def> 
        </gitem> 
        <gitem> 
          <label><termdef id="key-schema"
            term="Schema"><term>Schema</term></termdef> </label>
          <def> 
            <p>A set of rules for constraining the structure and articulating
              the information set of XML documents. </p> 
          </def> 
        </gitem> 
        <gitem> 
          <label><termdef id="key-schema-definition"
            term="Schema Definition"><term>Schema Definition</term></termdef> </label>
          <def> 
            <p>An XML document that defines a schema. See
              <specref ref="composition-schemaAccess"/> for the means by which schema
              definition documents are accessed during processing. The term &quot;Schema
              Definition&quot; may also be abbreviated to &quot;schema&quot; where no
              confusion is likely. </p> 
          </def> 
        </gitem> 
      </glist> 
      <p>Note that it is possible to specify a schema definition to which
        schema definitions themselves must conform, and this is given in
        <specref ref="normative-schemaSchema"/>. An XML 1.0 DTD to which schema
        definitions must conform is also provided in
        <specref ref="normative-schemaDTD"/>. </p> 
      <p>Any schema definition is therefore also an instance. The editors will
        make an attempt to always use the most precise of these terms, but the reader
        should note that rules specified herein for instances do apply to all of the
        following kinds of XML document: 
        <ulist> 
          <item> 
            <p>Documents that are not schema definitions;</p> 
          </item> 
          <item> 
            <p>Schema definitions applicable to documents that are not schema
              definitions;</p> 
          </item> 
          <item> 
            <p>The schema definition applicable to schema definitions. </p> 
          </item> 
        </ulist> Likewise, rules for schemas do apply to the schema definition
        for schema definitions, which is an instance of 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 of instances which they 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 the information sets of instances 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 element types 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>On &apos;types&apos;</head> 
      <p>The use of the word &apos;type&apos; has caused confusion in earlier
        discussions of schema technologies. Here, the word is used in several different
        contexts for a constraint on the form of (parts of) an element or attribute in
        an instance document. So, there are types that are suitable for constraining
        individual attributes, others that apply to entire elements (of which
        attributes may be a part), and so on. We use the words &apos;define&apos; and
        &apos;definition&apos; when speaking of types, and the words
        &apos;declare&apos; and &apos;declaration&apos; when specifying for an
        attribute or element type the type which constrains its form in instance
        documents. </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. An asterisk (*) in the
        &apos;Named?&apos; 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>
            
          </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
              containing all the definitions and declarations comprising a schema document. 
            </td>
            <td align="left" valign="top" rowspan="1" colspan="1"> Yes </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"> A type
              (content constraint), such as &apos;integer&apos;, 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>
          </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>
          </tr>
          <tr>
            <td align="left" valign="top" rowspan="1" colspan="1">
              <specref ref="declare-elementType"/></td>
            <td align="left" valign="top" rowspan="1" colspan="1"> An
              association between a name for an element and an archetype. An element type
              declaration for &apos;A&apos; 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>
          </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 a name for an attribute and a datatype, together with
              occurrence constraints such as &apos;required&apos; or &apos;default&apos;. The
              association is local to its surrounding archetype.</td>
            <td align="left" valign="top" rowspan="1" colspan="1"> Yes* (local)
              </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>
          </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 type
              (content 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>
          </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, sequencing, as well as for declaration of and
              reference to element types. </td>
            <td align="left" valign="top" rowspan="1" colspan="1"> No (but see
              below) </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>
          </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>
          </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>
          </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 an external schema,
              retaining the association with the original schema.</td>
            <td align="left" valign="top" rowspan="1" colspan="1"> 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 an external schema into the schema being
              defined, as if they had been defined locally.</td>
            <td align="left" valign="top" rowspan="1" colspan="1"> 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 are given names, which provide for references within the
        schema, and sometimes from one schema to another. For example, an attribute
        definition can refer to a named datatype, such as &apos;integer&apos;. A
        content model can refer to an element type, and so on. </p> 
      <p>If all such names were assigned from the same &apos;pool&apos;, then
        it would be impossible to have e.g. a datatype named &apos;integer&apos; and an
        element type with the name &apos;integer&apos; in the same schema.
        <termdef id="key-symbolSpace" term="symbol space">Accordingly we introduce the
        idea of a <term>symbol space</term> (avoiding &apos;name space&apos; to avoid
        confusion with &apos;Namespaces in XML&apos; <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 &apos;Attribute&apos; and
        &apos;Element type&apos;: 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 an archetype and an
        element type, without conflict or necessary relation between the two. </p> 
      <p>Attributes and local element type declarations are special, in that
        every archetype defines its own attribute and local element type symbol spaces.
        </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
        and in <specref ref="normative-schemaSchema"/> and
        <specref ref="normative-schemaDTD"/>. The emphasis in this version has been to
        stay quite close to the abstract syntax. </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 instance documents 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><nt def="nt-preamble">preamble</nt> <nt def="nt-dds">dds</nt>* 
          </rhs> 
        </prod> 
        <prod id="nt-dds"> 
          <lhs>dds</lhs> 
          <rhs><nt def="nt-datatypeDefn">datatypeDefn</nt> |
            <nt def="nt-archetypeDefn">archetypeDefn</nt> | <nt
            def="nt-elementTypeDecl">elementTypeDecl</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><nt def="nt-xmlSchemaRef">xmlSchemaRef</nt> <nt
            def="nt-schemaIdentity">schemaIdentity</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><pt>URI</pt> </rhs> 
        </prod> 
        <prod id="nt-schemaIdentity"> 
          <lhs>schemaIdentity</lhs> 
          <rhs><pt>URI</pt></rhs> 
        </prod> 
        <prod id="nt-schemaVersion"> 
          <lhs>schemaVersion</lhs> 
          <rhs><pt>string-value</pt> </rhs> 
        </prod> 
        <prod id="nt-model"> 
          <lhs>model</lhs> 
          <rhs><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-schemaIdentity">schemaIdentity</nt> specifying the URI by which
        <emph>this</emph> schema is to be identified; and a <nt
        def="nt-schemaVersion">schemaVersion</nt> specification for private version
        documentation purposes and version management.</p> 
      <note role="example">
        <eg xml:space="preserve">
&lt;!DOCTYPE schema 
          PUBLIC &apos;-//W3C//DTD XML Schema Version 1.0//EN&apos;
          SYSTEM &apos;&XSP1.URI;.dtd&apos; &gt;

&lt;schema name=&apos;file:/usr/schemas/xmlschema/mySchema.xsd&apos; 
        version=&apos;M.n&apos; 
        xmlns=&apos;&XSP1.URI;.xsd&apos;&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>The schema&apos;s <nt def="nt-model">model</nt> property is discussed in
      <specref ref="declare-refinement"/>. The schema&apos;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&apos;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><pt>NCName</pt> <nt def="nt-datatypeSpec">datatypeSpec</nt> </rhs>
        
      </prod> 
      <prod id="nt-archetypeDefn2" role="prefig"> 
        <lhs>archetypeDefn</lhs> 
        <rhs><pt>NCName</pt> <nt def="nt-archetypeSpec">archetypeSpec</nt> 
        </rhs> 
      </prod> 
      <prod id="nt-elementTypeDecl2" role="prefig"> 
        <lhs>elementTypeDecl</lhs> 
        <rhs><pt>NCName</pt> <nt def="nt-elementTypeSpec">elementTypeSpec</nt> 
        </rhs> 
      </prod> 
      <prod id="nt-modelGroupDefn2" role="prefig"> 
        <lhs>modelGroupDefn</lhs> 
        <rhs><pt>NCName</pt> <nt def="nt-modelGroupSpec">modelGroupSpec</nt> 
        </rhs> 
      </prod> 
      <prod id="nt-attrGroupDefn2" role="prefig"> 
        <lhs>attrGroupDefn</lhs> 
        <rhs><pt>NCName</pt> <nt def="nt-attrGroupSpec">attrGroupSpec</nt> 
        </rhs> 
      </prod> 
      <prod id="nt-entityDecl2" role="prefig"> 
        <lhs>entityDecl</lhs> 
        <rhs><pt>NCName</pt> <nt def="nt-entitySpec">entitySpec</nt> </rhs> 
      </prod> 
      <prod id="nt-notationDecl2" role="prefig"> 
        <lhs>notationDecl</lhs> 
        <rhs><pt>NCName</pt> <nt def="nt-notationSpec">notationSpec</nt> </rhs>
        
      </prod> 
 
    </scrap>

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

 &lt;archetype name=&apos;myArchetype&apos;&gt;
  ...
 &lt;/archetype&gt;

 &lt;elementType name=&apos;myElementType&apos;&gt;
  ...
 &lt;/elementType&gt;

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

 &lt;modelGroup name=&apos;myModelGroup&apos;&gt;
  ...
 &lt;/modelGroup&gt;

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

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

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

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

&lt;/schema&gt;
</eg>
      <p>When creating a new component, we declare that its name is associated
        with the specification for that component. Each new component definition
        creates a new entry in the symbol space for that kind of component. </p> 
  </note>
  <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>
  <issue id="no-evolution">
    <p> This draft does not deal with the requirement &quot;for addressing the
      evolution of schemata&quot; (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="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-definition">schema definition</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>(<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-datatypeRef2" role="prefig"> 
      <lhs>datatypeRef</lhs> 
      <rhs><nt def="nt-datatypeName">datatypeName</nt>
        <nt def="nt-datatypeQual">datatypeQual</nt></rhs> 
    </prod> 
    <prod id="nt-datatypeName2" role="prefig"> 
      <lhs>datatypeName</lhs> 
      <rhs><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">archetypeName</nt></rhs> 
    </prod> 
    <prod id="nt-archetypeName2" role="prefig"> 
      <lhs>archetypeName</lhs> 
      <rhs><pt>NCName</pt> <nt def="nt-schemaRef">schemaRef</nt>?</rhs> 
    </prod> 
    <prod id="nt-elementTypeRef2" role="prefig"> 
      <lhs>elementTypeRef</lhs> 
      <rhs><nt def="nt-elementTypeName">elementTypeName</nt> </rhs> 
    </prod> 
    <prod id="nt-elementTypeName2" role="prefig"> 
      <lhs>elementTypeName</lhs> 
      <rhs><pt>NCName</pt> <nt def="nt-schemaRef">schemaRef</nt>?</rhs> 
    </prod> 
    <prod id="nt-attrGroupRef2" role="prefig"> 
      <lhs>attrGroupRef</lhs> 
      <rhs><nt def="nt-attrGroupName">attrGroupName</nt>
        <nt def="nt-attrGroupQual">attrGroupQual</nt></rhs> 
    </prod> 
    <prod id="nt-attrGroupName2" role="prefig"> 
      <lhs>attrGroupName</lhs> 
      <rhs><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><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><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><pt>NCName</pt> <nt def="nt-schemaRef">schemaRef</nt>?</rhs> 
    </prod> 
 
  </scrap>

  <p>The BNF above illustrates the reference mechanisms used in this
    specification.</p> 
  <note role="example">
    <eg xml:space="preserve">
&lt;archetypeRef name=&apos;Address&apos;/&gt;

&lt;elementTypeRef name=&apos;BLOCKQUOTE&apos; schemaAbbrev=&apos;HTML&apos;/&gt;

&lt;datatypeRef name=&apos;quantityi&apos; schemaName=&apos;http://www.w3.org/xsl.xsd&apos;/&gt;
</eg>
    <p>The first of these is a local reference, the other two refer to schemas
      elsewhere. The <nt def="nt-elementTypeRef">elementTypeRef</nt> example assumes
      the <nt def="nt-schemaAbbrev">schemaAbbrev</nt> <code>HTML</code> has been
      declared for import; the <nt def="nt-datatypeRef">datatypeRef</nt> 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>
<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><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>&apos;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>. The
  <specref ref="cos-ident-ref"/> <termref def="gloss-cos">Constraint on
  Schemas</termref> may also obtain.</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> The treatment of aggregate datatypes (collections and
    structures) has not yet been resolved.</p> 
 
  <scrap lang="ebnf" id="RuleSet.XS5">

    <head>Datatypes</head> 
    <prod id="nt-datatypeDefn"> 
      <lhs>datatypeDefn</lhs> 
      <rhs><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, min/max constraint, etc.</com> </rhs> 
    </prod> 
    <prod id="nt-valueConstraint"> 
      <lhs>valueConstraint</lhs> 
      <rhs><pt>default</pt> | <pt>fixed</pt> </rhs> 
    </prod> 
    <prod id="nt-datatypeRef"> 
      <lhs>datatypeRef</lhs> 
      <rhs><nt def="nt-datatypeName">datatypeName</nt>
        <nt def="nt-datatypeQual">datatypeQual</nt></rhs> 
    </prod> 
    <prod id="nt-datatypeName"> 
      <lhs>datatypeName</lhs> 
      <rhs><pt>NCName</pt> <nt def="nt-schemaRef">schemaRef</nt>? </rhs> 
    </prod> 
    <prod id="nt-schemaRef2" role="prefig"> 
      <lhs>schemaRef</lhs> 
      <rhs>(<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 definition mechanisms specified by
    <bibref ref="ref-xsp2"/> in order to express <termref def="SC">SC</termref>s on
    attribute values and the character data contents of elements. </p> 
  <p>The first production above is for defining datatypes;
    <nt def="nt-datatypeSpec">datatypeSpec</nt> serves to indicate where this
    chapter connects with &XSP2;. <nt def="nt-exportControl">exportControl</nt> is
    defined in <specref ref="composition-schemaExport"/>.</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">attrDecl</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> 
  <note role="example">
    <eg xml:space="preserve">&lt;datatype name=&apos;myDatatype&apos;&gt;
 &lt;basetype name=&quot;...&quot;/&gt;
  [ ... TBD]
&lt;/datatype&gt;

&lt;datatypeRef name=&apos;myDatatype&apos;/&gt;

&lt;datatypeRef name=&apos;integer&apos;/&gt;

&lt;datatypeRef name=&apos;quantity&apos; schemaName=&apos;http://www.w3.org/xsl.xsd&apos;&gt;
 &lt;fixed&gt;12pt&lt;/fixed&gt;
&lt;/datatypeRef&gt;</eg>
    <p>The first example awaits the &XSP2; concrete syntax to be filled in. 
    </p> 
    <p>The first <nt def="nt-datatypeRef">datatypeRef</nt> 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>
<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><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></p> 
<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>&apos;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> 
<p>and</p> 
<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> 
<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">datatypeSpec</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>
<note>
  <p>Timing constraints were such that this text may not align completely with
    &XSP2;</p> 
</note>
</div3> 
<div3 id="declare-archetype"> 
<head>Archetype Definition</head> 
<p><termdef id="archetype" term="archetype"><term>Archetype</term> definitions
  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 type which shares
  the same <termref def="SC">SC</termref>s (see
  <specref ref="declare-elementType"/>), 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><pt>NCName</pt> <nt def="nt-archetypeSpec">archetypeSpec</nt> </rhs> 
  </prod> 
  <prod id="nt-archetypeSpec"> 
    <lhs>archetypeSpec</lhs> 
    <rhs><nt def="nt-refinement">refinement</nt>* <nt
      def="nt-contentType">contentType</nt> ( <nt def="nt-attrDecl">attrDecl</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><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><pt>open</pt> | <pt>refinable</pt> | <pt>closed</pt> </rhs> 
  </prod> 
  <prod id="nt-archetypeRef"> 
    <lhs>archetypeRef</lhs> 
    <rhs><nt def="nt-archetypeName">archetypeName</nt> </rhs> 
  </prod> 
  <prod id="nt-archetypeName"> 
    <lhs>archetypeName</lhs> 
    <rhs><pt>NCName</pt> <nt def="nt-schemaRef">schemaRef</nt>?</rhs> 
  </prod> 
 
</scrap>

<p>The first three productions above provide the basic structure of the
  definition, the last two provide for reference to the things defined. 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 type. The connection between an element
  type name and an archetype is made by an <nt
  def="nt-elementTypeDecl">elementTypeDecl</nt>, see below. </p> 
<p>Alongside <specref ref="declare-attribute"/> for permitted attributes,
  <termref def="SC">SC</termref>s for contents are defined in an archetype (<nt
  def="nt-contentType">contentType</nt>). For elements which may contain only
  character data, content type <termref def="SC">SC</termref>s are specified by
  reference to a <specref ref="declare-datatype"/>. Note that doing this by way
  of <nt def="nt-datatypeRef">datatypeRef</nt> means that the character data
  <termref def="SC">SC</termref>s may provide for specialization and even
  defaulting in a manner similar to attribute values. For other kinds of
  elements, a <specref ref="declare-contentModel"/> is required. </p> 
<issue id="elt-default">
  <p>The extension of defaulting to element content is tentative. </p> 
</issue>
<note role="example">
  <p> 
    <eg xml:space="preserve">
&lt;archetype name=&apos;myArchetype&apos;&gt;
    &lt;datatypeRef name=&apos;myDatatype&apos;/&gt;
    &lt;attrDecl ...&gt;. . .&lt;/attrDecl&gt;
&lt;/archetype&gt;
</eg>
    A simple archetype with character data content constrained by reference to
    a datatype defined in the same schema and one attribute. 
</p> 
</note>
<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 a
  <nt def="nt-archetypeSpec">archetypeSpec</nt> must <termref
  def="key-identify">identify</termref> an <nt
  def="nt-attrGroupSpec">attrGroupSpec</nt>.</p> 
</constraintnote>
<p><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">attrDecls</nt> together with all the <nt
def="nt-attrDecl">attrDecls</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><termdef id="key-attr-fullname"
term="full name of an attribute declaration">The <term>full name</term> of an
<nt def="nt-attrDecl">attrDecl</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>&apos;s
  <termref def="key-attr-decl-set">attribute declaration set</termref>.</p> 
</constraintnote>
<p><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&apos;s attribute items taken together as a set
<termref def="key-satisfy-attrs">attrs-satisfy</termref> the
<nt def="nt-archetypeSpec">archetypeSpec</nt>&apos;s
<termref def="key-attr-decl-set">attribute declaration set</termref>, and
either </termdef></p> 
<ulist> 
<item> 
  <p>The <nt def="nt-archetypeSpec">archetypeSpec</nt>&apos;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>&apos;s <nt
    def="nt-datatypeQual">datatypeQual</nt> if any;</p> 
</item> 
</ulist> 
<p>or</p> 
<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> 
<issue id="sic-elt-default">
<p>The above definitions do not provide for handling a default on an
  archetype&apos;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&apos;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>
<note role="example">
<p>Why is the separation of element type and archetype provided for? In certain
  XML instance documents, the same attribute and content <termref
  def="SC">SC</termref>s are appropriate for more than one named element.
  Consider the following instance fragment:</p> 
<eg xml:space="preserve">
&lt;ShippingAddress id=&apos;a32&apos; saleable=&apos;yes&apos;&gt;
  &lt;Street&gt;1 Main Street&lt;/Street&gt;
  &lt;City&gt;New York&lt;/City&gt;
  &lt;Zip NineDigit=&apos;FALSE&apos;&gt;12345&lt;/Zip&gt;
&lt;/ShippingAddress&gt;

&lt;BillingAddress id=&apos;a29&apos; saleable=&apos;no&apos;&gt;
  &lt;Street&gt;2 Rose Lane&lt;/Street&gt;
  &lt;City&gt;Anytown&lt;/City&gt;
  &lt;Zip NineDigit=&apos;TRUE&apos;&gt;12345-6789&lt;/Zip&gt;
&lt;/BillingAddress&gt;</eg>
<p>This fragment contains two elements, <code>ShippingAddress</code> and
  <code>BillingAddress</code>, that have similar attributes and content. By
  defining a single appropriate archetype and declaring two element types which
  reference it, that commonality can be precisely expressed. </p> 
</note>
<note>
<p>This draft does not provide any mechanism for applying any <termref
def="SC">SC</termref>s to element items whose namespace does not
<termref def="key-nominate">nominate</termref> a schema. This may be addressed
in a later draft: in the meantime a workaround is possible as follows:</p> 
<p>Suppose we wish to use some Dublin Core terms in a schema, but all we know
is the URI for the Dublin Core document. Perhaps we want to schema-validate 
<eg>&lt;mybook&gt;&lt;dc:creator xmlns:dc=&apos;...&apos;&gt;Rafael
 Sabattini&lt;/dc:creator&gt;&lt;/mybook&gt;</eg>
where <code>mybook</code> is already known to be covered by my schema. The
workaround is to replace the real Dublin Core URI with a local URL for a tiny
schema which simply defines <code>creator</code>, and references the real URI
for documentation. 
</p> 
</note>
</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>attrDecl</lhs> 
<rhs><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><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><pt>default</pt> | <pt>fixed</pt> </rhs> 
</prod> 
<prod id="nt-datatypeName3" role="prefig"> 
<lhs>datatypeName</lhs> 
<rhs><pt>NCName</pt> <nt def="nt-schemaRef">schemaRef</nt>? </rhs> 
</prod> 
<prod id="nt-schemaRef3" role="prefig"> 
<lhs>schemaRef</lhs> 
<rhs>(<nt def="nt-schemaAbbrev">schemaAbbrev</nt> | <nt
def="nt-schemaName">schemaName</nt>)</rhs> 
</prod> 
 
</scrap>

<note>
<p>Note that 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> 
<note role="example">
<eg xml:space="preserve">&lt;attrDecl name=&apos;myAttribute&apos;/&gt;

&lt;attrDecl name=&apos;anotherAttribute&apos;&gt;
 &lt;datatypeRef name=&apos;integer&apos;&gt;
  &lt;default&gt;42&lt;/default&gt;
 &lt;/datatypeRef&gt;
&lt;/attrDecl&gt;

&lt;attrDecl name=&apos;yetAnotherAttribute&apos; required=&apos;true&apos;&gt;
 &lt;datatypeRef name=&apos;integer&apos;/&gt;
&lt;/attrDecl&gt;

&lt;attrDecl name=&apos;stillAnotherAttribute&apos;&gt;
 &lt;datatypeRef name=&apos;string&apos;&gt;
  &lt;fixed&gt;Hello world!&lt;/fixed&gt;
 &lt;/datatypeRef&gt;
&lt;/attrDecl&gt;
</eg>
<p>Four attributes are declared: one with no explicit <termref
def="SC">SC</termref>s at all; two defined by reference to a built-in type, one
with a default and one required to be present in instances; and one with a
fixed value.</p> 
</note>
<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><termdef id="key-attr-satisfy" term="attr-satisfy">An attribute item
<term>attr-satisfies</term> an <nt def="nt-attrDecl">attrDecl</nt> if
</termdef></p> 
<ulist> 
<item> 
<p>The <nt def="nt-attrDecl">attrDecl</nt> contains no <nt
def="nt-datatypeRef">datatypeRef</nt> and the attribute item&apos;s value
string <termref def="key-satisfy-dt">dt-satisfies</termref> the default
<nt def="nt-datatypeSpec">datatypeSpec</nt> for attributes</p> 
</item> 
</ulist> 
<p>or</p> 
<ulist> 
<item> 
<p>the <nt def="nt-attrDecl">attrDecl</nt>&apos;s <nt
def="nt-datatypeRef">datatypeRef</nt> <termref
def="key-identify">identifies</termref> a <nt
def="nt-datatypeSpec">datatypeSpec</nt> and the attribute item&apos;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>&apos;s <nt
def="nt-datatypeQual">datatypeQual</nt> if any</p> 
</item> 
</ulist> 
<p>where the attribute item&apos;s value consists of only character information
items and by its &quot;value string&quot; 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> 
<issue id="default-attr-datatype">
<p>What <emph>is</emph> the default attribute <nt
def="nt-datatypeSpec">datatypeSpec</nt>?</p> 
</issue>
<p><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></p> 
<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">attrDecl</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&apos;s name and either</p> 
<ulist> 
  <item> 
    <p><B>1a1) </B>the attribute item has no namespace and the
      <nt def="nt-attrDecl">attrDecl</nt>&apos;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&apos;s namespace and the
      <nt def="nt-attrDecl">attrDecl</nt>&apos;s <termref
      def="key-attr-fullname">full name</termref>&apos;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&apos;s parent element item is <pt>open</pt></p> 
</item> 
</ulist> 
</item> 
</ulist> 
<p>and</p> 
<ulist> 
<item> 
<p><B>2) </B>every <nt def="nt-attrDecl">attrDecl</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> 
<constraintnote type="sic" id="sic-attr-default">
<head>Attribute Value Default</head> 
<p>For every <nt def="nt-attrDecl">attrDecl</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>
<issue id="namespace-declare">
<p>We&apos;ve got a problem with namespace declarations: they&apos;re not
attributes at the infoset level, so they can appear without compromising
validity, EXCEPT if there is a fixed or required declaration, and defaults
should have the apparently desired effect.</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><pt>NCName</pt> <nt def="nt-attrGroupSpec">attrGroupSpec</nt></rhs> 
</prod> 
<prod id="nt-attrGroupSpec"> 
<lhs>attrGroupSpec</lhs> 
<rhs><nt def="nt-attrDecl">attrDecl</nt>* <nt
def="nt-exportControl">exportControl</nt></rhs> 
</prod> 
<prod id="nt-attrGroupRef"> 
<lhs>attrGroupRef</lhs> 
<rhs><nt def="nt-attrGroupName">attrGroupName</nt> <nt
def="nt-attrGroupQual">attrGroupQual</nt></rhs> 
</prod> 
<prod id="nt-attrGroupName"> 
<lhs>attrGroupName</lhs> 
<rhs><pt>NCName</pt> <nt def="nt-schemaRef">schemaRef</nt>?</rhs> 
</prod> 
<prod id="nt-attrGroupQual"> 
<lhs>attrGroupQual</lhs> 
<rhs><nt def="nt-attrDecl">attrDecl</nt></rhs> 
</prod> 
 
</scrap>

<p>Attribute group definitions: </p> 
<ulist> 
<item> 
<p>provide a construct to replace some uses of
<termref def="gloss-parameterEntity">parameter entities</termref>. </p> 
</item> 
<item> 
<p>allow for the definition of <termref def="SC">SC</termref>s that relate
values of one attribute to others within the group. </p> 
</item> 
</ulist> 
<note role="example">
<eg xml:space="preserve">&lt;attrGroup name=&apos;myAttrGroup&apos;&gt;
    &lt;attrDecl .../&gt;
    ...
&lt;/attrGroup&gt;

&lt;archetype name=&apos;myElementType&apos;&gt;
    &lt;empty/&gt;
    &lt;attrGroupRef name=&apos;myAttrGroup&apos;/&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>
<note id="cos-qual">
<p>There needs to be a Constraint on Schema which constrains the attrDecls
which appear with an attrGroupRef: the name is the same as one of the attrDecls
in the group, datatype and defaulting preserves substitutability, etc.</p> 
</note>
</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><pt>any</pt> | <pt>empty</pt> | <nt def="nt-mixed">mixed</nt> |
<nt def="nt-eltOnly">eltOnly</nt></rhs> 
</prod> 
 
</scrap>

<p>A content model constrains the content of an archetype or an element type:
it says nothing about attributes. </p> 
<note role="example">
<p> 
<eg xml:space="preserve">&lt;any/&gt;   
   
&lt;empty/&gt; 

&lt;mixed&gt;...&lt;/mixed&gt;

[Element only content -- see element-only below]
</eg>

</p> 
</note>
<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><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></p> 
<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&apos;s namespace
item&apos;s <pt>URI</pt> and that <nt def="nt-import">import</nt> must either
be <pt>allElementTypes</pt> or contain an <nt
def="nt-elementTypeRef">elementTypeRef</nt> whose <pt>NCName</pt> matches that
element item&apos;s name;</p> 
</item> 
<item> 
<p>the <termref def="key-effective">effective</termref>
<nt def="nt-contentModel">contentModel</nt> is <nt def="nt-mixed">mixed</nt>
and every element item in <pt>CESeq</pt> <termref
def="key-satisfy-mixed">mixed-satisfies</termref> the
<termref def="key-effective">effective</termref> <nt def="nt-mixed">mixed</nt> 
</p> 
</item> 
</ulist> 
<p>or</p> 
<ulist> 
<item> 
<p>the <termref def="key-effective">effective</termref>
<nt def="nt-contentModel">contentModel</nt> is <termref
def="nt-eltOnly">eltOnly</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-eltOnly">eltOnly</termref>.</p> 
</item> 
</ulist> 
</div3> 
<div3 id="declare-mixedContent"> 
<head>Mixed Content</head> 
<p>A content model for mixed content provides for mixing elements with
character data in document instances. The allowed element types are named, but
neither their order or their number of occurrences are constrainted. </p> 
 
<scrap lang="ebnf" id="RuleSet.XS11">

<head>Mixed content</head> 
<prod id="nt-mixed"> 
<lhs>mixed</lhs> 
<rhs>( <nt def="nt-elementTypeRef">elementTypeRef</nt> |
<nt def="nt-elementTypeDecl">elementTypeDecl</nt> )*</rhs> 
</prod> 
 
</scrap>

<p>The <nt def="nt-elementTypeRef">elementTypeRef</nt>s and
<nt def="nt-elementTypeDecl">elementTypeDecl</nt>s determine the element types
which may appear as children along with character data.</p> 
<note role="example">
<eg xml:space="preserve">&lt;mixed&gt;
 &lt;elementTypeRef name=&apos;name1&apos;/&gt;
 &lt;elementTypeRef name=&apos;name2&apos;/&gt;
 &lt;elementTypeRef name=&apos;name3&apos;/&gt;
&lt;/mixed&gt;
</eg>
<p>Allows character data mixed with any number of <code>name1</code>,
<code>name2</code> and <code>name3</code> elements.</p> 
</note>
<note>
<p>The fact that <nt def="nt-mixed">mixed</nt> allows for there to be
<emph>no</emph> <nt def="nt-elementTypeRef">elementTypeRef</nt>s or
<nt def="nt-elementTypeDecl">elementTypeDecl</nt>s makes it similar to XML
1.0&apos;s <xtermref
href="http://www.w3.org/TR/REC-xml#NT-Mixed">Mixed</xtermref> production.
Indeed an empty <nt def="nt-mixed">mixed</nt> is the only way a schema can
allow character data content with no datatype constraint at all.</p> 
</note>
<constraintnote type="cos" id="cos-et-reuse">
<head>Element Type 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-elementTypeDecl">elementTypeDecl</nt>s and
<nt def="nt-elementTypeRef">elementTypeRef</nt>s with no <nt
def="nt-schemaRef">schemaRef</nt>s; a given <nt
def="nt-elementTypeName">elementTypeName</nt> must not appear two or more times
among the <nt def="nt-elementTypeRef">elementTypeRef</nt>s.</p> 
</constraintnote>
<p>See <specref ref="declare-elementType"/> for discussion and examples of the
appearance of <nt def="nt-elementTypeDecl">elementTypeDecl</nt> above.</p> 
<p><termdef id="key-satisfy-mixed" term="mixed-satisfy">An element item
<term>mixed-satisfies</term> a <nt def="nt-mixed">mixed</nt> if</termdef></p> 
<ulist> 
<item> 
<p>the <nt def="nt-mixed">mixed</nt> contains an <nt
def="nt-elementTypeRef">elementTypeRef</nt> which the element item
<termref def="key-satisfy-etr">ref-satisfies</termref></p> 
</item> 
</ulist> 
<p>or</p> 
<ulist> 
<item> 
<p>the <nt def="nt-mixed">mixed</nt> contains an <nt
def="nt-elementTypeDecl">elementTypeDecl</nt> whose <termref
def="gloss-NCName">NCName</termref> matches the element item&apos;s name, in
which case the element item must <termref
def="key-satisfy-ed">e-satisfy</termref> that <nt
def="nt-elementTypeDecl">elementTypeDecl</nt></p> 
</item> 
</ulist> 
<p>or</p> 
<ulist> 
<item> 
<p>the <nt def="nt-archetypeSpec">archetypeSpec</nt> which
<termref def="key-effective">effectively</termref> contains the
<nt def="nt-mixed">mixed</nt> 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&apos;s an implicit change in current schema in the definition of
satisfy-mixed above which should be made explicit.</p> 
</issue>
</div3> 
<div3 id="declare-elementOnly"> 
<head>Element-Only Content</head> 
<p>A content model for element-only content specifies only child elements (no
immediate character data content other than white space is allowed). 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>Element-only content</head> 
<prod id="nt-eltOnly"> 
<lhs>eltOnly</lhs> 
<rhs><nt def="nt-modelElt">modelElt</nt></rhs> 
</prod> 
<prod id="nt-modelElt"> 
<lhs>modelElt</lhs> 
<rhs><nt def="nt-occur">occur</nt> ( <nt def="nt-modelGroup">modelGroup</nt> |
<nt def="nt-modelGroupRef">modelGroupRef</nt> | <nt
def="nt-elementTypeRef">elementTypeRef</nt> | <nt
def="nt-elementTypeDecl">elementTypeDecl</nt> )</rhs> 
</prod> 
<prod id="nt-occur"> 
<lhs>occur</lhs> 
<rhs><pt>min</pt> <pt>max</pt>?</rhs> 
</prod> 
<prod id="nt-modelGroup"> 
<lhs>modelGroup</lhs> 
<rhs><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><pt>sequence</pt> | <pt>choice</pt> | <pt>all</pt> </rhs> 
</prod> 
<prod id="nt-modelEltSeq"> 
<lhs>modelEltSeq</lhs> 
<rhs><nt def="nt-modelElt">modelElt</nt> <nt
def="nt-modelEltSeq">modelEltSeq</nt>?</rhs> 
</prod> 
 
</scrap>

<p>The grammar for element-only content is built on model elements and model
groups (<nt def="nt-modelElt">modelElt</nt> and <nt
def="nt-modelGroup">modelGroup</nt> above). A model element provides for some
number of occurrences in an instance of either a single element (via
<nt def="nt-elementTypeRef">elementTypeRef</nt> or <nt
def="nt-elementTypeDecl">elementTypeDecl</nt>) or a group of elements (via
<nt def="nt-modelGroup">modelGroup</nt> or <nt
def="nt-modelGroupRef">modelGroupRef</nt>). A model group is two or more model
elements plus a <nt def="nt-compositor">compositor</nt>. </p> 
<p>A <nt def="nt-compositor">compositor</nt> for a model group specifies for a
given group whether it is a sequence of its model elements, a choice between
its model elements or a set of its model elements which must appear in
instances. These options reconstruct the XML 1.0 <code>,</code> connector, the
XML 1.0 <code>|</code> connector and the SGML <code>&amp;</code> connector
respectively. In the first case (sequence) all the model elements must appear
in the order given in the group; in the second case (choice), exactly one of
the model elements must appear in the element content; and in the third case
(all), all the model elements must appear in the element content, but may
appear in any order. </p> 
<p>The <nt def="nt-occur">occur</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. The absence of a <pt>max</pt> specification means
that no upper bound is placed on the number of occurrences. </p> 
<p>See <specref ref="declare-elementType"/> for further discussion and examples
of the appearance of <nt def="nt-elementTypeDecl">elementTypeDecl</nt> within
<nt def="nt-modelElt">modelElt</nt> above.</p> 
<note role="example">
<eg xml:space="preserve">&lt;elementTypeRef name=&apos;paragraph&apos;/&gt;

&lt;sequence&gt;
 &lt;elementTypeRef name=&apos;name1&apos;/&gt;
 &lt;elementTypeRef name=&apos;name2&apos; prefix=&apos;HTML&apos;/&gt;
&lt;/sequence&gt;

&lt;choice minOccur=&apos;3&apos; maxOccur=&apos;9&apos;&gt;
 &lt;elementTypeRef name=&apos;name1&apos;/&gt;
 &lt;elementTypeRef name=&apos;name2&apos;/&gt;
&lt;/choice&gt;    

&lt;all minOccur=&apos;3&apos;&gt;
 &lt;elementTypeRef name=&apos;name1&apos;/&gt;
 &lt;elementTypeRef name=&apos;name2&apos;/&gt;
&lt;/all&gt;

&lt;choice&gt;
 &lt;all&gt;
  &lt;elementTypeRef name=&apos;name1&apos;/&gt;
  &lt;elementTypeRef name=&apos;name2&apos;/&gt;    
 &lt;/all&gt;
 &lt;all&gt;
  &lt;elementTypeRef name=&apos;name3&apos;/&gt;
  &lt;elementTypeRef name=&apos;name4&apos;/&gt;    
 &lt;/all&gt;
&lt;/choice&gt;</eg>
<p>A minimal model which simply requires a <code>paragraph</code> (the default
is <code>minOccur=maxOccur=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><termdef id="key-satisfy-eo" term="eltOnly-satisfy">A sequence of element
items <term>eltOnly-satisfies</term> an <termref
def="key-effective">effective</termref> <nt def="nt-eltOnly">eltOnly</nt>
if</termdef></p> 
<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-occur">occur</nt>
specifications and accepting each element item in the sequence with an
<nt def="nt-elementTypeRef">elementTypeRef</nt> or <nt
def="nt-elementTypeDecl">elementTypeDecl</nt> in the content model. Accepting
an element item from the sequence with an <nt
def="nt-elementTypeRef">elementTypeRef</nt> requires that it
<termref def="key-satisfy-etr">ref-satisfy</termref> that
<nt def="nt-elementTypeRef">elementTypeRef</nt>; accepting an element item with
an <nt def="nt-elementTypeDecl">elementTypeDecl</nt> requires that the
<nt def="nt-elementTypeDecl">elementTypeDecl</nt>&apos;s
<termref def="gloss-NCName">NCName</termref> matches the element item&apos;s
name, in which case the element item must <termref
def="key-satisfy-ed">e-satisfy</termref> that <nt
def="nt-elementTypeDecl">elementTypeDecl</nt>.</p> 
</item> 
</ulist> 
<note>
<p>The above definition of eltOnly-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>
<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-elementTypeDecl">elementTypeDecl</nt>s and among the
<nt def="nt-elementTypeRef">elementTypeRef</nt>s with no <nt
def="nt-schemaRef">schemaRef</nt>s, or more than once among the
<nt def="nt-elementTypeDecl">elementTypeDecl</nt>s.</p> 
</constraintnote>
<note>
<p>Note that the above permits repeated use of the same
<nt def="nt-elementTypeRef">elementTypeRef</nt>, analogous to DTD usage.</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-elementTypeRef">elementTypeRef</nt> or
<nt def="nt-elementTypeDecl">elementTypeDecl</nt> in the content model. </p> 
</constraintnote>
<issue id="still-unambig">
<p>Should this compatibility constraint be preserved?</p> 
</issue>
</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><pt>NCName</pt> <nt def="nt-modelGroupSpec">modelGroupSpec</nt></rhs> 
</prod> 
<prod id="nt-modelGroupSpec"> 
<lhs>modelGroupSpec</lhs> 
<rhs>( <nt def="nt-modelGroup">modelGroup</nt> | <nt
def="nt-modelGroupRef">modelGroupRef</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><pt>NCName</pt> <nt def="nt-schemaRef">schemaRef</nt>?</rhs> 
</prod> 
 
</scrap>

<note role="example">
<eg xml:space="preserve">&lt;modelGroup name=&apos;myModelGroup&apos;&gt;
 &lt;elementTypeRef name=&apos;myElementType&apos;/&gt;
&lt;/modelGroup&gt;

&lt;elementType name=&apos;myElementType&apos;&gt;
 &lt;modelGroupRef name=&apos;myModelGroup&apos;/&gt;
 &lt;attrDecl ...&gt;. . .&lt;/attrDecl&gt;
&lt;/elementType&gt;

&lt;elementType name=&apos;anotherElementType&apos;&gt;
 &lt;choice&gt;
  &lt;elementTypeRef name=&apos;yetAnotherElementType&apos;/&gt;
  &lt;modelGroupRef name=&apos;myModelGroup&apos;/&gt;
 &lt;/choice&gt;
 &lt;attrDecl ...&gt;. . .&lt;/attrDecl&gt;
&lt;/elementType&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-elementType"> 
<head>Element Type Declaration</head> 
<p>An <termdef id="key-elementType" term="element type"><term>element
type</term> declares the association of an element type name with an
archetype</termdef>, either by reference or by incorporation. </p> 
 
<scrap lang="ebnf" id="RuleSet.XS13">

<head>Element type declaration</head> 
<prod id="nt-elementTypeDecl"> 
<lhs>elementTypeDecl</lhs> 
<rhs><pt>NCName</pt> <nt def="nt-elementTypeSpec">elementTypeSpec</nt></rhs> 
</prod> 
<prod id="nt-elementTypeSpec"> 
<lhs>elementTypeSpec</lhs> 
<rhs>( <nt def="nt-archetypeRef">archetypeRef</nt> | <nt
def="nt-archetypeSpec">archetypeSpec</nt> ) <nt
def="nt-exportControl">exportControl</nt> <pt>global</pt>?</rhs> 
</prod> 
<prod id="nt-elementTypeRef"> 
<lhs>elementTypeRef</lhs> 
<rhs><nt def="nt-elementTypeName">elementTypeName</nt> </rhs> 
</prod> 
<prod id="nt-elementTypeName"> 
<lhs>elementTypeName</lhs> 
<rhs><pt>NCName</pt> <nt def="nt-schemaRef">schemaRef</nt>? </rhs> 
</prod> 
 
</scrap>

<p>An element type declaration associates a name with an
<specref ref="declare-archetype"/>. This name will appear in tags in instance
documents; the archetype definition provides <termref def="SC">SC</termref>s on
the form of elements tagged with the specified name. An element type
declaration is comparable to an <code>&lt;!ELEMENT ...&gt;</code> declaration
in an XML 1.0 DTD. </p> 
<p>The last two productions above provide for element types to be referenced by
name from content models. </p> 
<p>As noted above element type names are in a separate
<termref def="key-symbolSpace">symbol space</termref> from the symbol space for
the names of <nt def="gloss-archetype">archetypes</nt>, so there can (but need
not be) an archetype with the same name as a top-level element type.</p> 
<p><termdef id="key-elt-fullname"
term="full name of an element type declaration">The <term>full name</term> of a
top-level <nt def="nt-elementTypeDecl">elementTypeDecl</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>An <nt def="nt-elementTypeDecl">elementTypeDecl</nt> may also appear 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 type name and an archetype. As with attribute names, locally-scoped
element type names reside in symbol spaces local to the archetype that defines
them. Note however that archetype names are always top-level names within a
schema, even when associated with locally-scoped element type names.</p> 
<note>
<p>It is not yet clear whether an archetype defined implicitly by the
appearance of an <nt def="nt-archetypeSpec">archetypeSpec</nt> directly within
an <nt def="nt-elementTypeSpec">elementTypeSpec</nt> will have an implicit
name, or if so what that name would be, or if not how, if at all, it might be
referred to.</p> 
</note>
<note role="example">
<eg xml:space="preserve">&lt;elementType name=&apos;myElementType&apos;&gt;
 &lt;datatypeRef name=&apos;myDatatype&apos;/&gt;
&lt;/elementType&gt;

&lt;elementType name=&apos;et0&apos;&gt;
 &lt;archetypeRef name=&apos;myArchetype&apos;/&gt;
&lt;/elementType&gt;

&lt;elementType name=&apos;et1&apos;&gt;
 &lt;all&gt;. . .&lt;/all&gt;
 &lt;attrDecl ...&gt;. . .&lt;/attrDecl&gt;
&lt;/elementType&gt;

&lt;elementType name=&apos;et2&apos;&gt;
 &lt;any/&gt;
&lt;/elementType&gt;

&lt;elementType name=&apos;et3&apos;&gt;
 &lt;empty/&gt;
 &lt;attrDecl ...&gt;. . .&lt;/attrDecl&gt;
&lt;/elementType&gt;

&lt;elementType name=&apos;et4&apos;&gt;
 &lt;choice&gt;. . .&lt;/choice&gt;
 &lt;attrDecl ...&gt;. . .&lt;/attrDecl&gt;
&lt;/elementType&gt;

&lt;elementType name=&apos;et5&apos;&gt;
 &lt;sequence&gt;. . .&lt;/sequence&gt;
 &lt;attrDecl ...&gt;. . .&lt;/attrDecl&gt;
&lt;/elementType&gt;

&lt;elementType name=&apos;et6&apos; model=&apos;open&apos;&gt;
 &lt;mixed/&gt;
&lt;/elementType&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;elementType name=&apos;contextOne&apos;&gt;
 &lt;sequence&gt;
  &lt;elementType name=&apos;myLocalElementType&apos;
   &lt;archetypeRef name=&apos;myFirstArchetype&apos;/&gt;
  &lt;/elementType&gt;
  &lt;elementTypeRef name=&apos;globalElementType&apos;/&gt;
 &lt;/sequence&gt;
&lt;/elementType&gt;

&lt;elementType name=&apos;contextTwo&apos;
 &lt;sequence&gt;
  &lt;elementType name=&apos;myLocalElementType&apos;
   &lt;archetypeRef name=&apos;mySecondArchetype&apos;/&gt;
  &lt;/elementType&gt;
  &lt;elementTypeRef name=&apos;globalElementType&apos;/&gt;
 &lt;/sequence&gt;
&lt;/elementType&gt;
</eg>
<p>Instances of <code>myLocalElementType</code> within
<code>contextOne</code> will be constrained by <code>myFirstArchetype</code>,
while those within <code>contextTwo</code> will be constrained by
<code>mySecondArchetype</code>. </p> 

</note>
<note>
<p>The possibility that differing attribute definitions 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>
<constraintnote type="cos" id="cos-local-global">
<head>Nested May Not Be Global</head> 
<p>An <nt def="nt-elementTypeSpec">elementTypeSpec</nt> in a nested
<nt def="nt-elementTypeDecl">elementTypeDecl</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-elementTypeSpec">elementTypeSpec</nt> is
<pt>global</pt>, then the <termref def="gloss-NCName">NCName</termref> of its
<nt def="nt-elementTypeDecl">elementTypeDecl</nt> must not be redeclared by any
nested <nt def="nt-elementTypeDecl">elementTypeDecl</nt> in the same schema or
any schema it <termref def="key-eventually-include">eventually
includes</termref>.</p> 
</constraintnote>
<p><termdef id="key-satisfy-ed" term="e-satisfy">An element item
<term>e-satisfies</term> an <nt def="nt-elementTypeDecl">elementTypeDecl</nt>
if the <nt def="nt-elementTypeDecl">elementTypeDecl</nt></termdef>:</p> 
<ulist> 
<item> 
<p>contains an <nt def="nt-archetypeSpec">archetypeSpec</nt> directly, and the
element item <termref def="key-satisfy-as">arch-satisfies</termref> that
<nt def="nt-archetypeSpec">archetypeSpec</nt>;</p> 
</item> 
</ulist> 
<p>or</p> 
<ulist> 
<item> 
<p>the <nt def="nt-archetypeRef">archetypeRef</nt> alternative is used in that
<nt def="nt-elementTypeDecl">elementTypeDecl</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><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-elementTypeDecl">elementTypeDecl</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-elementTypeDecl">elementTypeDecl</nt>.</termdef></p> 
<p><termdef id="key-satisfy-etr" term="ref-satisfies">An element item
<term>ref-satisfies</term> an <nt def="nt-elementTypeRef">elementTypeRef</nt>
if</termdef></p> 
<ulist> 
<item> 
<p> the <nt def="nt-elementTypeRef">elementTypeRef</nt>
<termref def="key-identify">identifies</termref> an
<nt def="nt-elementTypeDecl">elementTypeDecl</nt> whose
<termref def="gloss-NCName">NCName</termref> matches the element item&apos;s
name and either</p> 
<ulist> 
<item> 
<p>the <nt def="nt-elementTypeDecl">elementTypeDecl</nt>&apos;s
<termref def="key-elt-fullname">full name</termref> has no
<nt def="nt-schemaName">schemaName</nt>, in which case the element item&apos;s
namespace must be the same as its parent&apos;s namespace</p> 
</item> 
</ulist> 
<p>or</p> 
<ulist> 
<item> 
<p>the element item&apos;s namespace and the <nt
def="nt-elementTypeDecl">elementTypeDecl</nt>&apos;s
<termref def="key-elt-fullname">full name</termref>&apos;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-elementTypeDecl">elementTypeDecl</nt>.</p> 
</item> 
</ulist> 
<p>or</p> 
<ulist> 
<item> 
<p> the <nt def="nt-elementTypeRef">elementTypeRef</nt>
<termref def="key-identify">identifies</termref> an
<nt def="nt-elementTypeDecl">elementTypeDecl</nt> whose
<termref def="gloss-NCName">NCName</termref> matches the element item&apos;s
name (call this <pt>ETD1</pt> and there is a top-level
<nt def="nt-elementTypeDecl">elementTypeDecl</nt> (call this <pt>ETD2</pt>)
which contains or <termref def="key-identify">identifies</termref> an
<nt def="nt-archetypeSpec"> archetypeSpec</nt> which has an
<termref def="key-ancestor">ancestor</termref> which is itself
<termref def="key-identify">identified</termref> by <pt>ETD1</pt>, in which
case <pt>EDT1</pt> must be <termref def="key-satisfy-ed">e-satisfied</termref>
by the element item.</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>
</div3> 
</div2> 
<div2 id="declare-refinement"> 
<head>Archetype Refinement</head> 
<note>
<p>This section articulates what has only been hinted at above, namely a
considerable increase in the power and expressiveness of schema declarations,
by explaining what was provided for in the abstract syntax in the previous
section, but not explained much if at all at that point.</p> 
</note>
<p>We provide for the refinement of archetypes declared in a schema. An
archetype definition may identify one or more other archetypes from which it
specifies the creation of a (joint) refinement. </p> 
<p>We provide for interpreting archetypes as imposing constraints on instance
elements in either a closed, refinable or open fashion. </p> 
<ulist> 
<item> 
<p>The closed interpretation is as per XML 1.0, where content type and
attribute declarations specify all <emph>and only</emph> what must be present
in instances. </p> 
</item> 
<item> 
<p>The open interpretation removes the &apos;and only&apos;, i.e. it interprets
the content type and attribute declarations as requiring (non-optional) items
to be present, but <emph>not</emph> as excluding others. </p> 
</item> 
<item> 
<p>The refinable interpretation requires the declared (non-optional) items to
be present, and also admits such others as have been explicitly declared in
refinements. </p> 
</item> 
</ulist> 
<p>The relevant abstract syntax productions are as follows:</p> 
 
<scrap lang="ebnf" id="RuleSet.XS14">

<head>Refinement</head> 
<prod id="nt-preamble2" role="prefig"> 
<lhs>preamble</lhs> 
<rhs><nt def="nt-xmlSchemaRef">xmlSchemaRef</nt> <nt def="nt-schemaName">schemaName</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-archetypeSpec2" role="prefig"> 
<lhs>archetypeSpec</lhs> 
<rhs><nt def="nt-refinement">refinement</nt>* <nt
def="nt-contentType">contentType</nt> ( <nt def="nt-attrDecl">attrDecl</nt> |
<nt def="nt-attrGroupRef">attrGroupRef</nt> )* <nt def="nt-model">model</nt>
<nt def="nt-exportControl">exportControl</nt></rhs> 
</prod> 
<prod id="nt-model3" role="prefig"> 
<lhs>model</lhs> 
<rhs><pt>open</pt> | <pt>refinable</pt> | <pt>closed</pt></rhs> 
</prod> 
<prod id="nt-refinement"> 
<lhs>refinement</lhs> 
<rhs><nt def="nt-archetypeRef">archetypeRef</nt></rhs> 
</prod> 
 
</scrap>

<note role="example">
<eg xml:space="preserve">&lt;archetype name=&apos;chair&apos; model=&apos;refinable&apos;&gt;
 &lt;refines&gt;
  &lt;archetypeRef name=&apos;furniture&apos;/&gt;
 &lt;/refines&gt;
 &lt;attrDecl name=&apos;noOfSeats&apos;&gt;. . .&lt;/attrDecl&gt;
&lt;/archetype&gt;
</eg>
<p>An archetype which not only refines another by adding an attribute, but also
is itself (further) refinable. The <code>furniture</code> archetype must have
been declared <pt>refinable</pt>(or <pt>open</pt>).</p> 
</note>
<p>We distinguish between explicit, acquired and effective validation
constraints for any archetype. <termdef id="key-explicit"
term="explicit"><term>Explicit</term> constraints are those explicitly present,
via <nt def="nt-attrDecl">attrDecl</nt>s or <nt
def="nt-contentType">contentType</nt>, in the definition of the
archetype</termdef>. <termdef id="key-acquired"
term="acquired"><term>Acquired</term> constraints come from the ancestors of an
archetype, if it has any <nt def="nt-refinement">refinement</nt>s</termdef>.
<termdef id="key-effective" term="effective">The <term>effective</term>
constraints are the union of the explicit and the acquired</termdef>. The
<termref def="key-effective">effective</termref> constraints are what actually
constrain any element type declared with reference to a refining archetype. 
</p> 
<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>
<issue id="default-model">
<p>Should the default model be <emph>open</emph>, <emph>refinable</emph> or
<emph>closed</emph>?</p> 
</issue>
<p>For the present, the permitted refinements and the resulting
<termref def="key-effective">effective</termref> constraints are as follows: 
</p> 
<ulist> 
<item> 
<p>For attribute declarations, any attribute name defined in the explicit
constraints must not also be defined in any of the acquired constraints, and
any attribute name defined in a constraint acquired from one ancestor must not
also be defined in a constraint acquired from another, unless they
<emph>both</emph> acquired it from a common ancestor.</p> 
<p>The <termref def="key-effective">effective</termref> attribute declarations
are defined by the simple set union of the explicit and the acquired attribute
definitions. </p> 
</item> 
</ulist> 
<ulist> 
<item> 
<p>For content models, either </p> 
<ulist> 
<item> 
<p>all the explicit and acquired content models are <termref
def="key-vacuous">vacuous</termref> in which case the
<termref def="key-effective">effective</termref> model is
<termref def="key-vacuous">vacuous</termref>;</p> 
</item> 
</ulist> 
<p>or</p> 
<ulist> 
<item> 
<p>all but one of the explicit and the acquired content models are
<termref def="key-vacuous">vacuous</termref>, in which case that one becomes
the <termref def="key-effective">effective</termref> model; </p> 
</item> 
</ulist> 
<p>or</p> 
<ulist> 
<item> 
<p>No element type is referenced by more than one of the explicit and acquired
content models (unless two or more acquired models share <nt
def="nt-modelElt">modelElt</nt>s acquired from a common ancestor, in which case
such <nt def="nt-modelElt">modelElt</nt>s shall be ignored in all but the first
for the purpose of constructing the <termref
def="key-effective">effective</termref> model), in which case if the
non-<termref def="key-vacuous">vacuous</termref> explicit and acquired models
are all <nt def="nt-eltOnly">eltOnly</nt> the <termref
def="key-effective">effective</termref> model is a <pt>sequence</pt> of all the
non-<termref def="key-vacuous">vacuous</termref> acquired models, in the order
in which they are specified in the <nt def="nt-refinement">refinement</nt>s
list, followed by the explicit model (if it is non-<termref
def="key-vacuous">vacuous</termref>), or else if the non-<termref
def="key-vacuous">vacuous</termref> explicit and acquired models are all
<nt def="nt-mixed">mixed</nt>, the <termref
def="key-effective">effective</termref> model is a <nt
def="nt-mixed">mixed</nt> whose <nt
def="nt-elementTypeRef">elementTypeRef</nt>s and <nt
def="nt-elementTypeDecl">elementTypeDecl</nt>s are the union of the
<nt def="nt-elementTypeRef">elementTypeRef</nt>s and
<nt def="nt-elementTypeDecl">elementTypeDecl</nt>s of all the non-<termref
def="key-vacuous">vacuous</termref> explicit and acquired models.</p> 
</item> 
</ulist> 
</item> 
</ulist> 
<p><termdef id="key-vacuous" term="vacuous">A <pt>refinable</pt> or
<pt>open</pt> <nt def="nt-mixed">mixed</nt> content model is called
<term>vacuous</term> if it has no declared <nt
def="nt-elementTypeRef">elementTypeRef</nt>s or <nt
def="nt-elementTypeDecl">elementTypeDecl</nt>s within it</termdef>. This is
because <emph>any</emph> archetype is substitutable for an archetype with a
vacuous content model and no declared attributes.</p> 
<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></p> 
<note>
<p>Refinements are by definition substitutable for any of their ancestors.</p> 
</note>
<p><termdef id="key-substitutablity" term="substitutability">We define a
<term>substitutability</term> relation between two archetypes as follows:
</termdef></p> 
<p>One archetype is substitutable for another if any schema-valid instance of
the former is necessarily a schema-valid instance of the latter. </p> 
<p>Some simple cases: </p> 
<ulist> 
<item> 
<p>Any archetype with no attributes is substitutable for an archetype with no
attributes and a <nt def="nt-contentModel">contentModel</nt> of <pt>any</pt>; 
</p> 
</item> 
<item> 
<p>Any archetype which differs from another only by the specialization of one
or more of its attributes (and/or of its datatype if its content is character
data) is substitutable for that archetype; </p> 
</item> 
<item> 
<p>Any archetype which differs from another only by allowing only character
data content (i.e. whose <nt def="nt-contentType">contentType</nt> is
<nt def="nt-datatypeRef">datatypeRef</nt>) where the other has mixed content is
substitutable for that archetype. </p> 
</item> 
</ulist> 
<note>
<p>Refinement by definition creates substitutable archetypes:</p> 
<eg xml:space="preserve">&lt;archetype name=&apos;Address&apos; model=&apos;refinable&apos;&gt;
 &lt;sequence&gt;
  &lt;elementTypeRef name=&apos;street&apos;/&gt;
  &lt;elementTypeRef name=&apos;city&apos;/&gt;
 &lt;/sequence&gt;
&lt;/archetype&gt;

&lt;archetype name=&apos;USAddress&apos;&gt;
 &lt;refines&gt;
  &lt;archetypeRef name=&apos;Address&apos;/&gt;
 &lt;/refines&gt;
 &lt;sequence&gt;
  &lt;elementTypeRef name=&apos;state&apos;/&gt;
  &lt;elementTypeRef name=&apos;zip&apos;/&gt;
 &lt;/sequence&gt;
&lt;/archetype&gt;
</eg>
<p><code>USAddress</code> is substitutable for <code>Address</code>: the
<termref def="key-effective">effective</termref> content model (simplifying in
the obviously legitmate way) is</p> 
<eg xml:space="preserve">
&lt;sequence&gt;
  &lt;elementTypeRef name=&apos;street&apos;/&gt;
  &lt;elementTypeRef name=&apos;city&apos;/&gt;
  &lt;elementTypeRef name=&apos;state&apos;/&gt;
  &lt;elementTypeRef name=&apos;zip&apos;/&gt;
 &lt;/sequence&gt;
</eg>
<p>Here is a richer example: </p> 
<eg xml:space="preserve">&lt;archetype name=&apos;transclude&apos; model=&apos;refinable&apos;&gt;
 &lt;mixed/&gt;
 &lt;attrDecl name=&apos;xml:link&apos;&gt;
  &lt;fixed&gt;simple&lt;/fixed&gt;
 &lt;/attrDecl&gt;
 &lt;attrDecl name=&apos;actuate&apos;&gt;
  &lt;fixed&gt;auto&lt;/fixed&gt;
 &lt;/attrDecl&gt;
 &lt;attrDecl name=&apos;href&apos; required=&apos;true&apos;&gt;
  &lt;datatypeRef name=&apos;uri&apos;/&gt;
 &lt;/attrDecl&gt;
&lt;/archetype&gt;

&lt;archetype name=&apos;anchor&apos; interp=&apos;open&apos;&gt;
 &lt;mixed/&gt;
 &lt;attrDecl name=&apos;id&apos;&gt;
  &lt;datatypeRef name=&apos;ID&apos;/&gt;
 &lt;/attrDecl&gt;
&lt;/archetype&gt;

&lt;archetype name=&apos;nestHere&apos;&gt;
 &lt;refines&gt;
  &lt;archetypeRef name=&apos;transclude&apos;/&gt;
  &lt;archetypeRef name=&apos;anchor&apos;/&gt;
 &lt;/refines&gt;
 &lt;empty/&gt;
 &lt;attrDecl name=&apos;show&apos;&gt;
  &lt;fixed&gt;embed&lt;/fixed&gt;
 &lt;/attrDecl&gt;
&lt;/archetype&gt;

&lt;elementType name=&apos;nestHere&apos; archetype=&apos;nestHere&apos;/&gt;

&lt;nestHere href=&apos;http://www.ltg.ed.ac.uk/~ht/password.xml&apos; id=&apos;mpw&apos;/&gt;
</eg>
<p>The final instance element satisfies all the <termref
def="key-effective">effective</termref> constraints associated with the
<code>nestHere</code> archetype: its <code>xml:link</code>,
<code>actuate</code> and <code>href</code> attributes are constrained by
constraints acquired from <code>transclude</code>, its <code>id</code>
attribute is constrained by a constraint acquired from <code>anchor</code> and
its <code>show</code> attribute is constrained by its own explicit constraint. 
</p> 
<p>The <termref def="key-effective">effective</termref> content model for
<code>nestHere</code> is <pt>empty</pt>, under the second clause of the
discussion above: only the explicit content model is there at all, so it gets
to be the <termref def="key-effective">effective</termref> one. </p> 
<p>Note that because they are <pt>refinable</pt> and <pt>open</pt>
respectively, both <code>transclude</code> and <code>anchor</code> are
satisfied by the <code>nestHere</code> instance, i.e. the substitutability
requirement on refining archetypes is satisfied. </p> 


</note>
<note>
<p>Here&apos;s a case which merges content models and specializes an attribute
definition:</p> 
<eg xml:space="preserve">&lt;archetype name=&apos;polygon&apos; model=&apos;refinable&apos;&gt;
 &lt;elementTypeRef name=&apos;bbox&apos;/&gt;
 &lt;attrDecl name=&apos;n&apos; required=&apos;yes&apos;/&gt;
 &lt;attrDecl name=&apos;regular&apos;&gt;
  &lt;datatypeRef name=&apos;enumeratedSymbol&apos;&gt;
    &lt;enumeration&gt;
     &lt;literal&gt;yes&lt;/literal&gt;
     &lt;literal&gt;no&lt;/literal&gt;
    &lt;/enumeration&gt;
  &lt;/datatypeRef&gt;
 &lt;/attrDecl&gt;
&lt;/archetype&gt;

&lt;elementType name=&apos;regularPolygon&apos;&gt;
 &lt;refines&gt;
  &lt;archetypeRef name=&apos;polygon&apos;/&gt;
 &lt;/refines&gt;
 &lt;elementTypeRef name=&apos;side&apos;/&gt;
 &lt;attrDecl name=&apos;regular&apos;&gt;
  &lt;fixed&gt;yes&lt;/fixed&gt;
 &lt;/attrDecl&gt;
&lt;/elementType&gt;
</eg>
<p>Here we see not only the merging of two content models, with the two
<nt def="nt-elementTypeRef">elementTypeRefs</nt> being concatenated to produce
the <termref def="key-effective">effective</termref> sequence model for the
refined archetype, but also the provision in an explicit constraint of a fixed
value for an attribute consistent with its acquired constraint. (Strictly
speaking, this goes beyond the constraints on refinement set out above, but it
obviously preserves substitutability, and will be allowed as soon as more
detailed constraints are drafted.)</p> 
<eg xml:space="preserve">
&lt;regularPolygon n=&apos;3&apos;&gt;
   &lt;bbox&gt;...&lt;/bbox&gt;
   &lt;side length=&apos;3cm&apos;/&gt;
&lt;/regularPolygon&gt;</eg>


</note>
<note>
<p>The intention of the formal validity definition
<termref def="key-satisfy-etr">ref-satisfies</termref> is that element item
should be valid with respect to an <nt
def="nt-archetypeSpec">archetypeSpec</nt> that is <pt>refinable</pt> if it is
valid with respect to that <nt def="nt-archetypeSpec">archetypeSpec</nt> itself
or any <nt def="nt-archetypeSpec">archetypeSpec</nt> that refines it. It might
them be possible for validating parser to begin by checking daughters with
respect to the declared archetypeSpec if it is element only, since any
refinement can only add to the end of a sequence of daughters.</p> 
</note>
<p>There follows a semi-formal definition of validity with respect to an
<pt>open</pt> content model.</p> 
<p>To parse against an open content model:</p> 
<glist> 
<gitem> 
<label>informal statement</label>
<def> 
<p>ignore all daughters which are NOT mentioned explicitly anywhere in the
content model: what&apos;s left must match the model in the old, deterministic,
XML 1.0 way.</p> 
</def> 
</gitem> 
<gitem> 
<label>formal statement</label>
<def> 
<p>Consider the edge-labelled FSM for recognizing the declared content model
under a &apos;closed&apos; (i.e. deterministic, XML 1.0) interpretation.</p> 
<p>Call the set of all transition labels anywhere in the FSM (i.e. the tags
mentioned anywhere anywhere in the model) <emph>T</emph>.</p> 
<p>For each state <emph>s</emph> in the FSM, call the set of tags which label
transitions from that state <emph>T[s]</emph>.</p> 
<p>Then to turn the FSM into one which interprets the content model as open,
for each state s </p> 
<olist> 
<item> 
<p>add a transition to failure for every label in <emph>T-T[s]</emph>;</p> 
</item> 
<item> 
<p>add a transition to <emph>s</emph> for the complement of <emph>T</emph>,
i.e. a default loopback.</p> 
</item> 
</olist> 
</def> 
</gitem> 
</glist> 
<issue id="formal-refinement-FSM">
<p>Does refinement need this, or is it covered already?</p> 
</issue>
</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><pt>NCName</pt> <nt def="nt-entitySpec">entitySpec</nt></rhs> 
</prod> 
<prod id="nt-entitySpec"> 
<lhs>entitySpec</lhs> 
<rhs>( <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><nt def="nt-systemID">systemID</nt> <nt def="nt-publicID">publicID</nt>?
exportControl?</rhs> 
</prod> 
<prod id="nt-unparsedEntitySpec"> 
<lhs>unparsedEntitySpec</lhs> 
<rhs><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><pt>NCName</pt> <nt def="nt-schemaRef">schemaRef</nt>?</rhs> 
</prod> 
<prod id="nt-notationDecl"> 
<lhs>notationDecl</lhs> 
<rhs><pt>NCName</pt> <nt def="nt-notationSpec">notationSpec</nt></rhs> 
</prod> 
<prod id="nt-notationSpec"> 
<lhs>notationSpec</lhs> 
<rhs><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><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> 
<note>
<eg xml:space="preserve">
&lt;textEntity name=&apos;flavor&apos;&gt;Fresh mint&lt;/textEntity&apos;&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> 
<note>
<eg xml:space="preserve">
&lt;externalEntity name=&apos;FrontMatter&apos; 
                system=&apos;FrontMatter.xml&apos; /&gt;
&lt;externalEntity name=&apos;Chapter1&apos; 
                system=&apos;chapter1.xml&apos; /&gt;
&lt;externalEntity name=&apos;Chapter2&apos; 
                system=&apos;Chapter2.xml&apos; /&gt;
&lt;externalEntity name=&apos;BackMatter&apos; 
                system=&apos;BackMatter.xml&apos; /&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> 
<note>
<eg xml:space="preserve">
&lt;unparsedEntity name=&apos;SKU-5782-pic&apos; 
                system=&apos;http://www.vendor.com/SKU-5782.jpg&apos; 
                notation=&apos;JPEG&apos; /&gt;</eg>
<eg xml:space="preserve">
&lt;picture location=&apos;SKU-5782-pic&apos;/&gt;
</eg>
<p>The picture element carries an attribute which is (presumably) governed by
the unparsed entity declaration.</p> 

</note>
<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>
<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> 
<note>
<eg xml:space="preserve">
&lt;notation name=&apos;jpeg&apos; 
          public=&apos;image/jpeg&apos; system=&apos;viewer.exe&apos; /&gt;

&lt;elementType name=&apos;picture&gt;
 &lt;attrDecl name=&apos;entity&apos;&gt;
   &lt;datatypeRef name=&apos;NOTATION&apos;/&gt;
 &lt;/attrDecl&gt;
&lt;/elementtype&gt; 
</eg>
<eg xml:space="preserve">
&lt;picture entity=&apos;SKU-5782-pic&apos;/&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> 
<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>&apos;Namespaces in XML&apos; <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 &apos;markup vocabulary&apos;) 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 &apos;collisions&apos; occurring when markup
intended for some other software package uses the same element type 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> 
<ulist> 
<item> 
<p>Each schema is identified by a schema name, which is a namespace-compatible
<bibref ref="ref-uri"/>. </p> 
</item> 
<item> 
<p>A schema can identify archetypes, datatypes, element types, attribute
definitions, attribute groups, named model groups, entities, and notations to
be <emph>exported</emph> for use in other schemas. </p> 
</item> 
<item> 
<p>A schema can <emph>import</emph> declarations and definitions exported from
other schemas. Means are provided for using the imported features in the
importing schema. </p> 
</item> 
<item> 
<p>Namespace-compatible validation rules are defined for instance documents
using imported elements and attributes. </p> 
</item> 
<item> 
<p>Conventions are proposed for use of namespace-qualified entities and
notations in instance documents. Standardized implementation of these features
will depend on corresponding enhancements to the
<bibref ref="ref-xml-namespaces"/> recommendation. (To be supplied in a future
draft of this specification.) </p> 
</item> 
<item> 
<p>As specified herein, namespace-qualified attribute definitions are validated
only in the context of a corresponding validated elementType. A non-normative
appendix proposes changes to the <bibref ref="ref-xml-namespaces"/>
recommendation that would support more generalized export of attributes. (To be
supplied in a future draft of this specification.) </p> 
</item> 
</ulist> 
<p>As described in <specref ref="conformance"/>, full validation is supported
in the case where the transitive closure of all schemas referenced by an
instance document is available to the validating processor. Furthermore, the
schema language is compatible with partial validation, in which validation is
done only with respect to a subset of the schemas applicable to a document, or
in which a well formed document (I.e. one for which no overall schema is
provided) makes selective use of features imported from schemas which are
available. </p> 
<div2 id="composition-instances"> 
<head>Associating Instance Document Constructs with Corresponding Schemata 
</head> 
<p>During validation, the standard mechanisms of
<bibref ref="ref-xml-namespaces"/> are interpreted to create associations
between instance document prefixes and schema definitions. Thus, there is in
each valid instance document a namespace associated with each schema to which
the instance conforms. Each namespace qualified element (or eventually entity
or notation), its attributes and its content, is validated against its
declaration in the corresponding URI-named schema. In that sense, each schema
defines and is coextensive with a namespace. The means by which schemas are
located during processing is discussed below in
<specref ref="composition-schemaAccess"/>. Comprehensive rules for validation
are discussed in <specref ref="conformance"/>.</p> 
<note>
<p>For example (refer to schema definitions in the previous example):</p> 
<eg xml:space="preserve">
&lt;SomeDocument xmlns=&apos;http://coolbits.com/someschema.xsd&apos;
              xmlns:o=&apos;http://xyzcorp.com/otherschema.xsd&apos;
              xmlns:p=&apos;http://xyzcorp.com/yetanotherschema.xsd&apos;&gt;

    &lt;someelement&gt;
        &lt;name1/&gt;
        &lt;o:name2  p:someattr=&apos;123&apos;/&gt;
    &lt;/someelement&gt;

&lt;/SomeDocument&gt;
</eg>
<p>&apos;somelement&apos; and &apos;name1&apos; (which happens to be empty) are
validated against their definitions in
&apos;http://coolbits.com/someschema.xsd&apos;. Similarly, &apos;name2&apos; is
validated against its definition in
&apos;http://xyzcorp.com/otherschema.xsd&apos;. The existence of
&apos;name1&apos; and &apos;name2&apos; as content of &apos;somelement&apos;,
and specifically their URI qualification, is validated against the
corresponding content model declaration for &apos;someelement&apos; in
&apos;http://coolbits.com/someschema.xsd&apos;. Validation definition
<termref def="key-satisfy-attrs">attrs-satisfy</termref> determines whether
&apos;p:someattr&apos; is correctly namespace qualified according to the
content model definition for &apos;name2&apos;.</p> 
</note>
</div2> 
<div2 id="composition-schemaExport"> 
<head>Exporting Schema Constructs</head> 
<note>
<p>Experience with programming languages and similar schema definition systems
suggests that there is value in distinguishing the internal implementation of a
module from the features or interfaces that it provides for reuse by others.
For example, a schema defined to describe an automobile might intend that its
definitions for &apos;automobile&apos; and &apos;engine&apos; be building
blocks for use in other schemas, but that other constructs such as
&apos;screw&apos; or &apos;bolt&apos; be reserved for internal use. </p> 
</note>
<p>&XSP1; constructs must be exported for external use. By default, all
datatypes, archetypes, elementTypes, attribute definitions, model groups,
attribute groups, entities and notations are exported. The export declaration
can be used within a schema declaration to override the default behavior for
each such class of declaration or definition: </p> 
 
<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">allElementTypes</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>allElementTypes</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> 
 
</scrap>

<note>
<eg xml:space="preserve">
&lt;schema name=&apos;http://coolbits.com/someschema.xsd&apos;&gt;
  &lt;export datatypes=&apos;false&apos; 
          archetypes=&apos;false&apos; 
          elementTypes=&apos;true&apos;  &lt;!-- redundant: default is &apos;true&apos;&gt;
          ... /&gt;
[...schema body here...]
&lt;/schema&gt;
</eg>
<p>This declaration restricts export of datatypes and archetypes and
explicitly, although redundantly, enables export of element types.</p> 
</note>
<p>The default for all attributes of the export declaration is
&apos;true&apos;. Therefore, all constructions are exported by default if
&apos;export&apos; is not specified, and only the constructions that are not
specifically disabled are exported if &apos;export&apos; is specified. If a
schema A imports some other schema B, then by default, all definitions imported
from B are exported from A. See <specref ref="composition-schemaImport"/>
below. </p> 
<p>Export can also be controlled individually for each particular elementType,
archetype, model group, attribute group, datatype, entity or notation.
Attribute definitions are implicitly exported (or not) along with the
elementTypes in which they appear. An export declaration appearing on an
individual elementType, archetype, or other declaration or definition overrides
any default export behavior established at the schema level. </p> 
<p>The following abstract syntax is repeated from elsewhere in this document: 
</p> 
 
<scrap lang="ebnf" id="RuleSet.XS17">

<head>Export control</head> 
<prod id="nt-datatypeDefn3" role="prefig"> 
<lhs>datatypeDefn</lhs> 
<rhs>&nbsp;... <nt def="nt-exportControl">exportControl</nt>?</rhs> 
</prod> 
<prod id="nt-archetypeSpec3" role="prefig"> 
<lhs>archetypeSpec</lhs> 
<rhs>&nbsp;... <nt def="nt-exportControl">exportControl</nt>?</rhs> 
</prod> 
<prod id="nt-elementTypeSpec2" role="prefig"> 
<lhs>elementTypeSpec</lhs> 
<rhs>&nbsp;... <nt def="nt-exportControl">exportControl</nt>?</rhs> 
</prod> 
<prod id="nt-modelGroupDefn3" role="prefig"> 
<lhs>modelGroupDefn</lhs> 
<rhs>&nbsp;... <nt def="nt-exportControl">exportControl</nt>?</rhs> 
</prod> 
<prod id="nt-attrGroupDefn3" role="prefig"> 
<lhs>attrGroupDefn</lhs> 
<rhs>&nbsp;... <nt def="nt-exportControl">exportControl</nt>?</rhs> 
</prod> 
<prod id="nt-entityDecl3" role="prefig"> 
<lhs>entityDecl</lhs> 
<rhs>&nbsp;... <nt def="nt-exportControl">exportControl</nt>?</rhs> 
</prod> 
<prod id="nt-notationDecl3" role="prefig"> 
<lhs>notationDecl</lhs> 
<rhs>&nbsp;... <nt def="nt-exportControl">exportControl</nt>?</rhs> 
</prod> 
<prod id="nt-exportControl" role="prefig"> 
<lhs>exportControl</lhs> 
<rhs><pt>boolean</pt> </rhs> 
</prod> 
 
</scrap>

<note>
<eg xml:space="preserve">
&lt;elementType name=&apos;myElementType&apos; <B>export=&apos;true&apos;</B>&gt;
        &lt;sequence&gt;
            &lt;elementTypeRef name=&apos;e1&apos;/&gt;
            &lt;elementTypeRef name=&apos;e2&apos;/&gt;
        &lt;/sequence&gt;
        &lt;attrGroupRef name=&apos;attrgrpname&apos;/&gt;
&lt;/elementType&gt;
</eg>
<p>This element type declares that export is enabled.</p> 
</note>
<p>As with any other construct, an elementType or attribute which is not
exported cannot be imported for use in the declaration of a content model in an
importing schema. However, an instance document providing a namespace qualified
element is required to conform with the full archetype of that element,
including attributes and elements which might not have been explicitly exported
or imported; validating processors are required to check for conformance with
the full archetype as declared in the exporting schema. </p> 
<p>Similarly, an exported archetype applied to an elementType definition in an
importing schema confers its full content type and attribute definitions,
including references to elements, content models and attributes which may not
have been explicitly exported. </p> 
<note>
<p>For example, if schema B exports &apos;myElement&apos;, which relies on
unexported constructs from schema B, instances of myElement must conform to its
declared content model, including to elements and attributes which might
themselves not be overtly exported.</p> 
</note>
</div2> 
<div2 id="composition-facilities"> 
<head>Facilities for Schema Composition</head> 
<p>Section <specref ref="composition-schemaExport"/> describes the means by
which one schema can offer constructs for use in other schemas. Here we
contrast two facilities which are provided for combining two or more schemas
into a single schema definition. These facilities are referred to as
<specref ref="composition-schemaImport"/> and
<specref ref="composition-schemaInclude"/> respectively. </p> 
<p>Schema import provides for schema validation of content models for instance
documents that refer to two or more namespaces. Schema inclusion supports
modular development and composition of a schema that is ultimately
indistinguishable from an equivalent schema developed as a monolithic unit.
Stated another way, imported schema components retain their original URI schema
name association; included components are effectively re-declared in the
including schema, and are thus indistinguishable from similar constructions
declared locally. </p> 
<note>
<p>As described below, import and include operations are effected by
declarations at the head of the schema. Therefore, it is possible to discover
all of a schema&apos;s external dependencies by inspection of its import and
include declarations. </p> 
</note>
</div2> 
<div2 id="composition-schemaImport"> 
<head>Schema Import</head> 
<p>An external schema must be explicitly imported for use via a declaration at
the head of the importing schema document. </p> 
 
<scrap lang="ebnf" id="RuleSet.XS18">

<head>Import</head> 
<prod id="nt-import"> 
<lhs>import</lhs> 
<rhs><nt def="nt-schemaAbbrev">schemaAbbrev</nt> <nt
def="nt-schemaName">schemaName</nt> <nt
def="nt-importRestrictions">importRestrictions</nt>? </rhs> 
</prod> 
 
</scrap>

<p> As explained in <specref ref="refSchemaConstructs"/>, imported features can
be accessed through an explict <nt def="nt-schemaName">schemaName</nt> URI or
through a shorthand abbreviation (<nt def="nt-schemaAbbrev">schemaAbbrev</nt>).
</p> 
<note>
<eg xml:space="preserve">
&lt;schema name=&apos;http://coolbits.com/someschema.xsd&apos;&gt;

  &lt;!-- Establish &apos;other&apos; abbrev for use in schema --&gt;

&lt;import schemaAbbrev=&apos;other&apos; schemaName=&apos;http://coolbits.com/otherschema.xsd&apos;/&gt;

  &lt;!-- can use &apos;other&apos; anywhere in schema body --&gt;

&lt;elementType name=&apos;myNewElement&apos;&gt;
  &lt;choice&gt;
      &lt;elementTypeRef schemaAbbrev=&apos;other&apos; name=&apos;myElement&apos;/&gt;
      &lt;elementTypeRef schemaAbbrev=&apos;other&apos; name=&apos;otherElement&apos;/&gt;
  &lt;/choice&gt;
&lt;/elementType&gt;

&lt;/schema&gt;
</eg>
<p>A valid instance would look like the following, delta any namespace prefix
changes:</p> 
<eg xml:space="preserve">
&lt;myNewElement xmlns=&apos;http://coolbits.com/someschema.xsd&apos; 
              xmlns:pref1=&apos;http://coolbits.com/otherschema.xsd&apos;&gt;
    &lt;pref1:myElement/&gt;
    &lt;pref1:otherElement/&gt;
&lt;/myNewElement&gt;
</eg>
<p>The default namespace establishes that <code>myNewElement</code> is an
element name in the default namespace, and the two subordinate elements are
from the namespace associated with the <code>pref1</code> prefix.</p> 

</note>
<p>Use of schema abbreviations is explained in detail below.</p> 
</div2> 
<div2 id="composition-abbreviations"> 
<head>Using Abbreviations to Reference Imported Schemas</head> 
<p>As described in <specref ref="declare-schema"/>, the schema&apos;s
<nt def="nt-schemaName">schemaName</nt> property supplies a
<bibref ref="ref-uri"/> to name the schema being declared. When multiple
schemas are <emph>composed</emph>, a <nt def="nt-schemaRef">schemaRef</nt>
(which is either the full <nt def="nt-schemaName">schemaName</nt> URI or the
shorthand <nt def="nt-schemaAbbrev">schemaAbbrev</nt>) is used to reference
definitions and declarations from imported schemas. <nt
def="nt-schemaAbbrev">schemaAbbrev</nt>s are introduced via the
<specref ref="composition-schemaImport"/> mechanism. </p> 
<note>
<p>The following example illustrates the general role of abbreviations in
qualifying references to composed schemas:</p> 
<eg xml:space="preserve">
&lt;schema name=&apos;http://coolbits.com/someschema.xsd&apos;&gt;

    &lt;import schemaAbbrev=&apos;schema2&apos; 
        schemaName=&apos;http://coolbits.com/otherschema.xsd&apos;/&gt;

    &lt;elementType name=&apos;someelement&apos;&gt;
        &lt;sequence&gt;
            &lt;elementTypeRef name=&apos;name1&apos;/&gt;
            &lt;elementTypeRef name=&apos;name2&apos; schemaAbbrev=&apos;schema2&apos; /&gt;
        &lt;/sequence&gt;
    &lt;/elementType&gt;

&lt;/schema&gt;
</eg>
<p>The example illustrates the use of references, in a single content model, to
an unqualified and a abbreviation-qualified element type. A schema named with
the URI &apos;http://coolbits.com/someschema.xsd&apos; is shown importing
features from another schema named
&apos;http://coolbits.com/otherschema.xsd&apos;. No abbreviation is used in the
content model for element &apos;someelement&apos;, to indicate that
&apos;name1&apos; is a reference to an element defined locally. In contrast,
&apos;name2&apos; is qualified by the &apos;schema2&apos; abbreviation and is
therefore defined in &apos;otherschema.xsd&apos;. </p> 
</note>
<p>Further details of schema composition are spelled out formally in the
sections below. </p> 
</div2> 
<div2 id="composition-importRestrictions"> 
<head>Import Restrictions</head> 
<p>Import can be restricted to categories such as datatypes, archetypes,
element types, and so on: </p> 
 
<scrap lang="ebnf" id="RuleSet.XS19">

<head>Import restrictions</head> 
<prod id="nt-importRestrictions"> 
<lhs>importRestrictions</lhs> 
<rhs><nt def="nt-allDatatypes">allDatatypes</nt>? <nt
def="nt-allArchetypes">allArchetypes</nt>? <nt
def="nt-allElementTypes">allElementTypes</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-datatypeRef">datatypeRef</nt> | <nt
def="nt-elementTypeRef">elementTypeRef</nt> | <nt
def="nt-archetypeRef">archetypeRef</nt> | <nt
def="nt-modelGroupRef">modelGroupRef</nt> | <nt
def="nt-attrGroupRef">attrGroupRef</nt> | <nt def="nt-entityRef">entityRef</nt>
| <nt def="nt-notationRef">notationRef</nt> )*</rhs> 
</prod> 
<prod id="nt-allDatatypes2" role="prefig"> 
<lhs>allDatatypes</lhs> 
<rhs><pt>boolean</pt></rhs> 
</prod> 
<prod id="nt-allArchetypes2" role="prefig"> 
<lhs>allArchetypes</lhs> 
<rhs><pt>boolean</pt></rhs> 
</prod> 
<prod id="nt-allElementTypes2" role="prefig"> 
<lhs>allElementTypes</lhs> 
<rhs><pt>boolean</pt></rhs> 
</prod> 
<prod id="nt-allModelGroups2" role="prefig"> 
<lhs>allModelGroups</lhs> 
<rhs><pt>boolean</pt></rhs> 
</prod> 
<prod id="nt-allAttributeGroups2" role="prefig"> 
<lhs>allAttributeGroups</lhs> 
<rhs><pt>boolean</pt></rhs> 
</prod> 
<prod id="nt-allEntities2" role="prefig"> 
<lhs>allEntities</lhs> 
<rhs><pt>boolean</pt></rhs> 
</prod> 
<prod id="nt-allNotations2" role="prefig"> 
<lhs>allNotations</lhs> 
<rhs><pt>boolean</pt></rhs> 
</prod> 
 
</scrap>

<note>
<p>The following example illustrates control of schema import by category:</p> 
<eg xml:space="preserve">
&lt;schema name=&apos;http://coolbits.com/someschema.xsd&apos;&gt;

  &lt;!-- Establish abbrev1 abbrev for use in schema --&gt;

  &lt;import schemaAbbrev=&apos;abbrev1&apos; 
          schemaName=&apos;http://coolbits.com/otherschema.xsd&apos;
          archetypes=&apos;true&apos; 
          datatypes=&apos;true&apos; &gt;

        &lt;elementTypeRef name=&apos;myElement&apos;/&gt;
        &lt;elementTypeRef name=&apos;otherElement&apos;/&gt;

   &lt;import&gt;

   &lt;choice&gt;
        &lt;elementRef schemaAbbrev=&apos;abbrev1&apos; name=&apos;myElement&apos;/&gt;
        &lt;elementRef schemaAbbrev=&apos;abbrev1&apos; name=&apos;otherElement&apos;/&gt;
   &lt;/choice&gt;

&lt;/schema&gt;
</eg>
<p>In the example, all datatypes and achetypes that are exported from
&apos;otherschema&apos;, as well as the elements named &apos;myElement&apos;
and &apos;otherElement&apos; are imported. </p> 
</note>
<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 (elementType, 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>
<note>
<p>A question arises as to whether imported definitions are re-exported for use
by yet a third schema. Because of the difficulties in managing abbrev
associations, the answer is &apos;no&apos;, at least in this draft of the
specification. </p> 
</note>
<p>Imported constructs are not implicitly and cannot explicitly be re-exported.
However, any element or archetype is imported with its full content model, even
when that content model depends on recursively imported elements or attributes.
Similarly, an attribute definition can carry a datatype from an external
schema, and so on. In other words, myElement in the example above might have a
content model that draws on many schemas. Element1 itself is usable as shown
above, but its constituent components are only available for use in new content
models if explicitly imported.</p> 
<p>Furthermore, if some schema B includes features of schema A, and if schema C
includes features of B, then C can also explicitly include the same features of
schema A directly.</p> 
</div2> 
<div2 id="composition-schemaInclude"> 
<head>Schema Inclusion</head> 
<p>Although the declarations for schema inclusion resemble those for
importation, the purpose is quite different. Element types, attributes, model
groups, etc. are effectively redeclared when included in a schema.
Specifically, the resulting construct is named in a
<termref def="key-symbolSpace">symbol space</termref> of the including schema.
As seen by authors of instance documents and other schemas, the result is
indistinguishable from a definition or declaration made in the including
schema.</p> 
 
<scrap lang="ebnf" id="RuleSet.XS20">

<head>Include</head> 
<prod id="nt-include"> 
<lhs>include</lhs> 
<rhs><nt def="nt-schemaRef">schemaRef</nt> <nt
def="nt-allDatatypes">allDatatypes</nt>? <nt
def="nt-allArchetypes">allArchetypes</nt>? <nt
def="nt-allElementTypes">allElementTypes</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-datatypeRef">datatypeRef</nt> | <nt
def="nt-elementTypeRef">elementTypeRef</nt> | <nt
def="nt-archetypeRef">archetypeRef</nt> | <nt
def="nt-modelGroupRef">modelGroupRef</nt> | <nt
def="nt-attrGroupRef">attrGroupRef</nt> | <nt def="nt-entityRef">entityRef</nt>
| <nt def="nt-notationRef">notationRef</nt> )*</rhs> 
</prod> 
 
</scrap>

<p>An include specification is equivalent to a local definition of the
corresponding elementTypes, archetypes, datatypes, attributes, model groups,
entities, notations, and attribute groups. </p> 
<note>
<p>The following example illustrates inclusion: </p> 
<eg xml:space="preserve">
&lt;schema name=&apos;http://coolbits.com/someschema.xsd&apos;&gt;

  &lt;include schemaName=&apos;http://coolbits.com/otherschema.xsd&apos;&gt;
        &lt;elementRef name=&apos;myElement&apos;/&gt;
        &lt;elementRef name=&apos;otherElement&apos;/&gt;
  &lt;include&gt;

  &lt;!-- Note unqualified references below --&gt;
  &lt;choice&gt;
       &lt;elementTypeRef name=&apos;myElement&apos;/&gt;
       &lt;elementTypeRef name=&apos;otherElement&apos;/&gt;
  &lt;/choice&gt;
  
&lt;/schema&gt;
</eg>
<p>The two elements, myElement and otherElement, are deemed to part of the
overall schema&apos;s namespace. Barring accidental name collision, these two
foreign element types can be treated just as though they were defined in the
current schema. The definitions of their datatypes, achetypes, elements and
attributes, are also implicitly included.</p> 
</note>
<p>Because the intention is to hide the inclusion hierarchy from users, any
declarations or definitions on which the inclusion depends, and which are
themselves declared locally in or included by the included schema, are
similarly redeclared in the including schema. Conversely, definitions or
declarations imported by an included schema are effectively imported when used
in an including schema. </p> 
<note>
<p> There is some question as to whether all such features should be implicitly
imported, or whether features should be imported only when needed to complete
the specification of some explicitly included feature (e.g. an imported
attribute needed on an included element type.) </p> 
</note>
<p>An inclusion is treated as a local definition, so naming collisions are
possible with other locally defined or included constructs.
<termdef id="key-schemapath" term="schema path">All include declarations
encountered in a schema form a <term>schema path</term> in the order
encountered.</termdef> When two or more includes would cause the definition or
declaration of identically named elements (I.e. the same
<termref def="gloss-NCName">NCName</termref> in the same
<termref def="key-symbolSpace">symbol space</termref>), the first one
encountered in the schema path (I.e. the first included) is used and any others
are ignored. A local definition or declaration in an including schema
supersedes any definition or declaration from any included schema.</p> 
<p><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><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> 
<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>
</div2> 
<div2 id="composition-schemaAccess"> 
<head>Access to Schemata</head> 
<p>Validation requires that one or more schemas be available to the validating
processor. As specified above, schemas are named by URI&apos;s, which can but
need not resemble in form a <bibref ref="ref-url"/>. </p> 
<p>The means used by some particular processor to access a schema, based on its
URI, are beyond the scope of this specification, and are expected to vary from
processor to processor. Whether a URI that resembles a URL is indeed usable as
a URL during validation is application- and processor-dependent. This
specification requires that the transitive closure of all schemas required for
validation must be accessible to the processor, through whatever means, based
on the URI name of each schema. </p> 
<note>
<p>Why this choice? Several reasons, including: </p> 
</note>
<ulist> 
<item> 
<p>URL&apos;s are not appropriate to all the storage environments in which
schema access is required. </p> 
</item> 
<item> 
<p>We cannot assume that a schema which was once accessible via URL will remain
so for all time. Companies fail, organizations reorganize, but the schemas they
have written and named should remain usable without modification. We cannot
require a fixed website in perpetuity to host each schema. </p> 
</item> 
<item> 
<p>For widely used schemas (e.g. <bibref ref="ref-html-4"/>, or the schema for
XML schemas), access to a single copy or even to a centrally managed replica
can result in scaleability and availability problems. </p> 
</item> 
<item> 
<p>URN&apos;s are intended as at least a partial solution, but they are not yet
widely deployed, and their effectiveness has yet to be proven on a large scale.
Should they prove successful, this design is fully compatible with and will
require no modification for URN-based naming of schemas. </p> 
</item> 
</ulist> 
</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</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> 
<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&apos;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&apos;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 defined 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=&apos;no&apos;</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=&apos;no&apos;</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>&apos;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> 
<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>
<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&apos;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&apos;re
schema-validating may well include &apos;RUE items&apos;, 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&apos;s schema provides schema definitions
for these &apos;undefined&apos; 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-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 type (and type lattice), whether it&apos;s 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 type: 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
element types -- 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&apos;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 archetypes, element types, 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> 
<eg xml:space="preserve">
&lt;?xml version=&apos;1.0&apos;?&gt; 
 &lt;!DOCTYPE schema PUBLIC &apos;-//W3C//DTD XMLSCHEMA 19990506//EN&apos; &apos;&XSP1.URI;.dtd&apos;&gt;

&lt;schema xmlns=&apos;&XSP1.URI;.xsd&apos;    
        name=&apos;&XSP1.URI;.xsd&apos; 
        version=&apos;&XSP1.version;&apos;  &gt;
</eg>
<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 xmlSchemaRef references the schema name itself. and specifies that this
is version &quot;&XSP1.version;&quot;.</p> 
<p>In the following definition of the <code>schema</code> element type, the
<nt def="nt-preamble">preamble</nt> is reproduced with attributes corresponding
to <nt def="nt-schemaName">schemaName</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
xmlns attribute corresponds to <nt def="nt-xmlSchemaRef">xmlSchemaRef</nt>. The
<code>schema</code>&apos;s definitions and declarations are represented by
<code>datatype</code>, <code>archetype</code>, <code>elementType</code>,
<code>attrDecl</code>, <code>attrGroup</code>, <code>modelGroup</code>,
<code>textEntity</code>, <code>externalEntity</code>,
<code>unParsedEntity</code> and <code>notation</code>.</p> 
<eg xml:space="preserve">
    &lt;!-- ################################################ --&gt;
    &lt;!-- ################################################ --&gt;
&lt;!-- The datatype element type, and all of its members are defined
        in XML Schema: Part 2: Datatypes --&gt;
  &lt;include schemaName=&quot;&XSP2.URI;.xsd&quot;&gt;
  
&lt;!-- The NCName datatype is widely used for names of components --&gt;
  &lt;datatype name=&quot;NCName&quot;&gt;&lt;basetype name=&quot;NMTOKEN&quot;/&gt;&lt;/datatype&gt;
&lt;!-- The public datatype is used for entities and notations --&gt;
  &lt;datatype name=&quot;public&quot;&gt;&lt;basetype name=&quot;string&quot;/&gt;&lt;/datatype&gt;
  
  

    &lt;!-- ################################################ --&gt;
    &lt;!-- ################################################ --&gt;
&lt;!-- schema element type --&gt;
  
  &lt;elementType name=&quot;schema&quot;&gt;
    &lt;sequence&gt; 
      &lt;elementTypeRef name=&quot;import&quot; minOccur=&quot;0&quot;/&gt; 
      &lt;elementTypeRef name=&quot;export&quot; minOccur=&quot;0&quot;/&gt; 
      &lt;elementTypeRef name=&quot;include&quot; minOccur=&quot;0&quot;/&gt; 
      &lt;choice minOccur=&quot;0&quot;&gt; 
        &lt;elementTypeRef name=&quot;datatype&quot;/&gt; 
        &lt;elementTypeRef name=&quot;archetype&quot;/&gt; 
        &lt;elementTypeRef name=&quot;elementType&quot;/&gt; 
        &lt;elementTypeRef name=&quot;attrDecl&quot;/&gt; 
        &lt;elementTypeRef name=&quot;attrGroup&quot;/&gt; 
        &lt;elementTypeRef name=&quot;modelGroup&quot;/&gt; 
        &lt;elementTypeRef name=&quot;textEntity&quot;/&gt; 
        &lt;elementTypeRef name=&quot;externalEntity&quot;/&gt; 
        &lt;elementTypeRef name=&quot;unparsedEntity&quot;/&gt; 
        &lt;elementTypeRef name=&quot;notation&quot;/&gt; 
      &lt;/choice&gt; 
    &lt;/sequence&gt; 
    &lt;attrDecl name=&quot;name&quot;&gt; 
      &lt;datatypeRef name=&quot;uri&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;version&quot;&gt; 
      &lt;datatypeRef name=&quot;string&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;xmlns&quot;&gt; 
      &lt;datatypeRef name=&quot;uri&quot;&gt; 
        &lt;default&gt;&XSP1.URI;.xsd 
        &lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt;
    &lt;attrGroupRef name=&quot;model&quot;/&gt; 
  &lt;/elementType&gt;

  &lt;attrGroup name=&quot;model&quot;&gt; 
    &lt;attrDecl name=&quot;model&quot;&gt; 
      &lt;datatypeRef name=&quot;NCName&quot;&gt; 
        &lt;default&gt;closed&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
  &lt;/attrGroup&gt;

  &lt;!-- ################################################ --&gt;
    &lt;!-- import, export and include --&gt;
&lt;!-- The import, export and include elements all include the 
     restrictions attribute group, 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.  --&gt;
    &lt;!-- ################################################ --&gt;
&lt;!-- import element type  --&gt;
  
  &lt;elementType name=&quot;import&quot;&gt;
    &lt;choice&gt; 
      &lt;elementTypeRef name=&quot;datatypeRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;archetypeRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;elementTypeRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;attrGroupRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;modelGroupRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;entityRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;notationRef&quot;/&gt; 
    &lt;/choice&gt; 
    &lt;attrDecl name=&quot;schemaAbbrev&quot; required=&quot;true&quot;&gt; 
      &lt;datatypeRef name=&quot;NCName&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;schemaName&quot; required=&quot;true&quot;&gt; 
      &lt;datatypeRef name=&quot;uri&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt;
    &lt;attrGroupRef name=&quot;restrictions&quot;/&gt; 
  &lt;/elementType&gt;

&lt;!-- export element type  --&gt; 
  &lt;elementType name=&quot;export&quot;&gt;
    &lt;empty/&gt;
    &lt;attrGroupRef name=&quot;restrictions&quot;/&gt; 
  &lt;/elementType&gt;

&lt;!-- include element type  --&gt; 
  &lt;elementType name=&quot;include&quot;&gt;
    &lt;choice&gt; 
      &lt;elementTypeRef name=&quot;datatypeRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;archetypeRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;elementTypeRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;attrGroupRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;modelGroupRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;entityRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;notationRef&quot;/&gt; 
    &lt;/choice&gt;
    &lt;attrGroupRef name=&quot;restrictions&quot;/&gt; 
  &lt;/elementType&gt;

  &lt;attrGroup name=&quot;restrictions&quot;&gt; 
    &lt;attrDecl name=&quot;datatypes&quot;&gt; 
      &lt;datatypeRef name=&quot;boolean&quot;&gt; 
        &lt;default&gt;true&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;archetypes&quot;&gt; 
      &lt;datatypeRef name=&quot;boolean&quot;&gt; 
        &lt;default&gt;true&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;elementTypes&quot;&gt; 
      &lt;datatypeRef name=&quot;boolean&quot;&gt; 
        &lt;default&gt;true&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;attrGroups&quot;&gt; 
      &lt;datatypeRef name=&quot;boolean&quot;&gt; 
        &lt;default&gt;true&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;modelGroups&quot;&gt; 
      &lt;datatypeRef name=&quot;boolean&quot;&gt; 
        &lt;default&gt;true&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;entities&quot;&gt; 
      &lt;datatypeRef name=&quot;boolean&quot;&gt; 
        &lt;default&gt;true&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;notations&quot;&gt; 
      &lt;datatypeRef name=&quot;boolean&quot;&gt; 
        &lt;default&gt;true&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
  &lt;/attrGroup&gt;

  &lt;!-- ################################################ --&gt;
    &lt;!-- Fundamental archetypes needed to build the schema --&gt;
&lt;!-- Two fundamental archetypes (components and references) 
     are used hereafter to build the schema. --&gt;
    &lt;!-- A component specifies its own name and its export control. --&gt;
  &lt;!-- ################################################ --&gt;
  &lt;!-- component archetype  --&gt;
  
  &lt;archetype name=&quot;component&quot; model=&quot;refinable&quot;&gt;
    &lt;empty/&gt; 
    &lt;attrDecl name=&quot;name&quot;&gt; 
      &lt;datatypeRef name=&quot;NCName&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;export&quot;&gt; 
      &lt;datatypeRef name=&quot;boolean&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
  &lt;/archetype&gt;
 
 
&lt;!-- A reference specifies the name of a component, and 
     optionally a schemaAbbrev or schemaName attribute.  --&gt;
    &lt;!-- reference archetype  --&gt; 
  &lt;archetype name=&quot;reference&quot; model=&quot;refinable&quot;&gt;
    &lt;empty/&gt; 
    &lt;attrDecl name=&quot;name&quot; required=&quot;true&quot;&gt; 
      &lt;datatypeRef name=&quot;NCName&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;schemaAbbrev&quot;&gt; 
      &lt;datatypeRef name=&quot;NCName&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;schemaName&quot;&gt; 
      &lt;datatypeRef name=&quot;uri&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
  &lt;/archetype&gt;


  &lt;!-- ################################################ --&gt;
    &lt;!-- ######### COMPONENTS ########################### --&gt;
  &lt;!-- ################################################ --&gt;
      
&lt;!-- A datatypeRef element type is based on the reference archetype. 
     It provides for specification of datatype qualification 
     through the ordered and unordered facets and through the 
     optional default and fixed elements. The content model  
     is tentative, pending future coordination work between the 
     is tentative, pending further coordination between the 
     schema definition and datatype definition specifications. --&gt;
    &lt;!-- datatypeRef element type  --&gt; 
  &lt;archetype name=&quot;datatypeRef&quot;&gt; 
    &lt;refines&gt; &lt;archetypeRef name=&quot;reference&quot;/&gt; &lt;/refines&gt;
    &lt;all&gt; 
      &lt;all&gt; 
        &lt;modelGroupRef name=&quot;ordered&quot;/&gt; 
        &lt;modelGroupRef name=&quot;unordered&quot;/&gt; 
      &lt;/all&gt; 
      &lt;choice minOccur=&quot;0&quot; maxOccur=&quot;1&quot;&gt; 
        &lt;elementTypeRef name=&quot;default&quot;/&gt; 
        &lt;elementTypeRef name=&quot;fixed&quot;/&gt; 
      &lt;/choice&gt; 
    &lt;/all&gt; 
  &lt;/archetype&gt;

&lt;!-- datatypeRef element type  --&gt; 
  &lt;elementType name=&quot;datatypeRef&quot;&gt;
    &lt;archetypeRef name=&quot;datatypeRef&quot;/&gt; 
  &lt;/elementType&gt;

&lt;!-- default element type  --&gt; 
  &lt;elementType name=&quot;default&quot;&gt;
    &lt;datatypeRef name=&quot;string&quot;&gt; 
    &lt;/datatypeRef&gt; 
  &lt;/elementType&gt;

&lt;!-- fixed element type  --&gt; 
  &lt;elementType name=&quot;fixed&quot;&gt;
    &lt;datatypeRef name=&quot;string&quot;&gt; 
    &lt;/datatypeRef&gt; 
  &lt;/elementType&gt;


&lt;!-- The archetype element type is based on the component archetype. 
     It may include a refines element that specifies the archetype 
     that is is based on, and either a datatypeRef or a model, 
     followed by any number of attrDecl and attrGroupRef elements.  --&gt;
    &lt;!-- ################################################ --&gt;
  &lt;!-- ################################################ --&gt;
    &lt;!-- archetype element type --&gt; 
  &lt;elementType name=&quot;archetype&quot;&gt;
    &lt;refines&gt; &lt;archetypeRef name=&quot;component&quot;/&gt; &lt;/refines&gt;
    &lt;sequence&gt; 
      &lt;elementTypeRef name=&quot;refines&quot;/&gt; 
      &lt;choice&gt; 
        &lt;elementTypeRef name=&quot;datatypeRef&quot;/&gt; 
        &lt;modelGroupRef name=&quot;model&quot;/&gt; 
      &lt;/choice&gt; 
      &lt;elementTypeRef name=&quot;attrDecl&quot;/&gt; 
      &lt;elementTypeRef name=&quot;attrGroupRef&quot;/&gt; 
    &lt;/sequence&gt;
    &lt;attrGroupRef name=&quot;model&quot;/&gt; 
  &lt;/elementType&gt;
  
&lt;!-- The model model group, and the modelElt model group that 
     it references, are reusable content model fragments. 
     The model model group is used in the definition of the 
     archetype, elementType and modelGroup element types. 
     Its members are defined later. --&gt;
  
  &lt;modelGroup name=&quot;model&quot;&gt; 
    &lt;choice&gt; 
      &lt;elementTypeRef name=&quot;any&quot;/&gt; 
      &lt;elementTypeRef name=&quot;empty&quot;/&gt; 
      &lt;elementTypeRef name=&quot;mixed&quot;/&gt; 
      &lt;modelGroupRef name=&quot;modelElt&quot;/&gt; 
    &lt;/choice&gt; 
  &lt;/modelGroup&gt;

  &lt;modelGroup name=&quot;modelElt&quot;&gt; 
    &lt;choice&gt; 
      &lt;elementTypeRef name=&quot;all&quot;/&gt; 
      &lt;elementTypeRef name=&quot;choice&quot;/&gt; 
      &lt;elementTypeRef name=&quot;elementType&quot;/&gt; 
      &lt;elementTypeRef name=&quot;elementTypeRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;sequence&quot;/&gt; 
      &lt;elementTypeRef name=&quot;modelGroupRef&quot;/&gt; 
    &lt;/choice&gt; 
  &lt;/modelGroup&gt;
  

&lt;!-- The archetypeRef element type is based on the reference archetype.  --&gt;
    &lt;!-- archetypeRef element type --&gt; 
  &lt;elementType name=&quot;archetypeRef&quot;&gt;
    &lt;archetypeRef name=&quot;reference&quot;/&gt; 
  &lt;/elementType&gt;


&lt;!-- The elementType element type is based in the component archetype. 
     It is almost identical to the archetype element type except 
     that it additionally provides for immediate specification of 
     an archetypeRef upon which its definition is based.  --&gt;
    
&lt;!-- The elementTypeRef is based upon the reference archetype. 
     It additionally provides for specification of minOccurs 
     and maxOccurs attributes used when defining a content model.  --&gt;
    &lt;!-- ################################################ --&gt;
  &lt;!-- ################################################ --&gt;
    &lt;!-- elementType element type --&gt; 
  &lt;elementType name=&quot;elementType&quot;&gt;
    &lt;refines&gt; &lt;archetypeRef name=&quot;component&quot;/&gt; &lt;/refines&gt;
    &lt;sequence&gt; 
      &lt;elementTypeRef name=&quot;refines&quot;/&gt; 
      &lt;choice&gt; 
        &lt;elementTypeRef name=&quot;datatypeRef&quot;/&gt; 
        &lt;elementTypeRef name=&quot;archetypeRef&quot;/&gt; 
        &lt;modelGroupRef name=&quot;model&quot;/&gt; 
      &lt;/choice&gt; 
      &lt;elementTypeRef name=&quot;attrDecl&quot;/&gt; 
      &lt;elementTypeRef name=&quot;attrGroupRef&quot;/&gt; 
    &lt;/sequence&gt;
    &lt;attrGroupRef name=&quot;model&quot;/&gt; 
  &lt;/elementType&gt;


&lt;!-- elementTypeRef element type --&gt; 
  &lt;elementType name=&quot;elementTypeRef&quot;&gt;
    &lt;archetypeRef name=&quot;reference&quot;/&gt;
    &lt;attrGroupRef name=&quot;occurrence&quot;/&gt; 
  &lt;/elementType&gt;

  &lt;attrGroup name=&quot;occurrence&quot;&gt; 
    &lt;attrDecl name=&quot;minOccur&quot;&gt; 
      &lt;datatypeRef name=&quot;integer&quot;&gt; 
        &lt;default&gt;1&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;maxOccur&quot;&gt; 
      &lt;datatypeRef name=&quot;integer&quot;&gt; 
        &lt;default&gt;1&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
  &lt;/attrGroup&gt;

&lt;!-- The modelGroup element type is based on the component archetype. 
     It must contain elements of the model model group, and it 
     may specify its model and occurrence attributes. --&gt;
    &lt;!-- The modelGroupRef element type is based on the reference archetype. --&gt;
    &lt;!-- ################################################ --&gt;
  &lt;!-- ################################################ --&gt;
    &lt;!-- modelGroup element type --&gt; 
  &lt;elementType name=&quot;modelGroup&quot;&gt;
    &lt;refines&gt; &lt;archetypeRef name=&quot;component&quot;/&gt; &lt;/refines&gt;
    &lt;modelGroupRef name=&quot;model&quot;/&gt;
    &lt;attrGroupRef name=&quot;model&quot;/&gt;
    &lt;attrGroupRef name=&quot;occurrence&quot;/&gt; 
  &lt;/elementType&gt;

&lt;!-- modelGroupRef element type --&gt; 
  &lt;elementType name=&quot;modelGroupRef&quot;&gt;
    &lt;archetypeRef name=&quot;reference&quot;/&gt;
    &lt;attrGroupRef name=&quot;occurrence&quot;/&gt; 
  &lt;/elementType&gt;


&lt;!-- The modelGroup element type is based in the component archetype. 
     It provides for one or more attrDecl and attrGroupRef elements. --&gt;
  &lt;!-- The attrGroupRef element type is based on the reference archetype.  --&gt;
    &lt;!-- ################################################ --&gt;
  &lt;!-- ################################################ --&gt;
    &lt;!-- attrGroup element type --&gt; 
  &lt;elementType name=&quot;attrGroup&quot;&gt;
    &lt;refines&gt; &lt;archetypeRef name=&quot;component&quot;/&gt; &lt;/refines&gt;
    &lt;choice minOccur=&quot;1&quot; maxOccur=&quot;*&quot;&gt; 
      &lt;elementTypeRef name=&quot;attrDecl&quot;/&gt; 
      &lt;elementTypeRef name=&quot;attrGroupRef&quot;/&gt; 
    &lt;/choice&gt;
    &lt;attrGroupRef name=&quot;model&quot;/&gt; 
  &lt;/elementType&gt;

&lt;!-- attrGroupRef element type --&gt; 
  &lt;elementType name=&quot;attrGroupRef&quot;&gt;
    &lt;archetypeRef name=&quot;reference&quot;/&gt; 
  &lt;/elementType&gt;


&lt;!-- The textEntity element type is based on the component archetype. 
     It provides for string content to specify the entity value.  --&gt;
    &lt;!-- ################################################ --&gt;
  &lt;!-- ################################################ --&gt;
    &lt;!-- entities --&gt;
  &lt;!-- textEntity element type --&gt; 
  &lt;elementType name=&quot;textEntity&quot;&gt;
    &lt;datatypeRef name=&quot;string&quot;&gt; 
    &lt;/datatypeRef&gt; 
  &lt;/elementType&gt;

&lt;!-- The externalEntity and unparsedEntity element types are 
     based on the component archetype. They provide for specification 
     of a URI, an optional public identifier, and a notation attribute.  --&gt;
    &lt;!-- externalEntity element type --&gt; 
  &lt;elementType name=&quot;externalEntity&quot;&gt;
    &lt;refines&gt; &lt;archetypeRef name=&quot;component&quot;/&gt; &lt;/refines&gt;
    &lt;empty/&gt;
    &lt;attrGroupRef name=&quot;external&quot;/&gt; 
  &lt;/elementType&gt;

&lt;!-- unparsedEntity element type --&gt; 
  &lt;elementType name=&quot;unparsedEntity&quot;&gt;
    &lt;refines&gt; &lt;archetypeRef name=&quot;component&quot;/&gt; &lt;/refines&gt;
    &lt;empty/&gt;
    &lt;attrGroupRef name=&quot;external&quot;/&gt; 
  &lt;/elementType&gt;

  &lt;attrGroup name=&quot;external&quot;&gt; 
    &lt;attrDecl name=&quot;system&quot; required=&quot;true&quot;&gt; 
      &lt;datatypeRef name=&quot;uri&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;public&quot;&gt; 
      &lt;datatypeRef name=&quot;public&quot;&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
    &lt;attrDecl name=&quot;notation&quot; required=&quot;true&quot;&gt; 
      &lt;datatypeRef name=&quot;notation&quot;&gt; 
        &lt;default&gt;XML&lt;/default&gt; 
      &lt;/datatypeRef&gt; 
    &lt;/attrDecl&gt; 
  &lt;/attrGroup&gt;

&lt;!-- The entityRef elementType is based on the reference archetype. 
 --&gt;
    &lt;!-- entityRef element type --&gt; 
  &lt;elementType name=&quot;entityRef&quot;&gt;
    &lt;archetypeRef name=&quot;reference&quot;/&gt; 
  &lt;/elementType&gt;


&lt;!-- The notation element type is based on the component archetype. 
     The notationRef element type is based in the reference archetype. --&gt;
    &lt;!-- notation element type --&gt; 
  &lt;elementType name=&quot;notation&quot;&gt;
    &lt;refines&gt; &lt;archetypeRef name=&quot;component&quot;/&gt; &lt;/refines&gt;
    &lt;empty/&gt;
    &lt;attrGroupRef name=&quot;external&quot;/&gt; 
  &lt;/elementType&gt;

&lt;!-- notationRef element type --&gt; 
  &lt;elementType name=&quot;notationRef&quot;&gt;
    &lt;archetypeRef name=&quot;reference&quot;/&gt; 
  &lt;/elementType&gt;



  &lt;!-- ################################################ --&gt;
    &lt;!-- ################################################ --&gt;
&lt;!-- Content model atoms --&gt;
  
  &lt;elementType name=&quot;any&quot;&gt;
    &lt;empty/&gt; 
  &lt;/elementType&gt;

  &lt;elementType name=&quot;empty&quot;&gt;
    &lt;empty/&gt; 
  &lt;/elementType&gt;

  &lt;elementType name=&quot;mixed&quot;&gt;
    &lt;choice minOccur=&quot;0&quot; maxOccur=&quot;*&quot;&gt; 
      &lt;elementTypeRef name=&quot;elementTypeRef&quot;/&gt; 
      &lt;elementTypeRef name=&quot;elementType&quot;/&gt; 
    &lt;/choice&gt; 
  &lt;/elementType&gt;



  &lt;!-- ################################################ --&gt;
    &lt;!-- ################################################ --&gt;
&lt;!-- Element groups --&gt;
  
  &lt;archetype name=&quot;compositor&quot;&gt; 
    &lt;choice minOccur=&quot;2&quot; maxOccur=&quot;*&quot;&gt; 
      &lt;modelGroupRef name=&quot;modelElt&quot;/&gt; 
      &lt;elementTypeRef name=&quot;elementType&quot;/&gt; 
    &lt;/choice&gt;
    &lt;attrGroupRef name=&quot;occurrence&quot;/&gt; 
  &lt;/archetype&gt; 
  &lt;elementType name=&quot;all&quot;&gt;
    &lt;archetypeRef name=&quot;compositor&quot;/&gt; 
  &lt;/elementType&gt;

  &lt;elementType name=&quot;choice&quot;&gt;
    &lt;archetypeRef name=&quot;compositor&quot;/&gt; 
  &lt;/elementType&gt;

  &lt;elementType name=&quot;sequence&quot;&gt;
    &lt;archetypeRef name=&quot;compositor&quot;/&gt; 
  &lt;/elementType&gt;



  &lt;!-- ################################################ --&gt;
    &lt;!-- ################################################ --&gt;
&lt;!-- notations for use within &XSP1;  --&gt;
  &lt;notation name=&quot;XMLSchemaStructures&quot; public=&quot;structures&quot;
   system=&quot;&XSP1.URI;.xsd&quot;/&gt; 
  &lt;notation name=&quot;XML&quot; public=&quot;REC-xml-19980210&quot;
   system=&quot;http://www.w3.org/TR/1998/REC-xml-19980210&quot;/&gt; 
&lt;/schema&gt;
</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 following is the DTD for &XSP1;:</p> 
<eg xml:space="preserve">
&lt;!ELEMENT schema ((import*, include*, export?,  
                  (comment | datatype | archetype | elementType   
                  | attrGroup | modelGroup | notation 
                  | textEntity | externalEntity | unparsedEntity)* ))&gt;
&lt;!ATTLIST schema
                 name        CDATA       #IMPLIED
                 version     CDATA       #IMPLIED
                 xmlns       CDATA       &quot;&XSP1.URI;.xsd&quot;
                 model      (open|refinable|closed) &quot;closed&quot; &gt;

&lt;!ELEMENT import (( elementTypeRef | archetypeRef | datatypeRef 
                  | modelGroupRef | attrGroupRef | entityRef 
                  | notationRef )* ) &gt;

&lt;!ATTLIST import
                 schemaAbbrev     NMTOKEN      #REQUIRED 
                 schemaName       CDATA        #REQUIRED 
                 datatypes        (true|false) &quot;true&quot;  
                 archetypes       (true|false) &quot;true&quot;  
                 elementTypes     (true|false) &quot;true&quot;  
                 attrGroups       (true|false) &quot;true&quot;  
                 modelGroups      (true|false) &quot;true&quot;  
                 entities         (true|false) &quot;true&quot;  
                 notations        (true|false) &quot;true&quot; &gt;

&lt;!ELEMENT export EMPTY &gt;
&lt;!ATTLIST export 
                 datatypes        (true|false) &quot;true&quot;  
                 archetypes       (true|false) &quot;true&quot;  
                 elementTypes     (true|false) &quot;true&quot;  
                 attrGroups       (true|false) &quot;true&quot;  
                 modelGroups      (true|false) &quot;true&quot;  
                 entities         (true|false) &quot;true&quot;  
                 notations        (true|false) &quot;true&quot; &gt;

&lt;!ELEMENT include (( elementTypeRef | archetypeRef | datatypeRef 
                  | modelGroupRef | attrGroupRef | entityRef 
                  | notationRef )* ) &gt;

&lt;!ATTLIST include
                 schemaName       CDATA        #REQUIRED 
                 datatypes        (true|false) &quot;true&quot;  
                 archetypes       (true|false) &quot;true&quot;  
                 elementTypes     (true|false) &quot;true&quot;  
                 attrGroups       (true|false) &quot;true&quot;  
                 modelGroups      (true|false) &quot;true&quot;  
                 entities         (true|false) &quot;true&quot;  
                 notations        (true|false) &quot;true&quot; &gt;


&lt;!-- --&gt;
&lt;!-- comments contain text --&gt;
&lt;!-- --&gt;
&lt;!ELEMENT comment (#PCDATA) &gt;

&lt;!-- --&gt;
&lt;!-- The datatype element is defined in XML Schema: Part 2: Datatypes --&gt;
&lt;!-- --&gt;

&lt;!ENTITY % xs-datatypes PUBLIC &quot;datatypes&quot;
                   &quot;&XSP2.URI;.dtd&quot; &gt;
%xs-datatypes;

&lt;!ELEMENT datatypeRef ((%ordered; | %unordered)*, (default|fixed)*) &gt;
&lt;!ATTLIST datatypeRef
                 name            NMTOKEN    #REQUIRED
                 schemaAbbrev    NMTOKEN    #IMPLIED
                 schemaName      CDATA      #IMPLIED &gt;

&lt;!ELEMENT default (#PCDATA) &gt;
&lt;!ELEMENT fixed (#PCDATA) &gt;

&lt;!ENTITY % modelElt &quot;all|choice|elementTypeRef|elementType|sequence&quot; &gt;
&lt;!ENTITY % model    &quot;any|empty|%modelElt;|mixed&quot; &gt;
&lt;!-- --&gt;
&lt;!-- an archetype is a named content type specification --&gt;
&lt;!-- --&gt;
&lt;!ELEMENT archetype ( refines?,
                     ( datatypeRef |
                      (%model; | modelGroupRef) )?,
                     (attrDecl | attrGroupRef)* ) &gt;
&lt;!ATTLIST archetype
                 name        NMTOKEN     #REQUIRED
                 export     (true|false) &quot;true&quot;
                 model      (open|refinable|closed) #IMPLIED &gt;

&lt;!ELEMENT refines (archetypeRef)* &gt;

&lt;!ELEMENT archetypeRef EMPTY &gt;
&lt;!ATTLIST archetypeRef 
                 name      NMTOKEN    #REQUIRED 
                 schemaAbbrev    NMTOKEN    #IMPLIED
                 schemaName CDATA      #IMPLIED &gt;

&lt;!-- --&gt;
&lt;!-- an elementType is a named element and its content type --&gt;   
&lt;!-- --&gt;
&lt;!ELEMENT elementType ( refines?,
                       ( datatypeRef | archetypeRef |
                        (%model; | modelGroupRef) )?,
                       (attrDecl | attrGroupRef)* ) &gt;
&lt;!ATTLIST elementType
                 name        NMTOKEN       #REQUIRED
                 export     (true|false)   &quot;true&quot;
                 model      (open|refinable|closed) #IMPLIED &gt;

&lt;!ELEMENT elementTypeRef EMPTY &gt;
&lt;!ATTLIST elementTypeRef 
                 name      NMTOKEN    #REQUIRED
                 schemaAbbrev    NMTOKEN    #IMPLIED
                 schemaName CDATA      #IMPLIED
                 minOccur    CDATA      &quot;1&quot; 
                 maxOccur    CDATA      #IMPLIED &gt;

&lt;!-- --&gt;
&lt;!-- a model is a named content model (without attributes) --&gt;
&lt;!-- --&gt;
&lt;!ELEMENT modelGroup  (%modelElt;) &gt;
&lt;!ATTLIST modelGroup
                 name        NMTOKEN     #REQUIRED
                 export     (true|false) &quot;true&quot; &gt;

&lt;!ELEMENT modelGroupRef EMPTY &gt;
&lt;!ATTLIST modelGroupRef 
                 name        NMTOKEN    #REQUIRED
                 schemaAbbrev      NMTOKEN    #IMPLIED
                 schemaName   CDATA      #IMPLIED
                 minOccur    CDATA      &quot;1&quot; 
                 maxOccur    CDATA      #IMPLIED &gt;

&lt;!ELEMENT any EMPTY &gt;
&lt;!ELEMENT empty EMPTY &gt;
&lt;!ELEMENT mixed (elementTypeRef|elementType)* &gt;

&lt;!ELEMENT sequence (modelGroupRef | sequence | choice | all
                    | elementType | elementTypeRef)+ &gt;
&lt;!ATTLIST sequence
                 minOccur    CDATA      &quot;1&quot; 
                 maxOccur    CDATA      #IMPLIED &gt;

&lt;!ELEMENT choice (modelGroupRef | sequence | choice | all
                  | elementType | elementTypeRef)+ &gt;
&lt;!ATTLIST choice
                 minOccur    CDATA      &quot;1&quot; 
                 maxOccur    CDATA      #IMPLIED &gt;

&lt;!ELEMENT all (modelGroupRef | sequence | choice | all
               | elementType | elementTypeRef)+ &gt;
&lt;!ATTLIST all
                 minOccur    CDATA      &quot;1&quot; 
                 maxOccur    CDATA      #IMPLIED &gt;

&lt;!-- --&gt;
&lt;!-- an attrDecl names an attribute specification --&gt;
&lt;!-- the datatypeRef default is &quot;string&quot; --&gt;
&lt;!-- the attrValue allows * for NMTOKEN lists --&gt;
&lt;!-- --&gt;
&lt;!ELEMENT attrDecl (datatypeRef?) &gt;
&lt;!ATTLIST attrDecl
                 name        NMTOKEN     #REQUIRED
                 required   (true|false) &quot;false&quot;  &gt;

&lt;!-- an attrGroup is a named collection of attrDecls --&gt;
&lt;!ELEMENT attrGroup (attrDecl | attrGroupRef)+ &gt;
&lt;!ATTLIST attrGroup
                 name        NMTOKEN     #REQUIRED
                 export     (true|false) &quot;true&quot; &gt;

&lt;!ELEMENT attrGroupRef EMPTY &gt;
&lt;!ATTLIST attrGroupRef 
                 name      NMTOKEN    #REQUIRED
                 schemaAbbrev    NMTOKEN    #IMPLIED
                 schemaName CDATA      #IMPLIED &gt;

&lt;!--  --&gt;
&lt;!-- Entities and notations in XML Schema --&gt;
&lt;!--  --&gt;

&lt;!-- the three kinds of entities share a symbol space  --&gt;
&lt;!ELEMENT entityRef EMPTY &gt;
&lt;!ATTLIST entityRef 
                 name      NMTOKEN    #REQUIRED
                 schemaAbbrev    NMTOKEN    #IMPLIED
                 schemaName CDATA      #IMPLIED &gt;

&lt;!-- a textEntity can be referenced in documents of this type --&gt;
&lt;!ELEMENT textEntity (#PCDATA) &gt;
&lt;!ATTLIST textEntity
                 name        NMTOKEN     #REQUIRED
                 export      (true|false) #FIXED &quot;true&quot; &gt;

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

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

&lt;!ELEMENT notationRef EMPTY &gt;
&lt;!ATTLIST notationRef 
                 name      NMTOKEN    #REQUIRED
                 schemaAbbrev    NMTOKEN    #IMPLIED
                 schemaName CDATA      #IMPLIED &gt;

&lt;!-- an unparsedEntity can be referenced in documents of this type  --&gt;
&lt;!ELEMENT unparsedEntity EMPTY &gt;
&lt;!ATTLIST unparsedEntity
                 name        NMTOKEN     #REQUIRED
                 export     (true|false) #FIXED &quot;true&quot;
                 public      CDATA       #IMPLIED
                 system      CDATA       #REQUIRED
                 notation    NMTOKEN     #REQUIRED &gt;

&lt;!NOTATION XMLSchemaStructures PUBLIC &quot;structures&quot; &quot;&XSP1.URI;.xsd&quot; &gt;
&lt;!NOTATION XML PUBLIC &quot;REC-xml&quot; &quot;http://www.w3.org/TR/1998/REC-xml-19980210&quot; &gt;
</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>archetype</label>
<def> 
<p><termdef term="archetype" id="gloss-archetype">an <term>archetype</term>
is</termdef></p> 
</def> 
</gitem> 
<gitem> 
<label>archetype reference</label>
<def> 
<p><termdef term="archetype reference" id="gloss-archetypeReference">an
<term>archetype reference</term> is</termdef></p> 
</def> 
</gitem> 
<gitem> 
<label>&apos;all&apos; content model group</label>
<def> 
<p><termdef term="&apos;all&apos; content model group" id="gloss-all">the
<term>&apos;all&apos; content model group</term> is</termdef></p> 
</def> 
</gitem> 
<gitem> 
<label>&apos;any&apos; content</label>
<def> 
<p><termdef term="&apos;any&apos; content" id="gloss-anyContent">the
<term>&apos;any&apos; 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>&apos;choice&apos; content model group</label>
<def> 
<p><termdef term="&apos;choice&apos; content model group" id="gloss-choice">the
<term>&apos;choice&apos; 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 type</label>
<def> 
<p><termdef term="element type" id="gloss-elementType">an <term>element
type</term> is</termdef></p> 
</def> 
</gitem> 
<gitem> 
<label>element type reference</label>
<def> 
<p><termdef term="element type reference" id="gloss-elementTypeReference">an
<term>element type reference</term> is</termdef></p> 
</def> 
</gitem> 
<gitem> 
<label>&apos;empty&apos; content</label>
<def> 
<p><termdef term="&apos;empty&apos; content" id="gloss-emptyContent">the
<term>&apos;empty&apos; 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>&apos;mixed&apos; content</label>
<def> 
<p><termdef term="&apos;mixed&apos; content" id="gloss-mixedContent">the
<term>&apos;mixed&apos; 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>&apos;sequence&apos; content model group </label>
<def> 
<p><termdef term="&apos;sequence&apos; content model group"
id="gloss-sequenceGroup">the <term>&apos;sequence&apos; 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-austin-ftf" key="Austin-FTF">Fourth
Meeting of the &SchemaWG;. See <loc href="http://www.w3.org/XML/Group/1999/04/xml-schema-ftf.html">http://www.w3.org/XML/Group/1999/04/xml-schema-ftf.html
</loc> </bibl> 
<bibl id="ref-dcd" key="DCD"> <emph>Document
Content Description for XML (DCD)</emph>, Tim Bray et al. W3C, 10 August 1998.
See <loc href="http://www.w3.org/TR/NOTE-dcd">http://www.w3.org/TR/NOTE-dcd
</loc> </bibl> 
<bibl id="ref-ddml" key="DDML"> <emph>Document
Definition Markup Language</emph>. See
<loc href="http://www.w3.org/TR/NOTE-ddml">http://www.w3.org/TR/NOTE-ddml
</loc> </bibl> 
<bibl id="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/pub/ietf/uri/draft-fielding-uri-syntax-01.txt">http://www.ics.uci.edu/pub/ietf/uri/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/WD-WAI-PAGEAUTH">http://www.w3.org/TR/WD-WAI-PAGEAUTH
</loc> </bibl> 
<bibl id="ref-webarch-extlang" key="WEBARCH-EXTLANG" show="embed"
 actuate="auto"> <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;">&XSP2.URI;</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 (first public WD),
David Megginson et al., W3C, 1999. See
<loc href="http://www.w3.org/XML/Group/1999/04/WD-xml-infoset-19990428.html">http://www.w3.org/XML/Group/1999/04/WD-xml-infoset-19990428.html</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="acknowledgments"> 
<head>Grateful Acknowledgments (non-normative)</head> 
<p>The editors the acknowledge the members of the &SchemaWG;, 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 editors are particularly grateful to Lotus Development Corp. for
providing teleconferencing facilities.</p> 
</div1> 
<div1 id="sampleSchema"> 
<head>Sample Schema (non-normative)</head> 
<note>
<p>The editors did not get to this.</p> 
</note>
<note>
<p>An example of a full blown schema:</p> 
<eg xml:space="preserve">&lt;schema name=&apos;http://www.myOrg.com/bob/schema1.xsd&apos; &gt;


[...]

</eg>
<p>Explanation...</p> 
<eg xml:space="preserve">

[...]

&lt;/schema&gt;

</eg>
<p>Explanation...</p> 

</note>
</div1> 
<div1 id="openIssues"> 
<head>Open Issues</head> 
<p>A tabulation of open issues flagged above follows:</p> 
</div1> 
</back>

</spec>
