<?xml version="1.0" encoding="utf-8"?><!-- Id: datatypes.xml,v 1.7.2.370 2008/06/16 14:09:14 cmsmcq Exp  --><?xml-stylesheet type='text/xsl' href='xmlschema_diffs.xsl'?>
<!DOCTYPE spec
  SYSTEM "local.dgdf.dtd">
<spec dgdf="dg-statusquo-color-200602.xml" dgdf_desc="the status-quo text without adornment" w3c-doctype="wd" status="final" role="TR-copy" otherSpec="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html" schemaDump="./XMLSchema.diff-wd.xsd.dmp" drvdSchema="./derived.diff-wd.nxsd" primSchema="./primitives.diff-wd.nxsd" schemaProper="./XMLSchema.diff-wd.xsd" docStatus="final" me="datatypes">
<header>
<title><phrase diff="add" dg="ep26">W3C</phrase> XML Schema <phrase diff="add" dg="ep26">Definition Language (XSD)</phrase> 1.1 Part 2: Datatypes</title>
<w3c-designation>wd-20080620</w3c-designation>
<!--* <w3c-doctype>W3C Working Draft</w3c-doctype> *-->
<!--* <w3c-doctype>Editors' Draft</w3c-doctype> *-->
<w3c-doctype>W3C Working Draft</w3c-doctype>
<pubdate>
<day>20</day>
<month>June</month>
<year>2008<!--* Id: datatypes.xml,v 1.7.2.370 2008/06/16 14:09:14 cmsmcq Exp  *--></year>
</pubdate>
<publoc> 
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-2-20080620/">http://www.w3.org/TR/2008/WD-xmlschema11-2-20080620/</loc> 
</publoc>
<altlocs>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-2-20080620/datatypes.diff-wd.xml">XML</loc>
<!--* 
<loc href="http://www.w3.org/TR/2008/WD-xmlschema11-2-20080620/datatypes.diff-wd.diff-1.0.html">XHTML with changes since version 1.0 marked</loc>
<loc href="http://www.w3.org/TR/2008/WD-xmlschema11-2-20080620/datatypes.diff-wd.diff-wd.html">XHTML with changes since previous Working Draft marked</loc>
*-->
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-2-20080620/datatypes.diff-1.0.html">XHTML with changes since version 1.0 marked</loc>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-2-20080620/datatypes.diff-wd.html">XHTML with changes since previous Working Draft marked</loc>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="./XMLSchema.xsd">Independent copy of the schema for schema documents</loc>
<!--*
* material suppressed here by diff group dup-2214 *
*-->
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="./XMLSchema.dtd">Independent copy of the DTD for schema documents</loc>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/2003/03/Translations/byTechnology?technology=xmlschema">List of translations</loc>
</altlocs>
<latestloc>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xmlschema11-2/">http://www.w3.org/TR/xmlschema11-2/</loc>
</latestloc>
<prevlocs>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/">http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/</loc>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060116/">http://www.w3.org/TR/2006/WD-xmlschema11-2-20060116/</loc>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2005/WD-xmlschema11-2-20050224/">http://www.w3.org/TR/2005/WD-xmlschema11-2-20050224/</loc>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2004/WD-xmlschema11-2-20040716/">http://www.w3.org/TR/2004/WD-xmlschema11-2-20040716/</loc>
</prevlocs>
<authlist>
<authlist role="1.1">

<author>
<name>David Peterson</name>
<affiliation>invited expert (SGML<emph>Works!</emph>)</affiliation>
<email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:davep@iit.edu">davep@iit.edu</email>
</author>

<author><!--* diff="add" dg="wgi-20080613"> *-->
<name>Shudi (Sandy) Gao 高殊镝</name>
<affiliation>IBM</affiliation>
<email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:sandygao@ca.ibm.com">sandygao@ca.ibm.com</email>
</author>

<author>
<name>Ashok Malhotra</name>
<affiliation>Oracle Corporation</affiliation>
<email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:ashokmalhotra@alum.mit.edu">ashokmalhotra@alum.mit.edu</email>
</author>

<author><!--* diff="add" dg="wgi-20080613"> *-->
<name>C. M. Sperberg-McQueen</name>
<affiliation>World Wide Web Consortium</affiliation>
<email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:cmsmcq@w3.org">cmsmcq@w3.org</email>
</author>

<author><!--* diff="add" dg="wgi-20080613"> *-->
<name>Henry S. Thompson</name>
<affiliation>University of Edinburgh</affiliation>
<email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:ht@inf.ed.ac.uk">ht@inf.ed.ac.uk</email>
</author>

</authlist>
<authlist role="1.0">
<author>
<name>Paul V. Biron</name>
<affiliation>Kaiser Permanente, for Health Level Seven</affiliation>
<email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:Paul.V.Biron@kp.org">Paul.V.Biron@kp.org</email>
</author>
<author>
<name>Ashok Malhotra</name>
<affiliation>Oracle Corporation</affiliation>
<email xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:ashokmalhotra@alum.mit.edu">ashokmalhotra@alum.mit.edu</email>
</author>
</authlist>
</authlist>
<status>

<p><emph>This section describes the status of this document at the
time of its publication. Other documents may supersede this document.
A list of current W3C publications and the latest revision of this
technical report can be found in the <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/">W3C technical reports index</loc> at
http://www.w3.org/TR/.</emph></p>

<p>This is a <!--*
* material suppressed here by diff group wg-internal *
*--><phrase diff="add" dg="wgi-20080613">Last Call</phrase> Public Working
Draft of <phrase diff="del" dg="wgi-20080613">XML Schema 
1.1<phrase dg="wd4hax">: Datatypes</phrase></phrase><phrase diff="add" dg="wgi-20080613">W3C XML Schema Definition
Language (XSD) 1.1 Part 2: Datatypes</phrase>.  
It <!--*
* material suppressed here by diff group wg-internal *
*--> is here made available for
review by W3C members<phrase dg="wg-internal"> and the
public</phrase>.  <!--*
* material suppressed here by diff group wd4hax *
*--> This version of this document was created on 
20 June 2008.<!--*
* material suppressed here by diff group wg-internal *
*-->
</p>

<!--* <p diff="add" dg="wg-internal">The text of this draft is essentially
that which appeared in the Last Call version of this specification
published 17 February 2006.
The WG has not approved any changes since that publication;
new versions of the status-quo documents have been generated
primarily for technical reasons internal to the editorial
document-production system.</p> *-->  

<!--* Paragraphs specific to individual editorial proposals go here.
    * They should be deleted after the proposal is acted on, but
    * do please keep one here, for use as a template.

<p diff="add" dg="rec12-main">It also includes an editorial proposal
for reconciliation of the treatment of the special simple types
(anySimpleType and anyAtomicType) between Datatypes and Structures.</p>

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

<p>For those primarily interested in the changes since version 1.0,
the <specref ref="changes"/> appendix, which summarizes both changes
already made and also those in prospect, with links to the relevant
sections of this draft, is the recommended starting point.  <!--*
* material suppressed here by diff group qd3hax *
*--><phrase dg="qd3hax">An
accompanying version of this document displays in color all changes to
normative text since version 1.0; another shows changes since the
previous Working Draft.</phrase></p>

<p>The major changes since version 1.0 include:</p>
<ulist>
<item dg="b1838">
<p>Support for XML 1.1 has been added.  It is now implementation
defined whether datatypes dependent on definitions in 
<bibref ref="XML"/> and <bibref ref="XMLNS"/> use the definitions
as found in version 1.1 or version 1.0 of those specifications.
</p>
</item>
<item>
<p>A new primitive decimal type has been defined, which retains
information about the precision of the value.  This type is aligned
with the floating-point decimal types which will be part of the next
edition of IEEE 754.</p>
</item>
<item>
<p>In order to align this specification with those being prepared by
the XSL and XML Query Working Groups, a new datatype named
<dtref ref="anyAtomicType"/> <phrase dg="qd3hax">which
serves as the base type definition for all primitive atomic
datatypes</phrase> has been introduced.</p>
</item>
<item>
<p>The conceptual model of the date- and time-related types has been
defined more formally.</p>
</item>
<!--*
<item>
<p>Two subtypes of <dtref ref="duration"/> 
(<dtref ref="yearMonthDuration"/> and
<dtref ref="dayTimeDuration"/>) have been introduced, each of which is
totally ordered.</p>
</item>
*-->
<item>
<p>A more formal treatment of the fundamental facets of the primitive
datatypes has been adopted.</p>
</item>
<item>
<p>More formal definitions of the lexical space of most types have
been provided, with detailed descriptions of the mappings from lexical
representation to value and from value to <termref def="dt-canonical-representation"/>.</p>
</item>

<item dg="b2449">
<p dg="b2449">The validation rule <specref ref="cvc-datatype-valid"/> has been recast in more declarative form.
A paraphrase of the constraint in procedural terms, which corrects
some errors in the previous versions of this document, has been added
as a note.</p>
</item>
<item dg="partialfix">
<p dg="partialfix">The rules governing partial
implementations of infinite datatypes have been clarified.</p>
</item>
<item><p>Various changes have been made in order to align the relevant
parts of this specification more closely with other relevant
specifications, including especially the corresponding
sections of <bibref ref="structural-schemas"/>.</p>
</item>

</ulist>


<p>
    <phrase diff="add" dg="wgi-20080613">The  
    <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2006/WD-xmlschema11-2-20060217/">previous
    working draft</loc> of 17 February 2006 was a Last-Call Working Draft which
    elicited numerous comments and suggestions for improvements.  All
    substantive issues have now been resolved, although some editorial
    issues remain open.
    </phrase>
Changes since the previous public Working Draft include the following
</p>
<!--* N.B. these are all already in Appendix I. *-->
<!--* When the Last Call of June 2008 is published, clear this list
    * and remove the preceding comment.  Then just copy change records
    * into this list. *-->
<ulist>

<item diff="add" dg="b5030"><p>
Support has been added for assertions on simple type definitions,
analogous to those allowed by <bibref ref="structural-schemas"/> for complex type definitions.
</p></item>

<item>
<p>The requirements of conformance have been clarified in various
ways. </p>
<p diff="add" dg="b5585">A distinction is now made between
<termref def="key-impl-def"/> and <termref def="key-impl-dep"/> features, and a list of
such features is provided in <specref ref="idef-idep"/>.</p>
<p diff="add" dg="b5585">Requirements imposed on host languages which
use or incorporate the datatypes defined by this specification are
defined.</p>
<p diff="add" dg="b3220">The definitions of <rfc2119>must</rfc2119>, <rfc2119>must not</rfc2119>, and
<termref def="dt-error"/> have been changed to specify that processors <rfc2119>must</rfc2119> detect and
report errors in schemas and schema documents (although the quality
and level of detail in the error report is not constrained).</p>
</item>

<item diff="add" dg="b3251">
<p>Conforming implementations <rfc2119>may</rfc2119> now support <termref def="dt-primitive"/> datatypes
and facets in addition to those defined here.
</p>
</item>

<item diff="add" dg="b3659">
<p>A number of syntactic and semantic errors in some of the regular
expressions given to describe the lexical spaces of the <termref def="dt-primitive"/>
datatypes have been corrected.
</p>
<p>
The character sequence <string>+INF</string> has been added to the
lexical spaces of <dtref ref="float"/> and <dtref ref="double"/>.
</p>
</item>

<item diff="add" dg="b1889">
<p>Parts of the grammar of regular expressions given in
<specref ref="regexs"/> has been revised for clarity.
The set of legal regular expressions has not been changed
since the previous Working Draft.
</p>
</item>

<item diff="add" dg="b4395">
<p>The lexical mapping of the <dtref ref="QName"/> datatype,
in particular its dependence on the namespace bindings in
scope at the place where the <termref def="dt-literal"/> appears, 
has been clarified.
</p>
</item>

<item diff="add" dg="b3025">
<p>The characterization of <termref def="dt-lexical-mapping">lexical mappings</termref> has been revised to say
more clearly when they are functions and when they are not, and when
(in the <termref def="dt-special"/> datatypes) there are values in the <termref def="dt-value-space"/> not
mapped to by any members of the <termref def="dt-lexical-space"/>.
</p>
</item>

<item diff="add" dg="b2046">
<p>The nature of equality and identity of lists has been clarified.</p>
</item>

<item diff="add" dg="b3222">
<p>Enumerations, identity constraints, and value constraints now use
equality-based comparisons, not identity-based comparisons, in cases
where there is a difference between identity and equality.
</p>
</item>

<item diff="add" dg="b3228">
<p>The mutual relations of lists and unions have been clarified, in
particular the restrictions on what kinds of datatypes <rfc2119>may</rfc2119> appear as
the <termref def="dt-itemType"/> of a list or among the <termref def="dt-memberTypes"/> of a union.
</p>
</item>

<item diff="add" dg="b2861">
<p>Unions with no member types (and thus with empty
<termref def="dt-value-space"/> and <termref def="dt-lexical-space"/>) are now explicitly allowed.
</p>
</item>

<item diff="add" dg="b3235">
<p>Cycles in the definitions of <termref def="dt-union">unions</termref> and in the
derivation of simple types are now explicitly forbidden.
</p>
</item>

<item diff="add" dg="wgi-20080613">
<p>Errors have been corrected in the description of the
canonical mapping of <dtref ref="decimal"/>.
</p>
</item>

<item diff="add" dg="wgi-20080613">
<p>A variety of clarifications have been introduced connected
with the terms <quote>finite-length</quote>,
<quote>actual value</quote>,
<quote>type</quote>,
<quote>datatype</quote>,
<quote><termref def="dt-specialvalue"/></quote>,
and others.
</p>
</item>
    
<item diff="add" dg="wgi-20080613">
<p>A number of minor errors and obscurities have been fixed.</p>
</item>

<!--*
<item>
<p>[No changes made yet; the body of this document is the same
as that of the most recent public draft.]</p>
</item>
*-->

</ulist>   


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

<p dg="qd3hax">Comments on this document should be made in
W3C's public installation of Bugzilla, specifying "XML Schema" as the
product. Instructions can be found at <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/XML/2006/01/public-bugzilla">http://www.w3.org/XML/2006/01/public-bugzilla</loc>. If access to
Bugzilla is not feasible, please send your comments to the W3C XML
Schema comments mailing list, <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="mailto:www-xml-schema-comments@w3.org">www-xml-schema-comments@w3.org</loc> 
(<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://lists.w3.org/Archives/Public/www-xml-schema-comments/">archive</loc>)
<phrase diff="add" dg="wgi-20080613">and note explicitly that
you have not made a Bugzilla entry for the comment.</phrase>
Each Bugzilla entry and email message should contain only one
comment.</p>
<p dg="wd4hax">The end of the Last Call review period
is 12 September 2008; comments received after that date will be
considered if time allows, but no guarantees can be offered.</p>

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

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

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

<p>This document was produced <phrase diff="add" dg="wgi-20080613">by
a group operating</phrase> under the <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</loc>. The Working Group maintains a <loc xmlns:xlink="http://www.w3.org/1999/xlink" role="disclosure" href="http://www.w3.org/2004/01/pp-impl/19482/status">public list of
<phrase diff="add" dg="wgi-20080613">any</phrase> patent
disclosures</loc> made in connection with 
<phrase diff="del" dg="wgi-20080613">this document</phrase><phrase diff="add" dg="wgi-20080613">the deliverables of the group</phrase>; 
that page also includes instructions for disclosing a patent.  An individual who
has actual knowledge of a patent which the individual believes
contains <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</loc> <phrase diff="del" dg="wgi-20080613">with respect 
to this specification</phrase> must
disclose the information in accordance with <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 
6 of the W3C Patent Policy</loc>. </p>

<!--* 
<p>Patent disclosures relevant to this specification may be found on
the Working Group's <loc role="disclosure"
href="http://www.w3.org/2004/01/pp-impl/19482/status">Patent
disclosure page</loc> in conformance with the <loc
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">W3C Patent
Policy</loc> of 5 February 2004.  An individual who has actual
knowledge of a patent which the individual believes contains Essential
Claim(s) with respect to this specification should disclose the
information in accordance with <loc
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 
6 of the W3C Patent Policy</loc>.</p>
      *-->
<!--* <p>In accordance with 
<loc href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Exclusion">section 
4 of the W3C Patent Policy</loc>, Working Group participants have 150
days from the title page date of this document to exclude essential
claims from the W3C RF licensing requirements with respect to this
document series. Exclusions are with respect to the exclusion
reference document, defined by the <loc href="http://www.w3.org/Consortium/Patent-Policy-20040205/">W3C Patent
Policy</loc> to be the latest version of a document in this series
that is published no later than 90 days after the title page date of
this document.</p> *-->

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

</status>

<abstract>
<p>
<emph>XML Schema: Datatypes</emph> is part 2 of the specification of
the XML Schema language. It defines facilities for defining datatypes
to be used in XML Schemas as well as other XML specifications. The
datatype language, which is itself represented in XML<!--*
* material suppressed here by diff group rq152a *
*-->, provides a superset of the
capabilities found in XML<!--*
* material suppressed here by diff group rq152a *
*-->
document type definitions (DTDs) for specifying datatypes on elements
and attributes.
<!--* <issue id="RQ-152i" role="1.1">
  <p><loc href="&reqs;#xml1.1" target="reqs">RQ-152 (xml1.1)</loc></p>
  <p>How should this specification be aligned with XML 1.1?  The
changes in character set and name characters, and the question of what
determines which ones to use, must be addressed.</p>
 </issue> *--></p>
</abstract>
<langusage>
<language id="EN">English</language>
      <language id="ebnf">Extended Backus-Naur Form (formal grammar)</language>
</langusage>
<revisiondesc>
<slist>
<sitem id="telltale">A 'telltale' diff group is for use labeling phrases
which tell the reader which proposal / requirement / issue a change is
connected with.  It's intended for use when we provide only a single 
version of the spec with diff markup for several relatively small changes.
To distinguish changes related to RQ-nnn from those related to RQ-kkk
in the same display text, use 
<!--*
* material suppressed here by diff group telltale *
*-->
or 
<!--*
* material suppressed here by diff group telltale *
*-->
(or rather dg="rqnnn-telltale)
near the changes.  (This assumes the changes aren't anywhere near each
other; if they are, perhaps they shouldn't be in the same display.)
AFTER THE PRESENTATION FORM OF THE PROPOSALS IS PREPARED, or after the
WG approves the change, THE PHRASE ELEMENTS SHOULD GO AWAY, and
so should the telltale rqnnn-telltale diff group.

The 'telltale' diffgroup is also used (as of 2005-08-25) in the Status
section on the list of proposals included.

This usage proposal is currently (2005-08-25) experimental, but has
been used successfully for a couple of weeks.
For brevity, sometimes the suffix -tt is used instead of -telltale.
</sitem><sitem id="wg-internal">Phrases in status section which apply only to
to WG-internal draft copies.  (Copied into datatypes.xml from structures.xml,
2005-12-14.)</sitem>
<sitem id="diffHacks">Note to the reader: the following 'phrase' elements are 
here for use in supplying diff markup in auto-generated material.  Do not
delete them, and edit them only if you know what you are doing (i.e. if you
have reviewed either the output or the stylesheet or both).

  <phrase diff="add" dg="rec12-tableaux" role="hack" id="odiff_hack"/>
  <phrase diff="add" dg="rec12-tableaux" role="hack" id="idiff_hack"/>
  <phrase diff="add" dg="rec12-tableaux" role="hack" id="arrow_hack"/>
  <phrase diff="add" dg="rec12-tableaux" role="hack" id="odiff_del_hack">doom</phrase>
  <phrase diff="add" dg="rec12-tableaux" role="hack" id="idiff_del_hack">doom</phrase>
  <phrase diff="add" dg="rec12-tableaux" role="hack" id="del_arrow_hack"/>
  <!--* MSM essays a change to wording.  I'm leaving the old words here because
      * I'm not sure the change is an improvement. 
  <phrase diff="add" dg="rec12-tableaux" id="must_not_prose"> with <pt>fixed</pt> values 
as given &mdash; they <rfc2119>must not</rfc2119> be further restricted:</phrase>
  <phrase diff="add" dg="rec12-tableaux" id="may_prose1"> with values as given &mdash; 
they <rfc2119>may</rfc2119> be further restricted:</phrase>
      *-->
  <phrase dg="rec12-tableaux" id="must_not_prose"> with <pt>fixed</pt> values; these
facets <rfc2119>must not</rfc2119> be changed from the values shown:</phrase>
  <phrase dg="rec12-tableaux" id="may_prose1"> with the values shown; these
facets <rfc2119>may</rfc2119> be further restricted in the derivation of new types:</phrase>
  <phrase dg="rec12-tableaux" id="may_prose2"> <rfc2119>may</rfc2119> also
specify values for the
     following</phrase></sitem>
<sitem id="junk">diff group junk:  a few homeless targets; should
probably ALWAYS BE SHOW unless nothing is, or it is empty</sitem>
<sitem id="errata-2e">Some changes (assumed to be 2e) which were
marked without a diff group; this diff group added so as to control
them better.</sitem>
<sitem id="fa1">diff group fa1:  RQ-24 facets proposal, changes
made BEFORE the publication of the first public working draft.
APPROVED SOME TELECON 2004-10</sitem>
<sitem id="fa1.z">diff group fa1:  RQ-24 facets proposal, changes
made AFTER the publication of the first public working draft. APPROVED
SOME TELECON 2004-10</sitem>
<sitem id="cvs1">diff group cvs1:  Constructed Values Appendix
(div1)</sitem>
<sitem id="cvs1_pwd">diff group cvs1_pwd:  Constructed Values Appendix
as a whole (to avoid nested like-named diffs)</sitem>
<sitem id="num1">diff group num1:  Numerical Values Appendix
(div2); requires cvs1</sitem>
<sitem id="numap1">diff group numap1:  in-text productions, etc.,
first cut; requires funbase, nu1, num1</sitem>
<sitem id="funbase">diff group funbase:  The functions appendix
in its entirety.  ALWAYS ACCEPT OR SHOW</sitem>
<sitem id="nu1">diff group nu1:  basic numerical functions;
requires funbase, num1, cvs1</sitem>
<sitem id="du0">diff group du0:  first Ph 2 for duration;
requires numap, nu1, num1, funbase. NOT YET MARKED;  APPROVED
pre-FPWD</sitem>
<sitem id="du0.ysc">year-sec conformance note.  Distinguished from du0
to allow special treatment to preserve links.  The record is sadly
unclear.</sitem>
<sitem id="du0_prodigal">diff group du0_prodigal marks a paragraph
which was inadvertently marked 11 Jan as added by du1 and thus omitted
from the Feb. draft, since du1 was not status quo in Feb 2005.  It
needs to be distinct from the rest of du0 because it needs to shown as
added against the Feb WD.</sitem>
<sitem id="du1">diff group du1:  second set of revs for duration
(compare du2)</sitem>
<sitem id="du2">diff group du2:  second set of revs for
dayTimeDuration and yearMonthDuration (compare du1)</sitem>
<sitem id="dudt">diff group dudt:  function for adding duration to dateTime</sitem>
<sitem id="dudt_g">(experimental) diff group dudt_g: movement of prose
commentary from the existing appendix G into the new statement of the
algorithms (the new locations will be marked as add with this diff
group, but I plan to show that diff group as 'post' so as not to color
the paragraphs)</sitem>
<sitem id="dudt2">(experimental) diff group dudt2: revision of prose
commentary moved from the existing appendix G into the new statement
of the algorithms</sitem>
<sitem id="rq122d_sg">Corrections suggested by Sandy Gao's review of
proposal RQ-122-d for new duration algorithm.</sitem>
<sitem id="dt1">diff group dt1:  RQ-13 date/time rewrite, first
part Ph 2 (d/t app and gDay); requires funbase, nu1, num1; APPROVED
2004-08-27 FTF</sitem>
<sitem id="dt2">diff group dt2:  RQ-13 date/time rewrite, second
part Ph 2 (time and others); requires dt1, funbase, nu1, num1</sitem>
<sitem id="dtr">diff group dtr:  date/time nonnormative
description (INCLUDES 2 NORMATIVE TABLES); requires dt1</sitem>
<sitem id="dt3">diff group dt3:  RQ-13 date/time rewrite, third
part Ph 2 (time and others); requires dt1, dt2, funbase, nu1,
num1</sitem>
<sitem id="dt2-3">diff group dt2-3:  RQ-13 date/time rewrite,
third part of the phase-2 proposal (time and others).  This diff group
marks (as 'del') a single item which was added in dt2 and then delled
in dt3. Accept (i.e. display as "post") as a rule, but reject it (show
as "pre") if dt2 is accepted and dt3 is rejected, and show it
(show="colour") if dt2 is accepted and dt3 is set to 'show'.
[2006-10-06: no longer in use (it shows up now only on an issue 
element which has been commented out).  This entry retained for
historical reasons and sentimentality, but it's probably just 
cruft.]
</sitem>
<sitem id="dt4">diff group dt4:  RQ-13 date/time rewrite, fourth
part Ph 2 (time and others); requires dt1, dt2, dt3, funbase, nu1,
num1</sitem>
<sitem id="pd1">diff group pd1:  RQ-31 precisionDecimal first cut
for approval; co-requires pre, pd2, pd3; requires pdf</sitem>
<sitem id="pdo">diff group pdo:  RQ-31 precisionDecimal first
cut, deletion of old decimal; co-requires pre, pd1 ,pd3; requires pdf.
2005-01-20: WG chooses two-primitive approach, rejects this change.
2005-01-26: MSM removes this diff group to reduce cruft in the
document.
</sitem>
<sitem id="pd2">diff group pd2:  RQ-31 precisionDecimal first cut, 
addition of new aPDecimal; co-requires pre, pd1, pd2; requires pdf.
2005-01-20: WG chooses two-primitive approach, rejects this change.
2005-01-26: MSM removes this diff group to reduce cruft in the document.
</sitem>
<sitem id="pre">diff group pre:  Precision Appendix; co-requires pd1, 
requires num1 and cvs1.
Final wording approved (with changes) 2005-02-04.</sitem>
<sitem id="pdf">diff group pdf:  numerical functions just for 
precisionDecimal (RQ-31); requires num1 (??).
Final wording approved (with changes) 2005-02-04.</sitem>
<sitem id="pdf_m">diff group pdf:  numerical functions for 
precisionDecimal (RQ-31) in two-primitive form.
Final wording approved (with changes) 2005-02-04.</sitem>
<sitem id="pdf_u">diff group pdf:  numerical functions for
precisionDecimal (RQ-31) in single-primitive form.  Removed 2005-01-26
after WG chose two-primitive form.</sitem>
<sitem id="aat">diff group aat:  anyAtomicType (RQ-???); may require fa1 ??    
APPROVED with changes FTF 2004-11-10.
Changes decided by WG entered (as aatf), 2005-01-25.
Draft final wording approved (with changes) 2005-02-04.
</sitem>
<sitem id="aat1">diff group aat1:  anyAtomicType (RQ-???); requires aat</sitem>
<sitem id="trm1">diff group trm1:  terminological cleanup begun
with tightening meaning of derived (RQ-120); </sitem>
<sitem id="rq31facets">diff group rq31facets: with MSM's proposed
changes related to facets of precision decimal.  This takes a
single-primitive ('unitarian') view of precision decimal and legacy
decimal (here under the name aPdecimal). Compatible with both rq31m
and rq31u.</sitem>
<sitem id="rq31u">diff group rq31u: with changes for a one-primitive
('unitarian') version of precision decimal.  Incompatible with: rq31m,
which takes the manichean view. Assumes: pd1, pd2, pre, pdf, num1,
pdo(which deletes old decimal), pd2 (which inserts new aPDecimal). The
WG chose the Manichean decimal proposal over the Unitarian one,
2005-01-20.  Diffs for group rq31u were removed 2005-01-26.
</sitem>
<sitem id="rq31m">diff group rq31m: with changes for a two-primitive
('manichean') version of precision decimal.  Incompatible with: rq31u,
which takes the unitarian view, pdo, which deletes old decimal, pd2,
which inserts new aPDecimal. Assumes: pd1, pre, pdf, num1. Final
wording approved (with changes) 2005-02-04.
</sitem>
<sitem id="fa1-fix">diff group fa1-fix: MSM's proposed changes for
fixing problems (missing term definitions, in particular) caused by
the fact that fa1 was incomplete and left the document in an unstable
state.</sitem>
<sitem id="iff">diff group iff: with an editorial proposal
(2005-01-01) for being more consistent about the use of conditionals
and biconditionals.  When terms are being defined (whether or not
marked as termdefs) or necessary and sufficient conditions for some
state are being given (e.g. in constraint notes, which define terms
like 'facet valid with respect to X'), this diff group proposes to use
'if' only for conditions which are sufficient but not necessary; if
the conditions are both sufficient and necessary, then use 'if and
only if'.</sitem>
<sitem id="pdf_tweak">diff group pdf_tweak: for proposed improvements
to diff group pdf (all gone away now, and then come back again). Final
wording approved (with changes) 2005-02-04. </sitem>
<sitem id="review">diff group review: for marking stuff that is really intended
only for editorial review (usually to be used on ednotes).</sitem>
<sitem id="wdd">diff group wdd: for working-draft deviations:  changes
between the publication of the first public WD in July and the advent
of thorough and permanent change markup.  (Diff group wdd begun 9
January 2005, but diff not completed.  It was looking like another
three hours work.)  I.e. wdd should mark all and only those
differences between TR/2004/WD-xmlschema11-2-20040716/datatypes.xml
and xse/datatypes/datatypes.xml which are not already marked.  When we
run the result through the dg.xsl filter with wdd set to reject, the
result should be (modulo whitespace and other non-significant
differences) substantively the same as the public WD.
</sitem>
<sitem id="dpno">diff group dpno: change proposals transferred into
this file from the experimental fork datatypes.newOrg.xml. At the
moment, the quasi-systematic changes of ID have not been
reproduced.</sitem>
<sitem id="fpwd-rescinded-add">diff group fpwd-rescinded-add: marks
some paragraphs added in the first public working draft but since
deleted again.</sitem>
<sitem id="fpwd-rescinded-del">diff group fpwd-rescinded-del: marks
some paragraphs marked as deleted in the first public working draft
but since restored.</sitem>
<sitem id="aatf">diff group aatf: anyAtomicType (RQ-141).  Changes
decided on by WG at Redwood Shores ftf 2004-11-10. Draft final wording
approved (with changes) 2005-02-04.</sitem>
<sitem id="aatj">diff group aatj: anyAtomicType (RQ-141).  Proposal
for change, submitted to WG at Brisbane, January 2005 (hence the 'j').
Final wording approved (with changes) 2005-02-04. (The single use of
this got commented out later, I suspect because it was merely a change
to a non-sq proposal and doesn't need special processing in future
publications.  I leave this entry here and the commented-out text in
the body of the doc out of a sense of historical piety or something.
Later we'll rip them out.)</sitem>
<sitem id="aatg">diff group aatg: anyAtomicType (RQ-141).  Changes to
correct errors found in review of aatf, including changes agreed by WG
in telcon of 2005-02-04 when the RQ-141 proposal was approved.</sitem>
<sitem id="vrd">diff group vrd: make validation rules declarative. Not
yet complete.  Stems from rq31m edits:  first cut at editing the upper
and lower bounds facets included reformulation of the validation rules
to talk about numeric value.  When the order relation for numeric
values and pDecimal values was defined, however, it became clear that
the validation rules didn't need that change, and the remaining change
(making them declarative) didn't really have anything to do with
anyAtomicType.</sitem>
<sitem id="fpwd">diff group fpwd: used to mark things that changed
between 1.0 2E and the first public working draft of July 2004. (N.B.
issues elements and editorial notes are not consistently marked as
added.  They may consistently be unmarked.)</sitem>
<sitem id="rq001">diff group rq001: marks a phase-2 proposal to
resolve requirement RQ-001, adopted by the WG on 2 March 2004.</sitem>
<sitem id="rq31fix">diff group rq31fix: marks some wording changes
intended to address problems identified by Dave Peterson, Sandy Gao,
and Noah Mendelsohn after the draft final wording for RQ-31 went to
the WG.</sitem>
<sitem id="ep01">Micro-component-related changes (no longer in use
here, I think)</sitem>
<sitem id="ep01-part2">Micro-component-related changes specifically in
part 2.  Split off from the preceding 2005-06-07, so that the status
quo for Structures can continue to show ep01 as a non-status-quo
change, while for Datatypes it can be suppressed silently.</sitem>
<sitem id="ep01.add.ep01.del">Hack for section 4.4, added by EP-01 and
then removed from the EP-01 proposal.  On 2005-08-29 MSM believes
section 4.4 was never part of the status quo and can be deleted
entirely. This hack is temporary, and only needs to be kept while we
still have a residue of doubt about the question.</sitem>
<sitem id="wd2hax">Last-minute hacks to make the Working Draft of
February 2005 be valid and produce valid clean HTML.</sitem>
<sitem id="rq120">MSM's draft phase-2 proposal for RQ-120, which uses
'ordinary' as the general term for non-special types and 'constructed'
as the general term for types of classes 3 and 4.</sitem>
<sitem id="rq120c">Bits of the RQ-120 proposal which should only be
included if rq120o is excluded.</sitem>
<sitem id="rq120o">An alternate form of the phase-2 proposal for
RQ-120, which uses 'ordinary' for classes 3 and 4.</sitem>
<sitem id="rq120fix">Changes made in the course of our work on RQ-120
that were not marked as changes at the time. Some from version 152
(davep), some from version 144 (cmsmcq). Found and marked 26 August
2005.
</sitem>
<sitem id="lm.rel">lm.rel:  For making lex maps not functions.</sitem>
<sitem id="flfix">flfix: value/lexical space and lex/canon mappings
for float and double.</sitem>
<sitem id="flfix-tt">flfix-tt: comments only for flfix approval
cycle.</sitem>
<sitem id="lp">lp:  Introduction of 'literate programming' markup. A
purely internal change: no change to presentation or substance of the
material.  Thus no need for WG review or approval; marked here solely
for editorial convenience.</sitem>
<sitem id="rq20">Addition of type definitions for the two new totally
ordered subtypes of duration; completes satisfaction of RQ-20.</sitem>
<sitem id="rq20ep">Changes made en passant in the schema document for
schema documents and the DTD for schema documents, while doing
RQ-20.</sitem>
<sitem id="rq20rb">Changes which had been made in the externally
stored version of the schema document for schema documents and the DTD
for schema documents, which MSM found while doing RQ-20 and which MSM
proposes to roll back (subject to objection from the other editors).
To roll them back, display rq20rb as 'pre'.</sitem>
<sitem id="rq20ids">Addition of id attributes on the declarations of
the two new totally ordered subtypes of duration, done on editorial
initiative 2006-01-09.</sitem>
<sitem id="rq123">Changes for RQ-123 (allow year 0000).
Approved 17 June 2005.</sitem>
<sitem id="wd17">Resolution of issue wd-17 (changes to description of
value space of duration), including amendments of 29 April
2005.</sitem>
<sitem id="noleap">Changes for task 2-122-a remove leap seconds.
Decided by WG at Tech Plenary, action TP5-4.</sitem>
<sitem id="rq122a_sg">Corrections arising from Sandy Gao's comments on
proposal RQ-122a.</sitem>
<sitem id="dt3-del-noleap">Changes originally added by dt3 and deleted
by noleap. It was set as "del" for generating the noleap proposal.
After the proposal was accepted, the single occurrence of this diff
group was changed to "add". The dg-approved file should (and does)
show this dg as "pre"). </sitem>
<sitem id="idleap">Changes for alternate text: leap second support is
implementation defined.  (Prepared on spec, in case the WG changes
plans.)  The SQL spec says <quote>Whether an SQL-implementation
supports leap seconds, and the consequences of such support for date
and interval arithmetic, is <termref def="key-impl-def"/>.</quote> Short and
sweet.</sitem>
<sitem id="leapseconds">Addition of proper bibliographic reference to
ITU-R TF.460-6, which defines UTC.</sitem>
<sitem id="totl">Correction to timeOnTimeline function
(off by one error in step 3b).</sitem>
<sitem id="wd-2">Fix for wd-2 (add value constraint to list of duties
performed by identity checking).</sitem>
<sitem id="wd-3">Fix for wd-3 (wording in section 2.2.1 about
identity of values across types)</sitem>
<sitem id="wd-4">Fix for wd-4.</sitem>
<sitem id="wd-5">Fix for wd-5.</sitem>
<sitem id="wd-11">Fix for wd-11 (fundamental facets).</sitem>
<sitem id="wd-19">Fix for wd-19 (base64).</sitem>
<sitem id="wd-21">Fix for wd-2 (canonical form health warnings for
QName and NOTATION).</sitem>
<sitem id="wd-23">Fix for wd-23 (misleading / erroneous labels in the
table of applicable facets). Most changes are actually in dg.xsl and
xmlschema.xsl, not here.  Approved 2005-06-17.</sitem>
<sitem id="wd25">Fix for wd-25 (pointing to IRI spec).</sitem>

<sitem id="partialfix">Fix for handling of partial
implementations.</sitem>
<sitem id="partialfixfix">Post-hoc marking of changes made at the same
time as partialfix (rev 1.7.2.183) which were accidentally left
unmarked.</sitem>
<sitem id="partialfixfixfix">Minor repair to the partial-fix proposal
agreed on during ftf meeting 30 January 2006.</sitem>
<sitem id="rq150c.add.partial.del">Material introduced by 150c
which was deleted (moved) by partialfix.</sitem>
<sitem id="decfix">Fix for facet-sensitive canonical mapping for
decimal, and text cleanup. (RQ-150, part of RQ-21)</sitem>
<sitem id="decfix_movement">Movement of data for decfix diff group.
Show as pre or post, not as colour (unless you want to make it
impossible to follow the fine-grained changes).</sitem>
<sitem id="rq31m_decfix_movement">Movement of data for decfix diff
group. This paragraph was originally added by rq31m, and moved by
decfix. It was then deleted by rq21-lexmaps. Show accordingly.</sitem>
<sitem id="context">Lexmaps for context-sensitive QName and ENTITY,
and Canonmap for facet-sensitive decimal.</sitem>
<sitem id="rec12-main">RQ-141b Changes to reconcile overlap/conflict
between parts 1 and 2 -- various items.  Much of this was accepted by
the WG in Edinburgh 2005-09 as part of the omnibus proposal of 31
August. The parts that were not have been relabeled
rec12-main-excepted.</sitem>
<sitem id="rec12-main-excepted">RQ-141b Changes to reconcile
overlap/conflict between parts 1 and 2 -- various items which were not
accepted as part of the omnibus proposal of 31 August (they were
'excepted' from the decision to approve the omnibus).</sitem>
<sitem id="rec12-tableaux">RQ-141b Changes to reconcile
overlap/conflict between parts 1 and 2 -- provide better facet
information in section 3</sitem>
<sitem id="rec12-map">RQ-141b Changes to reconcile overlap/conflict
between parts 1 and 2 -- fix long-standing problems with mapping rules
in 4.1.2.  Every section in which this diff group appears was excepted
from the approval of the omnibus proposal in Edinburgh.  (That is why
this diff group has not been split in two the way rec12-main has
been.)</sitem>
<!--* <sitem id="rec12-map">RQ-141b Changes to reconcile overlap/conflict between parts 1 
and 2. Fix long-standing problems with mapping rules in 4.1.2</sitem> *-->
<sitem id="rec12-map-1853">
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=1853">define
'ancestor'</loc></sitem>
<sitem id="dpno.del.rec12-map.del">dpno.del.rec12-map.del:
portmanteau hack for paragraphs deleted by dpno (but still not in the
status quo) and deleted (again) by rec12-map; these are currently
marked del, so make this diff group's disposition equal to that of
rec12-map.</sitem>
<sitem id="dpno.add.rec12-map.del">dpno.add.rec12-map.del:
portmanteau hack for paragraphs added by dpno and deleted by
rec12-map.  These are currently marked 'add', so to show rec12-map,
make this diff group 'pre'.</sitem>
<sitem id="rec12-tt">A telltale for sections with a lot of rec12-map
and rec12-main changes.</sitem>
<sitem id="rq100">rq100: changes to achieve requirement RQ-100
canonical form for language.  Approved with changes 2005-08-26.
</sitem>
<sitem id="wd-23-bis">wd-23-bis: another attempt to fix the table of
applicable facets</sitem>
<sitem id="wd26">wd26: restore the notion of 'duration' in describing
timezones. Approved 1 July 2005.</sitem>
<sitem id="wd31">wd31: recast sentences about to Unicode database
changes. Approved 1 July 2005.</sitem>
<sitem id="sfs-cleaning">sfs-cleaning: trying to synch the schema for
schemas with recent changes found when checking ht's rec12
changes</sitem>

<sitem id="rq21-lit">rq21-lit: define 'literal' properly and use it to
denote the members of lexical spaces (some diffs are in local.dtd,
specifically the change in the entity declaration 'string' from
'character string' to 'literal'). When this diff group goes to the WG,
we must remember to note that the change proposed includes changing
each occurrence of the word 'literal' in the running prose (not in the
tableaux) to a termref.  Those changes can be reverted easily and we
would like not to show them in the diffed WD. (They also lack any
telltale in the formatted proposal.) Approved by WG 26-28 Sept 2005 in
Edinburgh as part of omnibus proposal of 31 August.
</sitem>
<sitem id="rq21-lexmaps">rq21-lexmaps:  editorial proposal to make
references to lexical and canonical mappings lighter weight. Approved
by WG 26-28 Sept 2005 in Edinburgh as part of omnibus proposal of 31
August.</sitem>
<sitem id="rq31m.add.rq21-lexmaps.del">rq31m.add.rq21-lexmaps.del:
special diff group for material added by rq31m and re-deleted by
rq21-lexmaps. For this and the following analogous diff groups, be
careful how you color them. Approved by WG 26-28 Sept 2005 in
Edinburgh as part of omnibus proposal of 31 August.</sitem>
<sitem id="rq31fix.add.rq21-lexmaps.del">rq31fix.add.rq21-lexmaps.del:
special diff group for material added by rq31fix and re-deleted by
rq21-lexmaps. Approved by WG 26-28 Sept 2005 in Edinburgh as part of
omnibus proposal of 31 August.</sitem>
<sitem id="du0_prodigal.add.rq21-lexmaps.del">du0.prodigal.add.rq21-lexmaps.del: 
special diff group for material added by du0.prodigal and re-deleted
by rq21-lexmaps. Approved by WG 26-28 Sept 2005 in Edinburgh as part
of omnibus proposal of 31 August.</sitem>
<sitem id="du0_prodigal.add.rq21-lexmaps.add">du0.prodigal.add.rq21-lexmaps.del: 
special diff group for material added by du0.prodigal and by
rq21-lexmaps. Show as colour for the second of these to be considered.
Approved by WG 26-28 Sept 2005 in Edinburgh as part of omnibus
proposal of 31 August.</sitem>
<sitem id="du0_prodigal2.add.rq21-lexmaps.del">du0.prodigal2.add.rq21-lexmaps.del: 
special diff group for material added by du0.prodigal2 and re-deleted
by rq21-lexmaps. It could probably have been changed silently, but I
wanted to be careful. Since prodigal2 has not been approved at the
time rq21-lexmaps is proposed, the disposition file will leave this as
pre.  If rq21-lexmaps is approved, this group should never become
colour or post; see next item. rq21-lexmaps WAS approved by WG 26-28
Sept 2005 in Edinburgh as part of omnibus proposal of 31 August, so
this should never be colour or post, always pre. [Correction,
2006-01-10:  the material marked prodigal2 was included in the
duration proposal approved by the WG on 18 December 2003. So today I
have reviewed all the diff groups related to it and made sure
prodigal2 appears in the status quo documents (for the first time in a
long time, if ever) unless later overridden.  Leave this one pre.]
</sitem>
<sitem id="du0_prodigal2.add.rq21-lexmaps.add">du0.prodigal2.add.rq21-lexmaps.del: 
special diff group for material added by du0.prodigal2 and revised by
rq21-lexmaps. If and when du0_prodigal2 is sent to the WG, make this
show as a colored addition. [No, p2 was approved.  Show this approved
after 200502]</sitem>
<sitem id="dt3.add.rq21-lexmaps.del">dt3.add.rq21-lexmaps.del: special
diff group for material added by dt3 and re-deleted by rq21-lexmaps.
Approved by WG 26-28 Sept 2005 in Edinburgh as part of omnibus
proposal of 31 August.</sitem>

<!--* MSM renames old str-bool-fix to rq21-string and -boolean, since
    * they are not actually bug fixes but part of fulfilling a new requirement.
    *-->
<sitem id="rq21-string">rq21-string: new lexical/canonical mappings
for string; requires moreFunctions DG as well. Approved by WG 26-28
Sept 2005 in Edinburgh.</sitem>
<sitem id="rq21-string-hack">rq21-string-hack: dummy diff group:  for
some text which has moved, avoid showing it as new text in the new
location, but mark it as an add so that if rq21-string is rejected,
the movement can be rejected.  If rq21-string is set to post, set this
to post. If to pre, set this to pre.  If to colour, set this to
post.</sitem>
<sitem id="b1902amend">b1902amend: amendments to the proposal for bug
1902 (RQ-21 for string) approved in Edinburgh.</sitem>

<sitem id="rq21-boolean">rq21-boolean: new lexical/canonical mappings
for boolean; requires moreFunctions DG as well. Approved by WG 26-28
Sept 2005 in Edinburgh as part of omnibus proposal of 31
August.</sitem>

<sitem id="moreFunctions">moreFunctions: adds another subsection after
numeric and d/t in functions appendix; show this whenever rq21-string,
rq21-boolean, or context are to be shown.</sitem>
<sitem id="du0_prodigal2">du0_prodigal2: continues resurrection of
lost duration stuff.  [Note, 2006-01-10:  the material marked
prodigal2 was included in the duration proposal approved by the WG on
18 December 2003. It has not been included in recent status-quo
documents, though, because until today it was not clear that the
material was in fact reviewed and approved.]
</sitem>
<sitem id="rq126">rq126: health warning about restricting away
canonical forms.</sitem>
<sitem id="rq140">rq-140: distinguishing negative from positive zero.
An attempt at a minimum-needed proposal added by MSM. Approved by WG
26-28 Sept 2005 in Edinburgh as part of omnibus proposal of 31
August.</sitem>
<sitem id="rq150c">rq-150c: require minimum support in
precisionDecimal. Approved with amendments by WG 26-28 Sept 2005 in
Edinburgh.
</sitem>
<sitem id="rq152a">rq152a: quick initial change of 'XML 1.0' to 'XML'
in abstract, done long ago (2004?) but not associated with a diff
group til 2005-08-27. (Other appearances of that string are
machine-generated for bibliographic references, don't get diff
markup.)
</sitem>
<sitem id="ed-pattern">Editorial proposal to replace all occurrences
of 'pattern' as a reference to a defined term with references to the
component.  (Need similar proposal for all the others ...)</sitem>
<sitem id="pattern-1929">pattern-1929: pattern value as set. Follow-on
proposal from RQ-141 reconciliation effort.  Make pattern facet have a
set-valued {value} in place of a regex-valued {value}, so we can have
just one.</sitem>
<sitem id="pattern-1929-fix">deletion of cross references to
src-multiple-patterns and src-multiple-enumerations.  The references
should have been deleted as part of pattern-1929, since their targets
were deleted then.</sitem>
<sitem id="lexMapFacet-1912">Remove lexicalMappings facet. 2006-01-14:
 diff attributes on this diff group changed from del (vis a vis
2005-02) to add (vis a vis 1.0).</sitem>
<sitem id="rq20rb-1912">Portmanteau for former additions destined for
rollback to actual deletions of lexicalMappings facet, ref. bug
1912</sitem>
<sitem id="pd1-1912">Portmanteau for former addition for precision to
actual deletion of lexicalMappings facet, ref. bug 1912. 2006-01-14:
The material was first published in February 2005; with the
publication of the new WD in January 2006, we no longer need to be
able to show this as a deletion:  vis-a-vis 1.0 it's not a deletion,
but a rejected addition / an addition later reverted. So I've changed
the polarity of its diff attribute from del to add.
</sitem>
<sitem id="rq21-specials-1909">RQ-21 (define lexical space and lexical
mappings more precisely) for specials.  Approved with amendments
2006-01-13 (amendments are not marked separately).</sitem>
<sitem id="context-2337">Replacing {scope} with {context} on stds,
ref. bug 2337.</sitem>
<sitem id="ep01-p2.add.context-2337.del">Material added by proposal EP-02 part 2,
but deleted by later context-2337 proposal.  This material was never status-quo.
It's shown as an ADD at the moment.
</sitem>
<sitem id="rec12-map-eff">Amendments to rec12-map agreed at Edinburgh
f2f 2005-09-26</sitem>
<sitem id="rec12-main-eff">Amendments to rec12-main agreed at
Edinburgh f2f 2005-09-26, in sections which were not, ultimately,
approved in Edinburgh.</sitem>
<sitem id="rec12-main-eff-ok">Amendments to rec12-main agreed at
Edinburgh f2f 2005-09-26, in sections which were ultimately approved
in Edinburgh (notably appendix A).</sitem>
<sitem id="enum-2454">Simplify mapping rules for enumeration facet
parallel to changes agreed for pattern</sitem>
<sitem id="rec12-main-dub">Material in the enumeration sections not
approved in Edinburgh (explicitly excepted) but also not actually
incorporated into the enumeration proposal (it was marked nsq, not
colour).  I'm going to swallow hard, though, and treat it as approved
anyway.</sitem>
<sitem id="metachar-2531">Correct Char production (was 10, now 51 or
something) of regex grammar to describe metacharacters
correctly.</sitem>
<sitem id="b2603">Minor editorial change to resolve bug 2603. Approved
by the WG 2005-12-16.</sitem>
<sitem id="sfs-1933">Remove built-in and derived primitives from sForS
proper, relocate in separate appendices/non-schema-documents</sitem>
<sitem id="aux-1933">Auxiliary diff group for bug 1933, to mark the
movement of data.  Normally this should be pre if sfs-1933 is pre,
post if sfs-1933 is post or colour.</sitem>
<sitem id="dup-2214">Deprecate <code>XMLSchema-datatypes</code>.
Wording accepted without change 2006-01-13.</sitem>
<sitem id="edinburgh.refuses.to.die">27 December, reviewing bugs
marked 'decided', I found some changes which had been agreed on in
Edinburgh which had not been made.  If any of these got re-deleted
after Edinburgh, I don't know about it.</sitem>
<sitem id="rec12-map-eff-pentimenti">27 December, reviewing bugs
marked 'decided', I found some changes I would like to make in HT's
execution of the instructions from Edinburgh.  These changes should
(aaaughh!) probably go to the WG.</sitem>
<sitem id="b2533-rq127-r196">Health warning about use of whitespace
facet for tokenizing natural-language data.  Approved for 1.1 in
Toronto (but overlooked by MSM when processing Toronto
minutes).</sitem>
<sitem id="b2044">Bugzilla 2044, R-198, unions of unions</sitem>
<sitem id="b2044-feedback">Feedback request for bugzilla 2044, R-198, 
unions of unions</sitem>
<sitem id="rq152temp">Temporary hack for Bugzilla 1838, RQ-152,
alignment with XML 1.1. We don't have final wording on this yet, but
I've updated the reference to point to XML 1.1, which is at least
consistent with the most recent clear WG decision on the
matter.</sitem>
<sitem id="b2642">Correct typo in description of double range: 2**53
not 2**57.</sitem>
<sitem id="wd3hax">Editorial hacks for publication of WD, 2006-01.
These should be shown coloured in diffed versions.</sitem>
<sitem id="qd3hax">Editorial hacks for publication of WD, 2006-01
which must be silent, NOT shown:  Correct / work around link rot. (We
can't show the old rotten links as links, because they are bad and
will raise linkcheck errors.)</sitem>
<sitem id="b2313.ieee">Bug 2313 Tie precisionDecimal to IEEE754R more
clearly. Wording approved 13 January 2006.</sitem>
<sitem id="b2627">Bug 2627 bad reference in appendix D. Wording
approved 13 January 2006.</sitem>
<sitem id="b2179">Bug 2179 R-185: Question about cardinality of
calendar types (Jeremy Carroll pointed out that gMonthDay, gMonth, and
gDay are not infinite.) Wording approved 13 January 2006.</sitem>
<sitem id="b1834">Bug 1834: clarification of lexical space of unsigned
types.</sitem>
<sitem id="dta">Material in *.nxsd which belongs in the files, but not
in the REC</sitem>
<sitem id="rad-1933">Exploration of removal of annotations from the
builtins in C1 and C2 and consequent fixups.  [N.B. these aren't all
showing as changes in the output, because some of them are within
non-status-quo text.]</sitem>
<sitem id="b1910-hexbin">RQ-21 / Bugzilla 1910 lexical mapping for
hexBinary</sitem>
<sitem id="b1910-hexbin-silent">Silent changes (transpositions) for
RQ-21 / Bugzilla 1910 lexical mapping for hexBinary</sitem>
<sitem id="b1910-hexbin-maybe">Changes for RQ-21 / Bugzilla 1910 which
MSM would rather avoid</sitem>
<sitem id="b1911-b64b">RQ-21 / Bugzilla 1911 lexical mapping for
base64Binary</sitem>
<sitem id="b1911-b64b-silent">Silent changes (transpositions) for
RQ-21 / Bugzilla 1911 lexical mapping for base64Binary</sitem>

<sitem id="b1838">Changes for Bugzilla 1838 = RQ-152 = support for XML
1.1.  Supersedes rq152temp (reverses some of rq152temp, calls out some,
but diffs against status quo without rq152temp, not with it.</sitem>
<sitem id="b2449">Changes for Bugzilla 2449 Datatype valid is broken.
Not sure how close this is to what people had in mind.</sitem>
<sitem id="b2449-vi">Changes for Bugzilla 2449 take VI.</sitem>
<sitem id="b2449-silent">Text movement changes for Bugzilla 2449.</sitem>
<sitem id="eg-1852">End-game resolution of dangling inconsistencies between
parts 1 and 2</sitem>
<sitem id="e2-67-botchfix">Repair error made July 2004 when resynching
this document with late change to 1.0 2E.</sitem>
<sitem id="rec12-main-excepted-rescinded">Part of the 1852 proposal
we withdrew before adopting it.  There's only one, and we should
probably delete it entirely, but I want the rescission to be part
of the CVS record first. -MSM</sitem>
<sitem id="b2250">Resolution of bugzilla 2250, consistency of
formulation for min/max inc/exclusive.  Approved by WG
30 January 2006.</sitem>
<sitem id="b1893">Resolution of bugzilla 1893, R-203: Inconsistency
with constraints on min/maxExclusive. Approved by WG 30 January
2006.</sitem>
<sitem id="fpwd-add-lc-del">Material added in first public working
draft and re-deleted for last call.</sitem>
<sitem id="wd4hax">wd4hax: miscellaneous editorial changes for Last
Call draft</sitem>
<sitem id="wd4hax-lc">wd4hax-lc: miscellaneous editorial changes for Last
Call draft that should not be carried after that</sitem>
<sitem id="wd4edhax">wd4edhax: misc editorial changes prior to Last Call, based on 
NM's comments but not approved by WG or other editors</sitem>
<sitem id="ast-pim">Addition of ptd, itd, and mtd to display
for simple type definitions.  This happened in the WD of 200502 and should
be marked as an add vis-a-vis that WD and vis-a-vis 1.0.</sitem>
<sitem id="b2948">Bug 2948: recast bounds-checking validation rules,
to resolve bug 2948.</sitem>
<sitem id="b3028">Bug 3028: typo in dayTimeDuration lexical space section.</sitem>
<sitem id="b3029">Bug 3029: typo in D.2.2 rule for dayFrag.</sitem>
<sitem id="b3030">Bug 3030: typo in dayTimeDuration lexical space section.</sitem>
<sitem id="b3074">Bug 3074: correction of mis-tagged 'may'.</sitem>
<sitem id="b3077">Bug 3077: editorial nit</sitem>
<!--* Decisions made 15 Sept *-->
<sitem id="b3223">Bug 3223: literals in the value space</sitem>
<sitem id="b3246">Bug 3246: leading plus sign</sitem>
<sitem id="b3254">Bug 3254: consistency of document versions
(no changes made here, the error was in dg-statusquo-color-1.0.xml)</sitem>
<sitem id="b3255">Bug 3255: datatype for seconds component of duration</sitem>
<sitem id="b3257">Bug 3257: 'order with' in 3.3.8.1</sitem>
<!--* 3026 and 3078, decided from Bugzilla 2006-09-29 *-->
<sitem id="b3026">Bug 3026: minimal conf. reqs for duration</sitem>
<sitem id="b3078">Bug 3078: puzzlement over 'ordered' in ordered durations</sitem>
<!--* 2911 decided from Bugzilla 2006-10-06 *-->
<sitem id="b2911">Bug 2911: pattern-valid</sitem>
<!--* 3736 and 3246 decided from Bugzilla 2006-10-13 *-->
<sitem id="b3736">Bug 3736: 'canonical representation' sections.
Also normalize the relevant section title for primitive datatypes
to 'Lexical Mapping'; unfortunately, of those expressing an
opinion on this topic, the majority was tone deaf.  The relevant sections for
the derived types have been left at Lexical representation, because they 
don't in fact talk about the mapping, and strictly speaking the WG
did not instruct that they be changed.</sitem>
<sitem id="rq21-lexmaps.add.b3246.del"/>

<!-- 14 items from consent agendas 2006-11-17 and -12-01 -->
<sitem id="dp200701"> All bugs entered from those CAs, and b3077 which was entered
but didn't make SQ listing before.  Should be pre, except nsq to display
the ednotes near each change which indicate which bug the change is for.</sitem>
<sitem id="b2220">Bug 2220:  change in fractionDigits example</sitem>
<sitem id="b2408">Bug 2408:  forbidden/must-be-absent consistency</sitem>
<sitem id="b2989">Bug 2989:  fix oops! in floatingPointRound function</sitem>

<sitem id="b3225">Bug 3225:  artificial disjointness of primitives explanation</sitem>
<!-- wdd put an error in, now b3225 has to take it back out, presumably preserving
error for diff-against-last-public displays.  :-(
If wdd is pre and b3225 is pre then b3225-wdd should be pre.
(If wdd is pre then presumably b3225 can't be colour or post.)
If wdd is colour and b3225 is pre then b3225-wdd should be colour.
If wdd is colour and b3225 is colour b3225-wdd should be pre.
(If wdd is colour then presumably b3225 can't be post.)
If wdd is post and b3225 is pre then b3225-wdd should be post.
If wdd is post and b3225 is colour then b3225-wdd should be reverse colour.
If wdd is post and b3225 is post then b3225-wdd should be pre.
In order to make the colour or reverse colour work, b3225-wdd-rev should be pre,
except should be post when reverse colour is wanted.  Glah! -->
<sitem id="b3225-wdd">Bug 3225 interacting with wdd</sitem>
<sitem id="b3225-wdd-rev">Bug 3225 interacting with wdd</sitem>
<!--* actually, none of these wrappers are needed.
    * The text has three states:
    * 1 decimal
    * 2 (changed by wdd) precisionDecimal
    * 3 (changed by 3225) decimal
    *
    * for state 1, set wdd and 3225 to pre
    * for state 2, set wdd to colour or post, 3225 to pre
    * for state 3, set wdd to post and 3225 to colour or post
    * if both are set to colour (as in the diff against 1.0), 
    * 
    *-->

<sitem id="b3813">Bug 3813:  lexical mapping vs representation nit</sitem>
<sitem id="b3850">Bug 3850:  two defs of "constraining facet(s)"</sitem>
<!-- ep01-part2 put in a paragraph, now b3850 has to take it back out.
If ep01-part2 is pre and b3850 is pre then  ep01-b3850 should be pre, epo1-b3850-colours pre, ep01-b3850-rev post.
(When ep01-part2 is pre then presumably b3850 can't be colour or post.)
If ep01-part2 is colour and b3850 is pre then ep01-b3850 should be colour, epo1-b3850-colours pre, ep01-b3850-rev post.
If ep01-part2 is colour and b3850 is colour then ep01-b3850 should be pre, ep01-b3850-colours colour, ep01-b3850-rev post.
(When ep01-part2 is colour then presumably b3850 can't be post.)
If ep01-part2 is post and b3850 is pre then ep01-b3850 should be post, epo1-b3850-colours pre, ep01-b3850-rev post.
If ep01-part2 is post and b3850 is colour then ep-01-b3850 should be pre, epo1-b3850-colours pre, ep01-b3850-rev colour.
If ep01-part2 is post and b3850 is post then epo1-b3850 should be pre, epo1-b3850-colours pre, ep01-b3850-rev post.
   (ep01-b3850-colours should be pre except in one instance above.)
   (ep01-b3850-rev should be post except in one instance above.)
Double glah! -->
<sitem id="ep01-b3850">Bug 3850 interacting with ep01-part2</sitem>
<sitem id="ep01-b3850-colours">Bug 3850 interacting with ep01-part2</sitem>
<sitem id="ep01-b3850-rev">Bug 3850 interacting with ep01-part2</sitem>
<sitem id="b3247">Bug 3247:  floating point nbrs description oops!</sitem>
<sitem id="b3252">Bug 3252:  </sitem>
<sitem id="b3258">Bug 3258:  Minor errors/omissions in 3.3.8.4 (dates and times)</sitem>
<sitem id="b3259">Bug 3259:  </sitem>
<sitem id="b3261">Bug 3261:  </sitem>
<sitem id="b3263">Bug 3263:  </sitem>
<sitem id="b3587">Bug 3587:  </sitem>
<sitem id="b3976">Bug 3976:  </sitem>
<sitem id="b3848">Bug 3848:  </sitem>
<!-- b4350 first appealed to in dg200701 group but may be used more later. -->
<sitem id="b4350-1">Bug 4350:  Correcting term to dtref in bulk of datatype defs</sitem>
<sitem id="b4453">Bug 4453:  fixing assorted style inconsistencies</sitem>
<sitem id="b4353ednote">Bug 4453:  should be nsq when b4353 is nsq or colour; otherwise pre</sitem>

<!-- these bugs had fixes approved during the FTF ca 30 Mar 07 -->
<sitem id="b3859">Bug 3859:  oops! in newDateTime</sitem>
<sitem id="b3233">Bug 3233:  Space-separation in lists</sitem>
<sitem id="b2497">Bug 2497:  R-127: Distinction between 00:00:00 and 24:00:00 for time datatype?</sitem>
<sitem id="b3851">Bug 3851:  bug in newDateTime function</sitem>
<sitem id="b3027">Bug 3027:  erroneous date example</sitem>
<sitem id="b3238">Bug 3238:  Unnecessary self-justification</sitem>
<sitem id="appr070331">notes introducing the bugs above. should be nsq while
reviewing said bugs, otherwise pre</sitem>

<!-- these bugs had fixes approved during telcon of 17 August 2007 -->
<sitem id="b3231">Bug 3231:  reference to ISO 11404 deleted</sitem>
<sitem id="b3234">Bug 3234:  enumeration facets for lists</sitem>
<sitem id="appr070824">notes introducing the bugs above. should be nsq while
reviewing said bugs, otherwise pre</sitem>

<!-- bugs fixed during telcon of 7 September 2007 -->
<sitem id="b2728">Bug 2728:  super-/subset constraints missing for born-binary pattern, 
enumeration respectively</sitem>
<sitem id="tt-20070907">labels for these bug fixes.</sitem>

<sitem id="b3224">Draft resolution of issue 3224.</sitem>
<sitem id="b2728-1">WG-approved partial resolution of issue 2728
(missing subset/superset relation on pattern facets).</sitem>
<sitem id="b2728-2">Draft note on issue 2728
(missing subset/superset relation on pattern facets),
for editorial review.</sitem>
<sitem id="b3840">Correct typo in ID of string datatype's whiteSpace facet;
prerequisite for fixing bug 1974.</sitem>

<sitem id="b2947">Recast discussion of ordering to avoid making
the triviality or non-triviality of an ordering seem like a big deal.
</sitem>
<sitem id="b2947b">Follow-on to b2947.</sitem>
<sitem id="b2861">Allow empty unions.</sitem>
<sitem id="b3228">Clarify lists of unions and unions of lists etc.
in 2.4.1 / 2.6.1.</sitem>

<!--* 28 September 2007, changes accepted from Bugzilla *-->
<sitem id="b3230">atomic and decomposability</sitem>
<sitem id="b3237">programming language types</sitem>
<sitem id="b3239a">acyclic type derivation (follow-on work needed)</sitem>

<!--* 26 October 2007, changes accepted from Bugzilla *-->
<sitem id="b3244">sets of lists</sitem>

<!--* ca 20071123, addl proposal for 2947 *-->
<sitem id="d071118">should be nsq during review, pre otherwise</sitem>
<sitem id="b2947-1"/>

<sitem id="b4850">Update reference to RFC 3066.  Also resolves 2439
and 3079.</sitem>
<sitem id="b2576">Clarify relation of xsd:language to xml:lang.</sitem>
<sitem id="b1889">Michael Kay's regex proposal.</sitem>
<sitem id="b1889b">MSM's mods to MK.</sitem>

<sitem id="dg-dgProd">redo of productions used for REs</sitem>

<sitem id="b3265">Length of QNames</sitem>
<sitem id="b3869">XML mapping of annotations:  make it harder to
follow but more correct.  Sigh.</sitem>
<sitem id="b4912">Allow empty unions.  Actually, the only change
still needed is in Structures, but we have an entry here because
we have a tell-tale.</sitem>
<sitem id="b4839">Fix documentation links in schema for schema 
documents.</sitem>
<sitem id="b4986">Fix typo in referring to case (in)sensitivity.</sitem>
<sitem id="b3249">Respond to QT comments on the term 'constant'.</sitem>
<sitem id="b3249a">Variant 'a': tweak definition.</sitem>
<sitem id="b3249b">Variant 'b': just say 'special value'.</sitem>
<sitem id="b3249c">Late amendments, and revision after WG handed it back to us,
including some changes proposed by davep.</sitem>
<sitem id="b4900">Typo in various paternalistic constraints..</sitem>
<sitem id="b3256">BC dates and breaking change.</sitem>
<sitem id="b3266">NOTATION and current schema.</sitem>
<sitem id="b4033">Restore missing 'facets' section for xs:date.</sitem>
<sitem id="b4089">Chop dead references from normative refs.</sitem>


<sitem id="ep26">Misc editorial changes accumulated to date (originally
entered as ep99".

- For "The float [or: double] datatype is the IEEE double-precision
32-bit [64-bit] floating point datatype [IEEE 754-1985] with the minor
exception noted below. Each floating point datatype has a value space
that is a subset of the rational numbers" read "The float [or:
double] datatype is the IEEE double-precision 32-bit [64-bit] floating
point datatype [IEEE 754-1985] with the minor exception noted
below. Its a value space is a subset of the rational numbers".

- others.
</sitem>
<sitem id="ep99">Misc editorial changes MSM would like to propose at some
point.  (Leave them to accumulate, then relabel them and put them in
an editorial proposal.)  
</sitem>
<sitem id="ep999">Misc editorial changes MSM may or may not propose at some
point.  Separate from ep99 for convenience.</sitem>
<sitem id="b5229">delete "with the exception noted below" from
float and double.  Also change 'is' to 'mirrors'.</sitem>
<sitem id="b5322">s/Char/NormalChar/</sitem>
<sitem id="b3950">'fixed' is redundant for length</sitem>
<sitem id="b4764">delete a sentence that should have been deleted by dg 'noleap'.
A casualty of the diffgroup notation and resulting confusions.</sitem>
<sitem id="b3220">'must' and 'error'</sitem>
<sitem id="b3220b">'must' and 'error' possibly separable tweaks</sitem>
<sitem id="b3220c">XML-instance conformance</sitem>
<sitem id="b3220d">late revisions (doesn't really need to be separate?)</sitem>
<sitem id="b3220-aux">some text movement</sitem>
<sitem id="b5062">what facets apply to unions</sitem>
<sitem id="b5062xx">text deleted by WG from b5062</sitem>
<sitem id="b5030">Assertions on simple types</sitem>
<sitem id="b5030a">A: Construct an element node as the XDM</sitem>
<sitem id="b5030b">B: Construct an attribute node as the XDM</sitem>
<sitem id="b5030c">C: Construct a text node as the XDM and use variables</sitem>
<sitem id="b5030d">D: Construct a value and use variables</sitem>
<sitem id="b5030e">E: Use variables, period.</sitem>
<sitem id="b5030f">F: Like D, but always provide an item, even for lists.</sitem>
<sitem id="b5030fx">F: abandoned text for version F.</sitem>
<sitem id="b5030v">v: include $value.</sitem>
<sitem id="b5030z">z: "assertions" is both a lexical and a value facet.</sitem>
<sitem id="b5030m">Tentative additions for b5030 (MSM)</sitem>
<sitem id="b5030-alpha">Type the node as base type</sitem>
<sitem id="b5030-beta">Type the node as primitive or aST</sitem>
<sitem id="b5030-gamma">Type the node as aST</sitem>
<sitem id="b5030-delta">Type the node as untypedAtomic</sitem>
<sitem id="b5030-.i.">Type the node as base type</sitem>
<sitem id="b5030-.ii.">Type the node as primitive or aST</sitem>
<sitem id="b5030-.iii.">Type the node as aST</sitem>
<sitem id="b5030-.iv.">Type the node as untypedAtomic</sitem>
<sitem id="b5030-.v.">Type the node as 'operational type' (nearest built-in)</sitem>
<sitem id="b5030-en">Editorial notes</sitem>
<sitem id="b5030mk">Mike Kay's proposals</sitem>
<sitem id="b5030mk-x">Mike Kay's proposal, abandoned bits (can be deleted later,
but kept for now in case of need)</sitem>
<sitem id="b5030tf">Task force draft proposal</sitem>
<sitem id="b5030tf-x">Task force draft proposal</sitem>
<sitem id="b3251">3251:  <termref def="key-impl-def"/> primitives and facets</sitem>
<sitem id="b3251-idef">3251:  definition of <termref def="key-impl-def"/></sitem>
<sitem id="b5585">5585: clarification of conformance</sitem>
<sitem id="b5150">5150:  clearer statement of normativity</sitem>
<sitem id="b3025">lexical mappings and functions</sitem>
<sitem id="b3227">effability</sitem>
<sitem id="b3243">Definition of anySimpleType</sitem>
<sitem id="b5058">anySimpleType and anyAtomicType value spaces</sitem>
<sitem id="b3025-aux">text movement for effability cluster 3025 et al</sitem>

<sitem id="b3232">type vs datatype</sitem>
<sitem id="b3262">base64Binary</sitem>
<sitem id="b5328">enumeration and aST</sitem>
<sitem id="b2046">list identity and equality</sitem>
<sitem id="b2046-abandoned">list identity and equality</sitem>
<sitem id="b3222">identity and equality, i.e. use equality not identity</sitem>
<sitem id="b3235">acyclic unions</sitem>
<sitem id="b5625">finite-length</sitem>
<sitem id="wgi-20080530">WG editorial instructions after the Long Meeting of 30 May 2008</sitem>
<sitem id="b3659">Regex fixes</sitem>
<sitem id="b3253">Allow +INF</sitem>
<sitem id="b4395">QName lexical mapping health warning.</sitem>
<sitem id="b4451">decimal canonical mapping, fix prose.</sitem>
<sitem id="wgi-20080606">WG editorial instructions after the call of 6 June 2008</sitem>
<sitem id="wgi-20080613">WG editorial instructions after the call of 13 June 2008</sitem>

<sitem id="ep99dp">Unmarked changes perhaps introduced by 
Dave P.</sitem>

<!--* Dummy IDs, solely for validation; any actual use of these _should_ be
        accompanied by a name attribute allowing an xtermref to
        Part 1 to be generated. *-->
<sitem id="td">Type Definition component</sitem>
<sitem id="a">Annotations component</sitem>
<sitem id="ctd">Complex Type Definition component</sitem>
<sitem id="ad">Attribute Declaration</sitem>
<sitem id="ed">Element Declaration</sitem>
</slist>
</revisiondesc>
</header>
<body>


<div1 role="1.0" id="Intro">
<head>Introduction</head>

<!--* <issue id="RQ-21i" role="1.1">
<p><loc href="&reqs;#bnf" target="reqs">RQ-21 (regex/BNF for all primitive types)</loc></p>
<p>Current plan is that all datatypes defined herein will have EBNF
productions at least approximately defining their lexical space, and
will include a nonnormative regex derived from the EBNF if a user
wishes to copy it directly.</p>
</issue> *-->

<!--* <issue id="RQ-24-2i" role="1.1">
<p><loc href="&reqs;#fundamentals" target="reqs">RQ-24 (systematic
facets: canonical representations for all datatypes)</loc></p>
<p>It is not possible for all datatypes to have 
&canonical_representations; of all values without violating the rules of
derivation or adding special-purpose &cfacets; which the WG does not
deem appropriate.&nbsp; The WG has not yet decided how to deal with
datatypes whose lexical and/or &canonical_mappings; are context
sensitive.</p>
</issue> *-->

<!--* <issue id="RQ-148i" role="1.1">
<p><loc href="&reqs;#Truncation-not-defined" target="reqs">RQ-148
(clarify use of "truncation)</loc></p>
<p>The word will probably be removed.</p>
</issue> *-->

<!--* <issue id="RQ-120i" role="1.1">
<p><loc href="&reqs;#term-derived" target="reqs">RQ-120 (consistent
use of "derived)</loc></p>
<p>"Derivations" other than "derivations by restriction" will be
renamed "constructions".</p>
</issue> *-->



<!--* <issue id="RQ-24-4i" role="1.1">
<p><loc href="&reqs;#fundamentals" target="reqs">RQ-24 (systematic
facets: assignment of datatype to nodes without components)</loc></p>
</issue> *-->
<div2 id="intro1.1" dg="fpwd">
<head>Introduction to Version 1.1</head>
<p>The Working Group has two main goals for this version of W3C XML
Schema:</p>
<ulist>
<item><p>Significant improvements in simplicity of design and clarity
of exposition <emph>without</emph> loss of backward <emph>or</emph>
forward compatibility;
</p></item>
<item><p>Provision of support for versioning of XML languages defined
using the XML Schema specification, including the XML transfer syntax
for schemas itself.</p></item>
</ulist>
<p>These goals are slightly in tension with one another -- the
following summarizes the Working Group's strategic guidelines for
changes between versions 1.0 and 1.1:</p>
<olist>
<item><p>Add support for versioning (acknowledging that this
<emph>may</emph> be slightly disruptive to the XML transfer syntax at
the margins)</p></item>
<item><p>Allow bug fixes (unless in specific cases we decide that the
fix is too disruptive for a point release)</p></item>
<item><p>Allow editorial changes</p></item>
<item><p>Allow design cleanup to change behavior in edge
cases</p></item>
<item><p>Allow relatively non-disruptive changes to type hierarchy (to
better support current and forthcoming international standards and W3C
recommendations)</p></item>
<item><p>Allow design cleanup to change component structure (changes
to functionality restricted to edge cases)</p></item>
<item><p>Do not allow any significant changes in functionality</p></item>
<item><p>Do not allow any changes to XML transfer syntax except those
required by version control hooks and bug fixes</p></item>
</olist>
<p>The overall aim as regards compatibility is that</p>

<ulist>
<item><p>All schema documents conformant to version 1.0 of this
specification should also conform to version 1.1, and should have the
same validation behavior across 1.0 and 1.1 implementations (except
possibly in edge cases and in the details of the resulting
PSVI);</p></item>
<item><p>The vast majority of schema documents conformant to version
1.1 of this specification should also conform to version 1.0, leaving
aside any incompatibilities arising from support for versioning, and
when they are conformant to version 1.0 (or are made conformant by the
removal of versioning information), should have the same validation
behavior across 1.0 and 1.1 implementations (again except possibly in
edge cases and in the details of the resulting PSVI);
</p></item>
</ulist>
    </div2>

      <div2 role="1.0" id="purpose">
<head>Purpose</head>
<p>
The <bibref ref="XML"/> specification defines limited
facilities for applying datatypes to document content in that documents
may contain or refer to DTDs that assign types to elements and attributes.
However, document authors, including authors of traditional
<emph>documents</emph> and those transporting <emph>data</emph> in XML,
often require a higher degree of type checking to ensure robustness in
document understanding and data interchange.
</p>
<p>
The table below offers two typical examples of XML instances
in which datatypes are implicit: the instance on the left
represents a billing invoice, the instance on the
right a memo or perhaps an email message in XML.
</p>
<table class="dtdemo" border="1">
<thead>
<tr>
<th colspan="1" rowspan="1">Data oriented</th>
<th colspan="1" rowspan="1">Document oriented</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="1" rowspan="1">
<eg xml:space="preserve">&lt;invoice&gt;
  &lt;orderDate&gt;1999-01-21&lt;/orderDate&gt;
  &lt;shipDate&gt;1999-01-25&lt;/shipDate&gt;
  &lt;billingAddress&gt;
   &lt;name&gt;Ashok Malhotra&lt;/name&gt;
   &lt;street&gt;123 Microsoft Ave.&lt;/street&gt;
   &lt;city&gt;Hawthorne&lt;/city&gt;
   &lt;state&gt;NY&lt;/state&gt;
   &lt;zip&gt;10532-0000&lt;/zip&gt;
  &lt;/billingAddress&gt;
  &lt;voice&gt;555-1234&lt;/voice&gt;
  &lt;fax&gt;555-4321&lt;/fax&gt;
&lt;/invoice&gt;</eg>
</td>
<td colspan="1" rowspan="1">
<eg xml:space="preserve">&lt;memo importance='high'
      date='1999-03-23'&gt;
  &lt;from&gt;Paul V. Biron&lt;/from&gt;
  &lt;to&gt;Ashok Malhotra&lt;/to&gt;
  &lt;subject&gt;Latest draft&lt;/subject&gt;
  &lt;body&gt;
    We need to discuss the latest
    draft &lt;emph&gt;immediately&lt;/emph&gt;.
    Either email me at &lt;email&gt;
    mailto:paul.v.biron@kp.org&lt;/email&gt;
    or call &lt;phone&gt;555-9876&lt;/phone&gt;
  &lt;/body&gt;
&lt;/memo&gt;</eg>
</td>
</tr>
</tbody>
</table>
<p>
The invoice contains several dates and telephone numbers, the postal
abbreviation for a state (which comes from an enumerated list of
sanctioned values), and a ZIP code (which takes a definable regular
form).  The memo contains many of the same types of information:
a date, telephone number, email address and an "importance" value
(from an enumerated list, such as "low", "medium" or "high"). 
Applications which process invoices and memos need to raise exceptions
if something that was supposed to be a date or telephone number does
not conform to the rules for valid dates or telephone numbers.
</p>
<p>
In both cases, validity constraints exist on the content of the
instances that are not expressible in XML DTDs.  The limited
datatyping facilities in XML have prevented validating XML processors
from supplying the rigorous type checking required in these
situations.  The result has been that individual applications
writers have had to implement type checking in an ad hoc manner. 
This specification addresses the need of both document authors and
applications writers for a robust, extensible datatype system for XML
which could be incorporated into XML processors.  As discussed
below, these datatypes could be used in other XML-related standards as
well.
</p>
</div2>

<div2 id="intro-relatedWork" dg="b1838">
<head>Dependencies on Other Specifications</head>
<p>Other specifications on which this one depends
are listed in <specref ref="biblio"/>.</p>
<p>This specification defines some datatypes which depend on
definitions in <bibref ref="XML"/> and <bibref ref="XMLNS"/>; those
definitions, and therefore the datatypes based on them, vary between
version 1.0 (<bibref ref="XML1.0"/>,
<bibref ref="XMLNS1.0"/>) and version 1.1 (<bibref ref="XML"/>,
<bibref ref="XMLNS"/>) of those specifications.  In any given use
of this specification, the choice of the 1.0 or the 1.1 definition of
those datatypes is <termref def="key-impl-def"/>.
</p>
<p>
Conforming implementations of this specification 
<phrase dg="b3074">may</phrase><!--*
* material suppressed here by diff group b3074 *
*--> provide either
the 1.1-based datatypes or the 1.0-based datatypes, or both.  If both
are supported, the choice of which datatypes to use in a particular
assessment episode <rfc2119>should</rfc2119> <!--* &may; *--> be under user control.
</p>
<note>
<p>
When this specification is used to check the datatype validity of XML
input, implementations <rfc2119>may</rfc2119> provide the heuristic of using the 1.1
datatypes if the input is labeled as XML 1.1, and using the 1.0 datatypes if
the input is labeled 1.0, but this heuristic <rfc2119>should</rfc2119> be subject to
override by users, to support cases where users wish to accept XML 1.1
input but validate it using the 1.0 datatypes, or accept XML 1.0 input
and validate it using the 1.1 datatypes.
</p>
</note>

</div2>

<div2 role="1.0" id="requirements">
<head>Requirements</head>
<p>
The <bibref ref="schema-requirements"/> document spells out
concrete requirements to be fulfilled by this specification,
which state that the XML Schema Language must:
</p>
<olist>
<item>
<p>
provide for primitive data typing, including byte, date,
integer, sequence, SQL and Java primitive datatypes, etc.;
</p>
</item>
<item>
<p>
define a type system that is adequate for import/export
from database systems (e.g., relational, object, OLAP);
</p>
</item>
<item>
<p>
distinguish requirements relating to lexical data representation
<phrase dg="ep99">vs.</phrase><!--*
* material suppressed here by diff group ep99 *
*--> 
those governing an underlying information set;
</p>
</item>
<item>
<p>
allow creation of user-defined datatypes, such as
datatypes that are derived from existing datatypes and which
may constrain certain of its properties (e.g., range,
precision, length, format).
</p>
</item>
</olist>
</div2>
<div2 role="1.0" id="scope">
<head>Scope</head>
<p>
This <phrase diff="del" dg="ep26">portion of the XML Schema Language
discusses</phrase><phrase diff="add" dg="ep26">specification
defines</phrase> datatypes that can be used in an XML Schema. 
These datatypes can be specified for element content that would be
specified as <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-chardata">#PCDATA</xspecref>
and attribute values of <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#sec-attribute-types">various types </xspecref> in a
DTD.  It is the intention of this specification that it be usable
outside of the context of XML Schemas for a wide range of other
XML-related activities such as <bibref ref="XSL"/> and
<bibref ref="RDFSchema"/>.
</p>
</div2>
<div2 role="1.0" id="terminology">
<head>Terminology</head>
<p>
The terminology used to describe XML Schema Datatypes 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 a datatype processor:
</p>
    <glist>
     <gitem>
      <label>
       <termdef id="dt-compatibility" term="for compatibility">for compatibility</termdef>
      </label>
      <def>
       <p>
	A feature of this specification included solely to ensure that
	schemas which use this feature remain compatible with <bibref ref="XML"/><phrase diff="add" dg="b3220">.</phrase>
       </p>
      </def>
     </gitem>
     <!--*
* material suppressed here by diff group b3220-aux *
*-->
     <gitem>
      <label>
       <termdef id="dt-may" term="may"><phrase diff="del" dg="b3220"><term>may</term></phrase><phrase diff="add" dg="b3220"><rfc2119>may</rfc2119></phrase></termdef>
      </label>
      <def>
       <p>
	<phrase diff="del" dg="b3220d">Conforming documents and 
	 processors</phrase><phrase diff="add" dg="b3220d">Schemas,
	 schema documents, and processors</phrase>
	are permitted to but need	
	not behave as described.
       </p>
      </def>
     </gitem>
     <gitem dg="b3220-aux">
      <label>
       <termdef id="dt-match" term="match"><term>match</term></termdef>
      </label>
      <def>
       <p><phrase id="match-p1" diff="hither" dg="b3220">
	<emph>(Of strings or names:)</emph> 
	Two strings or names being compared must be
	identical. Characters with multiple possible representations in
	ISO/IEC 10646 (e.g. characters with both precomposed and
	base+diacritic forms) match only if they have the same representation
	in both strings. No case folding is performed. </phrase></p>
       <p><phrase id="match-p2" diff="hither" dg="b3220"><emph>(Of strings and rules
	 in the grammar:)</emph> 
	A string matches a grammatical production 
	if <phrase dg="iff">and only if</phrase> it belongs to the language
	generated by that production.</phrase></p>
      </def>
     </gitem>
     <gitem diff="add" dg="b3220">
      <label><termdef id="dt-should" term="should"><rfc2119>should</rfc2119></termdef></label>
      <def>
       <p>It is recommended that schemas, schema documents, and
	processors behave as described, but there
	can be valid reasons for them not to; it is important that the
	full implications be understood and carefully weighed before
	adopting behavior at variance with the recommendation.</p>
      </def>
<!--*
3. SHOULD   This word, or the adjective "RECOMMENDED", mean that there
   may exist valid reasons in particular circumstances to ignore a
   particular item, but the full implications must be understood and
   carefully weighed before choosing a different course.
*-->
<!--*
4. SHOULD NOT   This phrase, or the phrase "NOT RECOMMENDED" mean that
   there may exist valid reasons in particular circumstances when the
   particular behavior is acceptable or even useful, but the full
   implications should be understood and the case carefully weighed
   before implementing any behavior described with this label.
*-->
     </gitem>
     <gitem>
      <label>
       <termdef id="dt-must" term="must"><phrase diff="del" dg="b3220"><term>must</term></phrase><phrase diff="add" dg="b3220"><rfc2119>must</rfc2119></phrase></termdef>
      </label>
      <def>
       <p>
	<phrase diff="add" dg="b3220"><emph>(Of schemas and 
	  schema documents:)</emph></phrase>
	<phrase diff="del" dg="b3220">Conforming documents and processors</phrase> 
	<phrase diff="add" dg="b3220">Schemas and documents</phrase>
	are required to behave as described; otherwise they are in <termref def="dt-error"/>.
       </p>
       <p diff="add" dg="b3220"><emph>(Of processors:)</emph>
	Processors are required to behave as described.
       </p>
      </def>
     </gitem>
     <gitem diff="add" dg="b3220">
      <label><termdef id="dt-mustnot" term="must not"><rfc2119>must not</rfc2119></termdef></label>
      <def>
       <p>Schemas, schema documents<!--*
* material suppressed here by diff group b3220c *
*-->
	and processors are forbidden to behave as
	described; schemas and documents which nevertheless
	do so are in <termref def="dt-error"/>.</p>
      </def>
<!--*
2. MUST NOT   This phrase, or the phrase "SHALL NOT", mean that the
   definition is an absolute prohibition of the specification.
*-->
     </gitem>
     <gitem>
      <label>
       <termdef id="dt-error" term="error"><term>error</term></termdef>
      </label>
      <def>
       <p diff="del" dg="b3220">A violation of the rules of this 
	specification; results are undefined.
	Conforming software <termref def="dt-may"/> detect and report an
	<term>error</term> and <termref def="dt-may"/> recover from it.
       </p>
       <p diff="add" dg="b3220">A failure of a 
	<!--*
* material suppressed here by diff group b3220c *
*--><phrase dg="b3220c">schema or schema 
	 document</phrase> 
	to conform to the rules of this specification.</p>
       <p diff="add" dg="b3220">
	Except as otherwise specified, 
	processors <rfc2119>must</rfc2119> distinguish
	error-free (conforming) schemas and schema documents
	from those with errors;
	<!--*
* material suppressed here by diff group b3220b *
*-->
	<phrase dg="b3220b">if a schema
	 used in type-validation or a schema document
	 used in constructing a schema
	 is in error, processors <rfc2119>must</rfc2119>
	 report the fact;
	 if more than one is in error, it is <termref def="key-impl-dep"/>
	 whether more than one is reported as being in error.
	 If more than one of the constraints given in 
	 this specification is violated, it 
	 is <termref def="key-impl-dep"/> how many of the violations, and which, are
	 reported.</phrase>
       </p>
       <note diff="add" dg="b3220">
	<p>Failure of an XML element or attribute to be
	 datatype-valid against a particular
	 datatype in a particular schema is not in itself a failure 
	 to conform to this specification and thus,
	 for purposes of this specification, not an error.  
	</p>
       </note>    
      </def>
     </gitem>
</glist>
</div2>

<div2 role="1.0" id="constraints-and-contributions">
<head>Constraints and Contributions</head>
<p>
This specification provides three different kinds of normative
statements about schema components, their representations in XML and
their contribution to the schema-validation of information items:
</p>
<glist>
<gitem>
<label>
<termdef id="dt-cos" term="Constraint on Schemas">
<term>Constraint on Schemas</term>
</termdef>
</label>
<def>
<p>
Constraints on the schema components themselves, i.e. conditions
components <termref def="dt-must"/> satisfy to be components at all.
Largely to be found in <specref ref="datatype-components"/>.
</p>
</def>
</gitem>
<gitem>
<label>
<termdef id="dt-src" term="Schema Representation Constraint">
<term>Schema Representation Constraint</term>
</termdef>
</label>
<def>
<p>
Constraints on the representation of schema components in XML. 
Some but not all of these are expressed in <specref ref="schema"/> and
<specref ref="dtd-for-datatypeDefs"/>.
</p>
</def>
</gitem>
<gitem>
<label>
<termdef id="dt-cvc" term="Validation Rule">
<term>Validation Rule</term>
</termdef>
</label>
<def>
<p>
Constraints expressed by schema components which information items
<termref def="dt-must"/> satisfy to be schema-valid.  Largely to
be found in <specref ref="datatype-components"/>.
</p>
</def>
</gitem>
</glist>
</div2>
</div1>

<div1 id="typesystem">
<head><!--*
* material suppressed here by diff group fa1 *
*--><phrase dg="fa1">Datatype</phrase> System</head>

<!-- ednote><edtext>I don't want to use the word
<mention>type</mention> without some prefix or
adjective.&emsp;&mdash;DP</edtext></ednote -->

<p>This section describes the conceptual framework behind the <phrase dg="fa1">data</phrase>type system defined in this
specification.  The framework has been influenced by the
<bibref ref="ISO11404"/> standard on language-independent datatypes as
well as the datatypes for <bibref ref="SQL"/> and for programming
languages such as Java.</p>

<!-- ednote><edtext>Our datatypes are <emph>not</emph>
<unusual>computer representations</unusual>.&nbsp; Our value spaces
are the abstract concepts; appropriate computer representations are
determined by the implementers.</edtext></ednote -->

<p>The datatypes discussed in this specification are <!--*
* material suppressed here by diff group fa1 *
*--><phrase dg="fa1">for the most part</phrase> well known abstract
concepts such as <emph>integer</emph> and <emph>date</emph>. It is not
the place of this specification to <phrase dg="fa1">thoroughly </phrase>define these abstract concepts; many
other publications provide excellent definitions.<phrase dg="fa1">  However, this specification will attempt to describe the
abstract concepts well enough that they can be readily recognized and
distinguished from other abstractions with which they may be
confused.</phrase></p>

<note dg="fa1">
<p>Only those operations and relations needed for schema processing
are defined in this specification. Applications using these datatypes
are generally expected to implement appropriate additional functions
and/or relations to make the datatype generally useful.  For
example, the description herein of the <dtref ref="float"/> datatype
does not define addition or multiplication, much less all of the
operations defined for that datatype in <bibref ref="ieee754"/> on
which it is based.
<phrase dg="rq100">For some datatypes (e.g. 
<dtref ref="language"/> or <dtref ref="anyURI"/>) defined in part by
reference to other specifications which impose constraints not part of
the datatypes as defined here, applications may also wish to check
that values conform to the requirements given in the current version
of the relevant external specification.</phrase>
</p>
</note>
<!--* rq100: this would be a good place to add that applications may want
    * to check for RFC conformance
    *-->

<div2 id="datatype">
<head>Datatype</head>
<!--* !!! newOrg assigns the id 'datatypes' to the section that contains
    * the following paragraphs.  At the moment, I have not followed that 
    * change.  -msm
    *-->
<!--*
* material suppressed here by diff group fa1 *
*-->


<p dg="fa1"><termdef term="datatype" id="dt-datatype">In
this specification, a <term>datatype</term> <!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">has
three</phrase> properties:

<ulist><item>
<p>A <termref def="dt-value-space"/>, which is <!--*
* material suppressed here by diff group wdd *
*-->a set<phrase dg="wdd"> of
values</phrase>. <!--*
* material suppressed here by diff group wdd *
*--></p>
</item>
<item>
<p>A <termref def="dt-lexical-space"/>, which is <!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">a set of
<!--*
* material suppressed here by diff group rq21-lit *
*--><phrase dg="rq21-lit"><termref def="dt-literal">literals</termref></phrase> used to denote the values</phrase>.</p>
</item>
<item>
<p>A small collection of <emph>functions, relations, and
procedures</emph> associated with the datatype.  Included are
equality and <phrase diff="add" dg="b2947b">(for some datatypes)</phrase>
order relations on the <termref def="dt-value-space"/>, and a
<termref def="dt-lexical-mapping"/>, which is a <phrase diff="del" dg="ep26">function on</phrase><phrase diff="add" dg="ep26">mapping from</phrase> the <termref def="dt-lexical-space"/> 
<phrase diff="del" dg="ep26">onto</phrase><phrase diff="add" dg="ep26">into</phrase> 
the <termref def="dt-value-space"/>.</p>
</item>
<!--*
* material suppressed here by diff group wdd *
*-->
</ulist>
</termdef>
</p>

<!--* This note about simple type definitions added to allow
    * the discussion in section 4 to speak of 'the value
    * space of the {base type definition}, etc.
    * Deleted 2005-08-31.  Rationale:  the crucial bit (simple typedef
    * uniquely identifies a datatype; vs/ls/etc of simple type (def)
    * are those of the datatype thus identified) is also stated in 
    * 4.4.1.  Some graf like this is required as a heads-up before
    * terms like 'facet' and so on are used, but that graf needs
    * careful drafting and must be based on a careful reading of
    * the first three sections of the spec.  No time for that today; 
    * postpone.
    *-->
<!--*
<p diff="add" dg="rec12-main">When this specification is used in
conjunction with &XSP1;, 
&simple_type_definition;s are used to define datatypes.  In the
context of a valid schema, any &simple_type_definition; identifies
exactly one datatype.  More than one &simple_type_definition;
may identify the same datatype.
*-->
<!--* 
In what follows, references to the 
&value_space; or &lexical_space; of a &simple_type_definition;
mean the &value_space; or &lexical_space; of the datatype
uniquely identifed by that &simple_type_definition;.
*-->
<!--* </p> *-->

<!--* !!! N.B. in the WD, the following note was in the penultimate list item, 
    * not after the list. We don't have good transposition markup, so I am 
    * leaving the movement unmarked.  -MSM *-->

<!--* <ednote diff="add" dg="wdd"><edtext>Do we want to delete the
following Note?</edtext></ednote> *-->

<!--* 2005-08-26.  Reviewing our diffs from 1.0 again, MSM sees
    * that whether we mark this as new vis-a-vis the WD of July 2004
    * or not, it needs to be marked as new vis-a-vis 1.0.
    *-->
<note dg="fa1">
<p>This specification only defines the operations and relations needed
for schema processing.  The choice of terminology for
describing/naming the datatypes is selected to guide users and
implementers in how to expand the datatype to be generally
useful—i.e., how to recognize the <quote>real world</quote>
datatypes and their variants for which the datatypes defined herein
are meant to be used for data interchange.</p>
</note>

<p dg="fa1">Along with the <termref def="dt-lexical-mapping"/> it is
often useful to have an inverse which provides a standard 
<termref def="dt-lexical-representation"/> for each value.  Such
a <termref def="dt-canonical-mapping"/> is not required for
schema processing, but is described herein for the benefit of users of
this specification, and other specifications which might find it
useful to reference these descriptions normatively.
<phrase dg="wd-21">For some datatypes, notably
<dtref ref="QName"/> and <dtref ref="NOTATION"/>, the mapping from
lexical representations to values is context-dependent; for these
types, no <termref def="dt-canonical-mapping"/> is defined.</phrase></p>

<note dg="rq126">
<p>
Where <termref def="dt-canonical-mapping">canonical mappings</termref> are defined in this specification, they are
defined for <termref def="dt-primitive"/> datatypes. When a datatype is derived <!--* by
&fb.restriction; *--> using facets which directly
constrain the <termref def="dt-value-space"/>, then for each value eliminated from the
<termref def="dt-value-space"/>, the corresponding lexical representations are dropped
from the lexical space.  The <termref def="dt-canonical-mapping"/> for such a datatype is
a subset of the <termref def="dt-canonical-mapping"/> for its <termref def="dt-primitive"/> type and
provides a <termref def="dt-canonical-representation"/> for each value remaining in the
<termref def="dt-value-space"/>.
</p>
<p>
The <phrase dg="ed-pattern"><termref def="dt-pattern"/></phrase><!--*
* material suppressed here by diff group ed-pattern *
*-->
facet, on the other hand, <phrase diff="add" dg="b3251">and
any other <phrase dg="b5030z">(<termref def="key-impl-def"/>)</phrase> 
<termref def="dt-lexical"/> facets<!--*
* material suppressed here by diff group b5030z *
*-->,</phrase>
restrict<phrase diff="del" dg="b3251">s</phrase>
the <termref def="dt-lexical-space"/> directly.  When more than one lexical
representation is provided for a given value, 
<phrase diff="del" dg="b3251">the <phrase dg="ed-pattern"><termref def="dt-pattern"/></phrase><!--*
* material suppressed here by diff group ed-pattern *
*--> facet</phrase><phrase diff="add" dg="b3251">such facets</phrase>
may 
remove the <termref def="dt-canonical-representation"/> while
permitting a different lexical representation; in this case, the value
remains in the <termref def="dt-value-space"/> but has no <termref def="dt-canonical-representation"/>.
This specification provides no recourse in such situations.
Applications are free to deal with it as they see fit.
</p>


</note>

<note diff="add" dg="b3232">
<p>This specification sometimes uses the shorter form <quote>type</quote>
where one might strictly speaking expect the longer form
<quote>datatype</quote> (e.g. in the phrases 
<quote>union type</quote>, <quote>list type</quote>, 
<quote>base type</quote>, <quote>item type</quote>, etc.
No systematic distinction is intended between
the forms of these phrase with <quote>type</quote> and
those with <quote>datatype</quote>;
the two forms are used interchangeably.</p>
<p>The distinction between <quote>datatype</quote>
and <quote>simple type definition</quote>, by contrast,
carries more information:  the datatype is characterized by its
<termref def="dt-value-space"/>, <termref def="dt-lexical-space"/>, <termref def="dt-lexical-mapping"/>, etc., as
just described, independently of the specific facets or
other definitional mechanisms used in the simple type 
definition to describe that particular <termref def="dt-value-space"/>
or <termref def="dt-lexical-space"/>.  Different simple type definitions
with different selections of facets can describe the
same datatype.
</p>
<!--*
<ednote>
<edtext>N.B. the association of the &basetype; with the
datatype and not with the simple type definition is a
prominent exception to the story just outlined.</edtext>
</ednote>
*-->
</note>

</div2>

<div2 id="value-space"><head>Value space</head>

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

<p dg="fa1"><termdef term="value space" id="dt-value-space">The <term>value space</term> <emph>of a
datatype</emph> is the set of values for that
datatype.</termdef>  Associated with each value space are
selected operations and relations necessary to permit proper schema
processing.  Each value in the value space of a 
<phrase diff="add" dg="b3025"><termref def="dt-primitive"/> or <termref def="dt-ordinary"/></phrase>
datatype is
denoted by one or more character strings in its <termref def="dt-lexical-space"/>,
according to <termref role="the" def="dt-lexical-mapping">the lexical
mapping</termref><phrase diff="add" dg="b3025">; <termref def="dt-special"/>
datatypes, by contrast, may include <quote>ineffable</quote>
values not mapped to by any lexical representation</phrase>. 
(If the mapping is restricted during a
derivation in such a way that a value has no denotation, that value is
dropped from the value space.)</p>

<p dg="fa1">The value spaces of datatypes are abstractions,
and are defined in <specref ref="built-in-datatypes"/> 
<!--* n.b. newOrg deletes 'built-in-datatypes' and inserts a
    * section with ID builtinSTDs, changing some but not all
    * pointers to built-in-datatypes to the new ID.
    * For the moment, I've left all of them at 'built-in-datatypes'. -msm
    *-->
to the extent needed to clarify them for readers.  For example,
in defining the numerical datatypes, we assume some general numerical
concepts such as number and integer are known.  In many cases we
provide references to other documents providing more complete
definitions.</p>

<note dg="fa1">
<p><emph>The value spaces and the values therein are
abstractions.</emph>  This specification does not prescribe any
particular internal representations that must be used when
implementing these datatypes.  In some cases, there are
references to other specifications which do prescribe specific
internal representations; these specific internal representations must
be used to comply with those other specifications, but need not be
used to comply with this specification.</p>

<p>In addition, other applications are expected to define additional
appropriate operations and/or relations on these value spaces (e.g.,
addition and multiplication on the various numerical datatypes'
value spaces), and are permitted where appropriate to even redefine
the operations and relations defined within this specification,
provided that <emph>for schema processing the relations and operations
used are those defined herein</emph>.</p>
</note>

<!--ednote><edtext>Could we do away with the following
paragraph?&nbsp; Does it really add anything?</edtext></ednote-->

<p>The <termref def="dt-value-space"/> of a <!--*
* material suppressed here by diff group fa1 *
*-->datatype can
be defined in one of the following ways:
<ulist>
<item><p>defined<phrase dg="fa1"> elsewhere</phrase>
axiomatically from fundamental notions (intensional definition) [see
<termref def="dt-primitive"/>]</p>
</item>
<item><p>enumerated outright<phrase dg="fa1"> from values
of an already defined datatype</phrase> (extensional definition) [see
<termref def="dt-enumeration"/>]</p>
</item>
<item><p>defined by restricting the <termref def="dt-value-space"/> of an already
defined datatype to a particular subset with a given set of properties
[see derived]</p>
</item>
<item><p>defined as a combination of values from one or more already
defined <termref def="dt-value-space"/>(s) by a specific construction procedure [see
<termref def="dt-list"/> and <termref def="dt-union"/>]</p>
</item></ulist></p>

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

<p dg="fa1">The relations of <emph>identity</emph><phrase diff="del" dg="b2947">,</phrase><phrase diff="add" dg="b2947">
and</phrase>
<emph>equality</emph><phrase diff="del" dg="b2947">, and <emph>order</emph></phrase> 
are required for each
value space.  <phrase diff="add" dg="b2947">An 
order relation is specified for some value spaces, but not 
all.</phrase>
A very few datatypes have other relations or
operations prescribed for the purposes of this specification.</p>

<div3 dg="fa1" id="identity">
<head>Identity</head>

<!--* <ednote diff="add" dg="wdd"><edtext>IIRC, someone in the WG
pointed out a third situation where identity is used, but I can't find
any reference.</edtext></ednote> *-->

<p>The identity relation is always defined. Every value space
inherently has an identity relation. Two things are
<emph>identical</emph> if <phrase dg="iff">and only
if</phrase> they are actually the same thing: i.e., if there is no way
whatever to tell them apart.  
<phrase diff="del" dg="b3222">The identity relation is used when
making <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-fb-restriction">facet-based restrictions</termref></phrase> by <emph>enumeration</emph>, 
<!--*
* material suppressed here by diff group wd-2 *
*-->when checking identity
constraints<phrase dg="wd-2">, and when checking value
constraints</phrase>.  These are the only uses of
<emph>identity</emph> for schema processing.</phrase></p>

<note>
<p>This does not preclude implementing datatypes by using more than
one <emph>internal</emph> representation for a given value, provided
no mechanism inherent in the datatype implementation (i.e., other than
bit-string-preserving "casting" of the datum to a different
datatype) will distinguish between the two representations.</p>
</note>

<p>In the identity relation defined herein, values from different
<termref def="dt-primitive"/> datatypes' <termref def="dt-value-space">value spaces</termref> are made artificially
distinct if they might otherwise be considered identical.  For
example, there is a number <emph>two</emph> in the <dtref ref="decimal"/> datatype and a number <emph>two</emph> in the <dtref ref="float"/> datatype.  In the identity relation defined herein,
these two values are considered distinct.  Other applications
making use of these datatypes may choose to consider values such as
these identical, but for the view of <termref def="dt-primitive"/> datatypes'
<termref def="dt-value-space">value spaces</termref> used herein, they are distinct.</p>

<p><emph>WARNING:</emph>  Care must be taken when identifying
values across distinct primitive datatypes.  <!--*
* material suppressed here by diff group wd-3 *
*--><phrase dg="wd-3">The
<termref def="dt-literal">literals</termref> <string>0.1</string> and <string>0.10000000009</string> map
to the same value in <dtref ref="float"/> (neither <phrase diff="add" dg="b3223">0.1 nor 0.10000000009</phrase> is in the value space, and
each <phrase diff="add" dg="b3223">literal</phrase> is mapped to the
nearest value, namely 0.100000001490116119384765625), but map to
distinct values in <dtref ref="decimal"/>.</phrase></p>

<note diff="add" dg="b2046">
<p>Datatypes <termref def="dt-constructed"/> by <termref def="dt-fb-restriction"/> do not create new
values; they define subsets of some <termref def="dt-primitive"/> datatype's
<termref def="dt-value-space"/>.  A consequence of this fact is that the <termref def="dt-literal">literals</termref>
<string>+2</string>, treated as a <dtref ref="decimal"/>,
<string>+2</string>, treated as an <dtref ref="integer"/>, and
<string>+2</string>, treated as a <dtref ref="byte"/>, all denote the
same value.  They are not only equal but identical.</p>
</note>

<p diff="add" dg="b2046">Given a list <var>A</var> and a list <var>B</var>, <var>A</var> and <var>B</var>
are the same list if they are the same sequence of atomic values.
The necessary and sufficient conditions for this identity are
that <var>A</var> and <var>B</var> have the same length and that the items of <var>A</var>
are pairwise identical to the items of <var>B</var>.
</p>

<note diff="add" dg="b2046">
<p>It is a consequence of the rule just given for list identity
that there is only one empty list.  An empty list declared as
having <termref def="dt-itemType"/> <dtref ref="decimal"/> and an empty
list declared as having <termref def="dt-itemType"/> <dtref ref="string"/> 
are not only equal but identical.
</p>
</note>

<!--*
* material suppressed here by diff group b2046-abandoned *
*-->
</div3>

<div3 dg="fa1" id="equality"><head>Equality</head>

<p>Each <termref def="dt-primitive"/> datatype has prescribed an equality relation for
its value space.  The equality relation for most datatypes is the
identity relation.  In the few cases where it is not, 
<!--*
* material suppressed here by diff group wd-5 *
*--><phrase dg="wd-5">equality</phrase> 
has been carefully defined so <!--*
* material suppressed here by diff group wd-5 *
*--><phrase dg="wd-5">that</phrase> for
most <!--*
* material suppressed here by diff group wd-5 *
*--> operations of
interest to the datatype<!--*
* material suppressed here by diff group wd-5 *
*--><phrase dg="wd-5">,</phrase> if
two values are equal and one is substituted for the other as an
argument to any of the operations, the results will always also be
equal.<!--*
* material suppressed here by diff group wd-5 *
*--></p>

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

<p>On the other hand, equality need not cover the entire value space
of the datatype (though it usually does). <phrase dg="wd-4">In 
particular, <phrase diff="del" dg="b3224">NaN &lt;&gt; NaN</phrase><phrase diff="add" dg="b3224">NaN
is not equal to itself</phrase> in the <dtref ref="precisionDecimal"/>, 
<dtref ref="float"/>, and <dtref ref="double"/> datatypes.</phrase></p>

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

<p>The equality relation is used <phrase diff="add" dg="b3222">
when 
making <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-fb-restriction">facet-based restrictions</termref></phrase> by <emph>enumeration</emph>, 
when checking identity constraints (in the context of
<bibref ref="structural-schemas"/>), when checking value
constraints, and</phrase>
in conjunction with order when making
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-fb-restriction">facet-based restrictions</termref></phrase> involving order.  
<phrase diff="del" dg="b3222">This is the only use of
<emph>equality</emph> for schema processing.</phrase>
<phrase diff="add" dg="b3222">All comparisons for
<quote>sameness</quote> prescribed by this specification
test for equality, not for identity.</phrase>
</p>

<note>
<p>In the prior version of this specification (1.0), equality was
always identity.  This has been changed to permit the datatypes
defined herein to more closely match the <unusual>real world</unusual>
datatypes for which  they are intended to be used as transmission
formats.</p>

<p>For example, the <dtref ref="float"/> datatype has an equality
which is not the identity ( −0 = +0 , but
they are not identical—although they <emph>were</emph> identical
in the 1.0 version of this specification), and whose domain excludes
one value, NaN, so that  NaN ≠ NaN .</p>

<p>For another example, the <dtref ref="dateTime"/> datatype
previously lost any timezone information in the
<termref def="dt-lexical-representation"/> as the value was converted to
<!--*
* material suppressed here by diff group dt2 *
*--><phrase dg="dt2"><termref def="dt-utc"/></phrase>;
now the timezone
is retained and two values representing the same <unusual>moment in
time</unusual> but with different remembered timezones are now
<emph>equal</emph> but not <emph>identical</emph>.</p>
</note>

<p>In the equality relation defined herein, values from different
primitive data spaces are made artificially unequal even if they might
otherwise be considered equal.  For example, there is a number
<emph>two</emph> in the <dtref ref="decimal"/> datatype and a number
<emph>two</emph> in the <dtref ref="float"/> datatype.  In the
equality relation defined herein, these two values are considered
unequal.  Other applications making use of these datatypes may
choose to consider values such as these equal<phrase dg="ep99"> (and must do so if they
choose to consider them identical)</phrase>; nonetheless, in the equality
relation defined herein, they are unequal.</p>

<p diff="add" dg="b2046">Two lists <var>A</var> and <var>B</var> are equal if and
only if they have the same length and their items are pairwise equal.
A list of length one containing a value <var>V1</var> and an atomic value
<var>V2</var> are equal if and only if <var>V1</var> is equal to <var>V2</var>.
</p>

<p>For the purposes of this specification, there is one equality
relation for all values of all datatypes (the union of the various
datatype's individual equalities, if one consider relations to be
sets of ordered pairs).  The <emph>equality</emph> relation is
denoted by <mention>=</mention> and its negation by
<mention>≠</mention>, each used as
a<!--*
* material suppressed here by diff group wdd *
*--> binary infix predicate: 
<var>x</var> = <var>y</var>  and 
<var>x</var> ≠ <var>y</var> .  On the other
hand, <emph>identity</emph> relationships are always described in
words.</p>



</div3>

<div3 dg="fa1" id="order"><head>Order</head>

<p><phrase diff="del" dg="b2947">Each datatype has an order relation 
prescribed.</phrase><phrase diff="add" dg="b2947">For some 
datatypes, an order relation is prescribed<!--*
* material suppressed here by diff group ep26 *
*--> 
for use in checking
upper and lower bounds of the <termref def="dt-value-space"/>.</phrase>  This order may be
a <emph>partial</emph> order, which means that there may be values in
the <termref def="dt-value-space"/> which are neither equal, less-than, nor
greater-than.  Such value pairs are
<emph>incomparable</emph>.  <phrase dg="b2947-1">In many cases, 
<phrase diff="del" dg="b2947">the prescribed order
is the <unusual>null order</unusual>:  the ultimate partial
order, in which no pairs are less-than or 
greater-than</phrase><phrase diff="add" dg="b2947">no order
is prescribed</phrase>; <phrase diff="del" dg="b2947">they are all</phrase><phrase diff="add" dg="b2947">each pair of values is either</phrase>
equal or <termref def="dt-incomparable"/>. 
</phrase><termdef term="incomparable" id="dt-incomparable" dg="wdd">Two
values that are neither equal, less-than, nor greater-than are
<term>incomparable</term>. <phrase dg="fa1-fix">Two values
that are not <termref def="dt-incomparable"/> are
<term>comparable</term>.</phrase></termdef></p>

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

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

<p>The order relation is used
in conjunction with equality when making <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-fb-restriction">facet-based restrictions</termref></phrase>
involving order.  This is the only use of <emph>order</emph> for
schema processing.</p>

<p>In this specification, this less-than order relation is denoted by
<mention>&lt;</mention> (and its inverse by <mention>&gt;</mention>),
the weak order by <mention>≤</mention> (and its inverse by
<mention>≥</mention>), and the resulting <termref def="dt-incomparable"/> relation by
<mention>&lt;&gt;</mention>, each used as a<!--*
* material suppressed here by diff group wdd *
*--> binary infix predicate: 
<var>x</var> &lt; <var>y</var> , 
<var>x</var> ≤ <var>y</var> , 
<var>x</var> &gt; <var>y</var> , 
<var>x</var> ≥ <var>y</var> , and 
<var>x</var> &lt;&gt; <var>y</var> .</p>

<note>
<p>The weak order <unusual>less-than-or-equal</unusual> means
<unusual>less-than</unusual> or <unusual>equal</unusual> <emph>and one
can tell which</emph>.  For example, the <dtref ref="duration"/> P1M (one month) is <emph>not</emph>
less-than-or-equal P31D (thirty-one days) because P1M is not less than
P31D, nor is P1M equal to P31D.  Instead, P1M is <termref def="dt-incomparable"/> with P31D.)  The formal
definition of order for <dtref ref="duration"/> (<specref ref="duration"/>) 
<phrase diff="del" dg="ep26">insures</phrase><phrase diff="add" dg="ep26">ensures</phrase> 
that this is true.</p>
</note>

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

<p><phrase diff="del" dg="b3225">The</phrase><phrase diff="add" dg="b3225">For
purposes of this specification, the</phrase> value spaces of primitive datatypes are
<phrase diff="del" dg="b3225">abstractions, which may
have</phrase><phrase diff="add" dg="b3225">disjoint, even in cases where the
abstractions they represent might be thought of as having</phrase> 
values in common.  In the order 
relation<phrase diff="add" dg="ep26">s</phrase> defined <phrase diff="del" dg="b3225">herein,
these</phrase><phrase diff="add" dg="b3225">in this specification, values from
different</phrase> value spaces are <phrase diff="del" dg="b3225">made 
artificially</phrase><phrase diff="add" dg="b3225"><!--*
* material suppressed here by diff group ep26 *
*--><!--* no causality here, lose the 'thus'! *--></phrase>
<termref def="dt-incomparable"/>.  For example, the numbers two
and three are values in both the
<!--* 
<phrase diff="del" dg="b3225-wdd-rev">
  <phrase diff="del" dg="b3225-wdd">decimal</phrase>
  <phrase diff="add" dg="b3225-wdd">&pD;</phrase>
</phrase>
<phrase diff="add" dg="b3225-wdd-rev">
  <phrase diff="del" dg="b3225-wdd">&pD;</phrase>
  <phrase diff="add" dg="b3225-wdd">decimal</phrase>
</phrase> *-->
<phrase diff="del" dg="b3225"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">precisionDecimal</phrase></phrase><phrase diff="add" dg="b3225">decimal</phrase>
datatype and the float datatype.  In the order relation defined
here<phrase diff="del" dg="b3225">in</phrase>,
<phrase diff="add" dg="b3225">the </phrase>two in the decimal datatype
<phrase diff="del" dg="b3225">and</phrase><phrase diff="add" dg="b3225">is
not less than the</phrase> three in the float datatype<phrase diff="add" dg="b3225">;
the two values</phrase> are
incomparable<phrase diff="del" dg="b3225"> values</phrase>.  Other
applications making use of these
datatypes may choose to consider values such as these comparable.</p>

<p diff="del" dg="b3224">While it is not an error to attempt to
compare values from the value spaces of two different primitive
datatypes, they will always be <termref def="dt-incomparable"/> and therefore unequal:  If
<var>x</var> and <var>y</var> are in the value spaces of different
primitive datatypes then 
<var>x</var> &lt;&gt; <var>y</var>  (and hence 
<var>x</var> ≠ <var>y</var> ).</p>

<note diff="add" dg="b3224">
<p>Comparison of values from different <termref def="dt-primitive"/> datatypes
can sometimes be an error and sometimes not, depending on context.
</p><p>
When made for purposes of checking an enumeration constraint,
such a comparison is not in itself an error, but since
<!--*
* material suppressed here by diff group wgi-20080530 *
*--><phrase dg="wgi-20080530">no
two values from different <termref def="dt-primitive"/> <termref def="dt-value-space">value spaces</termref> are 
equal</phrase>, any 
comparison of <termref def="dt-incomparable"/> values will invariably be false.
</p>
<p>
Specifying an upper or lower bound which is of the wrong primitive
datatype (and therefore <termref def="dt-incomparable"/> with the values of the datatype
it is supposed to restrict) is, by contrast, always an error.
It is a consequence of the rules for
<termref def="dt-fb-restriction"/> that in conforming simple type definitions, the
values of upper and lower bounds, and enumerated values, <rfc2119>must</rfc2119> be
drawn from the value space of the <termref def="dt-basetype"/>, which necessarily means
from the same <termref def="dt-primitive"/> datatype.
</p><p>
Comparison of <termref def="dt-incomparable"/> values in the context of an XPath
expression (e.g. in an assertion or in the rules for conditional type
assignment) can raise a dynamic error in the evaluation of the XPath
expression; see <bibref ref="F_O"/> for details.</p>
</note>
</div3>
</div2>

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

<div2 id="lexical-space" dg="fa1"><head>The Lexical Space and Lexical Mapping</head>

<!--
<p><termdef term="lexical mapping" id="dt-lexical-mapping">A
<term>lexical mapping</term> for a datatype is a function whose domain
is a set of character strings and whose range is a subset of the set
of values of that datatype.</termdef> Lexical mappings are designated
<emph>active</emph> or <emph>inactive</emph>.&nbsp; Two lexical
mappings active at the same time must have disjoint domains, or at
least must agree on the intersection of their domains; this assures
that <termref role="the" def="dt-lexical-mapping">the (combined)
lexical mapping</termref> is a function: it does not map one lexical
representation to more than one value.</p>

<p><termdef term="lexical representation"
id="dt-lexical-representation">The members of the domain of a lexical
mapping are <term>lexical representations</term> (under that mapping)
of the values to which they are mapped.</termdef></p>

<p><termdef term="the lexical mapping"
id="dt-the-lexical-mapping"><term><emph>The</emph> lexical
mapping</term> of a datatype is the union of all active lexical
mappings for that datatype.</termdef>&nbsp; The union of the active
lexical mappings will necessarily have as its range the
&value_space;.&nbsp; This assures that each value has at least one
&lexical_representation;.</p>

<p><termdef term="lexical space" id="dt-lexical-space">The
<term>lexical space</term> of a datatype is the domain of <termref
role="the" def="dt-lexical-mapping">the lexical mapping</termref> for
that datatype.</termdef>&nbsp; A datatype may have more than
one&lexical_mapping;, and more than one may be active, subject to the
constraints given above.</p>

<p>Should a datatype have &lexical_mappings; whose domains overlap and
which do not give the same value for character strings in the overlap,
then there must be a fixed algorithm (possibly dependent on facet
values) which selects which lexical mappings are active (subject to
the constraints above); otherwise there <emph>may</emph> be such an
algorithm and facet(s).&nbsp; In the absence of such an algorithm all
of the datatype's mappings are active.</p> -->

<!--* <ednote><edtext>Some things in this section and elsewhere will
need to be rewritten once we decide just how to deal with
context-dependent lexical mappings and lexical
spaces.</edtext></ednote> *-->

<p><termdef term="lexical mapping" id="dt-lexical-mapping">The
<term>lexical mapping</term> for a datatype is a prescribed 
<phrase diff="del" dg="b3227"><phrase dg="b3025">function</phrase><!--*
* material suppressed here by diff group b3025 *
*-->
whose domain is a prescribed set of character strings (the
<termref def="dt-lexical-space"/>) and whose range is the <termref def="dt-value-space"/> of that
datatype</phrase><phrase diff="add" dg="b3227">relation
which maps from the <termref def="dt-lexical-space"/> of the datatype
into its <termref def="dt-value-space"/></phrase>.</termdef></p>

<p><termdef term="lexical space" id="dt-lexical-space">The
<term>lexical space</term> of a datatype is 
<phrase diff="del" dg="b3227">the prescribed domain of</phrase><phrase diff="add" dg="b3227">the prescribed set of strings
which</phrase>
<termref role="the" def="dt-lexical-mapping">the lexical
mapping</termref> for that datatype<phrase diff="add" dg="b3227">
maps to values of that datatype</phrase>.</termdef><!-- &nbsp;  A datatype
may have more than one&lexical_mapping;, and more than one may be
active, subject to the constraints given above. --></p>

<p><termdef term="lexical representation" id="dt-lexical-representation">The members of the <termref def="dt-lexical-space"/> are
<term>lexical representations</term> of the values to which they are
mapped.</termdef></p>

<note diff="add" dg="ep26">
<p>For the <termref def="dt-special"/> datatypes, the <termref def="dt-lexical-mapping">lexical mappings</termref> defined
here map from the <termref def="dt-lexical-space"/> into, but not onto, the <termref def="dt-value-space"/>.
The <termref def="dt-value-space">value spaces</termref> of the <termref def="dt-special"/> datatypes
include <quote>ineffable</quote> values for which the <termref def="dt-lexical-mapping">lexical mappings</termref> defined
in this specification provide no lexical representation.</p>
<p>For the <termref def="dt-primitive"/> and <termref def="dt-ordinary"/> <phrase dg="b3025">atomic</phrase> datatypes, the <termref def="dt-lexical-mapping"/> is a 
(total)
function on the entire <termref def="dt-lexical-space"/> <emph>onto</emph> (not merely
<emph>into</emph>) the <termref def="dt-value-space"/>:  every member of the
<termref def="dt-lexical-space"/> maps into the <termref def="dt-value-space"/>, and every value is mapped
to by some member of the <termref def="dt-lexical-space"/>.</p>
<p dg="b3025">For <termref def="dt-union"/> datatypes, the <termref def="dt-lexical-mapping"/>
is not necessarily a function, since the same <termref def="dt-literal"/> may map to
different values in different member types.  For <termref def="dt-list"/> datatypes,
the <termref def="dt-lexical-mapping"/> is a function if and only if the <termref def="dt-lexical-mapping"/>
of the list's <termref def="dt-itemType"/> is a function.
</p>
</note>


<p dg="rq21-lit">
<termdef term="literal" id="dt-literal">A sequence of zero or more
characters in the Universal Character Set (UCS) which may or may not
prove upon inspection to be a member of the <termref def="dt-lexical-space"/> of a given
datatype and thus a <termref def="dt-lexical-representation"/> of a given value in that datatype's
<termref def="dt-value-space"/>, is referred to as a <term>literal</term>.</termdef> The
term is used indifferently both for character sequences which are
members of a particular <termref def="dt-lexical-space"/> and for those which are
not.</p>

<p>Should a derivation be made using a derivation mechanism that
removes <termref def="dt-lexical-representation">lexical representations</termref> from the<termref def="dt-lexical-space"/> to the
extent that one or more values cease to have any
<termref def="dt-lexical-representation"/>, then those values are dropped from the
<termref def="dt-value-space"/>.</p>

<note>
<p>This could happen by means of a <compref ref="f-p"/><!--*
* material suppressed here by diff group b5030z *
*-->
<phrase diff="add" dg="b3251">or other <termref def="dt-lexical"/></phrase>
facet<!-- or a
<phrase role="UNSURE"><compref ref="NOTATION-facets"/></phrase>
facet-->.</p>
</note>

<p>Conversely, should a derivation remove values then their
<termref def="dt-lexical-representation">lexical representations</termref> are dropped from the <termref def="dt-lexical-space"/> unless
there is a facet value whose impact is defined to cause the
otherwise-dropped <termref def="dt-lexical-representation"/> to be mapped to another
value instead.</p>

<note>
<p>There are currently no facets with such an impact.  There may
be in the future.</p>
</note>

<p>For example, '100' and '1.0E2' are two
different <termref def="dt-lexical-representation">lexical representations</termref> from the <dtref ref="float"/>
datatype which
both denote the same value.  The datatype system defined in this
specification provides mechanisms for schema designers to control the
<termref def="dt-value-space"/> and the corresponding set of acceptable
<termref def="dt-lexical-representation">lexical representations</termref> of those values for a datatype.</p>

<div3 id="canonical-lexical-representation"><head>Canonical Mapping</head>

<!--* <issue id="RQ-129i" role="1.1">
<p><loc href="&reqs;#eliminate-canonical" target="reqs">RQ-129 (remove
dependency on canonical representations)</loc></p>
<p>The dependencies are in Part 1; they will be resolved there.&nbsp;
Text in this Part will reflect that &canonical_representation; are
provided for the benefit of other users, including other
specifications that might want to reference these datatypes.</p>
</issue> *-->

<!--* <issue id="RQ-126i" role="1.1">
<p><loc href="&reqs;#restrict-can-forms" target="reqs">RQ-126
(restricting away canonical representations)</loc></p>
<p>Given the "pattern" &cfacet;, restricting away &canonical_representations; 
cannot be prohibited without undue processing
expense.&nbsp; A warning will be inserted, and RQ-129 will insure that
loss of &canonical_representations; will not affect schema
processing.</p>
</issue> *-->

<p>While the datatypes defined in this specification <phrase diff="del" dg="b3227">generally</phrase><phrase diff="add" dg="b3227">often</phrase> have a single <termref def="dt-lexical-representation"/> for
each value (i.e., each value in the datatype's <termref def="dt-value-space"/> is
denoted by a single <termref def="dt-lexical-representation">representation</termref> in its
<termref def="dt-lexical-space"/>), this is not always the case.  The example in
the previous section shows two <termref def="dt-lexical-representation">lexical representations</termref> from the
<dtref ref="float"/> datatype which denote the same value.</p>

<p><termdef id="dt-canonical-mapping" term="canonical mapping">The 
<term>canonical mapping</term> is a prescribed subset of the inverse of a
<termref def="dt-lexical-mapping"/> which is 
one-to-one and whose domain (where possible) is the entire range of the
<termref def="dt-lexical-mapping"/> (the
<termref def="dt-value-space"/>).</termdef>  Thus a 
<termref def="dt-canonical-mapping"/> selects one
<termref def="dt-lexical-representation"/> for each
value in the <termref def="dt-value-space"/>.<!-- 

&nbsp; <phrase role="UNSURE">Most lexical mappings have an associated
canonical mapping; the exceptions are a few lexical mappings that are
context dependent.</phrase>&nbsp; If two <termref
def="dt-canonical-mapping">canonical mappings</termref> with
intersecting domains, for a given &lexical_mapping;, are associated
with a datatype, then there will be a fixed algorithm (possibly
dependent on facet values) associated with the datatype which resolves
any ambiguity of &canonical_mapping; in the intersection.

--></p>

<p><termdef term="canonical representation" id="dt-canonical-representation">The <term>canonical
representation</term> of a value in the <termref def="dt-value-space"/> of a datatype is
the <termref def="dt-lexical-representation"/> associated with that value by the
datatype's <termref def="dt-canonical-mapping"/></termdef>.</p>

<!-- <p><termdef id="dt-the-canonical-mapping" term="the canonical
mapping"><term><emph>The</emph> canonical mapping</term> of a datatype
is essentially the union of the <termref
def="dt-canonical-mapping">canonical mappings</termref> associated
with the active &lexical_mappings;, with values (if any) in the
pairwise intersection of the domains of those mappings selected
according to a fixed algorithm (possibly having facet values as
parameters) associated with the datatype.</termdef></p> -->

<p><termref role="the" def="dt-canonical-mapping">Canonical
mappings</termref> are not available for datatypes whose
<termref def="dt-lexical-mapping">lexical mappings</termref> are context dependent (i.e., mappings for which the
value of a <termref def="dt-lexical-representation"/> depends on the context in which it
occurs, or for which a character string may or may not be a valid
<termref def="dt-lexical-representation"/> similarly depending on its context)</p>
<note><p><termref def="dt-canonical-representation">Canonical
representations</termref> are provided where feasible for the use of
other applications; they are not required for schema processing
itself.  <emph>A conforming schema processor implementation is
not required to implement <termref def="dt-canonical-mapping">canonical
mappings</termref>.</emph></p></note>

</div3>
</div2>

<!--*
* material suppressed here by diff group fa1.z *
*-->

<div2 role="1.0" id="datatype-dichotomies" dg="trm1">
<head>Datatype
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Distinctions</phrase></head>

<p>It is useful to categorize the datatypes defined in this
specification along various dimensions, <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">defining terms which
can be used to characterize datatypes and the <dtref ref="std"/>s
which define them</phrase>.</p>

<div3 role="1.0" id="atomic-vs-list">
<head>Atomic vs. List vs. Union Datatypes</head>

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

<p dg="rq120">First, we distinguish <termref def="dt-atomic"/>,
<termref def="dt-list"/>, and <termref def="dt-union"/> datatypes.</p>

<p diff="add" dg="b3244"><termdef id="dt-atomic-value" term="atomic value">An
<term>atomic value</term> is an elementary value, not
constructed from simpler values by any <phrase dg="ep26">user-accessible</phrase>
means defined by this specification.</termdef></p>

<ulist>
<item>
<p><termdef id="dt-atomic" term="atomic"><term>Atomic</term> datatypes
are those <phrase diff="del" dg="b3244">having values <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">treated</phrase> by
this specification as <!--*
* material suppressed here by diff group rq120 *
*-->
indivisible</phrase><phrase diff="add" dg="b3244">whose
<termref def="dt-value-space">value spaces</termref> contain only <termref def="dt-atomic-value">atomic values</termref></phrase>.<phrase dg="aat">  
<term>Atomic</term> datatypes are <!--* <phrase diff="del" dg="aatj">those derived from
<dtref ref="anyAtomicType"/></phrase> *--> <dtref ref="anyAtomicType"/> and all 
datatypes 
<!--*
* material suppressed here by diff group rq120 *
*--><termref def="dt-derived" dg="rq120"/> from it.</phrase></termdef></p>
</item>
<item>
<p><termdef id="dt-list" term="list"><term>List</term> datatypes are
those having values each of which consists of a finite-length
(possibly empty) sequence of <phrase diff="del" dg="b3244">values of an</phrase><phrase diff="add" dg="b3244"><termref def="dt-atomic-value">atomic values</termref>.  The values in a list are
drawn from some</phrase>
<termref def="dt-atomic"/> datatype<phrase dg="rq120"> (or <phrase diff="add" dg="b3244">from</phrase>
a <termref def="dt-union"/> of <termref def="dt-atomic"/> datatypes), which is
the <termref def="dt-itemType"/> of the <term>list</term></phrase>. <!--*
* material suppressed here by diff group aat1 *
*--> </termdef></p>
<note diff="add" dg="b3228">
<p>It is a consequence of constraints normatively specified
elsewhere in this document that the <termref def="dt-itemType"/> of a list <rfc2119>may</rfc2119> be any <termref def="dt-atomic"/> datatype,
or any <termref def="dt-union"/> datatype whose <termref def="dt-transitivemembership"/>
consists solely of <termref def="dt-atomic"/> datatypes (so a <termref def="dt-list"/> of a <termref def="dt-union"/> of
<termref def="dt-atomic"/> datatypes is possible, but not a <termref def="dt-list"/> of a <termref def="dt-union"/> of <termref def="dt-list">lists</termref>).
The <termref def="dt-itemType"/> of a list <rfc2119>must not</rfc2119> 
itself be a list datatype.</p>
</note>
</item>
<item>
<p><termdef id="dt-union" term="union"><term>Union</term> datatypes
are <phrase dg="b2044">(a) </phrase>those whose <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-value-space">value spaces</termref><phrase dg="b2044">,</phrase><!--*
* material suppressed here by diff group b2044 *
*-->
<termref def="dt-lexical-space">lexical spaces</termref><phrase dg="b2044">, and
<termref def="dt-lexical-mapping">lexical mappings</termref></phrase> are the union of the <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-value-space">value spaces</termref><phrase dg="b2044">,</phrase><!--*
* material suppressed here by diff group b2044 *
*-->
<termref def="dt-lexical-space">lexical spaces</termref><phrase dg="b2044">, and
<termref def="dt-lexical-mapping">lexical mappings</termref></phrase> of one or more other datatypes<phrase dg="rq120">, which are the <termref def="dt-memberTypes"/> of the
union</phrase><phrase dg="b2044">, or (b) those derived by
<termref def="dt-fb-restriction"/> of another union datatype</phrase>.<!--*
* material suppressed here by diff group aat1 *
*--> </phrase></phrase></termdef></p>

<note diff="add" dg="b3228">
<p>It is a consequence of constraints normatively specified
elsewhere in this document that any <termref def="dt-primitive"/> or <termref def="dt-ordinary"/> datatype <rfc2119>may</rfc2119> occur
among the <termref def="dt-memberTypes"/> of a <termref def="dt-union"/>.  (In particular,
<termref def="dt-union"/> datatypes may themselves be members of 
<termref def="dt-union">unions</termref>, as may <termref def="dt-list">lists</termref>.)  The only prohibition is that no <termref def="dt-special"/>
datatype may be a member of a <termref def="dt-union"/>.
</p>
</note></item>
</ulist>

<p>For example, a single token which <termref def="dt-match">matches</termref> <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Nmtoken">Nmtoken</xspecref> from
<bibref ref="XML"/> <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">is in the value
space</phrase> of <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">the</phrase> <termref def="dt-atomic"/> datatype <!--*
* material suppressed here by diff group rq120 *
*--><dtref ref="NMTOKEN"/><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">,</phrase> while a sequence of such tokens <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">is in the value space of the</phrase> <termref def="dt-list"/>
datatype <!--*
* material suppressed here by diff group rq120 *
*--><dtref ref="NMTOKENS"/><!--*
* material suppressed here by diff group rq120 *
*-->.
</p>

<div4 role="1.0" id="atomic">
<head>Atomic Datatypes</head>

<p diff="del" dg="b3230"><!--*
* material suppressed here by diff group aatf *
*--><phrase dg="aatf">An
<termref def="dt-atomic"/> datatype
has a <termref def="dt-value-space"/> consisting of a set of
<unusual>atomic</unusual> values which for purposes of this specification
are not further decomposable. </phrase> 
The <termref def="dt-lexical-space"/> of
an <termref def="dt-atomic"/> datatype is a set of
<!--*
* material suppressed here by diff group rq21-lit *
*--><phrase dg="rq21-lit"><termref def="dt-literal">literals</termref></phrase>
whose internal structure is specific to the datatype in question. 
<phrase dg="aatf">There is one
<!--*
* material suppressed here by diff group rq120 *
*--><termref def="dt-special" dg="rq120"/>
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-atomic"/> datatype</phrase>
(<dtref ref="anyAtomicType"/>)<phrase dg="rq120">,</phrase> and a
number of <termref def="dt-primitive"/> <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-atomic"/>
datatypes</phrase> which have
<dtref ref="anyAtomicType"/> as their <!--*
* material suppressed here by diff group rq120 *
*--><termref def="dt-basetype" dg="rq120"/>. 
All other <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-atomic"/> datatypes</phrase> are
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">derived</phrase>
either from one of the
<!--*
* material suppressed here by diff group rq120 *
*--><termref def="dt-primitive" dg="rq120"/>
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-atomic"/> datatypes</phrase> or from another
<!--*
* material suppressed here by diff group rq120 *
*--><termref def="dt-ordinary"/>
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-atomic"/> datatype</phrase>.  No
<!--*
* material suppressed here by diff group rq120 *
*--><termref def="dt-user-defined" dg="rq120"/>
<phrase dg="rq120">data</phrase>type may have <dtref ref="anyAtomicType"/> 
as its <!--*
* material suppressed here by diff group rq120 *
*--><termref def="dt-basetype" dg="rq120"/>.</phrase></p>

<p diff="add" dg="b3230">An <termref def="dt-atomic"/> datatype has a <termref def="dt-value-space"/>
consisting of a set of <unusual>atomic</unusual> or elementary values.</p>
<note diff="add" dg="b3230">
<p>Atomic values are sometimes regarded, and described, as <quote>not
decomposable</quote>, but in fact the values in several datatypes
defined here are described with internal structure, which is appealed
to in checking whether particular values satisfy various constraints
(e.g. upper and lower bounds on a datatype).  Other specifications
which use the datatypes defined here may define operations which
attribute internal structure to values and expose or act upon that
structure.</p>
</note>
<p diff="add" dg="b3230">
The <termref def="dt-lexical-space"/> of an <termref def="dt-atomic"/> datatype is a set of <termref def="dt-literal">literals</termref>
whose internal structure is specific to the datatype in
question.</p>
<p diff="add" dg="b3230">There is one <termref def="dt-special"/> <termref def="dt-atomic"/> datatype
(<dtref ref="anyAtomicType"/>), and a number of <termref def="dt-primitive"/> <termref def="dt-atomic"/>
datatypes which have <dtref ref="anyAtomicType"/> as their
<termref def="dt-basetype"/>.  All other <termref def="dt-atomic"/> datatypes are derived either
from one of the <termref def="dt-primitive"/> <termref def="dt-atomic"/> datatypes or from another
<termref def="dt-ordinary"/> <termref def="dt-atomic"/> datatype.  No <termref def="dt-user-defined"/> datatype <rfc2119>may</rfc2119> have
<dtref ref="anyAtomicType"/> as its <termref def="dt-basetype"/>.</p>

</div4>

<div4 role="1.0" id="list-datatypes">
<head>List Datatypes</head>
<!-- question: are lists ordered? answer should be NO...the sequence
within a single value is ordered, but the value space is a list type
is not ordered
-->

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

<p diff="del" dg="b3231">
Several type systems (such as the one described in
<bibref ref="ISO11404"/>) treat <termref def="dt-list"/> datatypes as
special cases of the more general notions of aggregate or collection
datatypes.</p>

<p><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-list">List</termref></phrase> datatypes are always <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-constructed"/><phrase dg="rq120"> from some other type; they are never
<termref def="dt-primitive"/></phrase>.  The <termref def="dt-value-space"/> of a <termref def="dt-list"/> datatype is
<phrase diff="del" dg="b3227">a</phrase><phrase diff="add" dg="b3227">the</phrase> set of finite-length sequences of
<!--* WG suppresses this 'ordinary', 2005-02-04 *-->
<!--* <phrase diff="add" dg="aatf">ordinary </phrase> *-->
<phrase diff="add" dg="b5625">zero or more</phrase>
<termref def="dt-atomic"/>
values<phrase diff="add" dg="b3227">
where each <termref def="dt-atomic"/> value is drawn from the <termref def="dt-value-space"/> of the lists's <termref def="dt-itemType"/>
and has a <termref def="dt-lexical-representation"/> containing no
whitespace</phrase>. 
The <termref def="dt-lexical-space"/> of a
<termref def="dt-list"/> datatype is a set of 
<termref def="dt-literal">literals</termref> <!--* <phrase dg="rq120" diff="add">&lexical_representations;</phrase>  *-->
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">each
of which</phrase> 
is a space-separated sequence of
<termref def="dt-literal">literals</termref>
<!--* <phrase dg="rq120" diff="add">&lexical_representations;</phrase> *-->
of the
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-itemType"/></phrase>.</p>

<p><termdef id="dt-itemType" term="item type">
The <termref def="dt-atomic"/> or <termref def="dt-union"/>
datatype that participates in the definition of a <termref def="dt-list"/> datatype
is <!--*
* material suppressed here by diff group rq120 *
*-->the 
<!--*
* material suppressed here by diff group rq120 *
*--><term dg="rq120">item type</term> 
of that <termref def="dt-list"/> datatype.</termdef><phrase dg="rq120">  If 
the <termref def="dt-itemType"/> is a <termref def="dt-union"/>, each of its 
<!--*
* material suppressed here by diff group b2044 *
*--><phrase dg="b2044"><termref def="dt-basicmember">basic members</termref></phrase> <rfc2119>must</rfc2119> be 
<termref def="dt-atomic"/>.</phrase></p>

<note role="example">
<eg xml:space="preserve">
&lt;simpleType name='sizes'&gt;
  &lt;list itemType='decimal'/&gt;
&lt;/simpleType&gt;
</eg>
<eg xml:space="preserve">
&lt;cerealSizes xsi:type='sizes'&gt; 8 10.5 12 &lt;/cerealSizes&gt;
</eg>
</note>

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

<p>A <termref def="dt-list"/> datatype can be 
<!--*
* material suppressed here by diff group rq120 *
*--><termref def="dt-constructed" dg="rq120"/>
from an <phrase dg="aatf">ordinary 
</phrase><phrase dg="rq120o">or
<termref def="dt-primitive"/> </phrase><termref def="dt-atomic"/> 
datatype whose <termref def="dt-lexical-space"/> allows
<phrase diff="del" dg="b3233">space</phrase><phrase diff="add" dg="b3233">whitespace</phrase>
(such as <dtref ref="string"/> or <dtref ref="anyURI"/>) or a
<termref def="dt-union"/> datatype any of whose 
<propref comp="std" prop="member type definitions"/>'s
<termref def="dt-lexical-space"/> allows space.
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Since <termref def="dt-list"/>
items are separated at whitespace before the
<termref def="dt-lexical-representation">lexical representations</termref>
of the items are mapped to values, no whitespace will ever occur
in the <termref def="dt-lexical-representation"/>
of a <termref def="dt-list"/> item, even when the item
type would in principle allow it.  
<!--* For the same reason, when whitespace is
<emph>required</emph> in every &lexical_representation; of a
value in the &value_space; of the &itemType;,
that value can never occur as an item of any of the
<termref def="dt-list">list&apos;s</termref> values</phrase>.
*-->
For the same reason, when every possible
<termref def="dt-lexical-representation"/> of a given
value in the <termref def="dt-value-space"/> of the <termref def="dt-itemType"/>
includes whitespace,
that value can never occur as an item in any value of the
<termref def="dt-list"/> datatype.</phrase></p>
<!--* wouldn't 'value in the item type' be more concise? *-->
<!--*
* material suppressed here by diff group pre *
*-->
<note role="example">
<eg xml:space="preserve">
&lt;simpleType name='listOfString'&gt;
  &lt;list itemType='string'/&gt;
&lt;/simpleType&gt;
</eg>
<eg xml:space="preserve">
&lt;someElement xsi:type='listOfString'&gt;
this is not list item 1
this is not list item 2
this is not list item 3
&lt;/someElement&gt;
</eg>

<p>In the above example, the value of the <emph>someElement</emph> element
is not a <termref def="dt-list"/> of <termref def="dt-length"/> 3;
rather, it is a <termref def="dt-list"/> of <termref def="dt-length"/>
18.</p>
</note>
<!--
     somehow need to get the <has-facets> concept for abstract lists
	 into built-in.xsd, so that the following can be auto-generated
  -->
<p>When a datatype is derived 
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">by 
<termref def="dt-fb-restriction">restricting</termref></phrase> a
<termref def="dt-list"/> datatype, the following
<termref def="dt-constraining-facet">constraining facets</termref> apply:
<ulist>
<item><p><termref def="dt-length"/></p></item>
<item><p><termref def="dt-maxLength"/></p></item>
<item><p><termref def="dt-minLength"/></p></item>
<item><p><termref def="dt-enumeration"/></p></item>
<item><p><phrase dg="ed-pattern"><termref def="dt-pattern"/></phrase><!--*
* material suppressed here by diff group ed-pattern *
*--></p></item>
<item><p><termref def="dt-whiteSpace"/></p></item>
<item diff="add" dg="b5030"><p><termref def="dt-assertions"/></p></item>
</ulist>
</p>

<p>For each of <termref def="dt-length"/>, <termref def="dt-maxLength"/>
and <termref def="dt-minLength"/>, the 
<emph><!--*
* material suppressed here by diff group rq120 *
*-->length</emph> is
measured in number 
of list 
items.  The value of <termref def="dt-whiteSpace"/>
is fixed to the value <pt>collapse</pt>.</p>

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

<p>For <termref def="dt-list"/> datatypes the <termref def="dt-lexical-space"/>
is composed of space-separated
<termref def="dt-literal">literals</termref>
of <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">the</phrase> 
<termref def="dt-itemType"/>.  
<!--* Hence, any
&pattern.tc; specified when a new datatype is
&derived; from a &list; datatype is matched against
<phrase diff="del" dg="rq120">each literal of the &list; 
datatype and not against the literals of the datatype that serves as its
&itemType;</phrase><phrase diff="add" dg="rq120">the 
&lexical_representations; of the &list; as a whole, 
not against the &lexical_representations; of the individual list items</phrase>.
*-->
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">A</phrase>ny 
<phrase dg="ed-pattern"><termref def="dt-pattern"/></phrase><!--*
* material suppressed here by diff group ed-pattern *
*--> specified when a new datatype is
derived from a <termref def="dt-list"/> datatype 
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">applies
to the members of the <termref def="dt-list"/> datatype's
<termref def="dt-lexical-space"/>, not to the members of the <termref def="dt-lexical-space"/>
of the <termref def="dt-itemType"/>.<phrase diff="add" dg="b3234">  Similarly, 
<!--*
* material suppressed here by diff group ep26 *
*--><phrase dg="ep26">enumerated
values are compared to the entire <termref def="dt-list"/></phrase>, not <phrase dg="ep26">to
individual</phrase> list items<phrase dg="b5030">,
and <compref ref="f-a"/> apply to the entire <termref def="dt-list"/> too</phrase>.</phrase></phrase>
<phrase diff="add" dg="b2046">Lists are identical if and only if they have the
same length and their items are pairwise identical; they are
equal if and only if they have the same length and their items
are pairwise equal.  And <!--*
* material suppressed here by diff group wgi-20080530 *
*-->
a list of length one whose item is an atomic value <var>V1</var> is
<!--*
* material suppressed here by diff group wgi-20080530 *
*--><phrase dg="wgi-20080530">equal</phrase> 
to an atomic value <var>V2</var> 
if and only if <var>V1</var> is <!--*
* material suppressed here by diff group wgi-20080530 *
*--><phrase dg="wgi-20080530">equal</phrase> to <var>V2</var>.
</phrase></p>

<note role="example">
<eg xml:space="preserve">&lt;xs:simpleType name='myList'&gt;
	&lt;xs:list itemType='xs:integer'/&gt;
&lt;/xs:simpleType&gt;
&lt;xs:simpleType name='myRestrictedList'&gt;
	&lt;xs:restriction base='myList'&gt;
		&lt;xs:pattern value='123 (\d+\s)*456'/&gt;
	&lt;/xs:restriction&gt;
&lt;/xs:simpleType&gt;
&lt;someElement xsi:type='myRestrictedList'&gt;123 456&lt;/someElement&gt;
&lt;someElement xsi:type='myRestrictedList'&gt;123 987 456&lt;/someElement&gt;
&lt;someElement xsi:type='myRestrictedList'&gt;123 987 567 456&lt;/someElement&gt;

</eg>
</note>
<!--*
* material suppressed here by diff group rq120 *
*-->

<p dg="rq120">The <termref def="dt-canonical-mapping"/> of a 
<termref def="dt-list"/> datatype maps each value onto the 
space-separated concatenation of the 
<!--*
* material suppressed here by diff group rq120o *
*--><phrase dg="rq120o"><termref def="dt-canonical-representation">canonical 
representations</termref> of all the items in the value</phrase>
(in order), using the <termref def="dt-canonical-mapping"/> of the 
<termref def="dt-itemType"/>.</p>
<!--* MSM finds this wordier, but not clearer or more precise.  Sigh. *-->

</div4>

<div4 role="1.0" id="union-datatypes">
<head>Union datatypes</head>

<p>
<!--*
* material suppressed here by diff group b3025-aux *
*--> 
<phrase dg="b2044"><!--*
* material suppressed here by diff group b3025-aux *
*--> 
<!--*
* material suppressed here by diff group b3025-aux *
*--></phrase> 
<!--*
* material suppressed here by diff group b3025-aux *
*-->
</p>

<p dg="b3025-aux"><phrase id="p2413a" dg="b3025-aux"><!--*
* material suppressed here by diff group b2044 *
*--> </phrase> <phrase dg="b2044"><phrase id="p2413b" dg="b3025-aux">Union types
may be defined in either of two ways.  When a union type is
<termref def="dt-constructed"/> by <termref def="dt-union"/>, its <termref def="dt-value-space"/>, <termref def="dt-lexical-space"/>, and
<termref def="dt-lexical-mapping"/> are the <unusual>ordered unions</unusual> of the
<termref def="dt-value-space">value spaces</termref>, <termref def="dt-lexical-space">lexical spaces</termref>, and <termref def="dt-lexical-mapping">lexical mappings</termref> of its
<termref def="dt-memberTypes"/>.</phrase></phrase></p>

<p>It will be observed that the <termref def="dt-lexical-mapping"/> of a union, so
defined, is not necessarily a function: a given <termref def="dt-literal"/> may map to
one value or to several values of different <termref def="dt-primitive"/> datatypes, and
it may be indeterminate which value is to be preferred in a particular
context.  When the datatypes defined here are used in the context of
<bibref ref="structural-schemas"/>, the <att>xsi:type</att> attribute defined by that
specification in section <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#xsi_type">xsi:type</xspecref> can be used to indicate
which value a <termref def="dt-literal"/> which is the content of an element should map
to.  In other contexts, other rules (such as type coercion rules) may
be employed to determine which value is to be used.</p>

<p dg="b3025-aux"><phrase dg="b2044"><phrase id="p2413c" dg="b3025-aux">When a union type is defined by
<termref def="dt-fb-restriction">restricting</termref> another <termref def="dt-union"/>, its <termref def="dt-value-space"/>, <termref def="dt-lexical-space"/>,
and <termref def="dt-lexical-mapping"/> are subsets of the <termref def="dt-value-space">value spaces</termref>,
<termref def="dt-lexical-space">lexical spaces</termref>, and <termref def="dt-lexical-mapping">lexical mappings</termref> of its
<termref def="dt-basetype"/>.</phrase></phrase></p>

<p dg="b3025-aux"><phrase id="p2413d" dg="b3025-aux"><termref def="dt-union">Union</termref> datatypes are always <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-constructed"/><phrase dg="rq120"><phrase dg="rq120o"> from other
datatypes</phrase>; they are never <termref def="dt-primitive"/></phrase>. Currently,
there are no <termref def="dt-built-in"/> <termref def="dt-union"/> datatypes.</phrase></p>


<note role="example">
<p>A prototypical example of a <termref def="dt-union"/> type is the
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#p-max_occurs">maxOccurs attribute</xspecref> on the
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#element-element">element element</xspecref>
in XML Schema itself: it is a union of nonNegativeInteger
and an enumeration with the single member, the string "unbounded", as shown below.</p>

<eg xml:space="preserve">
  &lt;attributeGroup name="occurs"&gt;
    &lt;attribute name="minOccurs" type="nonNegativeInteger"
    	use="optional" default="1"/&gt;
    &lt;attribute name="maxOccurs"use="optional" default="1"&gt;
      &lt;simpleType&gt;
        &lt;union&gt;
          &lt;simpleType&gt;
            &lt;restriction base='nonNegativeInteger'/&gt;
          &lt;/simpleType&gt;
          &lt;simpleType&gt;
            &lt;restriction base='string'&gt;
              &lt;enumeration value='unbounded'/&gt;
            &lt;/restriction&gt;
          &lt;/simpleType&gt;
        &lt;/union&gt;
      &lt;/simpleType&gt;
    &lt;/attribute&gt;
  &lt;/attributeGroup&gt;
</eg>
</note>

<p>Any number <phrase diff="del" dg="b2861">(greater than 
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">0</phrase>)</phrase><phrase diff="add" dg="b2861">(zero or more)</phrase> 
<!--* !!! N.B. substantive change (perhaps should not be in rq120, but I'll
    * leave it here for now):  the rest of the spec does NOT say unions have
    * to have at least two members.  Me, I don't see why they should be
    * required to have any at all.  When the WG discusses rq120, this
    * substantive change should be called out.
    *-->
of <phrase dg="aatf">ordinary
</phrase><phrase dg="rq120o"> or
<termref def="dt-primitive"/> </phrase><!--*
* material suppressed here by diff group b2044 *
*-->
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-datatype">datatypes</termref></phrase>
can participate in a <termref def="dt-union"/> type.</p>

<p><termdef id="dt-memberTypes" term="member types">
The datatypes that participate in the
definition of a <termref def="dt-union"/> datatype are known as the
<!--*
* material suppressed here by diff group rq120 *
*--><term dg="rq120">member types</term> 
of that <termref def="dt-union"/> datatype.</termdef></p>

<p dg="b2044"><termdef id="dt-transitivemembership" term="transitive membership">The <term>transitive membership</term> of
a <termref def="dt-union"/> is the set of its own <termref def="dt-memberTypes"/>, and the <termref def="dt-memberTypes"/>
of its members, and so on. More formally, if <var>U</var> is a
<termref def="dt-union"/>, then (a) its <termref def="dt-memberTypes"/> are in the transitive membership
of <var>U</var>, and (b) for any datatypes <var>T1</var> and
<var>T2</var>, if <var>T1</var> is in the transitive membership of
<var>U</var> and <var>T2</var> is one of the <termref def="dt-memberTypes"/> of
<var>T1</var>, then <var>T2</var> is also in the transitive membership
of <var>U</var>.</termdef></p>

<p diff="add" dg="b3235">The <termref def="dt-transitivemembership"/>
of a <termref def="dt-union"/> <rfc2119>must not</rfc2119> contain the <termref def="dt-union"/> itself, nor
any datatype derived or <termref def="dt-constructed"/> from the <termref def="dt-union"/>.
</p>

<p dg="b2044"><termdef id="dt-basicmember" term="basic member">Those members of the <termref def="dt-transitivemembership"/>
of a <termref def="dt-union"/> datatype <var>U</var> which are themselves not <termref def="dt-union"/>
datatypes<!--* , but &atomic; or &list; datatypes, *-->
are the <term>basic members</term> of <var>U</var>.</termdef></p>

<!--* <ednote diff="add" dg="b2044">
<edtext>If <dtref ref="anySimpleType"/> is allowed as a member
of a &union;, the preceding definition will need to be revised
slightly to avoid the restriction to lists and atomics.</edtext>
</ednote> *-->
<!--ednote><edtext>I hope to rewrite the following para somehow in terms of the 
STD itself rather than a schema document fragment.&emsp;&mdash;DP</edtext></ednote>
I hope to do better but the current fix below will do for now. -->

<p dg="b2044"><termdef id="dt-interveningunion" term="intervening union">If a datatype <var>M</var> is in the
<termref def="dt-transitivemembership"/> of a <termref def="dt-union"/>
datatype <var>U</var>, but not one of <var>U</var>'s <termref def="dt-memberTypes"/>,
then a sequence of one or more <termref def="dt-union"/> datatypes necessarily exists,
such that the first is one of the <termref def="dt-memberTypes"/> <phrase diff="del" dg="ep26">if</phrase><phrase diff="add" dg="ep26">of</phrase> <var>U</var>, each
is one of the <termref def="dt-memberTypes"/> of its predecessor in the sequence, and
<var>M</var> is one of the <termref def="dt-memberTypes"/> of the last in the sequence.
The <termref def="dt-union"/> datatypes in this sequence are said to
<term>intervene</term> between <var>M</var> and <var>U</var>. When
<var>U</var> and <var>M</var> are given by the context, the datatypes
in the sequence are referred to as the <term>intervening unions</term>.
When <var>M</var> is one of the <termref def="dt-memberTypes"/> of <var>U</var>,
the set of <term>intervening unions</term> is the empty set.
</termdef>
</p>

<p dg="b2449-vi">
<termdef id="dt-active-member" term="active member type">In a valid
instance of any <termref def="dt-union"/>, the first of its members in order which
accepts the instance as valid is the <term>active member
type</term>.</termdef> 
<termdef id="dt-active-basic-member" term="active basic member">If the <termref def="dt-active-member"/> is
itself a <termref def="dt-union"/>, one of <emph>its</emph> members will be
<emph>its</emph> <termref def="dt-active-member"/>, and so on, until
finally a <termref def="dt-basicmember">basic (non-union)
member</termref> is reached. That <termref def="dt-basicmember"/> is
the <term>active basic member</term> of the union.</termdef>
</p>

<p>The order in which the <termref def="dt-memberTypes"/> are specified in the
definition (that is, <phrase dg="rq120">in the case of
datatypes defined in a schema document, </phrase>the order of the
&lt;simpleType&gt; children of the &lt;union&gt; element, or the order
of the <dtref ref="QName"/>s in the <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><att>memberTypes</att> </phrase> attribute) is
significant. During validation, an element or attribute's value is
validated against the <termref def="dt-memberTypes"/> in the order in which they appear
in the definition until a match is found.  <phrase diff="del" dg="b3227">The</phrase> <phrase diff="add" dg="b3227">As noted above,
the</phrase> evaluation order can be overridden with the use of
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#xsi_type">xsi:type</xspecref>.</p>

<note>

<p>For example, given the definition below, the first instance of the &lt;size&gt; element
validates correctly as an <specref ref="integer"/>, the second and third as
<specref ref="string"/>.</p>

<eg xml:space="preserve">
  &lt;xsd:element name='size'&gt;
    &lt;xsd:simpleType&gt;
      &lt;xsd:union&gt;
        &lt;xsd:simpleType&gt;
          &lt;xsd:restriction base='integer'/&gt;
        &lt;/xsd:simpleType&gt;
        &lt;xsd:simpleType&gt;
          &lt;xsd:restriction base='string'/&gt;
        &lt;/xsd:simpleType&gt;
      &lt;/xsd:union&gt;
    &lt;/xsd:simpleType&gt;
  &lt;/xsd:element&gt;
</eg>

<eg xml:space="preserve">
  &lt;size&gt;1&lt;/size&gt;
  &lt;size&gt;large&lt;/size&gt;
  &lt;size xsi:type='xsd:string'&gt;1&lt;/size&gt;
</eg>
</note>

<!--*
* material suppressed here by diff group rq120 *
*-->
<p dg="rq120">The <termref def="dt-canonical-mapping"/> of 
a <termref def="dt-union"/> datatype maps each value onto the 
<termref def="dt-canonical-representation"/> of that value obtained 
using the <termref def="dt-canonical-mapping"/> of the first 
<termref def="dt-memberTypes">member type</termref> in whose value space it lies.</p>
<!--* Longer, yes.  Clearer?  More precise? Oh, well. *-->

<note diff="del" dg="b3237">
<p>A datatype which is <termref def="dt-atomic"/> in this specification
need not be an <unusual>atomic</unusual> datatype in any programming language used to
implement this specification.  Likewise, a datatype which is a
<termref def="dt-list"/> in this specification need not be a "list"
datatype in any programming language used to implement this specification.
Furthermore, a datatype which is a <termref def="dt-union"/> in this
specification need not be a "union" datatype in any programming
language used to implement this specification.</p>
</note>

<p diff="add" dg="b5062">
When a datatype is derived by <termref def="dt-fb-restriction">restricting</termref> a
<termref def="dt-union"/> datatype, the following
<termref def="dt-constraining-facet">constraining facets</termref> apply:
<ulist>
<item><p><termref def="dt-enumeration"/></p></item>
<item><p><phrase dg="ed-pattern"><termref def="dt-pattern"/></phrase><!--*
* material suppressed here by diff group ed-pattern *
*--></p></item>
<item dg="b5030tf"><p><termref def="dt-assertions"/></p></item>
</ulist>
</p>
<!--*
* material suppressed here by diff group b5062xx *
*-->
</div4>
</div3>

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

<!--* !!! this was not marked as deleted in WD of July 2004.
    * When fa1 is split, this is post-wd
    *-->
<div3 id="primitive-vs-derived">
<head><phrase dg="rq120o">Special vs. </phrase>Primitive vs.
<!--*
* material suppressed here by diff group fa1.z *
*--><phrase dg="fa1.z"><!--*
* material suppressed here by diff group rq120o *
*--><phrase dg="rq120o">Ordinary</phrase>
Datatypes</phrase></head>

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

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

<p dg="rq120o">Next, we distinguish <termref def="dt-special"/>,
<termref def="dt-primitive"/>, and <termref def="dt-ordinary"/> 
(or <termref def="dt-constructed"/>) datatypes.<phrase diff="add" dg="b3238"> 
<!--*
* material suppressed here by diff group ep26 *
*--><phrase dg="ep26">Each
datatype</phrase> defined by <phrase dg="ep26">or in accordance
with</phrase> this specification fall<phrase dg="ep26">s</phrase> 
into <phrase dg="ep26">exactly one of</phrase> these
categories.</phrase></p>

<ulist>
<item dg="rq120o">
<p><termdef id="dt-special" term="special">The <term>special</term>
datatypes are <dtref ref="anySimpleType"/> and 
<dtref ref="anyAtomicType"/>.</termdef> They are special by virtue of their
position in the type hierarchy<!--*
* material suppressed here by diff group lm.rel *
*-->.</p>
</item>

<item>
<p><termdef id="dt-primitive" term="primitive"><term>Primitive</term>
datatypes are those 
<phrase dg="rq120"><!--*
* material suppressed here by diff group rq120o *
*-->datatypes</phrase> that are not
<phrase dg="rq120o"><termref def="dt-special"/> and are
not</phrase> defined in terms of other datatypes;
they exist <emph>ab initio</emph>.</termdef>
<phrase dg="rq120">All <termref def="dt-primitive"/> datatypes have 
<dtref ref="anyAtomicType"/> as their
<termref def="dt-basetype"/>, but their <termref def="dt-value-space">value</termref>
and <termref def="dt-lexical-space">lexical spaces</termref>
must be given in prose; they cannot be described as 
<termref def="dt-fb-restriction">restrictions</termref> of
<dtref ref="anyAtomicType"/> by the application of particular 
<termref def="dt-constraining-facet">constraining facets</termref>.</phrase></p>
<note diff="add" dg="b3251">
<p>As normatively specified elsewhere, 
conforming processors <rfc2119>must</rfc2119> support all the
primitive datatypes defined in this specification; it is
<termref def="key-impl-def"/> whether other primitive datatypes are
supported.</p>
</note>
</item>

<item dg="rq120o">
<p><termdef id="dt-ordinary" term="ordinary"><term>Ordinary</term>
datatypes are all datatypes other than the <termref def="dt-special"/> 
and <termref def="dt-primitive"/> datatypes.</termdef> 
<!--* 'dt-constructed' used to be here. ... *-->
<termref def="dt-ordinary">Ordinary</termref> datatypes
can be understood fully in terms of their <compref ref="std"/> and 
the properties of the datatypes from which they are <termref def="dt-constructed"/>.</p>
</item>

<!--*
* material suppressed here by diff group rq120o *
*-->
</ulist>

<p>For example, in this specification, <dtref ref="float"/> is a 
<phrase dg="rq120"><termref def="dt-primitive"/> datatype based on 
a </phrase>well-defined mathematical concept
<!-- find example other than float -->
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">and
not</phrase> 
defined in terms of other datatypes, while<!--*
* material suppressed here by diff group rq120 *
*-->
<dtref ref="integer"/> is <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-constructed"/>
from</phrase> the more general datatype <dtref ref="decimal"/>.</p>

<!--* <issue id="diff-RQ-141i" role="1.1" diff="del" dg="aat">
<p><loc href="&reqs;#anyAtomicType" target="reqs">RQ-141 (add abstract
anyAtomicType)</loc> <loc href="&reqs;#fundamentals" target="reqs">RQ-24
(systematic facets: status and value space of
anySimpleType)</loc></p>
<p>A new <term>special</term> datatype will be introduced as a child
of anySimpleType and the base type of all primitive atomic datatypes.</p>
</issue> *-->

<!--* <ednote diff="add" dg="rq120">
<edtext>The definition of anySimpleType has not been deleted, only
moved to a more appropriate location.</edtext>
</ednote> *-->
  
<!--*
* material suppressed here by diff group rq120 *
*-->

<p diff="del" dg="b3238">The <!--*
* material suppressed here by diff group rq120c *
*-->
datatypes defined by this specification fall into
<!--*
* material suppressed here by diff group rq120o *
*--> the <phrase dg="rq120o">categories
<termref def="dt-special"/>,</phrase>
<termref def="dt-primitive"/><phrase dg="rq120o">,</phrase> and 
<!--*
* material suppressed here by diff group rq120 *
*--><!--*
* material suppressed here by diff group rq120o *
*--><phrase dg="rq120o"><termref def="dt-ordinary"/></phrase>.  It 
is felt that a judiciously chosen set of
<termref def="dt-primitive"/> datatypes will serve <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">a wide</phrase> audience by 
providing a set of convenient datatypes that
can be used as is, as well as providing a rich enough base from
which <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">a 
large</phrase> variety of datatypes needed by schema designers can be
<!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-constructed"/>.</p>

<!--*
* material suppressed here by diff group rq120 *
*-->
<!--* MSM reverted proposed change from 'derived' to 'constructed'.
Both are true as the terms are now defined, but for definitions which
derive by restriction we elsewhere prefer the term 'derived'. 
MSM then deleted it on the grounds that in the last three days alone
the paragraph has caused more trouble than it's worth. *-->

<note diff="del" dg="b3237">
<p>A datatype which is <termref def="dt-primitive"/> in this specification
need not be a <unusual>primitive</unusual>
  datatype in any programming language used to
implement this specification.  Likewise, a datatype which is
<!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-constructed"/>
in this specification <phrase dg="rq120">from
some other datatype</phrase> need not be a <unusual>derived</unusual> 
datatype in any programming language used to implement
this specification.</p>
</note>

<!-- We just said what follows above; why repeat it?  We should get rid of
     the internal diffs; I don't want to deal with it now. -->
<!--*
* material suppressed here by diff group rq120 *
*-->

<div4 role="1.0" id="restriction">
<head><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Facet-based Restriction</phrase></head>

<!--* 2006-01-08 del_dt-restriction does not work as ID here, because
    * it causes an ID of 'restriction' to be emitted in the HTML,
    * when dg rq120 is shown coloured.
    * del-dt-restriction doesn't work either because it causes an
    * ID of dt-restriction to be emitted.  Both are duplicate IDs.
    * This section is processed by dg.xsl in id-cleanup mode because
    * diff group trm1 (not approved) proposed to delete it, and has
    * show="pre".
    * A word to the wise.
    *-->
<!--*
* material suppressed here by diff group rq120 *
*-->

<p dg="rq120"><termdef id="dt-fb-restriction" term="facet-based restriction">A 
datatype is defined by <term>facet-based restriction</term> of another datatype
(its <termref def="dt-basetype"/>),
when values for zero or more <termref def="dt-constraining-facet">constraining facets</termref> are specified
that serve to constrain its <termref def="dt-value-space"/> and/or its
<termref def="dt-lexical-space"/> to a subset of those of the
<termref def="dt-basetype"/>.</termdef>
The <termref def="dt-basetype"/> of a <termref def="dt-fb-restriction"/>
<rfc2119>must</rfc2119> be a <termref def="dt-primitive"/> or <termref def="dt-ordinary"/> datatype.</p>
<!--* 
On the other hand, all datatypes except <dtref ref="anySimpleType"/>
are &derived; by <term>restriction</term>, since no means
exists to expand the &lexical_space; or
&lexical_space; of a &derived; datatype
over that of its &basetype;.</termdef>&nbsp; All
&ordinary; datatypes not explicitly &constructed;
as a &list; or &union; are
&constructed; as
&restrictions;.&nbsp;
Datatypes &constructed; as
&restrictions;
do <emph>not</emph> have either &special;
datatype as their &basetype;</p>
*-->

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

<!--* <termdef id="trm1-dt-immediately-derived" term="immediately
derived">A datatype is <term>immediately derived</term> from another
if <phrase diff="add" dg="iff">and only if</phrase> it is immediately
below the other (i.e., away from the root) in the derivation
hierarchy.</termdef> *-->

<!-- NO NO NO !!!  This definition says derivation by restriction is
     the same as derivation, period.  But elsewhere derivation by restriction
     is used to mean the same as derivation from ordinary (or primitive).
     This *must* be fixed.  I don't know how, offhand, but this is not
     acceptable. -->
<!--* dp deletes the following *-->

<!-- FOLLOWING STATEMENT IS FALSE.  derivation by restriction is
     by definition just derivation, and anySimpleType is not
     derived from itself. -->
<!--* Nice catch.  Let's make it true, then. *-->
<!--* dp deletes the following paragraph *-->
<!--*  *-->
<!--* *-->
</div4>

<div4 id="list">
<head><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Construction by List</phrase></head>

<p>A <termref def="dt-list"/> datatype can be <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-constructed"/>
from another datatype (its <termref def="dt-itemType"/>) by creating
a <termref def="dt-value-space"/> that consists of <phrase diff="del" dg="b5625">a</phrase> 
finite-length sequence<phrase diff="add" dg="b5625">s</phrase>
of <phrase diff="add" dg="b5625">zero or more</phrase> values of its <termref def="dt-itemType"/>.
<phrase dg="rq120">Datatypes so <termref def="dt-constructed"/>
have <dtref ref="anySimpleType"/> as their <termref def="dt-basetype"/>.
Note that since the <termref def="dt-value-space"/> and <termref def="dt-lexical-space"/> of any <termref def="dt-list"/> 
datatype are necessarily subsets of the <termref def="dt-value-space"/> and <termref def="dt-lexical-space"/> of
<dtref ref="anySimpleType"/>, any datatype <termref def="dt-constructed"/> as a <termref def="dt-list"/> is a 
<termref def="dt-restriction"/> of its base type.
</phrase></p>
</div4>

<div4 id="union">
<head><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Construction by Union</phrase></head>

<p>One datatype can be <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-constructed"/> from one or more 
<!--*
* material suppressed here by diff group rq120fix *
*-->datatypes
<!--*
* material suppressed here by diff group rq120fix *
*-->by
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">unioning</phrase>
their <!--*
* material suppressed here by diff group b2044 *
*--><phrase dg="b2044"><termref def="dt-lexical-mapping">lexical mappings</termref></phrase>
and<phrase dg="rq120fix">, consequently, their</phrase>
<phrase dg="b2044"><termref def="dt-value-space">value spaces</termref> and</phrase>
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-lexical-space">lexical spaces</termref></phrase>. 
<phrase dg="rq120">Datatypes so <termref def="dt-constructed"/>
also have <dtref ref="anySimpleType"/> as their <termref def="dt-basetype"/>.
Note that since the <termref def="dt-value-space"/> and <termref def="dt-lexical-space"/> of any <termref def="dt-union"/> 
datatype are necessarily subsets of the <termref def="dt-value-space"/> and <termref def="dt-lexical-space"/> of
<dtref ref="anySimpleType"/>, any datatype <termref def="dt-constructed"/> as a <termref def="dt-union"/> is a 
<termref def="dt-restriction"/> of its base type.
</phrase></p>

</div4>
</div3>

<div3 dg="rq120" id="derivation">
<head>Definition, Derivation, Restriction, and Construction</head>

<p>Definition, derivation, restriction, and construction
are conceptually distinct, although in practice
they are frequently performed by the same mechanisms.</p>

<p>By <mention>definition</mention> is meant the explicit
identification of the relevant properties of a datatype,
in particular its
<termref def="dt-value-space"/>,
<termref def="dt-lexical-space"/>, and
<termref def="dt-lexical-mapping"/>. 
</p>

<p>The properties of the <termref def="dt-special"/> and <phrase diff="add" dg="b3251">the
standard</phrase>
<termref def="dt-primitive"/> datatypes are defined by this 
specification.  A <compref ref="std"/> is present for each of these 
datatypes in every valid schema; it serves as a representation of the
datatype, but by itself it does not capture all the relevant 
information and does not suffice (without knowledge
of this specification) to <emph>define</emph> the datatype.</p>

<note diff="add" dg="b3251">
<p>The properties of any <termref def="key-impl-def"/> <termref def="dt-primitive"/>
datatypes are given not here but in the documentation for
the implementation in question.</p>
</note>

<p>For all other datatypes, a <compref ref="std"/> does suffice.
The properties of an <!--*
* material suppressed here by diff group rq120c *
*--><termref dg="rq120o" def="dt-ordinary"/> datatype can be inferred
from the datatype's <compref ref="std"/> and the properties of
the <termref def="dt-basetype"/>, <termref def="dt-itemType"/>
if any, and <termref def="dt-memberTypes"/> if any.
All <!--*
* material suppressed here by diff group rq120c *
*--><termref dg="rq120o" def="dt-ordinary"/> datatypes can be defined in this way.</p>

<p>By <mention>derivation</mention> is meant the relation of
a datatype to its <termref def="dt-basetype"/>, or to the
<termref def="dt-basetype"/> of its <termref def="dt-basetype"/>,
and so on.</p>


<p><termdef id="dt-basetype" term="base type">Every datatype 
is associated with another datatype, its <term>base type</term>. 
<term>Base types</term> can be <termref def="dt-special"/>, 
<termref def="dt-primitive"/>, or 
<!--*
* material suppressed here by diff group rq120o *
*--><termref dg="rq120o" def="dt-ordinary"/>.
</termdef>
</p>
<!--* ??? revisit; MSM leans toward keeping the definition of base type
    * where it was ??? *-->
<p><termdef id="dt-immediately-derived" term="derived">A datatype 
<var>T</var> is <term>immediately derived</term> from another datatype 
<var>X</var> if and only if <var>X</var> is the 
<termref def="dt-basetype"/> of <var>T</var>.</termdef>
</p>

<p>
More generally, 
<termdef id="dt-derived" term="derived">A datatype <var>R</var> 
is <term>derived</term> from another 
datatype <var>B</var> if and only if one of the following is true:
 <ulist>
<item>
<p><var>B</var> is the <termref def="dt-basetype"/> 
of <var>R</var>.
</p>
</item>
<item>
<p>There is some datatype <var>X</var>
such that <var>X</var> is the <termref def="dt-basetype"/> 
of <var>R</var>, and <var>X</var> is derived from
<var>B</var>.</p>
</item>
</ulist>
</termdef>
</p>
<p diff="add" dg="b3239a">A datatype <rfc2119>must not</rfc2119> be 
derived from itself.  That is, the
base type relation must be acyclic.</p>
<!--* 
Since every &simple_type_definition; has a &basetype;,
it is a consequence of this definition fhat <emph>every</emph>
datatype defined by a &simple_type_definition; is a 
&derived; datatype.</p>
*-->
<p>It is a consequence of <phrase diff="del" dg="b3239a">these
definitions</phrase><phrase diff="add" dg="b3239a">the above</phrase>
that every datatype other than <dtref ref="anySimpleType"/> is
derived
from <dtref ref="anySimpleType"/>.</p>

<p>Since each datatype has exactly one <termref def="dt-basetype"/>,
and every datatype is derived directly or
indirectly from <dtref ref="anySimpleType"/>, it follows that
the <termref def="dt-basetype"/> relation arranges all
simple types into a tree structure, which is conventionally
referred to as the <emph>derivation hierarchy</emph>.</p>

<p>By <mention>restriction</mention> is meant the definition
of a datatype whose <termref def="dt-value-space"/> and <termref def="dt-lexical-space"/> are 
subsets of those of its <termref def="dt-basetype"/>.</p>

<p dg="rq120">Formally,
<termdef id="dt-restriction" term="restriction">A datatype <var>R</var> 
is a <term>restriction</term> of another 
datatype <var>B</var> when</termdef>
 <ulist>
<item>
<p>the <termref def="dt-value-space"/> of <var>R</var> is a subset of the <termref def="dt-value-space"/>
of <var>B</var>, and 
</p>
</item>
<item>
<p>the <termref def="dt-lexical-space"/> of <var>R</var> is a subset of the 
<!--*
* material suppressed here by diff group rec12-main *
*--><termref def="dt-lexical-space"/> of <var>B</var>.
</p>
</item>
</ulist>
</p>

<p>
Note that all three forms of datatype <termref def="dt-constructed">construction</termref> produce 
<termref def="dt-restriction">restrictions</termref> of the <termref def="dt-basetype"/>:
<termref def="dt-fb-restriction"/> does so by means of 
<termref def="dt-constraining-facet">constraining facets</termref>, 
while <termref def="dt-constructed">construction</termref> by <termref def="dt-list"/> or <termref def="dt-union"/> does so because those 
<termref def="dt-constructed">constructions</termref> take 
<dtref ref="anySimpleType"/> as the <termref def="dt-basetype"/>. It follows that all
datatypes are <termref def="dt-restriction">restrictions</termref> 
of <dtref ref="anySimpleType"/>.
This specification provides no means by which a datatype may be
defined so as to have a larger <termref def="dt-lexical-space"/> or <termref def="dt-value-space"/> 
than its <termref def="dt-basetype"/>.
</p>

<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<p dg="rq120"><!--*
* material suppressed here by diff group rec12-main *
*--></p>

<p>By <mention>construction</mention> is meant the creation of a
datatype by defining it in terms of another.</p>

<!--* 
<p>Every definition of a datatype
as a &fb.restriction; of another datatype,
every use of &list;
&construction; to define a datatype 
in terms of a particular &itemType;,
every use of &union;
&construction; to define a datatype 
in terms of a particular set of &member_types;,
may be said to <emph>construct</emph> a datatype.</p>
*-->
<p>
<termdef id="dt-constructed" term="constructed">All
<termref def="dt-ordinary"/> datatypes are defined in terms of, or
<term>constructed</term> from, other datatypes, either by 
<termref def="dt-fb-restriction">restricting</termref> the 
<termref def="dt-value-space"/> or <termref def="dt-lexical-space"/> 
of a <termref def="dt-basetype"/> using zero or more
<termref def="dt-constraining-facet">constraining facets</termref>
or by specifying the new datatype as a <termref def="dt-list"/> of items of some
<termref def="dt-itemType"/>,
or by defining it as a <termref def="dt-union"/> of some specified 
sequence of <termref def="dt-memberTypes"/>.</termdef>
These three forms of <termref def="dt-constructed">construction</termref>
are often called <quote><termref def="dt-fb-restriction"/></quote>,
<quote><termref def="dt-constructed">construction</termref> 
by <termref def="dt-list"/></quote>, and <quote><termref def="dt-constructed">construction</termref> by 
<termref def="dt-union"/></quote>, respectively.
Datatypes so constructed may be understood fully (for
purposes of a type system) in terms of (a) the properties
of the datatype(s) from which they are constructed, and
(b) their <compref ref="std"/>.  This distinguishes
<!--*
* material suppressed here by diff group rq120o *
*--><phrase dg="rq120o"><termref def="dt-ordinary"/>
datatypes</phrase>
from the <termref def="dt-special"/> and 
<termref def="dt-primitive"/> datatypes, which can be understood 
only in the light of documentation (namely, their descriptions 
elsewhere in this specification<phrase diff="add" dg="b3251">,
or, for <termref def="key-impl-def"/> <termref def="dt-primitive">primitives</termref>, in the appropriate
implementation-specific documentation</phrase>).
<phrase dg="rq120o">All <termref def="dt-ordinary"/>
datatypes are <termref def="dt-constructed"/>, and all
<termref def="dt-constructed"/> datatypes are 
<termref def="dt-ordinary"/>.</phrase>
</p>

</div3>

<div3 role="1.0" id="built-in-vs-user-derived">
<head>Built-in vs. User-<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Defined</phrase> Datatypes</head>
<ulist>
<item>
<p>
<termdef id="dt-built-in" term="built-in"><term>Built-in</term>
datatypes are those which are defined in this 
specification<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">; they</phrase> can 
be <!--*
* material suppressed here by diff group rq120 *
*--> 
<phrase dg="rq120"><termref def="dt-special"/>,</phrase>
<termref def="dt-primitive"/><phrase dg="rq120">,</phrase> or
<!--*
* material suppressed here by diff group rq120 *
*--><!--*
* material suppressed here by diff group rq120c *
*--><termref dg="rq120o" def="dt-ordinary"/><phrase dg="rq120"> datatypes
</phrase>.
</termdef>
</p>
</item>
<item>
<!--*
* material suppressed here by diff group rq120 *
*-->
<p dg="rq120">
<termdef id="dt-user-defined" term="user-defined">
<term>User-defined</term> datatypes are those 
datatypes that are defined by individual schema designers.
</termdef>
</p>
</item>
</ulist>

<p diff="add" dg="b3251">The <termref def="dt-built-in"/> datatypes are intended to be
available automatically whenever this specification is implemented or
used, whether by itself or embedded in a host language.  In the
language defined by <bibref ref="structural-schemas"/>, 
the <termref def="dt-built-in"/> datatypes are automatically
included in every valid schema.  Other host languages <rfc2119>should</rfc2119> specify
that all of the datatypes decribed here as built-ins are automatically
available; they <rfc2119>may</rfc2119> specify that additional datatypes are also made
available automatically.</p>

<note diff="add" dg="b3251">
<p><termref def="key-impl-def">Implementation-defined</termref> datatypes, whether <termref def="dt-primitive"/> or <termref def="dt-ordinary"/>,
may sometimes
be included automatically in any schemas processed
by that implementation; nevertheless, they are not built in
to <emph>every</emph> schema, and are thus not included
in the term <mention>built-in</mention>, as that term is
used in this specification.
</p>
</note>

<p diff="add" dg="b3251">The mechanism for making <termref def="dt-user-defined"/>
datatypes available for use is not defined in this specification; if
<termref def="dt-user-defined"/> datatypes are to be available, some such mechanism
<rfc2119>must</rfc2119> be specified by the host language.</p>

<p diff="add" dg="b3251"><termdef id="dt-unknown-dt" term="unknown">A
datatype which is not available for use is said to be
<term>unknown</term>.</termdef>  </p>
<note diff="add" dg="b3251">
<p>From the schema author's perspective, a reference to
a datatype which proves to be <termref def="dt-unknown-dt"/> might reflect
any of the following causes, or others:
<olist>
<item id="unkown.type">
<p>An error has been made in giving the name of the datatype.</p>
</item>
<item id="unkown.sdoc">
<p>The datatype is a <termref def="dt-user-defined"/> datatype which has not been made
available using the means defined by the host language (e.g.
because the appropriate schema document has not been
consulted).</p>
</item>
<item id="unkown.id-primitive">
<p>The datatype is an <termref def="key-impl-def"/>
<termref def="dt-primitive"/> datatype not supported by the implementation being
used.</p>
</item>
<item id="unkown.id-derived">
<p>The datatype is an <termref def="key-impl-def"/> <termref def="dt-ordinary"/>
datatype which is made automatically available by some
implementations, but not by the implementation being
used.</p>
</item>
<item id="unkown.contaminated">
<p>The datatype is a <termref def="dt-user-defined"/> <termref def="dt-ordinary"/> datatype
whose base type is <termref def="dt-unknown-dt"/></p>
</item>
</olist>
From the point of view of the implementation, these cases
are likely to be indistinguishable.
</p>
</note>

<note diff="add" dg="b3251">
<p>In the terminology of <bibref ref="structural-schemas"/>,
the datatypes here called <termref def="dt-unknown-dt"/> are referred to as
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-null">absent</xspecref>.
</p>
</note>

<p>
Conceptually there is no difference between the <!--*
* material suppressed here by diff group rq120c *
*--><termref dg="rq120o" def="dt-ordinary"/>
<termref def="dt-built-in"/> <!--*
* material suppressed here by diff group rq120 *
*--> 
datatypes included in this specification and the <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-user-defined"/>
datatypes which will be created by individual schema designers.
The <termref def="dt-built-in"/> <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-constructed"/> datatypes
are those which are believed to be so common that if they were not
defined in this specification many schema designers would end up
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">reinventing</phrase> them.  Furthermore, including these
<!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-constructed"/> datatypes in this specification serves to
demonstrate the mechanics and utility of the datatype generation
facilities of this specification.
</p>
<note diff="del" dg="b3237">
<p>
A datatype which is <termref def="dt-built-in"/> in this specification
need not be a 
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">built-in</phrase>
datatype in any programming language used
to implement this specification.  Likewise, a datatype which is
<!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-user-defined"/> in this specification need not be a 
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">user-defined</phrase> 
datatype in any programming language used to
implement this specification.
</p>
</note>
</div3>
</div2>


</div1>

<div1 id="built-in-datatypes">
<!--* !!! n.b. newOrg gives this section the id builtinSTDs.
    * For now, I have left this ID unchanged. -msm
    *-->
<head><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Built-in Datatypes and Their Definitions</phrase></head>

<!--* <ednote diff="add" dg="wdd"><edtext>The graphic will be redrawn to show anyAtomicType and any other appropriate changes.</edtext></ednote> *-->

<!--* !!! temporary / experimental change from type-hierarchy.gif to 
    * type-hierarchy.png.  Revert when appropriate.
    *-->
<!--* 
<graphic source="type-hierarchy.gif" alt="Diagram of built-in type hierarchy" map="typeImage"/> 
*-->
<graphic xmlns:xlink="http://www.w3.org/1999/xlink" map="built-in-datatype-hierarchy-image-map" id="type-hierarchy-diagram" source="type-hierarchy.png" alt="Diagram of built-in type hierarchy"/>
<!--
	thanx to Asir S Vedamuthu for creating this image map
  -->
<!--*
  <imagemap source="image-map.html" id="typeImage"/>
  <imagemap source="image-map_fullsize.html" id="typeImage"/>
*-->
<imagemap source="built-in-datatype-hierarchy.html" id="built-in-datatype-hierarchy-image-map"/>

<p>Each built-in datatype <phrase diff="add" dg="b3251">defined</phrase>
in this specification <!--*
* material suppressed here by diff group rq120 *
*--> can be uniquely addressed via a
URI Reference constructed as follows:
<olist>
<item><p>the base URI is the URI of the XML Schema namespace</p></item>
<item><p>the fragment identifier is the name of the datatype</p></item>
</olist>
</p>

<p>For example, to address the <dtref ref="int"/> datatype, the URI is:
<ulist>
<item><p><code>http://www.w3.org/2001/XMLSchema#int</code></p></item>
</ulist>
</p>

<p>Additionally, each facet definition element can be uniquely
addressed via a URI constructed as follows:
<olist>
<item><p>the base URI is the URI of the XML Schema namespace</p></item>
<item><p>the fragment identifier is the name of the facet</p></item>
</olist>
</p>

<p>For example, to address the maxInclusive facet, the URI is:
<ulist>
<item><p><code>http://www.w3.org/2001/XMLSchema#maxInclusive</code></p></item>
</ulist>
</p>

<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<p>Additionally, each facet usage in a built-in <!--*
* material suppressed here by diff group rec12-main *
*-->
<phrase dg="rec12-main"><compref ref="std"/></phrase>
can be uniquely addressed via a URI constructed as follows:
<olist>
<item><p>the base URI is the URI of the XML Schema namespace</p></item>
<item><p>the fragment identifier is the name of the 
<!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main"><compref ref="std"/></phrase>, followed
by a period (<string>.</string>) followed by the name of the facet</p></item>
</olist>
</p>

<p>For example, to address the usage of the maxInclusive facet in
the definition of int, the URI is:
<ulist>
<item><p><code>http://www.w3.org/2001/XMLSchema#int.maxInclusive</code></p></item>
</ulist>
</p>

<div2 role="1.0" id="namespaces">
<head>Namespace considerations</head>
<p>
The <termref def="dt-built-in"/> datatypes defined by this specification
are designed to be used with the XML Schema definition language as well as other
XML specifications.
To facilitate usage within the XML Schema definition language, the <termref def="dt-built-in"/>
datatypes in this specification have the namespace name:
</p>
<ulist>
<item><p>http://www.w3.org/2001/XMLSchema</p></item>
</ulist>
<p>
To facilitate usage in specifications other than the XML Schema definition language,
such as those that do not want to know anything about aspects of the
XML Schema definition language other than the datatypes, each <phrase dg="dup-2214">non-<termref def="dt-special"/></phrase> <termref def="dt-built-in"/>
datatype is also defined in the namespace whose URI is:
</p>
<ulist>
<item><p>http://www.w3.org/2001/XMLSchema-datatypes</p></item>
</ulist>
<!--*
* material suppressed here by diff group rq120 *
*-->
<p dg="rq120">
<!--*
* material suppressed here by diff group dup-2214 *
*--></p>
<note dg="dup-2214">
  <p>The use of the <code>XMLSchema-datatypes</code> namespace and the 
definitions therein are deprecated as of
XML Schema 1.1.</p>
 </note>
<p>
Each <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-user-defined"/> datatype <phrase diff="del" dg="ep26">is also</phrase><phrase diff="add" dg="ep26">may also be</phrase> associated with a
<phrase diff="del" dg="ep26">unique</phrase><phrase diff="add" dg="ep26">target</phrase> 
namespace.  <phrase diff="del" dg="ep26">However, <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-user-defined"/> datatypes
do not come from the namespace defined by this specification; rather,
they come from the <!--*
* material suppressed here by diff group ep26 *
*-->
namespace of the schema in which they are defined
(see</phrase><phrase diff="add" dg="ep26">If it is constructed
from a schema document, then its namespace is typically the
target namespace of that schema document. (See</phrase> 
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#declare-schema">XML Representation of
Schemas</xspecref> in <bibref ref="structural-schemas"/><phrase diff="del" dg="ep26">).</phrase><phrase diff="add" dg="ep26">.)</phrase>
</p>
</div2>

<div2 id="special-datatypes" dg="rq120">
<head>Special Built-in Datatypes</head>

<p>The two datatypes at the root of the hierarchy of simple
types are <dtref ref="anySimpleType"/> and <dtref ref="anyAtomicType"/>.</p>

<div3 id="anySimpleType">
<head>anySimpleType</head>

<p><termdef id="dt-anySimpleType" term="anySimpleType" role="local">
The definition of <dtref ref="anySimpleType"/> is a special
<termref def="dt-restriction"/> of <dtref ref="anyType"/>. 
<phrase diff="del" dg="b3244"><term>anySimpleType</term> has 
an unconstrained <termref def="dt-lexical-space"/><phrase dg="rq120">,</phrase> 
<!--*
* material suppressed here by diff group rq120 *
*-->a <termref def="dt-value-space"/> consisting of the union of the <termref def="dt-value-space">value spaces</termref>
of all the <termref def="dt-primitive"/> datatypes and the set of all lists of all
members of the <termref def="dt-value-space">value spaces</termref> of all the <termref def="dt-primitive"/> 
datatypes<!--*
* material suppressed here by diff group lm.rel *
*-->.</phrase><phrase diff="add" dg="b3244">Its
<termref def="dt-lexical-space"/> is the set of all sequences of Unicode
characters, <!--* ep99:  unicode?  ucs?  what? *-->
and its <termref def="dt-value-space"/> includes all <termref def="dt-atomic-value">atomic values</termref>
and all finite-length lists of 
<phrase dg="b5625">zero or more</phrase>
<termref def="dt-atomic-value">atomic values</termref>.</phrase></termdef></p>

<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<p dg="rec12-main">For further details of <dtref ref="anySimpleType"/>
and its representation as a <compref ref="std"/>, see
<specref ref="builtin-stds"/>.</p>

<!--*
* material suppressed here by diff group rec12-main *
*-->
<div4 dg="rq21-specials-1909">
<head>Value space</head>
<p diff="del" dg="b3244">The <termref def="dt-value-space"/> of <dtref ref="anySimpleType"/> is 
the union of the <termref def="dt-value-space">value spaces</termref> of all the
<termref def="dt-primitive"/> datatypes defined here, and of all sets
of lists formed from the members of the <termref def="dt-primitive"/>
datatypes.</p>
<p diff="add" dg="b3244">The <termref def="dt-value-space"/> of <dtref ref="anySimpleType"/>
is the set of all <termref def="dt-atomic-value">atomic values</termref> and of all finite-length
lists of <phrase dg="b5625">zero or more</phrase>
<termref def="dt-atomic-value">atomic values</termref>.</p>

<note diff="add" dg="b3243">
<p>It is a consequence of this definition, together with the
definition of the <termref def="dt-lexical-mapping"/> in the next section, that some
values of this datatype have no <termref def="dt-lexical-representation"/> using the
<termref def="dt-lexical-mapping">lexical mappings</termref> defined by this specification. That is, the
<quote>potential</quote> <termref def="dt-value-space"/> and the <quote>effable</quote>
or <quote>nameable</quote> <termref def="dt-value-space"/> diverge for this datatype.
As far as this specification is concerned, there is no operational
difference between the potential and effable <termref def="dt-value-space">value spaces</termref> and the
distinction is of mostly formal interest.  Since some host languages
for the type system defined here may allow means of construction
values other than mapping from a <termref def="dt-lexical-representation"/>, the
difference may have practical importance in some contexts. In those
contexts, the term <termref def="dt-value-space"/> should unless otherwise qualified be
taken to mean the potential <termref def="dt-value-space"/>.
</p>
</note>

</div4>
<div4 dg="rq21-specials-1909">
<head>Lexical mapping</head>

<p>The <termref def="dt-lexical-space"/> of <dtref ref="anySimpleType"/> is the set of
all finite-length sequences of <phrase diff="add" dg="b5625">zero or more</phrase>
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-character">character</xtermref>s (as 
defined in <bibref ref="XML"/>) that <termref def="dt-match"/> the 
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Char">Char</xnt> production from 
<bibref ref="XML"/>.  This is equivalent to the union of the 
<termref def="dt-lexical-space">lexical spaces</termref> of all 
<termref def="dt-primitive"/> and all possible <termref def="dt-ordinary"/> datatypes.
</p>
<p dg="b1838">It is <termref def="key-impl-def"/> whether an
implementation of this specification supports the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Char">Char</xnt> production from 
<bibref ref="XML"/>, or that from 
<bibref ref="XML1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p>

<p>The <termref def="dt-lexical-mapping"/> of <dtref ref="anySimpleType"/> is the union
of the <termref def="dt-lexical-mapping">lexical mappings</termref> of
all <termref def="dt-primitive"/> datatypes and all list datatypes.
It will be noted that this mapping is not a function: a given
<termref def="dt-literal"/> may map to one value or to several values of different
<termref def="dt-primitive"/> datatypes, and it may be indeterminate which value is to
be preferred in a particular context.  When the datatypes defined here
are used in the context of <bibref ref="structural-schemas"/>, the
<att>xsi:type</att> attribute defined by that specification in section
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#xsi_type">xsi:type</xspecref> can be used
to indicate which value a <termref def="dt-literal"/> which is the content of an element
should map to.  In other contexts, other rules (such as type coercion
rules) may be employed to determine which value is to be used.</p>

</div4>

<div4 dg="rq21-specials-1909">
<head>Facets</head>
<p>When a new datatype is defined 
by <termref def="dt-fb-restriction"/>,
<dtref ref="anySimpleType"/> <rfc2119>must not</rfc2119> be used
as the <termref def="dt-basetype"/>.
So no 
<termref def="dt-constraining-facet">constraining facets</termref> are
directly applicable to <dtref ref="anySimpleType"/>.
</p>

</div4>
</div3>

<div3 id="anyAtomicType">
<head>anyAtomicType</head>

<p><termdef id="dt-anyAtomicType" term="anyAtomicType" role="local">
<dtref ref="anyAtomicType"/>
is a special <termref def="dt-restriction"/> of <dtref ref="anySimpleType"/>.
The <termref def="dt-value-space">value</termref>
and <termref def="dt-lexical-space">lexical spaces</termref> 
of <term>anyAtomicType</term> are the unions of the 
<termref def="dt-value-space">value</termref>
and <termref def="dt-lexical-space">lexical spaces</termref>
of all the <termref def="dt-primitive"/> datatypes, and
<term>anyAtomicType</term> is their <termref def="dt-basetype"/>.
</termdef>
</p>

<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<p dg="rec12-main">For further details of <dtref ref="anyAtomicType"/>
and its representation as a <compref ref="std"/>, see
<specref ref="builtin-stds"/>.</p>

<!--*
* material suppressed here by diff group rec12-main *
*-->
<div4 dg="rq21-specials-1909">
<head>Value space</head>
<p>The <termref def="dt-value-space"/> of <dtref ref="anyAtomicType"/> is the union of the
<termref def="dt-value-space">value spaces</termref> of all the
<termref def="dt-primitive"/> datatypes defined here<phrase diff="add" dg="b3251">
or supplied as <termref def="key-impl-def"/> <termref def="dt-primitive">primitives</termref></phrase>.</p>
</div4>
<div4 dg="rq21-specials-1909">
<head>Lexical mapping</head>

<p>The <termref def="dt-lexical-space"/> of <dtref ref="anyAtomicType"/> is the set of
all finite-length sequences of <phrase diff="add" dg="b5625">zero or more</phrase>
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-character">character</xtermref>s (as 
defined in <bibref ref="XML"/>) that <termref def="dt-match"/> the 
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Char">Char</xnt> production from 
<bibref ref="XML"/>.  This is equivalent to the union of the 
<termref def="dt-lexical-space">lexical spaces</termref> of all 
<termref def="dt-primitive"/> datatypes.
</p>

<p dg="b1838">It is <termref def="key-impl-def"/> whether an
implementation of this specification supports the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Char">Char</xnt> production from 
<bibref ref="XML"/>, or that from 
<bibref ref="XML1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p>

<p>The <termref def="dt-lexical-mapping"/> of <dtref ref="anyAtomicType"/> is the union
of the <termref def="dt-lexical-mapping">lexical mappings</termref> of
all <termref def="dt-primitive"/> datatypes.
It will be noted that this mapping is not a function: a given
<termref def="dt-literal"/> may map to one value or to several values of different
<termref def="dt-primitive"/> datatypes, and it may be indeterminate which value is to
be preferred in a particular context.  When the datatypes defined here
are used in the context of <bibref ref="structural-schemas"/>, the
<att>xsi:type</att> attribute defined by that specification in section
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#xsi_type">xsi:type</xspecref> can be used
to indicate which value a <termref def="dt-literal"/> which is the content of an element
should map to.  In other contexts, other rules (such as type coercion
rules) may be employed to determine which value is to be used.</p>

</div4>

<div4 dg="rq21-specials-1909">
<head>Facets</head>
<p>When a new datatype is defined 
by <termref def="dt-fb-restriction"/>,
<dtref ref="anyAtomicType"/> <rfc2119>must not</rfc2119> be used
as the <termref def="dt-basetype"/>.
So no 
<termref def="dt-constraining-facet">constraining facets</termref> are
directly applicable to <dtref ref="anyAtomicType"/>.
</p>

</div4>
</div3>
</div2>

<div2 role="1.0" id="built-in-primitive-datatypes">
<head>Primitive Datatypes</head>
<p>
The <termref def="dt-primitive"/> datatypes defined by this specification
are described below.  For each datatype, the
<termref def="dt-value-space"/> 
<phrase dg="b1902amend">is described;
</phrase><!--*
* material suppressed here by diff group b1902amend *
*--><phrase dg="b1902amend">the
</phrase><termref def="dt-lexical-space"/>
<!--*
* material suppressed here by diff group b1902amend *
*--><phrase dg="b1902amend">is</phrase>
defined<!--*
* material suppressed here by diff group b1902amend *
*--> 
<phrase dg="b1902amend">using
an extended Backus Naur Format grammar 
(and in most cases also a regular expression using the
regular expression language of 
<specref ref="regexs"/>);</phrase>
<termref def="dt-constraining-facet">constraining facets</termref> which apply
to the datatype are listed<phrase dg="b1902amend">;</phrase> 
and any datatypes 
<!--*
* material suppressed here by diff group rq120 *
*--><termref def="dt-constructed" dg="rq120"/>
from this datatype are specified.
</p>
<p>
<phrase diff="add" dg="b3251">Conforming processors <rfc2119>must</rfc2119> support
the <termref def="dt-primitive">primitive</termref> datatypes defined
in this specification; it is <termref def="key-impl-def"/> whether they
support others.</phrase> <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-primitive">Primitive</termref></phrase> datatypes <phrase diff="del" dg="b3251">can only</phrase><phrase diff="add" dg="b3251">may</phrase> be added by revisions to this specification.
</p>

<div3 id="string">
<!--* !!! newOrg replaces 'string' in the following head with a dtref.
    * Similarly the 'term' in the termdef (which it deletes).
    * I'm leaving it alone for now; a single change where
    * this change is applied to all datatypes is better than a
    * piecemeal change.
    *-->
<!-- And of course that insures it'll never get done.  :-(  -->
<!--* Up to you.  It's not hard to do the change for all types,
    * if one wants to do the change.
    *-->
<head>string</head>

<!--* Hmm.  Should the rq2-string deletion below really be labeled
    * rq21-string-hack?  The text is moved, not changed. *-->
<p><termdef id="dt-string" term="string" role="local">The <term>string</term> datatype
represents character strings in XML.<!--*
* material suppressed here by diff group rq21-string *
*-->
</termdef></p>

<note>
<p>Many human languages have writing systems that require
child elements for control of aspects such as bidirectional formatting or
ruby annotation (see <bibref ref="ruby"/> and Section 8.2.4
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/dirlang.html#h-8.2.4">Overriding the
bidirectional algorithm: the BDO element</xspecref> of <bibref ref="html4"/>). 
Thus, <!--*
* material suppressed here by diff group rq21-string *
*--><dtref ref="string" dg="rq21-string"/>, as a simple type that can contain only
characters but not child elements, is often not suitable for representing text.
In such situations, a complex type that allows mixed content should be considered.
For more information, see Section 5.5
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2001/REC-xmlschema-0-20010502/#textType">Any
Element, Any Attribute</xspecref> of <bibref ref="schema-primer"/>.</p>
</note>

<!--*
* material suppressed here by diff group rq21-string-hack *
*-->

<div4 dg="rq21-string-hack"><head dg="rq21-string">Value Space</head>
<!--* MSM munges the diff markup to avoid showing the old text 
    * which follows as old text.  rq21-string-hack should be rejected when
    * rq21-string is rejected, accepted when it is accepted.  But when
    * rq21-string is shown in color, rq21-string-hack should be accepted silently.
    *-->
<p>The <termref def="dt-value-space"/>
of <dtref ref="string"/> is the set of finite-length sequences of
<phrase diff="add" dg="b5625">zero or more</phrase>
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-character">character</xtermref>s (as defined in
<bibref ref="XML"/>) that <termref def="dt-match"/> the
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Char">Char</xnt> production from <bibref ref="XML"/>.
<!--* herein called simply <quote>&literals.xcss;</quote>.&nbsp; *-->
<!--* MSM finds 'herein' awkward, and our usage of the term 'character
    * string' includes a lot of places where we do not want to be
    * making the commitment or claim that the things in question are to be
    * regarded as *values* in the value space of the string type.
    * Not because there is some magic distinction (we are talking
    * in any case about sequences of UCS characters), but because
    * our system neither relies on nor provides tools to exploit
    * the identity of the value and lexical spaces of xsd:string
    * with the set of literals that might represent values in
    * any arbitrary simple type.
    *-->
A <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-character">character</xtermref> is an atomic unit of
communication; it is not further specified except to note that every
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-character">character</xtermref> has a corresponding
Universal Character Set (UCS) code point, which is an integer.</p>

<p dg="b1838">It is <termref def="key-impl-def"/> whether an
implementation of this specification supports the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Char">Char</xnt> production from 
<bibref ref="XML"/>, or that from 
<bibref ref="XML1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p>

<p dg="b1902amend">Equality for <dtref ref="string"/> is
identity.  No order is prescribed.</p>

<note>
<p>As noted in <compref ref="ff-o"/>, the fact that this specification does
not specify an 
<phrase dg="dpno"><!--*
* material suppressed here by diff group fa1-fix *
*--><phrase dg="fa1-fix">order relation</phrase>
for <termref def="dt-string"/></phrase><!--*
* material suppressed here by diff group dpno *
*-->
does not preclude other applications from treating 
<phrase dg="dpno">strings</phrase><!--*
* material suppressed here by diff group dpno *
*-->
as being ordered.</p>
</note>

</div4>

<div4 id="string-lexical-mapping" dg="rq21-string">
<head>Lexical Mapping</head>

<p>The <termref def="dt-lexical-space"/> of <dtref ref="string"/> is the set of 
finite-length sequences of <phrase diff="add" dg="b5625">zero or more</phrase>
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-character">character</xtermref>s (as defined in
<bibref ref="XML"/>) that <termref def="dt-match"/> the
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Char">Char</xnt> production from <bibref ref="XML"/>.

<!--* <ednote>
<edtext>An alternative design would (a) change this
definition and that of the value space to read <quote>The xxx space of
<dtref ref="string"/> is the set of finite-length sequences of UCS
characters</quote> (i.e. drop the restriction to characters matching
the Char production of XML, thus aligning with the Infoset spec);
(b) add a Note saying <quote>When literals of
type <dtref ref="string"/> stem from an XML document or information
set, all characters in the string will match the <xnt href="&xmlspec;#NT-Char">Char</xnt> production of <bibref ref="XML"/>; not all UCS characters are allowed by the XML spec</quote>;
and
(c) change the initial description of the type to read
<quote>The string datatype represents strings of characters.</quote>
</edtext>
</ednote> *-->

<defset role="prod"><head>Lexical Space</head>
<prod id="nt-stringRep">
<lhs>stringRep</lhs>
<rhs><xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Char">Char</xnt>*  <com>(as defined in <bibref ref="XML"/>)</com></rhs>
</prod>
</defset>

<!--*
* material suppressed here by diff group b1902amend *
*--></p>

<p dg="b1838">It is <termref def="key-impl-def"/> whether an
implementation of this specification supports the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Char">Char</xnt> production from 
<bibref ref="XML"/>, or that from 
<bibref ref="XML1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p>

<!--*
* material suppressed here by diff group rq21-lexmaps *
*-->
<p dg="rq21-lexmaps">The <termref def="dt-lexical-mapping"/> 
for <dtref ref="string"/> is <pfref ref="f-stringLexmap"/>, and
the <termref def="dt-canonical-mapping"/> is <pfref ref="f-stringCanmap"/>;
each is a subset of the identity function.
</p>

</div4>

<div4 role="1.0" id="string-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="string-derived-types">
<head><phrase dg="dpno">Derived
datatypes</phrase><!--*
* material suppressed here by diff group dpno *
*--></head>
<!--* Blecch!  Is there some reason this heading has to be unreadable?
    * Why not 'Related types'? *-->
<subtypes/>
</div4>
</div3>

<div3 id="boolean">
<head>boolean</head>

<p><termdef id="dt-boolean" term="boolean" role="local"><term>boolean</term>
<!--*
* material suppressed here by diff group rq21-boolean *
*--><phrase dg="rq21-boolean">represents the 
values of two-valued logic</phrase>.</termdef></p>

<div4 dg="rq21-boolean"><head>Value Space</head>

<p><dtref ref="boolean"/> has the <termref def="dt-value-space"/> of
two-valued logic:  {<pt>true</pt>, <pt>false</pt>}.</p>
</div4>

<!--*
* material suppressed here by diff group rq21-boolean *
*-->

<!--*
* material suppressed here by diff group rq21-boolean *
*-->

<div4 id="boolean-lexical-mapping" dg="rq21-boolean">
<head>Lexical Mapping</head>

<p><dtref ref="boolean"/>'s lexical space is a set of four <!--*
* material suppressed here by diff group rq21-lit *
*--><phrase dg="rq21-lit"><termref def="dt-literal">literals</termref></phrase>:

<defset role="prod"><head>Lexical Space</head>
<prod id="nt-booleanRep">
<lhs>booleanRep</lhs>
<rhs><string>true</string> | <string>false</string> |
<string>1</string> | <string>0</string></rhs>
</prod>
</defset>
<!--* This is equivalent to the regular expression <string>true|false|0|1</string>. *-->
</p>

<!--*
* material suppressed here by diff group rq21-lexmaps *
*-->
<p dg="rq21-lexmaps">The <termref def="dt-lexical-mapping"/>
for <dtref ref="boolean"/> is <pfref ref="f-booleanLexmap"/>;
the <termref def="dt-canonical-mapping"/> is <pfref ref="f-booleanCanmap"/>.
</p>

</div4>

<div4 role="1.0" id="boolean-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="decimal">
<head>decimal</head>

<!--* <issue id="RQ-150i" role="1.1" diff="del" dg="decfix">
<p><loc href="&reqs;#composition" target="reqs">RQ-150 (minimum number of digits for decimal)</loc></p>
<p>The minimum number of digits implementations are required to support
will be lowered to 16 digits; a health warning will be added to note 
that implementations of derived datatypes may support more digits of
precision than the base decimal type does, but that they are not required
to do so.</p>
</issue> *-->

<p><termdef id="dt-decimal" term="decimal" role="local"><term>decimal</term>
represents
<phrase dg="decfix">a</phrase><!--*
* material suppressed here by diff group decfix *
*-->
subset of the real numbers<phrase dg="decfix">,</phrase> which
can be represented by
<!--*
* material suppressed here by diff group decfix *
*-->decimal numerals.
<!--* ah, how about "the subset of the real numbers which can
be represented by finite-length decimal numerals" ? *-->
<phrase dg="decfix">The <termref def="dt-value-space"/> of <term>decimal</term>
is the set of numbers that can be obtained by 
<!--*
* material suppressed here by diff group rq31m *
*--><phrase dg="rq31m">dividing</phrase> 
an integer by a non-<!--*
* material suppressed here by diff group rq31m *
*--><phrase dg="rq31m">negative</phrase>
power of ten, i.e., expressible as 
<!--*
* material suppressed here by diff group rq31m *
*--><phrase dg="rq31m"><var>i</var> / 10<sup><var>n</var></sup></phrase>
where <var>i</var> and <var>n</var> are integers
and 
<!--*
* material suppressed here by diff group rq31m *
*--><phrase dg="rq31m"><var>n</var> ≥ 0</phrase>.
Precision is not reflected in this value space;
the number 2.0 is not distinct from the number 2.00.
<phrase dg="rq31m">(The datatype <dtref ref="precisionDecimal"/> may be used
for values in which precision is significant.)</phrase>
The <!--*
* material suppressed here by diff group fa1-fix *
*--><phrase dg="fa1-fix">order relation</phrase> on <term>decimal</term>
is the order relation on real numbers, restricted
to this subset.</phrase></termdef></p>

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

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

<div4 id="decimal-lexical-representation">
<head>Lexical
<!--*
* material suppressed here by diff group rq21-lexmaps *
*--><phrase dg="rq21-lexmaps">Mapping</phrase></head>

<!--ednote diff="add" dg="b4453ednote"><edtext>Bug b4453 fix.</edtext></ednote-->

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

<p><phrase dg="b4453"><term>decimal</term></phrase><!--*
* material suppressed here by diff group b4453 *
*-->
has
<phrase dg="b4453">a lexical representation</phrase><!--*
* material suppressed here by diff group b4453 *
*-->
consisting of <phrase dg="b4453">a</phrase>
<phrase diff="add" dg="b5625">non-empty</phrase> finite-length
sequence<!--*
* material suppressed here by diff group b4453 *
*--> of 
decimal
digits (#x30–#x39) separated
by a period as a decimal indicator. 
An optional leading sign is allowed. 
If the sign is omitted,
<phrase dg="b4453">"+"</phrase><!--*
* material suppressed here by diff group b4453 *
*-->
is assumed.  Leading and trailing zeroes are optional. 
If the fractional part is zero, the period and following zero(es) can
be omitted.
For example: 
<phrase diff="del" dg="b3587"><code>-1.23, 12678967.543233, +100000.00,
210</code></phrase><phrase diff="add" dg="b3587"><string>-1.23</string>,
<string>12678967.543233</string>, <string>+100000.00</string>,
<string>210</string></phrase>.
</p>
<p dg="rq31m"><defset>
<head>The <dtref ref="decimal"/> Lexical Representation</head>
<prod id="nt-decimalRep"><lhs>decimalLexicalRep</lhs>
<rhs><nt def="nt-decNuml"/> | <nt def="nt-noDecNuml"/></rhs></prod>
</defset></p>

<p dg="rq31m">The lexical space of decimal is the set of
lexical representations which match the grammar given above, or
(equivalently) the regular expression<phrase diff="del" dg="b3659">
<mention><phrase dg="b3246"><code>-</code></phrase><!--*
* material suppressed here by diff group b3246 *
*--><code>?(([0-9]+(.[0-9]*)?)|(.[0-9]+))</code></mention>.</phrase>
<display diff="add" dg="b3659">
<code>(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)</code></display>
</p>
<!--*
* material suppressed here by diff group pre *
*-->


<!--*
* material suppressed here by diff group rq31m.add.rq21-lexmaps.del *
*-->

<p dg="rq21-lexmaps">
The mapping from lexical representations to values is the usual
one for decimal numerals; it is given formally in 
<pfref ref="f-decimalLexmap"/>.
</p>

<!--* <ednote diff="add" dg="decfix_movement"><edtext>The following paragraphs were
moved from the deleted section that follows into this one to align the
organization of this datatype description with that of others that are
newly rewritten for 1.1.</edtext></ednote> *-->

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

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

<!--*
* material suppressed here by diff group rq31m_decfix_movement *
*-->
<p diff="del" dg="rq21-lexmaps.add.b3246.del">
The mapping from values to <termref def="dt-canonical-representation">canonical representations</termref> 
is given formally in 
<pfref ref="f-decimalCanmap"/>.
</p>

<p diff="add" dg="b3736">The <phrase dg="b3247">definition
of the </phrase><termref def="dt-canonical-representation"/> <!--*
* material suppressed here by diff group b3247 *
*--><phrase dg="b3247">has the
effect of</phrase> prohibiting certain options from the
<phrase dg="decfix"><specref ref="decimal-lexical-representation"/></phrase><!--*
* material suppressed here by diff group decfix *
*-->. 
Specifically, <phrase dg="b4451">
for integers, the decimal point and fractional part are prohibited.
For other values, 
</phrase>
the preceding optional
<phrase dg="decfix">"+"</phrase><!--*
* material suppressed here by diff group decfix *
*-->
sign is prohibited.  The decimal point is required.  
<!--*
* material suppressed here by diff group b4451 *
*--><phrase dg="b4451">In
all cases, leading</phrase> and
trailing zeroes are prohibited subject to the following:  there
must be at least one digit to the right and to the left of the decimal
point<!--*
* material suppressed here by diff group decfix *
*--> which may be a
zero.</p>

<p diff="add" dg="b3736">
The mapping from values to <termref def="dt-canonical-representation">canonical representations</termref> 
is given formally in 
<pfref ref="f-decimalCanmap"/>.
</p>

</div4>

<div4 role="1.0" id="decimal-canonical-representation" diff="del" dg="b3736">
<head>Canonical representation</head>

<p>The <termref def="dt-canonical-representation"/> for
<term>decimal</term> is defined by prohibiting certain options from the
<phrase dg="decfix"><specref ref="decimal-lexical-representation"/></phrase><!--*
* material suppressed here by diff group decfix *
*-->. 
Specifically, the preceding optional 
<phrase dg="decfix">"+"</phrase><!--*
* material suppressed here by diff group decfix *
*--> 
sign is prohibited.  The decimal point is required.  Leading 
and trailing zeroes are prohibited subject to the following:  there 
must be at least one digit to the right and to the left of the decimal 
point<!--*
* material suppressed here by diff group decfix *
*--> which may be a zero.</p>

<!--*
* material suppressed here by diff group rq31m.add.rq21-lexmaps.del *
*-->

<p dg="rq21-lexmaps">
The mapping from values to <termref def="dt-canonical-representation">canonical representations</termref> 
is given formally in 
<pfref ref="f-decimalCanmap"/>.
</p>

</div4>

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

<div4 id="decimal-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="decimal-derived-types">
<head><!--*
* material suppressed here by diff group rq31m *
*--><phrase dg="rq31m">Datatypes based on decimal</phrase></head>
<subtypes/>
</div4>
</div3>

<div3 id="precisionDecimal" dg="pd1"><head>precisionDecimal</head>

<!--* <ednote diff="del" dg="rq31fix">
<edtext>For technical reasons rooted in the editorial
production system, the old primitive decimal type and the two new
decimal types must all have distinct names.  In the current form of
this proposal, the old decimal type is called &ldquo;decimal&rdquo;
(or in some places &ldquo;&odec_;&rdquo;), the new decimal type which
carries information about precision is called &ldquo;&pD;&rdquo;, and
the new decimal type which corresponds most closely to &odec_; is
called &ldquo;&dec;&rdquo;.  
Eventually the editorial system will be changed to allow more than
one of these types to have the same name, but that is not likely for
the foreseeable future.  So the reader should bear in mind that the
names of the types given here are not the final names.
</edtext></ednote> *-->

<!-- satisfied issues disappear -->
<!--* <issue id="RQ-31i" role="1.1" dg="rq31fix" diff="del">
<p><loc href="&reqs;#trailing-zeroes" target="reqs">RQ-31
(precisionDecimal)</loc></p>
<p>This draft describes a new type named (for now) 
&ldquo;precisionDecimal&rdquo;,
which is intended to satisfy requirement RQ-31.&nbsp; It is possible that
this new type will replace the old decimal type.</p>
</issue> *-->

<!--* <issue id="RQ-30i" role="1.1" dg="rq31fix" diff="del">
<p><loc href="&reqs;#negative-scale" target="reqs">RQ-30
(negative fractionDigits for decimal)</loc></p>
<p>The <dtref ref="&pD;"/> type allows negative values for the fractionDigits
facet.</p>
</issue> *-->

<!--* <issue id="RQ-28i" role="1.1" dg="rq31fix" diff="del">
<p><loc href="&reqs;#scientific-notn" target="reqs">RQ-28 (scientific notation for decimal)</loc></p>
<p>The <dtref ref="&pD;"/> type allows exponential notation.</p>
</issue> *-->

<p><termdef id="dt-precisionDecimal" term="precisionDecimal">The <term>precisionDecimal</term>
datatype represents <!--*
* material suppressed here by diff group rq31fix *
*--><phrase dg="rq31fix">the
numeric value and (arithmetic) precision of decimal numbers which retain
precision</phrase>; it also 
includes 
<phrase diff="del" dg="b3249b">special</phrase>
values for positive and negative infinity and 
<phrase diff="add" dg="b3249c">for</phrase>
<unusual>not a number</unusual>, and it differentiates
between <unusual>positive zero</unusual> and <unusual>negative
zero</unusual>.</termdef>  <!--*
* material suppressed here by diff group b2313.ieee *
*-->
<phrase dg="b2313.ieee">This datatype is introduced
to provide a variant of decimal that closely corresponds
to the floating-point decimal datatypes described by the
expected forthcoming revision of IEEE/ANSI 754.
Precision of values is retained<phrase diff="del" dg="b3249c">, and 
the <phrase dg="b3249b">special values</phrase><!--*
* material suppressed here by diff group b3249b *
*-->
(two zeroes, 
infinities, and not-a-number)</phrase><phrase diff="add" dg="b3249c">
and values</phrase>
are included<phrase diff="add" dg="b3249c">
for two zeroes, two infinities, and not-a-number</phrase>.</phrase></p>

<p>Precision is sometimes given in absolute, sometimes in relative
terms.  <termdef id="dt-arithmetic-precision" term="arithmetic precision">The <term>arithmetic precision</term> of a value is
expressed in absolute quantitative terms,
<phrase dg="rq31fix">by </phrase>indicating
how many digits to the right of the decimal point are significant.</termdef>
<quote>5</quote> has an arithmetic precision of 0, and 
<quote>5.01</quote> an arithmetic precision of 2.
</p>

<!--*
* material suppressed here by diff group rq150c.add.partial.del *
*-->

<note dg="partialfix">
<p>See the conformance note in <specref ref="partial-implementation"/>, which
applies to this datatype.</p>
</note>

<!--* note 2005-12-08 in Edinburgh the WG instructed the editors to make
    * some specific amendments here (made) and correct the numbers.
    * I believe we have found good numbers since Edinburgh, but in
    * processing the Edinburgh decision today I have NOT found them and
    * put them in.  If you come in here with better numbers and are
    * surprised to find these, it's probably because they are wrong.
    * And possibly because you are right, although that's less certain.
    * -MSM
    *-->
<!--* Edinburgh minutes say -369 to 398, -6111 to 6176 *-->

<!--*
* material suppressed here by diff group rq150c.add.partial.del *
*-->

<!--*
* material suppressed here by diff group rq150c.add.partial.del *
*-->

<div4><head>Value Space</head>

<defset><head alt="Properties of precisionDecimal Values">Properties of
<dtref ref="precisionDecimal"/> Values</head>

<vpropdef><name id="vp-pd-numVal">numericalValue</name>
<limits>a <phrase>decimal number</phrase>, <pt>positiveInfinity</pt>,
<pt>negativeInfinity</pt> or <pt>notANumber</pt></limits></vpropdef>

<vpropdef><name id="vp-pd-precision">arithmeticPrecision</name>
<limits>an <phrase>integer</phrase> or <pt>absent</pt>;
<pt>absent</pt> if and only if <pfref ref="vp-pd-numVal"/> is a 
<phrase diff="del" dg="b3249b"><dtref ref="constant"/></phrase><phrase diff="add" dg="b3249b"><termref def="dt-specialvalue"/></phrase>.</limits></vpropdef>

<vpropdef><name id="vp-pd-sign">sign</name>
<limits><pt>positive</pt>, <pt>negative</pt>, or <pt>absent</pt>;
must be <pt>positive</pt> if <pfref ref="vp-pd-numVal"/>
is positive or <pt>positiveInfinity</pt>, must be <pt>negative</pt>
if <pfref ref="vp-pd-numVal"/> is negative or <pt>negativeInfinity</pt>,
must be <pt>absent</pt> if and only if <pfref ref="vp-pd-numVal"/> is <pt>notANumber</pt></limits></vpropdef>
</defset>

<note><p>The <pfref ref="vp-pd-sign"/> property is redundant except when <pfref ref="vp-pd-numVal"/>
is zero; in other cases, the <pfref ref="vp-pd-sign"/> value is fully determined by the
<pfref ref="vp-pd-numVal"/> value.<!--*
* material suppressed here by diff group rq31fix *
*--></p></note>

<note><p>As explained below, <phrase diff="add" dg="b3249c"><string>NaN</string> is</phrase> the lexical
representation of the <dtref ref="precisionDecimal"/> value <phrase diff="del" dg="b3249c">object</phrase> whose <pfref ref="vp-pd-numVal"/> 
<phrase diff="del" dg="b3249c">is</phrase><phrase diff="add" dg="b3249c">property 
has the <termref def="dt-specialvalue"/></phrase>
<pt>notANumber</pt><phrase diff="del" dg="b3249c"> is
<string>NaN</string></phrase>.  Accordingly, in English text we
use <mention>NaN</mention> to refer to that value.  Similarly we
use <mention>INF</mention> and <mention>−INF</mention> to refer
to the two <phrase diff="del" dg="b3249c">value
objects</phrase><phrase diff="add" dg="b3249c">values</phrase> whose
<pfref ref="vp-pd-numVal"/> <phrase diff="del" dg="b3249c">is</phrase><phrase diff="add" dg="b3249c">properties have
the <termref def="dt-specialvalue">special values</termref></phrase> <pt>positiveInfinity</pt> and
<pt>negativeInfinity</pt>.  These three <phrase diff="del" dg="b3249c">value objects</phrase><phrase diff="add" dg="b3249c"><dtref ref="precisionDecimal"/> values</phrase> are also
informally called <quote>not-a-number</quote>, <quote>positive
infinity</quote>, and <quote>negative infinity</quote>. The latter two
together are called <quote>the infinities</quote>.</p></note>

<p>Equality and order for <dtref ref="precisionDecimal"/> are defined as follows:
<ulist>
<item>
<p>Two numerical <dtref ref="precisionDecimal"/> values
are ordered (or equal) as their
<pfref ref="vp-pd-numVal"/> values are ordered (or equal).  
(This means 
<!--*
* material suppressed here by diff group rq31fix *
*--><phrase dg="rq31fix">that</phrase> 
two zeroes with <!--*
* material suppressed here by diff group rq31fix *
*--> 
different <pfref ref="vp-pd-sign"/><phrase dg="rq31fix">s</phrase> 
are <emph>equal</emph>;
negative zeroes are <emph>not</emph> ordered less than positive zeroes.)</p></item>
<!--*
* material suppressed here by diff group rq31fix *
*-->
<item>
<p>INF is equal only to itself, and is greater than
−INF and all numerical <dtref ref="precisionDecimal"/> values.</p></item>
<item>
<p>−INF is equal only to itself, and is less than
INF and all numerical <dtref ref="precisionDecimal"/> values.</p></item>
<item><p>NaN is incomparable with all values, <emph>including
itself</emph>.</p></item>

</ulist>
</p>

<note diff="add" dg="wgi-20080530">
<p>Any value <termref def="dt-incomparable"/> with the value used for the four
bounding facets (<termref def="dt-minInclusive"/>, <termref def="dt-maxInclusive"/>,
<termref def="dt-minExclusive"/>, and <termref def="dt-maxExclusive"/>) will be
excluded from the resulting restricted <termref def="dt-value-space"/>. 
In particular, when NaN is used as a facet value for a bounding facet, since no
<dtref ref="float"/> values are <termref def="dt-incomparable">comparable</termref>
with it, the result is a <termref def="dt-value-space"/> that is empty. 
If any other value is used for a bounding facet,
NaN will be excluded from the resulting restricted <termref def="dt-value-space"/>;
to add NaN back in requires union with the NaN-only space (which may be derived
<!--*
* material suppressed here by diff group wgi-20080530 *
*--><phrase dg="wgi-20080530">using a pattern</phrase>).</p></note>

<note diff="add" dg="wgi-20080530">
<p>As specified elsewhere, enumerations test values for equality with one of the
enumerated values.  Because NaN ≠ NaN, including NaN in an enumeration
does not have the effect of accepting NaNs as instances of the enumerated
type; a union with a NaN-only datatype (which may be derived using the
pattern <quote><code>NaN</code></quote>) can be used instead.
</p>
</note>
</div4>

<div4><head>Lexical Mapping</head>

<p><dtref ref="precisionDecimal"/>'s lexical space is the set of all 
decimal numerals with or without a decimal
point, numerals in scientific (exponential) notation, and
the character strings <string>INF</string>,
<string>+INF</string>, <string>-INF</string>,
and <string>NaN</string>.<!--*
* material suppressed here by diff group lexMapFacet-1912 *
*-->

<defset role="prod"><head>Lexical Space</head>
<prod id="nt-precDecRep">
<lhs>p<!--*
* material suppressed here by diff group rq31fix *
*-->DecimalRep</lhs>
<rhs><nt def="nt-noDecNuml"/> | <nt def="nt-decNuml"/> |
<nt def="nt-sciNuml"/> | <nt def="nt-numSpecReps"/></rhs>
</prod>
</defset>
</p>
<p diff="add" dg="b3659">The <nt def="nt-precDecRep"/> production
is equivalent (after whitespace is removed) to the following regular expression:
<display role="shrink"><code>(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?<br/>
|(\+|-)?INF|NaN</code></display></p>

<!--*
* material suppressed here by diff group rq31fix.add.rq21-lexmaps.del *
*-->

<p dg="rq21-lexmaps">The <termref def="dt-lexical-mapping"/> for
<dtref ref="precisionDecimal"/> is <pfref ref="f-precDecLexmap"/>. The
<termref def="dt-canonical-mapping"/> is <pfref ref="f-precDecCanmap"/>.
</p>
</div4>

<!--*
* material suppressed here by diff group rec12-tableaux *
*-->

<div4>
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 role="1.0" id="float">
<head>float</head>

<!--* <issue id="RQ-1i" role="1.1" diff="del" dg="flfix">
<p><loc href="&reqs;#canonical-float" target="reqs">RQ-1 (canonical
representation of float, double)</loc></p>
<p>The description of &canonical_representations; for float and double
needs to be cleaned up.</p>
</issue> *-->

<!--* <issue id="RQ-140i" role="1.1" diff="del" dg="flfix">
<p><loc href="&reqs;#negative-positive-zero" target="reqs">RQ-140
(positive and negative zero in float and double)</loc></p>
<p>Two zeroes will be provided similar to those in precisionDecimal</p>
</issue> *-->

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

<p><termdef id="dt-float" term="float" role="local"><phrase dg="flfix">The
</phrase><term>float</term><phrase dg="flfix"> datatype</phrase>
is<!--*
* material suppressed here by diff group flfix *
*--><phrase diff="add" dg="b5229"> 
patterned after</phrase> the IEEE 
single-precision 32-bit floating point <phrase dg="flfix">data</phrase>type
<bibref ref="ieee754"/><phrase diff="del" dg="b5229"><phrase dg="flfix"> with the minor exception
noted below</phrase></phrase>.<!--*
* material suppressed here by diff group flfix *
*--></termdef><phrase dg="flfix"> 
<phrase diff="add" dg="b3252"><!--*
* material suppressed here by diff group ep26 *
*--><phrase dg="ep26">Its</phrase> 
value space <!--*
* material suppressed here by diff group ep26 *
*--> is a subset of the
rational numbers.  </phrase>Floating point numbers <phrase diff="del" dg="b3252">are
certain subsets of the
rational numbers, and </phrase>are often used to 
approximate arbitrary real numbers.</phrase></p>

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

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

<div4 dg="flfix"><head>Value Space</head>

<p>The <termref def="dt-value-space"/> of <dtref ref="float"/> contains the
non-zero numbers  <var>m</var> × 2<sup><var>e</var></sup> ,
where <var>m</var> is an integer whose absolute value is less than 2<sup>24</sup>,
and <var>e</var> is an integer between −149 and 104, inclusive.  In addition to
these values, the <termref def="dt-value-space"/> of <dtref ref="float"/> also contains
the following <phrase diff="del" dg="b3249b"><emph>special values</emph></phrase><phrase diff="add" dg="b3249b"><termref def="dt-specialvalue">special values</termref></phrase>:  <pt>positiveZero</pt>,
<pt>negativeZero</pt>, <pt>positiveInfinity</pt>,
<pt>negativeInfinity</pt>, and <pt>notANumber</pt>.</p>

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

<note>
<p>As explained below, the
<phrase diff="del" dg="b3813"><termref def="dt-lexical-mapping"/></phrase><phrase diff="add" dg="b3813"><termref def="dt-lexical-representation"/></phrase>
of the <dtref ref="float"/>
value <pt>notANumber</pt> is <string>NaN</string>.  Accordingly, in English
text we generally use <mention>NaN</mention> to refer to that value.  Similarly,
we use <mention>INF</mention> and <mention>−INF</mention> to refer to the two
values <pt>positiveInfinity</pt> and <pt>negativeInfinity</pt>,
and <mention>0</mention> and <mention>−0</mention> to refer to
<pt>positiveZero</pt> and <pt>negativeZero</pt>.</p></note>

<p>Equality and order for <dtref ref="float"/> are defined as follows:
<ulist>
<item>
<p>Equality is identity, except that  0 = −0  (although
they are not identical) and  NaN ≠ NaN  
(although NaN is of course identical to itself).</p>

<p>0 and −0 are thus <phrase diff="del" dg="b3222">distinct</phrase><phrase diff="add" dg="b3222">equivalent</phrase>
for purposes of enumerations and
identity constraints, <phrase diff="del" dg="b3222">but equal for purposes of</phrase><phrase diff="add" dg="b3222">as well as for</phrase> minimum and maximum values.</p></item>
<item>
<p>For the basic values, the order relation
on float is the order relation for rational numbers.  INF is greater
than all other non-NaN values; −INF is less than all other non-NaN
values.  NaN is <termref def="dt-incomparable"/> with any value
in the <termref def="dt-value-space"/> including itself.  0 and −0
are greater than all the negative numbers and less than all the positive
numbers.</p></item>
</ulist>
</p>

<note>
<p>Any value <termref def="dt-incomparable"/> with the value used for the four
bounding facets (<termref def="dt-minInclusive"/>, <termref def="dt-maxInclusive"/>,
<termref def="dt-minExclusive"/>, and <termref def="dt-maxExclusive"/>) will be
excluded from the resulting restricted <termref def="dt-value-space"/>. 
In particular, when NaN is used as a facet value for a bounding facet, since no
<dtref ref="float"/> values are <termref def="dt-incomparable">comparable</termref>
with it, the result is a <termref def="dt-value-space"/> that is empty. 
If any other value is used for a bounding facet,
NaN will be excluded from the resulting restricted <termref def="dt-value-space"/>;
to add NaN back in requires union with the NaN-only space (which may be derived
<phrase diff="del" dg="wgi-20080530">by an enumeration</phrase><phrase diff="add" dg="wgi-20080530">using a pattern</phrase>).</p></note>

<note>
<p>The Schema 1.0 version of this datatype did not differentiate between
0 and −0 and NaN was equal to itself.  The changes were
made to make the datatype more closely mirror <bibref ref="ieee754"/>.</p></note>

<note diff="add" dg="wgi-20080530">
<p>As specified elsewhere, enumerations test values for equality with one of the
enumerated values.  Because NaN ≠ NaN, including NaN in an enumeration
does not have the effect of accepting NaNs as instances of the enumerated
type; a union with a NaN-only datatype (which may be derived using the
pattern <quote><code>NaN</code></quote>) can be used instead.
</p>
</note>

</div4>

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

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

<div4 dg="flfix"><head>Lexical Mapping</head>

<p>The <termref def="dt-lexical-space"/> of <dtref ref="float"/> is
the set of all decimal numerals with or without a decimal
point, numerals in scientific (exponential) notation, and
the <termref def="dt-literal">literals</termref> <string>INF</string>,
<string>-INF</string>, and <string>NaN</string>

<defset role="prod"><head>Lexical Space</head>
<prod id="nt-floatRep">
<lhs>floatRep</lhs>
<rhs><nt def="nt-noDecNuml"/> | <nt def="nt-decNuml"/> |
<nt def="nt-sciNuml"/> | <nt def="nt-minNumSpecReps"/></rhs>
</prod>
</defset>

The <nt def="nt-floatRep"/> production is equivalent to this regular 
expression<phrase diff="add" dg="b3659"> (after whitespace is
removed from the regular expression)</phrase>:

<display diff="del" dg="b3659"><code>(-|+)?(([0-9]+(.[0-9]*)?)|(.[0-9]+))((e|E)(-|+)?[0-9]+)?|-?INF|NaN</code></display>
<display diff="add" dg="b3659" role="shrink"><code>(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?<br/>
|(\+|-)?INF|NaN</code></display>
</p>
<!--*
* material suppressed here by diff group pre *
*-->

<p>The <dtref ref="float"/> datatype is designed to implement for schema
processing the single-precision floating-point datatype of
<bibref ref="ieee754"/>.  That specification does not specify specific
<termref def="dt-lexical-representation">lexical representations</termref>,
but does prescribe requirements on any <termref def="dt-lexical-mapping"/>
used.  Any <termref def="dt-lexical-mapping"/>
that maps the <termref def="dt-lexical-space"/> just described onto the
<termref def="dt-value-space"/>, <phrase diff="add" dg="b3025">is a function,</phrase>
satisfies the requirements of
<bibref ref="ieee754"/>, and correctly handles the 
<phrase diff="add" dg="b3249b">mapping of the literals
<string>INF</string>, <string>NaN</string>, etc., to the</phrase>
<phrase diff="del" dg="b3249b">special values</phrase><phrase diff="add" dg="b3249b"><termref def="dt-specialvalue">special values</termref></phrase><phrase diff="del" dg="b3249b">
(<nt def="nt-numSpecReps"/> <termref def="dt-literal">literals</termref>)</phrase>,
satisfies the conformance requirements of this specification.</p>

<p>Since IEEE allows some variation in rounding of values, processors
conforming to this specification may exhibit some variation in their
<termref def="dt-lexical-mapping">lexical mappings</termref>.</p>

<p>The <termref def="dt-lexical-mapping"/> <pfref ref="f-floatLexmap"/> is 
provided as an example of a simple algorithm that yields a conformant mapping,
and that provides the most accurate rounding possible—and is thus useful
for insuring inter-implementation reproducibility and inter-implementation
round-tripping.  The simple rounding
algorithm used in <pfref ref="f-floatLexmap"/> may be more efficiently
implemented using the algorithms of <bibref ref="clinger1990"/>.</p>

<note>
<p>The Schema 1.0 version of this datatype did not permit rounding
algorithms whose results differed from <bibref ref="clinger1990"/>.</p>
</note>

<p>The <termref def="dt-canonical-mapping"/> <pfref ref="f-floatCanmap"/> is 
provided as an example of a mapping that does not produce unnecessarily long
<termref def="dt-canonical-representation">canonical representations</termref>. 
Other algorithms which do not yield identical results for mapping from float
values to character strings are permitted by <bibref ref="ieee754"/>.</p>

</div4>

<!-- The Simple Type definition for float was never accepted, so we don't need HT's
cute <head/> trickery to remove it.  I'm commenting it out to eliminate the spurious
empty Division (number w/o head) that otherwise results.  -DP 051016

<div4 dg="flfix" diff="add"><head/>
<div5 diff="del" dg="rec12-tableaux"><head>Simple Type Definition for float</head>
<p>The &simple_type_definition; of <dtref ref="float"/> is present in every
schema.&nbsp; It has the following properties:</p>

<schemaComp id="float-def">
<head alt="Simple Type Definition of float">&simple_type_definition; of 
<dtref ref="float"/></head>

<pvlist>
<pvpair comp="std" prop="name"><string>float</string></pvpair>
<pvpair comp="std" prop="target namespace"><string>http://www.w3.org/2001/XMLSchema</string></pvpair>
<pvpair comp="std" prop="base type definition">The
<dtref ref="anyAtomicType" role="def"/></pvpair>
<pvpair comp="std" prop="final">The empty set</pvpair>
<pvpair comp="std" prop="variety"><pt>atomic</pt></pvpair>
<pvpair comp="std" prop="primitive type definition"><dtref ref="float"/></pvpair>
<pvpair comp="std" prop="facets">{a &whiteSpace; facet with 
<propref comp="f-w" prop="value"/> = <pt>collapse</pt> and
<propref comp="f-w" prop="fixed"/> = <pt>true</pt>}
</pvpair>
<pvpair comp="std" prop="fundamental facets"><p>{<ulist>
<item><p>an <compref ref="ff-o"/> facet
with <propref comp="ff-o" prop="value"/> = <pt>total</pt></p></item>
<item><p>a <compref ref="ff-b"/> facet
with <propref comp="ff-b" prop="value"/> = <pt>true</pt></p></item>
<item><p>a <compref ref="ff-c"/> facet
with <propref comp="ff-c" prop="value"/> = <pt>finite</pt></p></item>
<item><p>a <compref ref="ff-n"/> facet
with <propref comp="ff-n" prop="value"/> = <pt>true</pt></p></item>
</ulist>}</p>
</pvpair>
<pvpair comp="std" prop="scope"><pt>global</pt></pvpair>
<pvpair comp="std" prop="item type definition"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="member type definitions"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="annotations">The empty sequence</pvpair>
</pvlist>
</schemaComp>
</div5></div4>
-->

<div4 id="float-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="double">
<head>double</head>

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

<p>
<termdef id="dt-double" term="double" role="local">The <term>double</term>
datatype is<!--*
* material suppressed here by diff group flfix *
*--><phrase diff="add" dg="b5229"> 
patterned after</phrase> the
IEEE double-precision 64-bit floating point <phrase dg="flfix">data</phrase>type
<bibref ref="ieee754"/><phrase diff="del" dg="b5229"><phrase dg="flfix"> with the minor exception
noted below</phrase></phrase>.<!--*
* material suppressed here by diff group flfix *
*--></termdef><phrase dg="flfix"> 
<phrase diff="add" dg="b3252">Each floating
point datatype has a value space that is a subset of the
rational numbers.  </phrase>Floating point numbers <phrase diff="del" dg="b3252">are
certain subsets of the rational numbers, and </phrase>are often used to 
approximate arbitrary real numbers.</phrase></p>

<note dg="flfix"><p>The only significant differences between float and double are
the three defining constants 53 (vs 24), −1074 (vs −149),
and 971 (vs 104).</p></note>

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

<div4 dg="flfix"><head>Value Space</head>

<p>The <termref def="dt-value-space"/> of <dtref ref="double"/> contains the
non-zero numbers  <var>m</var> × 2<sup><var>e</var></sup> ,
where <var>m</var> is an integer whose absolute value is less than <!--*
* material suppressed here by diff group b2642 *
*--><phrase dg="b2642">2<sup>53</sup></phrase>,
and <var>e</var> is an integer between −1074 and 971, inclusive.  In addition to
these values, the <termref def="dt-value-space"/> of <dtref ref="double"/> also contains
the following <phrase diff="del" dg="b3249b"><emph>special values</emph></phrase><phrase diff="add" dg="b3249b"><termref def="dt-specialvalue">special values</termref></phrase>:  <pt>positiveZero</pt>,
<pt>negativeZero</pt>, <pt>positiveInfinity</pt>,
<pt>negativeInfinity</pt>, and <pt>notANumber</pt>.</p>

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

<note>
<p>As explained below, the
<phrase diff="del" dg="b3813"><termref def="dt-lexical-mapping"/></phrase><phrase diff="add" dg="b3813"><termref def="dt-lexical-representation"/></phrase>
of the <dtref ref="double"/>
value <pt>notANumber</pt> is <string>NaN</string>.  Accordingly, in English
text we generally use <mention>NaN</mention> to refer to that value.  Similarly,
we use <mention>INF</mention> and <mention>−INF</mention> to refer to the two
values <pt>positiveInfinity</pt> and <pt>negativeInfinity</pt>,
and <mention>0</mention> and <mention>−0</mention> to refer to
<pt>positiveZero</pt> and <pt>negativeZero</pt>.</p></note>

<p>Equality and order for <dtref ref="double"/> are defined as follows:
<ulist>
<item>
<p>Equality is identity, except that  0 = −0  (although
they are not identical) and  NaN ≠ NaN  
(although NaN is of course identical to itself).</p>

<p><phrase diff="del" dg="b3222">0 and −0 are thus distinct for purposes of enumerations and
identity constraints, but equal for purposes of minimum and maximum values.</phrase><phrase diff="add" dg="b3222">0 and −0 are thus equivalent for purposes of enumerations,
identity constraints, and minimum and maximum values.</phrase>
</p></item>
<item>
<p>For the basic values, the order relation
on double is the order relation for rational numbers.  INF is greater
than all other non-NaN values; −INF is less than all other non-NaN
values.  NaN is <termref def="dt-incomparable"/> with any value
in the <termref def="dt-value-space"/> including itself.  0 and −0
are greater than all the negative numbers and less than all the positive
numbers.</p></item>
</ulist>
</p>

<note>
<p>Any value <termref def="dt-incomparable"/> with the value used for the four
bounding facets (<termref def="dt-minInclusive"/>, <termref def="dt-maxInclusive"/>,
<termref def="dt-minExclusive"/>, and <termref def="dt-maxExclusive"/>) will be
excluded from the resulting restricted <termref def="dt-value-space"/>. 
In particular, when NaN is used as a facet value for a bounding facet, since no
<dtref ref="double"/> values are <termref def="dt-incomparable">comparable</termref>
with it, the result is a <termref def="dt-value-space"/> that is empty. 
If any other value is used for a bounding facet,
NaN will be excluded from the resulting restricted <termref def="dt-value-space"/>;
to add NaN back in requires union with the NaN-only space (which may be derived
<phrase diff="del" dg="wgi-20080530">by an enumeration</phrase><phrase diff="add" dg="wgi-20080530">with a pattern</phrase>).</p></note>

<note>
<p>The Schema 1.0 version of this datatype did not differentiate between
0 and −0 and NaN was equal to itself.  The changes were
made to make the datatype more closely mirror <bibref ref="ieee754"/>.</p></note>

<note diff="add" dg="wgi-20080530">
<p>As specified elsewhere, enumerations test values for equality with one of the
enumerated values.  Because NaN ≠ NaN, including NaN in an enumeration
does not have the effect of accepting NaNs as instances of the enumerated
type; a union with a NaN-only datatype (which may be derived using the
pattern <quote><code>NaN</code></quote>) can be used instead.
</p>
</note>
</div4>

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

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

<div4 dg="flfix"><head>Lexical Mapping</head>

<p>The <termref def="dt-lexical-space"/> of <dtref ref="double"/> is
the set of all decimal numerals with or without a decimal
point, numerals in scientific (exponential) notation, and
the <termref def="dt-literal">literals</termref> <string>INF</string>,
<string>-INF</string>, and <string>NaN</string>

<defset role="prod"><head>Lexical Space</head>
<prod id="nt-doubleRep">
<lhs>doubleRep</lhs>
<rhs><nt def="nt-noDecNuml"/> | <nt def="nt-decNuml"/> |
<nt def="nt-sciNuml"/> | <nt def="nt-minNumSpecReps"/></rhs>
</prod>
</defset>

The <nt def="nt-doubleRep"/> production is equivalent to this regular 
expression<phrase diff="add" dg="b3659">
(after whitespace is eliminated from the expression)</phrase>:

<display diff="del" dg="b3659"><code>(-|+)?(([0-9]+(.[0-9]*)?)|(.[0-9]+))((e|E)(-|+)?[0-9]+)?|-?INF|NaN</code></display>
<display diff="add" dg="b3659" role="shrink">
<code>(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?
|(\+|-)?INF|NaN</code>
</display>
</p>
<!--*
* material suppressed here by diff group pre *
*-->

<p>The <dtref ref="double"/> datatype is designed to implement for schema
processing the double-precision floating-point datatype of
<bibref ref="ieee754"/>.  That specification does not specify specific
<termref def="dt-lexical-representation">lexical representations</termref>,
but does prescribe requirements on any <termref def="dt-lexical-mapping"/>
used.  Any <termref def="dt-lexical-mapping"/>
that maps the <termref def="dt-lexical-space"/> just described onto the
<termref def="dt-value-space"/>, <phrase diff="add" dg="b3025">is a function,</phrase>
satisfies the requirements of
<bibref ref="ieee754"/>, and correctly handles the 
<phrase diff="add" dg="b3249b">mapping of the literals
<string>INF</string>, <string>NaN</string>, etc., to the</phrase>
<phrase diff="del" dg="b3249b">special values</phrase><phrase diff="add" dg="b3249b"><termref def="dt-specialvalue">special values</termref></phrase><phrase diff="del" dg="b3249b">
(<nt def="nt-numSpecReps"/> <termref def="dt-literal">literals</termref>)</phrase>,
satisfies the conformance requirements of this specification.</p>

<p>Since IEEE allows some variation in rounding of values, processors
conforming to this specification may exhibit some variation in their
<termref def="dt-lexical-mapping">lexical mappings</termref>.</p>

<p>The <termref def="dt-lexical-mapping"/> <pfref ref="f-doubleLexmap"/> is 
provided as an example of a simple algorithm that yields a conformant mapping,
and that provides the most accurate rounding possible—and is thus useful
for insuring inter-implementation reproducibility and inter-implementation
round-tripping.  The simple rounding
algorithm used in <pfref ref="f-doubleLexmap"/> may be more efficiently
implemented using the algorithms of <bibref ref="clinger1990"/>.</p>

<note>
<p>The Schema 1.0 version of this datatype did not permit rounding
algorithms whose results differed from <bibref ref="clinger1990"/>.</p>
</note>

<p>The <termref def="dt-canonical-mapping"/> <pfref ref="f-doubleCanmap"/> is 
provided as an example of a mapping that does not produce unnecessarily long
<termref def="dt-canonical-representation">canonical representations</termref>. 
Other algorithms which do not yield identical results for mapping from float values
to character strings are permitted by <bibref ref="ieee754"/>.</p>

</div4>

<!-- The Simple Type definition for float was never accepted, so we don't need HT's
cute <head/> trickery to remove it.  I'm commenting it out to eliminate the spurious
empty Division (number w/o head) that otherwise results.  -DP 051016

<div4 dg="flfix" diff="add"><head/>
<div5 diff="del" dg="rec12-tableaux"><head>Simple Type Definition for double</head>
<p>The &simple_type_definition; of <dtref ref="double"/> is present in every
schema.&nbsp; It has the following properties:</p>

<schemaComp id="double-def">
<head alt="Simple Type Definition of &pD;">&simple_type_definition; of 
<dtref ref="double"/></head>

<pvlist>
<pvpair comp="std" prop="name"><string>double</string></pvpair>
<pvpair comp="std" prop="target namespace"><string>http://www.w3.org/2001/XMLSchema</string></pvpair>
<pvpair comp="std" prop="base type definition">The
<dtref ref="anyAtomicType" role="def"/></pvpair>
<pvpair comp="std" prop="final">The empty set</pvpair>
<pvpair comp="std" prop="variety"><pt>atomic</pt></pvpair>
<pvpair comp="std" prop="primitive type definition"><dtref ref="double"/></pvpair>
<pvpair comp="std" prop="facets">{a &whiteSpace; facet with 
<propref comp="f-w" prop="value"/> = <pt>collapse</pt> and
<propref comp="f-w" prop="fixed"/> = <pt>true</pt>}
</pvpair>
<pvpair comp="std" prop="fundamental facets"><p>{<ulist>
<item><p>an <compref ref="ff-o"/> facet
with <propref comp="ff-o" prop="value"/> = <pt>total</pt></p></item>
<item><p>a <compref ref="ff-b"/> facet
with <propref comp="ff-b" prop="value"/> = <pt>true</pt></p></item>
<item><p>a <compref ref="ff-c"/> facet
with <propref comp="ff-c" prop="value"/> = <pt>finite</pt></p></item>
<item><p>a <compref ref="ff-n"/> facet
with <propref comp="ff-n" prop="value"/> = <pt>true</pt></p></item>
</ulist>}</p>
</pvpair>
<pvpair comp="std" prop="scope"><pt>global</pt></pvpair>
<pvpair comp="std" prop="item type definition"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="member type definitions"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="annotations">The empty sequence</pvpair>
</pvlist>
</schemaComp>

</div5></div4>
-->

<div4 id="double-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>
 
<div3 id="duration">
<head>duration</head>

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

<!--* !!! this note was not expressly deleted by du0 as approved 19 Dec 2003
    * http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2003Dec/att-0042/durationsProposal3.html
    * but also not shown as retained.
    *-->
<!--*
* material suppressed here by diff group du0.ysc *
*-->
<!--* n.b. newOrg removes the termdef here and retags the term
    * as a dtref.  As with string, I have foreborne to follow
    * suit, just yet. -msm 2005-01-09
    *-->

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

<p dg="du0">
<termdef id="dt-duration" term="duration" role="local"><term>duration</term> 
is a datatype that represents
durations of time.</termdef>  The concept of duration being captured is
drawn from those of <bibref ref="ISO8601"/>, specifically
<emph>durations without fixed endpoints</emph>.  For example,
<unusual>15 days</unusual> (whose most common lexical representation
in <dtref ref="duration"/> is <quote><string>P15D</string></quote>) is
a <dtref ref="duration"/> value; <unusual>15 days beginning 12 July
1995</unusual> and <unusual>15 days ending 12 July 1995</unusual> are
not<phrase diff="add" dg="b3077"> <dtref ref="duration"/> 
values</phrase>.  <dtref ref="duration"/> can provide addition and
subtraction operations between <dtref ref="duration"/> values and
between <dtref ref="duration"/>/<dtref ref="dateTime"/> value pairs,
and can be the result of subtracting <dtref ref="dateTime"/>
values.  However, only addition to <!--*
* material suppressed here by diff group dudt *
*--><dtref ref="dateTime"/>
is required for XML Schema processing and is
defined <!--*
* material suppressed here by diff group dudt *
*--><phrase dg="dudt">in
the function <pfref ref="vp-dt-dateTimePlusDuration"/></phrase>.</p>

<!--* !!! n.b. newOrg suppresses the specref above, substituting TBD.
    * I've left it as is for now.  -msm 2005-01-09 *-->

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

<div4 dg="du0"><head>Value Space</head>
<!--* !!! this paragraph is not quite the same as was adopted by the WG in
    * December 2003; editorial changes have been made.
    *-->
<p><!--*
* material suppressed here by diff group wd17 *
*-->
<phrase dg="wd17">Duration values can be modelled as
two-property tuples.  Each value consists of an integer number of
months and a decimal number of seconds.  The 
<vpropref ref="vp-du-second"/> value <rfc2119>must not</rfc2119> be negative if the 
<vpropref ref="vp-du-month"/> value is positive and <rfc2119>must not</rfc2119> be 
positive if the <vpropref ref="vp-du-month"/> is negative.</phrase>

<!--* !!! n.b. the display of this material is not, in the status quo document,
    * the same as in the proposal adopted by the WG in December 2003.
    * It is the same as was published as SQ text in July 2004.
    *-->
<defset><head>Properties of <dtref ref="duration"/> Values</head>
<vpropdef><name id="vp-du-month">months</name>
<limits dg="wd17"><dtref ref="integer"/></limits>
</vpropdef>
<vpropdef><name id="vp-du-second">seconds</name>
<limits>a <phrase diff="del" dg="b3255"><dtref ref="precisionDecimal"/></phrase><phrase diff="add" dg="b3255"><dtref ref="decimal"/></phrase> value;
<!--*
* material suppressed here by diff group wd17 *
*--><phrase dg="wd17"><rfc2119>must not</rfc2119></phrase> 
be negative if <vpropref ref="vp-du-month"/> is positive, and 
<!--*
* material suppressed here by diff group wd17 *
*--><phrase dg="wd17"><rfc2119>must not</rfc2119></phrase>
be positive if <vpropref ref="vp-du-month"/> is negative.</limits>
</vpropdef>
</defset>

<dtref ref="duration"/> is partially ordered.  
<!--*
* material suppressed here by diff group wd17 *
*--><phrase dg="wd17">Equality of <dtref ref="duration"/> 
is defined in terms of equality of <dtref ref="dateTime"/>;  order for 
<dtref ref="duration"/> is defined in terms of the order of 
<dtref ref="dateTime"/>.  Specifically, the equality or order of 
two <dtref ref="duration"/> values is determined by adding each 
<dtref ref="duration"/> in the pair to each of</phrase> the following 
four <dtref ref="dateTime"/> values:

<ulist>
<item><p>1696-09-01T00:00:00Z</p></item>
<item><p>1697-02-01T00:00:00Z</p></item>
<item><p>1903-03-01T00:00:00Z</p></item>
<item><p>1903-07-01T00:00:00Z</p></item>
</ulist>

If all four resulting <dtref ref="dateTime"/> value pairs are ordered
the same way (less than, equal, or greater than), then the original
pair of <dtref ref="duration"/> values is ordered the same way;
otherwise the original pair is <termref def="dt-incomparable"/>.</p>

<note>
<p>These four values are chosen so as to maximize 
the possible differences in results that could occur, 
such as the difference when adding P1M and P30D:  
1697-02-01T00:00:00Z + P1M &lt; 1697-02-01T00:00:00Z + P30D , 
but 
1903-03-01T00:00:00Z + P1M &gt; 1903-03-01T00:00:00Z + P30D , 
so that  P1M &lt;&gt; P30D .  
If two <dtref ref="duration"/> values are ordered the same way 
when added to each of these four <dtref ref="dateTime"/> values, 
they will retain the same order when added 
to <emph>any</emph> other <dtref ref="dateTime"/> 
values<!--*
* material suppressed here by diff group noleap *
*-->.  Therefore, 
two <dtref ref="duration"/> values are incomparable if and only 
if they can <emph>ever</emph> result in different orders when added to <emph>any</emph> 
<dtref ref="dateTime"/> value<!--*
* material suppressed here by diff group noleap *
*-->.</p>

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

<p><!--*
* material suppressed here by diff group noleap *
*--><phrase dg="noleap">U</phrase>nder the definition just given, 
two <dtref ref="duration"/> values are equal if and only if they are identical.</p>

<!--* !!! n.b. newOrg moves the following paragraph to another location. *-->
<note id="two_totally_ordered_subtypes">
<p>Two totally ordered datatypes (<dtref ref="yearMonthDuration"/> and
<dtref ref="dayTimeDuration"/>) are derived from <dtref ref="duration"/> in
<specref ref="ordinary-built-ins"/>.</p></note>

<note><p>There are many ways to implement <dtref ref="duration"/>,
some of which do not base the implementation on the two-component
model.  This specification does not prescribe any particular
implementation, as long as the visible results are isomorphic to those
described herein.</p></note>

<note dg="partialfix">
<p>See the conformance notes in <specref ref="partial-implementation"/>, which
apply to this datatype.</p>
</note>

<!--* !!! n.b. newOrg moves the note 'two_totally_ordered_subtypes' from another
    * location to this point.  I'm leaving it alone for now. *-->

</div4>

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

<div4 id="duration-lexical-space" dg="du0"><head>Lexical <phrase diff="del" dg="b3736">Space</phrase><phrase diff="add" dg="b3736">Mapping</phrase></head>

<p>The <termref def="dt-lexical-representation">lexical representations</termref>
of <dtref ref="duration"/> are 
more or less based on the pattern:
<display role="shrink"><code>P<var>n</var>Y<var>n</var>M<var>n</var>DT<var>n</var>H<var>n</var>M<var>n</var>S</code></display>
</p>

<p>More precisely, the <termref def="dt-lexical-space"/> of <dtref ref="duration"/>
is the set of character 
strings that satisfy <nt def="nt-durationRep"/> as defined by the following productions:
<defset><head> Lexical Representation Fragments</head>
<prod id="nt-duYrFrag"><lhs>duYearFrag</lhs>
<rhs><nt def="nt-unsNoDecNuml"/> <string>Y</string></rhs></prod>
<prod id="nt-duMoFrag"><lhs>duMonthFrag</lhs>
<rhs><nt def="nt-unsNoDecNuml"/> <string>M</string></rhs></prod>
<prod id="nt-duDaFrag"><lhs>duDayFrag</lhs>
<rhs><nt def="nt-unsNoDecNuml"/> <string>D</string></rhs></prod>
<prod id="nt-duHrFrag"><lhs>duHourFrag</lhs>
<rhs><nt def="nt-unsNoDecNuml"/> <string>H</string></rhs></prod>
<prod id="nt-duMiFrag"><lhs>duMinuteFrag</lhs>
<rhs><nt def="nt-unsNoDecNuml"/> <string>M</string></rhs></prod>
<prod id="nt-duSeFrag"><lhs>duSecondFrag</lhs>
<rhs>(<nt def="nt-unsNoDecNuml"/> | <nt def="nt-unsDecNuml" dg="du1"/><!--*
* material suppressed here by diff group du1 *
*-->) <string>S</string></rhs></prod>

<prod id="nt-duYMFrag"><lhs>duYearMonthFrag</lhs>
<rhs>(<nt def="nt-duYrFrag"/> <nt def="nt-duMoFrag"/>?) | <nt def="nt-duMoFrag"/></rhs></prod>

<prod id="nt-duTFrag"><lhs>duTimeFrag</lhs>
<rhs><string>T</string> ((<nt def="nt-duHrFrag"/> <nt def="nt-duMiFrag"/>? <nt def="nt-duSeFrag"/>?) |
(<nt def="nt-duMiFrag"/> <nt def="nt-duSeFrag"/>?) |
<nt def="nt-duSeFrag"/>)</rhs></prod>

<prod id="nt-duDTFrag"><lhs>duDayTimeFrag</lhs>
<rhs>(<nt def="nt-duDaFrag"/> <nt def="nt-duTFrag"/>?) | <nt def="nt-duTFrag"/></rhs></prod>

</defset>

<defset><head>Lexical Representation</head>
<prod id="nt-durationRep"><lhs>durationLexicalRep</lhs>
<rhs><string>-</string>? <string>P</string> ((<nt def="nt-duYMFrag"/> <nt def="nt-duDTFrag"/>?) | <nt def="nt-duDTFrag"/>)</rhs></prod>
</defset>
</p>

<p>Thus, a <nt def="nt-durationRep"/> consists of one or more of a <nt def="nt-duYrFrag"/>, 
<nt def="nt-duMoFrag"/>, <nt def="nt-duDaFrag"/>, <nt def="nt-duHrFrag"/>, 
<nt def="nt-duMiFrag"/>, and/or <nt def="nt-duSeFrag"/>, in order, with letters 
<string>P</string> and <string>T</string> (and perhaps a <string>-</string>)
where appropriate.</p>

<!--*
* material suppressed here by diff group rq20 *
*-->
<p dg="rq20">The language accepted by the <nt def="nt-durationRep"/> 
production is the set of strings which satisfy all of the following
three regular expressions:
<ulist>
<item><p>The expression 
<phrase diff="del" dg="b3659"><string>-?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?((([0-9]+(.[0-9]*)?)|(.[0-9]+))S)?)?</string></phrase>
<display diff="add" dg="b3659" role="shrink">
<code>-?P([0-9]+Y)?([0-9]+M)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(\.[0-9]+)?S)?)?</code>
</display>
matches only strings in which the fields occur in the proper order.</p>
</item>
<item><p>The expression <string>.*[YMDHS].*</string> matches only
strings in which at least one field occurs.</p>
</item>
<item><p>The expression <string>.*[^T]</string> matches
only strings in which <string>T</string> is not the final character, so that
if <string>T</string> appears, something follows it.  The first rule
ensures that what follows <string>T</string> will be an hour,
minute, or second field.</p>
</item>
</ulist>
The intersection of these three regular expressions is equivalent to
the following (after removal of the white space inserted here for
legibility):
<display role="shrink" diff="del" dg="b3659"><code>-?P(((([0-9]+Y([0-9]+M)?)|<br/>
      (       <ghostchar>(</ghostchar>[0-9]+M<ghostchar>)</ghostchar> ) )(([0-9]+D(T(([0-9]+H([0-9]+M)?([0-9]+(\.[0-9]+)?S)?)|<br/>
                                       (       <ghostchar>(</ghostchar>[0-9]+M<ghostchar>)</ghostchar> ([0-9]+(\.[0-9]+)?S)?)|<br/>
                                       (                 <ghostchar>(</ghostchar>[0-9]+(\.[0-9]+)?S<ghostchar>)</ghostchar> ) ))?)|<br/>
                            (       <ghostchar>(</ghostchar>T(([0-9]+H([0-9]+M)?([0-9]+(\.[0-9]+)?S)?)|<br/>
                                       (       <ghostchar>(</ghostchar>[0-9]+M<ghostchar>)</ghostchar> ([0-9]+(\.[0-9]+)?S)?)|<br/>
                                       (                 <ghostchar>(</ghostchar>[0-9]+(\.[0-9]+)?S<ghostchar>)</ghostchar> ) )<ghostchar>)</ghostchar> ) )?)|<br/>
    (                      <ghostchar>(</ghostchar>([0-9]+D(T(([0-9]+H([0-9]+M)?([0-9]+(\.[0-9]+)?S)?)|<br/>
                                       (       <ghostchar>(</ghostchar>[0-9]+M<ghostchar>)</ghostchar> ([0-9]+(\.[0-9]+)?S)?)|<br/>
                                       (                 <ghostchar>(</ghostchar>[0-9]+(\.[0-9]+)?S<ghostchar>)</ghostchar> ) ))?)|<br/>
                            (       <ghostchar>(</ghostchar>T(([0-9]+H([0-9]+M)?([0-9]+(\.[0-9]+)?S)?)|<br/>
                                       (       <ghostchar>(</ghostchar>[0-9]+M<ghostchar>)</ghostchar> ([0-9]+(\.[0-9]+)?S)?)|<br/>
                                       (                 <ghostchar>(</ghostchar>[0-9]+(\.[0-9]+)?S<ghostchar>)</ghostchar> ) )<ghostchar>)</ghostchar> ) <ghostchar>)</ghostchar> ) )</code></display>
<eg diff="add" dg="b3659" xml:space="preserve">
-?P(([0-9]+Y)([0-9]+M)?([0-9]+D)?(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?
   |([0-9]+M)([0-9]+D)?(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?
   |([0-9]+D)?(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?
   |T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?
     |([0-9]+M)?([0-9]+(\.[0-9]+)?S)?
     |([0-9]+(\.[0-9]+)?S)))</eg>

</p>
<!--* !!! The text following the regex is not exactly what was approved
    * by the WG in December 2003.  It is the same as appeared in the draft
    * of July 2004.
    *-->

<!--* !!! The following paragraph was approved by the WG in December 2003
    * as part of the same proposal as the paragraph above.  It's not
    * clear why they are marked with different diff groups.
    *-->
<!--* du0_prodigal2 has not yet been considered by the WG, so unlike
    * the other diff groups where additions are changed by rq21-lexmaps,
    * it doesn't get reversed from an add to an del. MSM 2005-08-25
    * Correction 2006-01-10: approved as part of RQ-20 proposal
    * on 18 Dec 2003.
    *-->
<!--*
* material suppressed here by diff group du0_prodigal2.add.rq21-lexmaps.del *
*-->

<p dg="du0_prodigal2.add.rq21-lexmaps.add">The
<termref def="dt-lexical-mapping"/> for <dtref ref="duration"/> is <pfref ref="f-durationMap"/>.
</p>

<!--* !!! The following note and paragraph were not part of the proposal approved 
    * by the WG in December 2003.  At the moment, it's not clear whether 
    * or when it has been considered by the WG.
    * The note appeared, marked as non-status-quo text, in July 2004.
    *-->
<!--*
* material suppressed here by diff group du1 *
*-->

<!--* changed the following from du1 to du0, 2005-04-28.  The assignment
    * to du1 was added in 1.7.2.98, for which the comment says that some
    * things that depend on du1 were marked as du1.  I infer now that
    * this was mis-identified as dependent on the preceding paragraph.
    * In reality, a full description of the canonical mapping was part of
    * the wording approved 18 Dec 2003 (proposal for rq-20).
    *-->
<!--*
* material suppressed here by diff group du0_prodigal.add.rq21-lexmaps.del *
*-->

<p dg="du0_prodigal.add.rq21-lexmaps.add"><termref role="the" def="dt-canonical-mapping">The canonical
mapping</termref> for <dtref ref="duration"/>
is <pfref ref="f-durationCanMap"/>.
</p>
</div4>



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

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

<!--* The following section was shown as deleted by the proposal 
    * approved by the WG in December 2003.  It was restored in
    * version 1.7.2.140 as part of making a more complete diff
    * against 1.0, but was erroneously not marked deleted.
    * As a result, it was wrongly included without diff coloring
    * in the Working Draft of 24 February 2005.
    *-->
<!--*
* material suppressed here by diff group du0 *
*-->

<div4 id="duration-facets"><head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="duration-derived-types" dg="rq20">
<head>Related Datatypes</head>
<subtypes/>
</div4>
</div3>

<div3 id="dateTime">
<head>dateTime</head>

<!--*
* material suppressed here by diff group dt2 *
*-->
<!--* MSM reverted from &pD; to decimal 3ll up, since paragraph is now gone anyway.
    * If change appeared in Feb WD we'll need to mark it as a change, but for now
    * I'm busy rechecking against 1.0, not the WD yet. *-->

<!--*
<ednote><edtext>I'm not sure how UTC and TAI are handled&mdash;as
termrefs or just plain text.  Michael, please fix appropriately
once we converge</edtext></ednote>
*-->

<p dg="dt2"><dtref ref="dateTime"/> represents
instants of time, optionally marked
with a particular timezone.  Values representing
the same instant but having
different timezones are equal but not
identical.</p>

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

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

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

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

<div4 id="dateTime-value-space" dg="dt2">
<head>Value Space</head>

<p><dtref ref="dateTime"/> uses the
<dtref ref="dt-dt-7PropMod"/>, with no properties 
except <pfref ref="vp-dt-timezone"/>
permitted 
to be <pt>absent</pt>.  The <pfref ref="vp-dt-timezone"/> property remains
<termref def="dt-optional"/>.</p>

<!--* This note duplicates on in the appendix; see that they remain in synch. *-->
<note dg="rq123">
<p>In version 1.0 of this specification, the 
<pfref ref="vp-dt-year"/> property was not permitted to have the value
zero. The year <phrase diff="add" dg="b3256">before the year 1
in the proleptic Gregorian calendar, traditionally referred to as 
1 BC or as</phrase>
1 BCE<phrase diff="add" dg="b3256">,</phrase> was represented by a 
<pfref ref="vp-dt-year"/> value of −1, 2 BCE by −2, and so
forth. <phrase diff="add" dg="b3256">Of course, many, perhaps most,
references to 1 BCE (or 1 BC) actually refer not 
to a year in the proleptic Gregorian calendar but to a year in the
Julian or <quote>old style</quote> calendar; the two correspond
approximately but not exactly to each other.</phrase>
</p>
<p>
In this version of this specification,
two changes are made in order to agree with existing usage. 
First, <pfref ref="vp-dt-year"/> is permitted to have the value zero.
Second, the interpretation of
<pfref ref="vp-dt-year"/> values is changed accordingly: a <pfref ref="vp-dt-year"/> value of zero represents 1 BCE, −1
represents 2 BCE, etc. This representation simplifies interval
arithmetic and leap-year calculation for dates before the common 
era<phrase diff="add" dg="b3256"> (which may be why astronomers
and others interested in such calculations with the proleptic
Gregorian calendar have adopted it), and is consistent with the
current edition of <bibref ref="ISO8601"/></phrase>.
</p>
<p>
Note that 1 BCE, 5 BCE, and so on (years 0000, -0004, etc. in the
lexical representation defined here) are leap years in the proleptic
Gregorian calendar used for the date/time datatypes defined here.
Version 1.0 of this specification was unclear about the treatment of
leap years before the common era<phrase diff="add" dg="b3256">.</phrase><phrase diff="del" dg="b3256">; caution should be used if</phrase>
<phrase diff="add" dg="b3256">If</phrase> existing
schemas or data specify dates of 29 February for any years before the
common era<phrase diff="add" dg="b3256">, then some values giving
a date of 29 February which were valid under a plausible
interpretation of XSD 1.0 will be invalid under this specification,
and some which were invalid will be valid</phrase>.  With that possible 
exception, schemas and data valid
under the old interpretation remain valid under the new.
</p>
</note>

<constraintnote id="con-dateTime-dayValue" type="value">
<head>Day-of-month Values</head>
<p>The <pfref ref="vp-dt-day"/> value <!--* is limited to *-->
<rfc2119>must</rfc2119> be
no more than 30 if <pfref ref="vp-dt-month"/>
is one of 4, 6, 9, or 11; <!--* , to *-->
no more than 28
if <pfref ref="vp-dt-month"/> is 2 and
<pfref ref="vp-dt-year"/> is not divisible 4,
or is divisible by 100 but not by 400;
and no more than 29 if <pfref ref="vp-dt-month"/>
is 2 and <pfref ref="vp-dt-year"/>
is divisible by 400, or by 4 but not by 100.</p>
</constraintnote>

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

<note>
<p>See the conformance note in 
<!--*
* material suppressed here by diff group partialfix *
*--><phrase dg="partialfix"><specref ref="partial-implementation"/></phrase>
which applies to the <pfref ref="vp-dt-year"/> and <pfref ref="vp-dt-second"/>
values of this datatype.</p>
</note>

<p>Equality and order are as prescribed
in <specref ref="theSevenPropertyModel"/>. 
<dtref ref="dateTime"/> values are ordered
by their <pfref ref="vp-dt-timeOnTimeline"/> value.</p>

<note>
<p>Since the order of a <dtref ref="dateTime"/>
value having a <pfref ref="vp-dt-timezone"/>
<phrase diff="del" dg="b3257">with</phrase><phrase diff="add" dg="b3257">relative to</phrase> another value whose
<pfref ref="vp-dt-timezone"/> is <pt>absent</pt> is determined
by imputing timezones of both +14:00
and −14:00 to the untimezoned value, many such
combinations will be
<termref def="dt-incomparable"/> because the two imputed
timezones yield different orders.</p>

<!-- moved up from MSM's experiment in the later delled subsection -->
<p>Although <dtref ref="dateTime"/> and other
types related to dates and times have only a partial order, it
is possible for datatypes derived from <dtref ref="dateTime"/> to have
total orders, if they are restricted (e.g. using the
<compref ref="f-p"/> facet) to the subset of values with, or
the subset of values without, timezones.  Similar restrictions
on other date- and time-related types will similarly produce
totally ordered subtypes.  Note, however, that
such restrictions do not affect the value shown, for a given 
<compref ref="std"/>, in the <compref ref="ff-o"/> facet.</p>
</note>

<note>
<p>Order and equality are essentially the same for
<dtref ref="dateTime"/> in this version of this specification as
they were in version 1.0.  However, since values
now distinguish timezones, equal
values with different <pfref ref="vp-dt-timezone"/>s
are not <emph>identical</emph>, and values with extreme
<pfref ref="vp-dt-timezone"/>s may no longer be equal
to any value with a smaller <pfref ref="vp-dt-timezone"/>.</p>
</note>

</div4>

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

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

<div4 id="dateTime-lexical-mapping" dg="dt2">
<head>Lexical Mapping<phrase diff="del" dg="b3736">s</phrase></head>

<!--
<p diff="add" dg="rq123">
Informally, the &lexical_space; of <dtref ref="dateTime"/> consists of
literals of the form:
<code>'-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?</code>,
where 
</p>
<ulist diff="add" dg="rq123">
  <item><p><code>'-'? yyyy</code> denotes the year. There must
be at least four digits; leading zeroes are prohibited if the numeral
is more than four digits long, and non-positive numbers represent
years before the common era (<string>0000</string> represents the
year 1 BCE, <string>-0001</string> is 2 BCE, etc.); no plus sign is
permitted.</p>
<note>
<p>Version 1.0 of this specification described a different
interpretation of negative years, in which 1 BCE was
represented <string>-0001</string>, etc.  That interpretation
however, is inconsistent with existing established usage of
negative year numbers.  Note that existing schemas and XML data valid
under the old interpretation remain valid under the new.</p>
</note>
</item>
  <item><p><code>'-' mm '-' dd</code> represents the month and day
of the month; both <var>mm</var> and <var>dd</var> are two-digit
numerals.</p></item>
  <item><p><string>T</string> is a separator indicating that 
time-of-day follows.</p></item>
  <item><p><string>hh ':' mm ':' ss ('.' s+)?</string> denotes
the time of day.  <var>hh</var> is a two-digit numeral
representing the hour. <var>hh</var> may be
<string>24</string> if and only if <var>hh</var>
and <var>mm</var> are each <string>00</string>;
the <dtref ref="dateTime"/> value so represented is the first 
instant of the following day. <var>mm</var> and <var>ss</var> 
are two-digit numerals representing the minute and the
integral number of seconds, respectively; the <string>.</string>
and trailing <var>s</var> digits (if any) represent fractional
seconds.</p></item>
  <item><p><string>zzzzzz</string> (if present) represents
the timezone either as <string>Z</string> or
in the format <code>('+'|'-') hh ':' mm</code>,
giving the offset from UTC in hours and minutes.</p></item>
</ulist>

<p diff="add" dg="rq123">
For example, 2002-10-10T12:00:00-05:00 
(noon on 10 October 2002, Central Daylight
Savings Time as well as Eastern Standard Time
in the U.S.) is 2002-10-10T17:00:00Z,
five hours later than 2002-10-10T12:00:00Z.
</p>
-->

<p>The lexical representations for <dtref ref="dateTime"/> are as follows:

<defset><head>Lexical Space</head>
<prod id="nt-dateTimeRep"><lhs>dateTimeLexicalRep</lhs>
<rhs><nt def="nt-yrFrag"/> <string>-</string> <nt def="nt-moFrag"/> <string>-</string> <nt def="nt-daFrag"/> <string>T</string> ((<nt def="nt-hrFrag"/> <string>:</string> <nt def="nt-miFrag"/> <string>:</string> <nt def="nt-seFrag"/>) |
<nt def="nt-eodFrag"/>) <nt def="nt-tzFrag"/>?</rhs>
<constraint def="con-dateTime-day"/><!--*
* material suppressed here by diff group noleap *
*-->
</prod></defset>

<constraintnote id="con-dateTime-day" type="lexical">
<head>Day-of-month Representations</head>
<p>Within a <nt def="nt-dateTimeRep"/>, a <nt def="nt-daFrag"/> <rfc2119>must not</rfc2119>
begin with the digit <string>3</string> or be <string>29</string>
unless the value to
which it would map would satisfy the value constraint on
<pfref ref="vp-dt-day"/> values
<!-- The 2 <quote>s following should be a ref of some sort.  I don't know
how to link to <constraintnote>s. -->
(<quote>Constraint: Day-of-month Values</quote>) given above.</p>
</constraintnote>

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

<phrase dg="rq123">In such representations:</phrase>
<ulist dg="rq123">
<item>
<p><nt def="nt-yrFrag"/> is a numeral consisting
of at least four decimal digits, optionally preceded by a minus sign;
leading <string>0</string> digits are prohibited except to bring the
digit count up to four. 
It represents the <pfref ref="vp-dt-year"/> value.</p></item>
<item>
<p>Subsequent <string>-</string>, <string>T</string>, and
<string>:</string>, separate the various numerals.</p></item>
<item>
<p><nt def="nt-moFrag"/>, <nt def="nt-daFrag"/>, <nt def="nt-hrFrag"/>,
and <nt def="nt-miFrag"/> are numerals consisting
of exactly two decimal digits. 
They represent<!--*
* material suppressed here by diff group rq123 *
*--> 
the <pfref ref="vp-dt-month"/>, <pfref ref="vp-dt-day"/>,
<pfref ref="vp-dt-hour"/>, and <pfref ref="vp-dt-minute"/> values
respectively.</p></item>
<item>
<!--*
* material suppressed here by diff group dp200701 *
*-->
<p><phrase diff="del" dg="b3258"><nt def="nt-daFrag"/></phrase><phrase diff="add" dg="b3258"><nt def="nt-seFrag"/></phrase>
is a numeral consisting
of exactly two decimal digits, or two decimal digits,
a decimal point, and one or more trailing digits. 
It represents the <pfref ref="vp-dt-second"/> value.</p></item>
<item>
<p>Alternatively, <nt def="nt-eodFrag"/> combines the <nt def="nt-hrFrag"/>,
<nt def="nt-miFrag"/>, <nt def="nt-miFrag"/>, and their separators to
represent midnight of the day, which is the first moment of the next
day.</p></item>
<item>
<p><nt def="nt-tzFrag"/>, if present, specifies the timezone in which
the moment occurs.  Timezones are a count of minutes (expressed in
<nt def="nt-tzFrag"/> as a count of hours and minutes) that are added
or subtracted from UTC time to get the <unusual>local</unusual> time. 
<string>Z</string> is an alternative representation of the timezone of
UTC, which is, of course, zero minutes from UTC.</p>

<p>For example, 2002-10-10T12:00:00−05:00 
(noon on 10 October 2002, Central Daylight
Savings Time as well as Eastern Standard Time
in the U.S.) is equal to 2002-10-10T17:00:00Z,
five hours later than 2002-10-10T12:00:00Z.</p>
</item>
</ulist>
</p>

<p>The <nt def="nt-dateTimeRep"/> <phrase dg="dt3">production
</phrase>is equivalent to this regular expression
once whitespace is removed<!--*
* material suppressed here by diff group dt3 *
*-->.
<display role="shrink" diff="del" dg="b3659"><code>
<!--* year  *-->\-?([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9])<!--*
    * month *-->\-(0[1-9])|(1[0-2])<!--*
    * day   *-->\-(0[1-9])([12][0-9])|(3[01])<br/>
<!--* Time  *--> T<!--*
    * hour  *-->(([01][0-9])|(2[0-3])<!--*
    * min   *-->:[0-5][0-9]<!--*
    * sec   *-->:<phrase dg="dt3">(<!--*
    *   normal *--><!--*
* material suppressed here by diff group rq122a_sg *
*--></phrase><!--* 
    *     tens *-->[0-<!--* 
    *          *--><!--*
* material suppressed here by diff group dt3 *
*--><!--*
    *          *--><phrase dg="dt3">5</phrase>]<!--* 
    *     ones *-->[0-9]<phrase dg="dt3"><!--* 
    *          *--><!--*
* material suppressed here by diff group rq122a_sg *
*--><!--* 
    *          *-->)<!--*
    * secfrag  *-->(<phrase dg="rq122a_sg">\</phrase>.[0-9]+)?)</phrase><!--*
    * eodfrag  *-->|(24:00:00<!--*
    * eodsecfrag *--><phrase dg="dt3">(<phrase dg="rq122a_sg">\</phrase>.<!--* 
    *            *--><!--*
* material suppressed here by diff group rq122a_sg *
*--><!--* 
    *            *--><phrase dg="rq122a_sg">0</phrase>+)?</phrase>)<br/><!--*
    * timezone *-->   ([+\-](0[0-9])|(1[0-4]):[0-5][0-9])?
</code></display>
<eg diff="add" dg="b3659" xml:space="preserve">
-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</eg>
<eg diff="add" dg="b3659" xml:space="preserve">
-?([1-9][0-9]{3,}|0[0-9]{3})
-(0[1-9]|1[0-2])
-(0[1-9]|[12][0-9]|3[01])
T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))
(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</eg>
<!--*
* material suppressed here by diff group pre *
*-->
Note that neither the <!--*
* material suppressed here by diff group dt3 *
*--><nt def="nt-dateTimeRep"/> <phrase dg="dt3">production
</phrase>nor this regular
expression alone enforce the constraint<!--*
* material suppressed here by diff group noleap *
*-->
<phrase dg="dt3">on <nt def="nt-dateTimeRep"/> </phrase>given above.</p>

<!--*
* material suppressed here by diff group rq21-lexmaps *
*-->

<p dg="rq21-lexmaps">The <termref def="dt-lexical-mapping"/>
for <dtref ref="dateTime"/> is <pfref ref="vp-dateTimeLexRep"/>.
The <termref def="dt-canonical-mapping"/> is <pfref ref="vp-dateTimeCanRep"/>.
</p>
</div4>

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

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

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

<div4 id="dateTime-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="time">
<head>time</head>
<!--*
* material suppressed here by diff group dt2 *
*-->

<p dg="wdd"><dtref ref="time"/>
represents instants of time that recur at the same point in each
calendar day<phrase dg="dt2">, or that occur in some arbitrary calendar day.</phrase></p>

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

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

<div4 id="time-value-space" dg="dt2">
<head>Value Space</head>

<p><dtref ref="time"/> uses the <dtref ref="dt-dt-7PropMod"/>, with
<pfref ref="vp-dt-year"/>, <pfref ref="vp-dt-month"/>,
and <pfref ref="vp-dt-day"/> required 
to be <pt>absent</pt>.  <pfref ref="vp-dt-timezone"/> remains
<termref def="dt-optional"/>.</p>

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

<note>
<p>See the conformance note in 
<!--*
* material suppressed here by diff group partialfix *
*--><phrase dg="partialfix"><specref ref="partial-implementation"/></phrase>
which applies to the <pfref ref="vp-dt-second"/> value of this datatype.</p>
</note>

<!--* <issue id="RQ-13i-time-copy" role="1.1" diff="del" dg="dt2-3">
<p><loc href="&reqs;#time" target="reqs">RQ-13 (time 
zone crosses date line)</loc></p>

<p>The "seven property model" rewrite of
date/time datatype descriptions includes 
a carefully crafted definition of order
that insures that for repeating datatypes (time, gDay, etc.), timezoned values 
will be compared as though they are on the same <unusual>calendar day</unusual> 
(<unusual>local</unusual> property values) so that in any given timezone, 
the days start at <unusual>local</unusual> 
00:00:00 and end immediately before <unusual>local</unusual> 24:00:00.  
Days in timezones other than Z do not run from 00:00:00Z to 24:00:00Z.</p>
</issue> *-->

<p>Equality and order are as prescribed in
<specref ref="theSevenPropertyModel"/>.  <dtref ref="time"/> values
(points in time in an <unusual>arbitrary</unusual> day) are ordered
taking into account their <pfref ref="vp-dt-timezone"/>.<!--* &nbsp;
This was not true of the
<dtref ref="time"/> datatype as defined in the 1.0 version of this
specification, where <dtref ref="time"/> values were not
<unusual>timezone aware</unusual>. *--></p>

<p>A calendar ( or <unusual>local time</unusual>) day with an early
timezone begins earlier than the same calendar day with a later
timezone.  Since the timezones allowed spread over 28 hours,
there are timezone pairs for which a given calendar day in the two
timezones are totally disjoint—the earlier day ends before the
same day starts in the later timezone.  The moments in time
represented by a single calendar day are spread over a 52-hour
interval, from the beginning of the day in the +14:00 timezone to the
end of that day in the −14:00 timezone.</p>

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

<note>
<p>Since the order of a <dtref ref="time"/> value having a <pfref ref="vp-dt-timezone"/> with another value whose <pfref ref="vp-dt-timezone"/> is
<pt>absent</pt> is determined by imputing timezones of both +14:00 and
−14:00 to the untimezoned value, many such combinations will be
<termref def="dt-incomparable"/> because the two imputed timezones
yield different orders.  However, for a given untimezoned value,
there will always be timezoned values at one or both ends of the
52-hour interval that are <termref def="dt-incomparable">comparable</termref> (because the interval of
<termref def="dt-incomparable">incomparability</termref> is only 24
hours wide).</p>

<p diff="del" dg="b3027">Examples that show the difference from version 1.0 of this specification (see 
<specref ref="time-lexical-mapping"/> for the notations):
<ulist>
<item>
<p>A day is a calendar (or <unusual>local
time</unusual>) day in each timezone.<!--
Yes it's true.  Note that we're talking about a "day" as is
involved in the time datatype; we used to run times from
00:00:00Z up to 24:00:00Z no matter what the timezone. -DP -->
<!--* is this next sentence true?  I don't think so. 
So I'm suppressing it.
(in version 1.0, by contrast, a day was
always <termref def="dt-utc"/>): *--></p>
<p>08:00:00+10:00 &lt; 17:00:00+10:00 
(just as 08:00:00Z has always been less than
17:00:00Z, but in version 1.0 
08:00:00+10:00 &gt; 17:00:00+10:00 )</p></item>
<item>
<p>A <dtref ref="time"/> value in a calendar day with an early timezone 
may precede <emph>every</emph> value in a later calendar day:</p>
<p>00:00:00+01:00 is less than <emph>every</emph> value with 
<pfref ref="vp-dt-timezone"/> Z</p></item>
<item>
<p>A calendar day with a very early timezone may be completely
disjoint from a calendar day with a very late timezone:</p>
<p>Each value with <pfref ref="vp-dt-timezone"/>
+13:00 is less than <emph>every</emph>
value with <pfref ref="vp-dt-timezone"/> −13:00</p></item>
<item>
<p><dtref ref="time"/> values do not always
convert to <termref def="dt-utc"/> 
in the same way as in 1.0, since a time 
in a timezone may convert to 
a <termref def="dt-utc"/> time on
a <emph>different day</emph> (whereas time 
conversions in version 1.0 <unusual>wrapped around</unusual>
by ignoring the day during conversion):</p>
<p>
22:00:00Z &gt; 03:00:00+05:00
(since 1971-12-31T03:00:00+05 is 1979-12-30T22:00:00Z,
not 1979-12-31T22:00:00Z); in the previous
version of this specification  22:00:00Z =
03:00:00+05:00 )</p>
</item>
</ulist>
</p>
<p diff="add" dg="b3027">Date values in different
timezones that were identical in the 1.0 version
of this specification, such as 2000-12-12+13:00 and 2000-12-11−11:00, are
in this version of this specification equal (because they begin at the
same moment on the time line) but are not identical (because they have
and retain different timezones).</p>
</note>

</div4>

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

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

<div4 id="time-lexical-mapping" dg="dt2">
<head>Lexical Mappings</head>

<p>The lexical representations for <dtref ref="time"/>
are <unusual>projections</unusual> of 
those of <dtref ref="dateTime"/>, as follows:

<defset><head>Lexical Space</head>
<prod id="nt-timeRep"><lhs>timeLexicalRep</lhs>
<rhs>((<nt def="nt-hrFrag"/> <string>:</string> <nt def="nt-miFrag"/> <string>:</string> <nt def="nt-seFrag"/>) |
<nt def="nt-eodFrag"/>) <nt def="nt-tzFrag"/>?</rhs>
<!--*
* material suppressed here by diff group noleap *
*-->
</prod></defset>

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

The <nt def="nt-timeRep"/> <phrase dg="dt3">production
</phrase>is equivalent to this
regular expression, once whitespace is
removed<!--*
* material suppressed here by diff group dt3 *
*-->:
<!--*
* material suppressed here by diff group rq122a_sg *
*-->
<display dg="rq122a_sg"><code><phrase diff="del" dg="b3659">
(((([01][0-9])|(2[0-3])):([0-5][0-9]):(([0-5][0-9])(\.[0-9]+)?))<br/>
  |(24:00:00(\.0+)?))<br/>
(Z|((+|-)(0[0-9]|1[0-4]):[0-5][0-9]))?<br/></phrase>
<phrase diff="add" dg="b3659">(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</phrase></code></display>
<phrase dg="dt3">Note that neither
the <nt def="nt-timeRep"/> production
nor this regular
expression alone enforce the constraint
on <nt def="nt-timeRep"/> given above.</phrase>
</p>
<!--*
* material suppressed here by diff group pre *
*-->

<!--*
* material suppressed here by diff group rq21-lexmaps *
*-->

<p dg="rq21-lexmaps">The <termref def="dt-lexical-mapping"/>
for <dtref ref="time"/> is
<pfref ref="vp-timeLexRep"/>; the <termref def="dt-canonical-mapping"/> is
<pfref ref="vp-timeCanRep"/>.
</p>

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

<note diff="add" dg="b2497">
<p>The <termref def="dt-lexical-mapping"/> maps <string>00:00:00</string> and
<string>24:00:00</string> to the same value, namely midnight
(<pfref ref="vp-dt-hour"/> = 0 ,
<pfref ref="vp-dt-minute"/> = 0 , 
<pfref ref="vp-dt-second"/> = 0).</p>
</note>

</div4>

<div4 id="time-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="date">
<head>date</head>
<p><termdef id="dt-date" term="date" role="local">
<!--*
* material suppressed here by diff group dt2 *
*--><phrase dg="dt2"><term>date</term>
represents top-open intervals of exactly one day in length on the timelines of
<dtref ref="dateTime"/>, beginning on the beginning moment of each day (in
each timezone), up to but not including the beginning
moment</phrase> of the next day).  For nontimezoned values, the top-open
intervals disjointly cover the nontimezoned timeline,
one per day.  For timezoned
values, the intervals begin at every minute and therefore overlap.
</termdef>
</p>

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

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

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

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

<!--* strictly speaking, dt2 didn't delete this, just moved it into
    * the new section immediately following.  (Silently at first;
    * I found it missing when I collated 1.0 against a reconstruction
    * of 1.0 based on our diff markup, 26 August 2005.)
    * We could hack around this the way we do in rq21-string-hack,
    * but it's late, I'm tired, and I won't do it tonight.
    *-->
<!--*
* material suppressed here by diff group dt2 *
*-->

<div4 id="date-value-space" dg="dt2">
<head>Value Space</head>

<p><dtref ref="date"/> uses the <dtref ref="dt-dt-7PropMod"/>, with
<pfref ref="vp-dt-hour"/>, <pfref ref="vp-dt-minute"/>,
and <pfref ref="vp-dt-second"/> required 
to be <pt>absent</pt>.  <pfref ref="vp-dt-timezone"/> remains
<termref def="dt-optional"/>.</p>

<constraintnote id="con-date-dayValue" type="value">
<head>Day-of-month Values</head>
<p>The <pfref ref="vp-dt-day"/> value <rfc2119>must</rfc2119> be
no more than 30 if <pfref ref="vp-dt-month"/>
is one of 4, 6, 9, or 11, no more than 28
if <pfref ref="vp-dt-month"/> is 2 and
<pfref ref="vp-dt-year"/> is not divisble 4,
or is divisible by 100 but not by 400,
and no more than 29 if <pfref ref="vp-dt-month"/>
is 2 and <pfref ref="vp-dt-year"/>
is divisible by 400, or by 4 but not by 100.</p>
</constraintnote>

<note>
<p>See the conformance note in 
<!--*
* material suppressed here by diff group partialfix *
*--><phrase dg="partialfix"><specref ref="partial-implementation"/></phrase>
which applies to the <!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd"><pfref ref="vp-dt-year"/>
value</phrase> of this datatype<!--*
* material suppressed here by diff group wdd *
*-->.</p>
</note>

<p>Equality and order are as prescribed in
<specref ref="theSevenPropertyModel"/>.</p>

<note>
<p>In version 1.0 of this specification, <dtref ref="date"/> values 
did not retain a timezone explicitly, but for timezones not too far from 
<termref def="dt-utc"/> their timezone could be recovered based on
their value's first moment on the timeline.  The
<dtref ref="dt-dt-7PropMod"/> retains all timezones.</p>

<p>Examples that show the difference from version 1.0 (see 
<specref ref="date-lexical-mapping"/> for the notations):
<ulist>
<item>
<p>A day is a calendar (or <unusual>local
time</unusual>) day in each timezone,
including the timezones outside of +12:00 through -11:59 inclusive:</p>

<p>2000-12-12+13:00 &lt; 2000-12-12+11:00 
(just as 2000-12-12+12:00 has always been less than
2000-12-12+11:00, but in version 1.0 
2000-12-12+13:00 &gt; 2000-12-12+11:00 ,
since 2000-12-12+13:00's <unusual>recoverable
timezone</unusual> was −11:00)</p></item>
<item>
<p>Similarly:</p>
<p>2000-12-12+13:00 = 2000-12-13−11:00 
(whereas under 1.0, as just
stated,  2000-12-12+13:00 = 2000-12-12−11:00)</p></item>
</ulist>
</p>

</note>
</div4>

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

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

<div4 id="date-lexical-mapping" dg="dt2">
<head>Lexical Mapping<phrase diff="del" dg="b3736">s</phrase></head>

<p>The lexical representations for <dtref ref="date"/>
are <unusual>projections</unusual> of 
those of <dtref ref="dateTime"/>, as follows:

<defset><head>Lexical Space</head>
<prod id="nt-dateRep"><lhs>dateLexicalRep</lhs>
<rhs><nt def="nt-yrFrag"/> <string>-</string> <nt def="nt-moFrag"/> <string>-</string> <nt def="nt-daFrag"/> <nt def="nt-tzFrag"/>?</rhs>
<constraint def="con-date-day"/></prod></defset>

<constraintnote id="con-date-day" type="lexical">
<head>Day-of-month Representations</head>
<p>Within a
<!--*
* material suppressed here by diff group dt4 *
*--><phrase dg="dt4"><nt def="nt-dateRep"/></phrase>,
a <nt def="nt-daFrag"/> <rfc2119>must not</rfc2119>
begin with the digit <string>3</string> or be <string>29</string>
unless the value to
which it would map would satisfy the value constraint on
<pfref ref="vp-dt-day"/> values
<!-- The <quote> following should be a ref of some sort.  I don't know
how to link to <constraintnote>s. -->
(<quote>Constraint: Day-of-month Values</quote>) given above.</p>
</constraintnote>

The <nt def="nt-dateRep"/> <phrase dg="dt3">production
</phrase>is equivalent to this
regular expression<!--*
* material suppressed here by diff group dt3 *
*-->:
<display role="shrink" diff="del" dg="b3659"><code>\-?([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9])\-(0[1-9])|(1[0-2])\-([0-2][0-9])|(3[01])((+|\-)(0[0-9]|1[0-4]):[0-5][0-9])?</code>
</display>
<display diff="add" dg="b3659" role="shrink">
<code>-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</code>
</display>
<!--*
* material suppressed here by diff group pre *
*-->
<phrase dg="dt3">Note that neither
the <nt def="nt-dateRep"/> production
nor this regular
expression alone enforce the constraint
on <nt def="nt-dateRep"/> given above.</phrase></p>

<!--*
* material suppressed here by diff group rq21-lexmaps *
*-->

<p dg="rq21-lexmaps">The <termref def="dt-lexical-mapping"/>
for <dtref ref="date"/> is <pfref ref="vp-dateLexRep"/>.
The <termref def="dt-canonical-mapping"/> is <pfref ref="vp-dateCanRep"/>.
</p>
</div4>

<div4 id="date-facets" diff="add" dg="b4033">
<head>Facets</head>
<facets/>
</div4>
</div3>

<div3 id="gYearMonth">
<head>gYearMonth</head>

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

<p dg="dt2">
<term>gYearMonth</term> <!--* is a datatype that *--> 
represents specific whole Gregorian months in specific 
Gregorian years.</p>

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

<note>
<p>Because month/year combinations in one calendar only rarely correspond
to month/year combinations in other calendars, values of this type
are not, in general, convertible to simple values corresponding to month/year
combinations in other calendars.  This type should therefore be used
with caution in contexts where conversion to other calendars is desired.</p>
</note>

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

<div4 id="gYearMonth-value-space" dg="dt2">
<head>Value Space</head>

<p><dtref ref="gYearMonth"/> uses the <dtref ref="dt-dt-7PropMod"/>, with
<pfref ref="vp-dt-day"/>, <pfref ref="vp-dt-hour"/>,
<pfref ref="vp-dt-minute"/>, and <pfref ref="vp-dt-second"/> required 
to be <pt>absent</pt>.  <pfref ref="vp-dt-timezone"/> remains
<termref def="dt-optional"/>.</p>

<note>
<p>See the conformance note in 
<!--*
* material suppressed here by diff group partialfix *
*--><phrase dg="partialfix"><specref ref="partial-implementation"/></phrase>
which applies to the <pfref ref="vp-dt-year"/> value of this datatype.</p>
</note>

<p>Equality and order are as prescribed in
<specref ref="theSevenPropertyModel"/>.</p>

<!--* <ednote dg="review" diff="add"><edtext>The following note and example
are true, but unlike for date, 1.0 2E did not spell
out the fact.</edtext></ednote> *-->

<note>
<p>In version 1.0 of this specification, <dtref ref="gYearMonth"/>
values did not
retain a timezone explicitly, but timezones not too far from
<termref def="dt-utc"/>
 could be recovered based on the <dtref ref="gYearMonth"/>
value's first moment on the timeline.  The
<dtref ref="dt-dt-7PropMod"/> simply retains all timezones.</p>

<p>An example that shows the difference from version 1.0 (see 
<specref ref="gYearMonth-lexical-repr"/> for the notations):
<ulist>
<item>
<p>A day is a calendar (or <unusual>local time</unusual>) day in
each timezone, including the timezones outside of +12:00 through
−11:59 inclusive:</p>
<p>2000-12+13:00 &lt; 2000-12+11:00 
(just as 2000-12+12:00 has always been less than 2000−12+11:00,
but in version 1.0  2000-12+13:00 &gt;
2000-12+11:00 , since 2000−12+13:00's <unusual>recoverable
timezone</unusual> was −11:00)</p></item>
</ulist>
</p>

</note>
</div4>

<div4 id="gYearMonth-lexical-repr">
<head>Lexical
<!--*
* material suppressed here by diff group dt3 *
*--><phrase dg="dt3">Mapping<phrase diff="del" dg="b3736">s</phrase></phrase></head>

<!--ednote diff="add" dg="dt2" diff="del" dg="dt3"><edtext>This "Lexical representation"
section will be replaced by a "Lexical Mappings" section similar in
spirit to that for <dtref ref="date"/> and others above, as soon as
the appropriate mappings are written.</edtext></ednote-->

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

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

<p dg="dt2">The lexical representations for
<dtref ref="gYearMonth"/> are <unusual>projections</unusual> of 
those of <dtref ref="dateTime"/>, as follows:

<defset><head>Lexical Space</head>
<prod id="nt-gYearMonthRep"><lhs>gYearMonthLexicalRep</lhs>
<rhs><nt def="nt-yrFrag"/> <string>-</string> <nt def="nt-moFrag"/> <nt def="nt-tzFrag"/>?</rhs>
</prod></defset>

The <nt def="nt-gYearMonthRep"/> is equivalent to this regular expression:
<display role="shrink" diff="del" dg="b3659">
<code>\-?([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9])\-(0[1-9])|(1[0-2])((+|\-)(0[0-9]|1[0-4]):[0-5][0-9])?</code>
</display>
<display diff="add" dg="b3659" role="shrink">
<code>-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</code>
</display>
</p>
<!--*
* material suppressed here by diff group pre *
*-->

<!--*
* material suppressed here by diff group dt3.add.rq21-lexmaps.del *
*-->

<p dg="rq21-lexmaps">The <termref def="dt-lexical-mapping"/>
for <dtref ref="gYearMonth"/> is <pfref ref="vp-gYearMonthLexRep"/>.
The <termref def="dt-canonical-mapping"/> is <pfref ref="vp-gYearMonthCanRep"/>.
</p>
</div4>

<div4 id="gYearMonth-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="gYear">
<head>gYear</head>

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

<p dg="dt2"><term>gYear</term>
represents Gregorian calendar years.</p>

<!--*
* material suppressed here by diff group dt2 *
*-->
<note>
<p>
Because years in one calendar only rarely correspond to years
in other calendars, values of this type
are not, in general, convertible to simple values corresponding to years
in other calendars.  This type should therefore be used with caution
in contexts where conversion to other calendars is desired.
</p>
</note>
 <!--*
* material suppressed here by diff group dt2 *
*-->

<div4 id="gYear-value-space" dg="dt2">
<head>Value Space</head>

<p><dtref ref="gYear"/> uses the <dtref ref="dt-dt-7PropMod"/>, with
<pfref ref="vp-dt-month"/>, <pfref ref="vp-dt-day"/>, <pfref ref="vp-dt-hour"/>,
<pfref ref="vp-dt-minute"/>, and <pfref ref="vp-dt-second"/> required 
to be <pt>absent</pt>.  <pfref ref="vp-dt-timezone"/> remains
<termref def="dt-optional"/>.</p>

<note>
<p>See the conformance note in 
<!--*
* material suppressed here by diff group partialfix *
*--><phrase dg="partialfix"><specref ref="partial-implementation"/></phrase>
which applies to the <pfref ref="vp-dt-year"/> value of this datatype.</p>
</note>

<p>Equality and order are as prescribed in
<specref ref="theSevenPropertyModel"/>.</p>

<note>
<p>In version 1.0 of this specification, <dtref ref="gYear"/>
values did not
retain a timezone explicitly, but timezones not too far from
<termref def="dt-utc"/>
 could be recovered based on the <dtref ref="gYear"/>
value's first moment on the timeline.  The
<dtref ref="dt-dt-7PropMod"/> simply retains all timezones.</p>

<p>An example that shows the difference from version 1.0 (see 
<specref ref="gYear-lexical-repr"/> for the notations):
<ulist>
<item>
<p>A day is a calendar (or <unusual>local time</unusual>) day in
each timezone, including the timezones outside of +12:00 through
−11:59 inclusive:</p>
<p>2000+13:00 &lt; 2000+11:00 
(just as 2000+12:00 has always been less than 2000+11:00,
but in version 1.0  2000+13:00 &gt;
2000+11:00 , since 2000+13:00's <unusual>recoverable
timezone</unusual> was −11:00)</p></item>
</ulist>	
</p>
</note>
</div4>

<div4 id="gYear-lexical-repr">
<head>Lexical 
<!--*
* material suppressed here by diff group dt3 *
*--><phrase dg="dt3">Mapping<phrase diff="del" dg="b3736">s</phrase></phrase></head>
<!--* <ednote diff="del" dg="dt3"><edtext>The editors intend to replace this "Lexical
representation" section with a "Lexical Mappings" section in
the spirit of that in "date" and others above, as soon as the
appropriate mappings can be written.</edtext></ednote> *-->

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

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

<p dg="dt2">The lexical representations for
<dtref ref="gYear"/> are <unusual>projections</unusual> of 
those of <dtref ref="dateTime"/>, as follows:

<defset><head>Lexical Space</head>
<prod id="nt-gYearRep"><lhs>gYearLexicalRep</lhs>
<rhs><nt def="nt-yrFrag"/><phrase diff="del" dg="b3848"><string>-</string> <nt def="nt-moFrag"/></phrase> <nt def="nt-tzFrag"/>?</rhs>
</prod></defset>

The <nt def="nt-gYearRep"/> is equivalent to this regular expression:
<display role="shrink" diff="del" dg="b3659">
<code>\-?([1-9][0-9][0-9][0-9]+)|(0[0-9][0-9][0-9])((+|\-)(0[0-9]|1[0-4]):[0-5][0-9])?</code>
</display>
<display diff="add" dg="b3659" role="shrink">
<code>-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</code>
</display>
</p>
<!--*
* material suppressed here by diff group pre *
*-->

<!--*
* material suppressed here by diff group dt3.add.rq21-lexmaps.del *
*-->


<p dg="rq21-lexmaps">The <termref def="dt-lexical-mapping"/>
for <dtref ref="gYear"/> is <pfref ref="vp-gYearLexRep"/>.
The <termref def="dt-canonical-mapping"/>
is <pfref ref="vp-gYearCanRep"/>.
</p>
</div4>

<div4 id="gYear-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="gMonthDay">
<head>gMonthDay</head>

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

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

<p dg="wdd"><dtref ref="gMonthDay"/> represents whole calendar 
days that recur at the same point in each calendar year, or that occur 
in some arbitrary calendar year.<phrase diff="add" dg="b3259">  (Obviously,
days beyond 28 cannot occur in all Februaries; 29 is nonetheless
permitted.)</phrase></p>

<p dg="dt2">This datatype can be used, for example, to record
birthdays; an instance of the datatype could be used to say that 
someone's birthday occurs on the 14th of September every year.</p>

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

<note>
<p>
Because day/month combinations in one calendar only rarely correspond
to day/month combinations in other calendars, values of this type do not,
in general, have any straightforward or intuitive representation
in terms of most other calendars. This type should therefore be
used with caution in contexts where conversion to other calendars
is desired.
</p>
</note>

<div4 id="gMonthDay-value-space" dg="dt2">
<head>Value Space</head>

<p><dtref ref="gMonthDay"/> uses the <dtref ref="dt-dt-7PropMod"/>, with
<pfref ref="vp-dt-year"/>, <pfref ref="vp-dt-hour"/>, <pfref ref="vp-dt-minute"/>, and <pfref ref="vp-dt-second"/> required 
to be <pt>absent</pt>.  <pfref ref="vp-dt-timezone"/> remains
<termref def="dt-optional"/>.</p>

<constraintnote id="con-gMonthDay-dayValue" type="value"><head>Day-of-month Values</head>
<p>The <pfref ref="vp-dt-day"/> value <rfc2119>must</rfc2119> be no more than 30 if <pfref ref="vp-dt-month"/>
is one of 4, 6, 9, or 11, and no more than 29 if <pfref ref="vp-dt-month"/> is 2.</p>
</constraintnote>


<p>Equality and order are as prescribed in
<specref ref="theSevenPropertyModel"/>.</p>

<note> 
<p>In version 1.0 of this specification, <dtref ref="gMonthDay"/> values 
did not retain a timezone explicitly, but for timezones not too far from 
<termref def="dt-utc"/> their timezone could be recovered based on
their value's first moment on the timeline.  The
<dtref ref="dt-dt-7PropMod"/> retains all timezones.</p>

<p>An example that shows the difference from version 1.0 (see 
<specref ref="gMonthDay-lexical-repr"/> for the notations):
<ulist>
<item>
<p>A day is a calendar (or <unusual>local time</unusual>) day in each timezone,
including the timezones outside of +12:00 through −11:59 inclusive:</p>
<p>--12-12+13:00 &lt; --12-12+11:00 
(just as --12-12+12:00 has always been less than
--12-12+11:00, but in version 1.0 
--12-12+13:00 &gt; --12-12+11:00 , since
--12-12+13:00's <unusual>recoverable
timezone</unusual> was −11:00)</p></item>
</ulist>
</p>
</note>
</div4>

<div4 id="gMonthDay-lexical-repr">
<head>Lexical 
<!--*
* material suppressed here by diff group dt3 *
*--><phrase dg="dt3">Mapping<phrase diff="del" dg="b3736">s</phrase></phrase></head>

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

<p dg="dt2">The lexical representations for 
<dtref ref="gMonthDay"/> are <unusual>projections</unusual> 
of those of <dtref ref="dateTime"/>, as follows:

<defset><head>Lexical Space</head>
<prod id="nt-gMonthDayRep"><lhs>gMonthDayLexicalRep</lhs>
<rhs><string>--</string> <nt def="nt-moFrag"/> <string>-</string> <nt def="nt-daFrag"/> <nt def="nt-tzFrag"/>?</rhs>
<constraint def="con-gMonthDay-day" dg="dt4"/></prod></defset>

<constraintnote id="con-gMonthDay-day" type="lexical" dg="dt4">
<head>Day-of-month Representations</head>
<p>Within a <nt def="nt-gMonthDayRep"/>, a <nt def="nt-daFrag"/> <rfc2119>must not</rfc2119>
begin with the digit <string>3</string> or be <string>29</string>
unless the value to
which it would map would satisfy the value constraint on
<pfref ref="vp-dt-day"/> values
<!-- The <quote> following should be a ref of some sort.  I don't know
how to link to <constraintnote>s. -->
(<quote>Constraint: Day-of-month Values</quote>) given above.</p>
</constraintnote>

The <nt def="nt-gMonthDayRep"/> is equivalent to this regular 
expression<!--*
* material suppressed here by diff group dt4 *
*-->:
<!--* <ednote diff="del" dg="dt3"><edtext>Note initial escape hyphen does not appear on 
most other d/ts; check them out.</edtext></ednote> *-->
<!--* er, why ARE we escaping the initial hyphen? 
    * It's not a reserved character, is it?
YES  AFAIK, we didn't ever agree to making it part-time reserved.  -DP
    *-->
<display role="shrink" diff="del" dg="b3659">
<code>\-\-(0[1-9])|(1[0-2])\-([0-2][0-9])|(3[01])((+|\-)(0[0-9]|1[0-4]):[0-5][0-9])?</code>
</display>
<!--* also, if role="shrink" does what I think it does, it renders
    * the thing unreadable in my browser; is it expendable?
It's forced one line, so without shrink the line is quite long. -DP
    *-->
<display diff="add" dg="b3659" role="shrink">
<code>--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</code></display>
<phrase dg="dt4">Note that neither
the <nt def="nt-gMonthDayRep"/> production
nor this regular
expression alone enforce the constraint
on <nt def="nt-gMonthDayRep"/> given above.</phrase></p>

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

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

<!--*
* material suppressed here by diff group dt3.add.rq21-lexmaps.del *
*-->

<p dg="rq21-lexmaps">The <termref def="dt-lexical-mapping"/>
for <dtref ref="gMonthDay"/> is <pfref ref="vp-gMonthDayLexRep"/>.
The <termref def="dt-canonical-mapping"/> is <pfref ref="vp-gMonthDayCanRep"/>.
</p>

</div4>

<div4 id="gMonthDay-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="gDay">
<head>gDay</head>
<!--*
* material suppressed here by diff group dt1 *
*-->
<p><termdef dg="dt1" id="dt-gday" role="local" term="dDay"><term>gDay</term> 
<!--*
* material suppressed here by diff group dt2 *
*--> represents 
whole days within an arbitrary month—days that recur at the same
point in each (Gregorian) month.</termdef>  This datatype <!--*
* material suppressed here by diff group dt1 *
*--><phrase dg="dt1">is</phrase> used to represent a specific day of the month.
To <!--*
* material suppressed here by diff group dt1 *
*--><phrase dg="dt1">indicate, for example, that an employee gets a paycheck</phrase> on the 15th of each month.  <phrase dg="dt1">(Obviously, days
beyond 28 cannot occur in <emph>all</emph> months; they are nonetheless permitted, up to 31.)</phrase></p>

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

<!-- F27Aug FTF--> 
<!--* MSM doesn't know what the August ftf said about this, but I'm
    * restoring the note because it's as true for gDay as for gMonth
    * and the others. *-->
<!-- FTF Directed that this note be removed.  Probably should go
in all cases, and I missed the others. -->
<!--* <note dg="dt2" diff="del"> *-->
<note>
<p>Because days in one calendar only rarely
correspond to days in other calendars, 
<phrase dg="dt1"><term>gday</term> </phrase>values<!--*
* material suppressed here by diff group dt1 *
*--> do not, in general, have any straightforward or
intuitive representation in terms of most 
<!--*
* material suppressed here by diff group dt1 *
*--><phrase dg="dt1">non-Gregorian</phrase> 
calendars. 
<!--*
* material suppressed here by diff group dt1 *
*--><phrase dg="dt1"><term>gday</term></phrase> 
should therefore be used with caution in contexts where conversion to 
other calendars is desired.</p>
</note>

<div4 dg="dt1">
<head>Value Space</head>
<p><dtref ref="gDay"/> uses the <dtref ref="dt-dt-7PropMod"/>, with
<pfref ref="vp-dt-year"/>, <pfref ref="vp-dt-month"/>,
<pfref ref="vp-dt-hour"/>, <pfref ref="vp-dt-minute"/>,
and <pfref ref="vp-dt-second"/> required to be
<pt>absent</pt>.  <pfref ref="vp-dt-timezone"/> remains
<termref def="dt-optional"/> and <pfref ref="vp-dt-day"/>
must be between 1 and 31 inclusive.</p>

<!--* <issue id="del-RQ-13i" role="1.1" diff="del" dg="dt2">
<p><loc href="&reqs;#time" target="reqs">RQ-13 (time zone crosses date line)</loc></p>
<p>The "seven property model" rewrite of date/time datatype descriptions includes a carefully crafted definition of order
that insures that for repeating datatypes (time, gDay, etc.), timezoned values will be compared as though they are on the same "calendar day" ("local"
property values) so that in any given timezone, the days start at "local" 00:00:00 and end not quite including "local" 24:00:00.  Days are not
00:00:00Z to 24:00:00Z in timezones other than Z.</p>
</issue> *-->

<p>Equality and order are as prescribed in
<specref ref="theSevenPropertyModel"/>.  Since <dtref ref="gDay"/>
values (days) are ordered by their first moments, it is possible
for apparent anomalies to appear in the order when
<pfref ref="vp-dt-timezone"/> values
<!--*
* material suppressed here by diff group dt3 *
*-->differ by at least 24
hours.  (It is possible for <pfref ref="vp-dt-timezone"/>
values to differ by up to 28 hours.)</p>
<p>
Examples that may appear anomalous (see <specref ref="gDay-lexical-mapping"/> for the notations):
<ulist>
<item><p>---15 &lt; ---16 , but  ---15−13:00 &gt; ---16+13:00</p></item>
<item><p>---15−11:00 = ---16+13:00</p></item>
<item><p>---15−13:00 &lt;&gt; ---16 ,
because  ---15−13:00 &gt; ---16+14:00 
and ---15−13:00 &lt; 16−14:00</p></item>
</ulist>
</p>
<note>
<p><!-- 2004-08-27 FTF-->
<!--* <phrase diff="del" dg="dt2">Timezones</phrase><phrase diff="add" dg="dt2">
Because of the definition in <specref ref="theSevenPropertyModel"/>,
timezones</phrase> *-->
<!--* I don't know what the ftf said, but it says here I'm suggesting 
    * we go back to 'Timezones do not cause wrap-around'.
    *-->
<!--* If we have to mention the 7-property model, then we should
    * recast the sentence.  Because of the definition of WHAT? in the
    * model?  Because of the way XXX is defined in the 7-property model ...
    *-->
Timezones do not cause wrap-around at the end of the month:  
<!--*
* material suppressed here by diff group dt2 *
*--><phrase dg="dt2">the last day of a 
given month in timezone −13:00 may start after the first 
day of the <emph>next</emph> month in timezone +13:00, as 
measured on the global timeline,</phrase>
but nonetheless 
---01+13:00 &lt; ---31−13:00 .</p>
</note>
</div4>

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

<div4 id="gDay-lexical-mapping" dg="dt1">
<head>Lexical Mapping<phrase diff="del" dg="b3736">s</phrase></head>
<p>
The lexical representations for <dtref ref="gDay"/> are 
<unusual><!--*
* material suppressed here by diff group dt2 *
*--><phrase dg="dt2">projections</phrase></unusual> 
of those of <dtref ref="dateTime"/>, as follows:

<defset><head>Lexical Space</head>
<prod id="nt-gDayRep"><lhs>gDayLexicalRep</lhs>
<rhs><string>---</string> <nt def="nt-daFrag"/> <nt def="nt-tzFrag"/>?</rhs></prod></defset>

The <nt def="nt-gDayRep"/> is equivalent to this regular expression:
<display role="shrinkx" diff="del" dg="b3659">
<code><!--*
* material suppressed here by diff group dt3 *
*--><phrase dg="dt3">\-\-\-</phrase>([0-2][0-9]|3[01])((+|\-)(0[0-9]|1[0-4]):[0-5][0-9])?</code>
</display>
<display diff="add" dg="b3659" role="shrink">
<code>---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</code>
</display>
</p>

<!--*
* material suppressed here by diff group rq21-lexmaps *
*-->

<p dg="rq21-lexmaps">The <termref def="dt-lexical-mapping"/> 
for <dtref ref="gDay"/> is <pfref ref="vp-gDayLexRep"/>.
The <termref def="dt-canonical-mapping"/> is <pfref ref="vp-gDayCanRep"/>.
</p>
</div4>

<div4 id="gDay-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="gMonth">
<head>gMonth</head>

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

<p><!--*
* material suppressed here by diff group dt2 *
*--><phrase dg="dt2"><term><!--*
* material suppressed here by diff group dt3 *
*--><phrase dg="dt3">gMonth</phrase></term>
represents whole (Gregorian) months
within an arbitrary year—months that recur at the same point in 
each year.  It might be used, for example, to say what
month annual Thanksgiving celebrations fall in different countries
(--11 in the United States, --10 in Canada, and possibly other months in
other countries).</phrase></p><!-- I think Oct in Germany as well -DP -->

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

<note>
<p>
Because months in one calendar only rarely correspond
to months in other calendars, values of this type do not,
in general, have any straightforward or intuitive representation
in terms of most other calendars. This type should therefore be
used with caution in contexts where conversion to other calendars
is desired.
</p>
</note>

<div4 id="gMonth-value-space" dg="dt2">
<head>Value Space</head>

<p><dtref ref="gMonth"/> uses the <dtref ref="dt-dt-7PropMod"/>, with
<pfref ref="vp-dt-year"/>, <pfref ref="vp-dt-day"/>, <pfref ref="vp-dt-hour"/>, <pfref ref="vp-dt-minute"/>, and <pfref ref="vp-dt-second"/> required 
to be <pt>absent</pt>.  <pfref ref="vp-dt-timezone"/> remains
<termref def="dt-optional"/>.</p>

<p>Equality and order are as prescribed in
<specref ref="theSevenPropertyModel"/>.</p>

<note>
<p>In version 1.0 of this specification, <dtref ref="gMonth"/> values 
did not retain a timezone explicitly, but for timezones not too far from 
<termref def="dt-utc"/> their timezone could be recovered based on
their value's first moment on the timeline.  The
<dtref ref="dt-dt-7PropMod"/> retains all timezones.</p>

<p>An example that shows the difference from version 1.0 (see 
<specref ref="gMonth-lexical-repr"/> for the notations):
<ulist>
<item>
<p>A month is a calendar (or <unusual>local time</unusual>) month in each timezone,
including the timezones outside of +12:00 through −11:59 inclusive:</p>
<p>--12+13:00 &lt; --12+11:00 
(just as --12+12:00 has always been less than --12+11:00, but in version 1.0 
--12+13:00 &gt; --12+11:00 , since --12+13:00's <unusual>recoverable
timezone</unusual> was −11:00)</p></item>
</ulist>
</p>
</note>

</div4>

<div4 id="gMonth-lexical-repr">
<head>Lexical 
<!--*
* material suppressed here by diff group dt3 *
*--><phrase dg="dt3">Mapping<phrase diff="del" dg="b3736">s</phrase></phrase></head>

<!--*
* material suppressed here by diff group dt2 *
*--><p dg="dt2">The lexical representations for <dtref ref="gMonth"/> are <unusual>projections</unusual> of 
those of <dtref ref="dateTime"/>, as follows:

<defset><head>Lexical Space</head>
<prod id="nt-gMonthRep"><lhs>gMonthLexicalRep</lhs>
<rhs><string>--</string> <nt def="nt-moFrag"/> <nt def="nt-tzFrag"/>?</rhs>
</prod></defset>

The <nt def="nt-gMonthRep"/> is equivalent to this regular expression:
<display role="shrink" diff="del" dg="b3659">
<code>\-\-(0[1-9])|(1[0-2])((+|\-)(0[0-9]|1[0-4]):[0-5][0-9])?</code>
</display>
<display diff="add" dg="b3659" role="shrink">
<code>--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</code>
</display>
</p>
<!--*
* material suppressed here by diff group pre *
*-->

<!--*
* material suppressed here by diff group dt3.add.rq21-lexmaps.del *
*-->

<p dg="rq21-lexmaps">
The <termref def="dt-lexical-mapping"/> for <dtref ref="gMonth"/> is <pfref ref="vp-gMonthLexRep"/>.
The <termref def="dt-canonical-mapping"/> is <pfref ref="vp-gMonthCanRep"/>.
</p>
</div4>

<div4 id="gMonth-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 role="1.0" id="hexBinary">
<head>hexBinary</head>

<p><termdef id="dt-hexBinary" term="hexBinary" role="local"><term>hexBinary</term>
represents arbitrary hex-encoded binary data. 
<!--*
* material suppressed here by diff group b1910-hexbin-silent *
*--></termdef>
</p>
<div4 dg="b1910-hexbin-silent">
<head dg="b1910-hexbin">Value Space</head>

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

<p>The <termref def="dt-value-space"/> of
<phrase diff="del" dg="b4350-1"><term>hexBinary</term></phrase><phrase diff="add" dg="b4350-1"><dtref ref="hexBinary"/></phrase>
is the set of <phrase diff="add" dg="b5625">possibly empty</phrase>
finite-length sequences of binary octets.<phrase diff="add" dg="b3263">  The
length of a value is the number of octets.</phrase></p>
</div4>

<div4 role="1.0" id="hexBinary-lexical-representation">
<head>Lexical <phrase diff="del" dg="b3736">Representation</phrase><phrase diff="add" dg="b3736">Mapping</phrase></head>

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

<p diff="del" dg="b3261"><term>hexBinary</term> has a <termref def="dt-lexical-representation"/> where
each binary octet is encoded as a character tuple, consisting of two
hexadecimal digits ([0-9a-fA-F]) representing the octet code. For example,
<string>0FB7</string> is a <emph>hex</emph> encoding for the 16-bit integer 4023
(whose binary representation is 111110110111).
</p>

<p diff="add" dg="b3261"><dtref ref="hexBinary"/>'s <termref def="dt-lexical-space"/>
consists of strings of hex (hexadecimal) digits, two consecutive digits
representing each octet in the corresponding value (treating the octet
as the binary representation of a number between 0 and 255).  For
example, <string>0FB7</string> is a <termref def="dt-lexical-representation"/> of the
two-octet value 00001111 10110111.</p>
	 
<p dg="b1910-hexbin">More formally, the <termref def="dt-lexical-space"/> of
<dtref ref="hexBinary"/> is the set of literals matching the <nt def="nt-hexBinary"/> production.
<defset>
<head>Lexical space of hexBinary</head>
<prod id="nt-hexDigit">
<lhs>hexDigit</lhs>
<rhs><charclass>0-9a-fA-F</charclass></rhs>
</prod>
<prod id="nt-hexOctet">
<lhs>hexOctet</lhs>
<rhs><nt def="nt-hexDigit"/> <nt def="nt-hexDigit"/></rhs>
</prod>
<prod id="nt-hexBinary">
<lhs>hexBinary</lhs>
<rhs><nt def="nt-hexOctet"/>*</rhs>
</prod>
</defset>
</p>
<p dg="b1910-hexbin">The set recognized by <nt def="nt-hexBinary"/> is the same as that recognized by the regular
expression <string>([0-9a-fA-F]{2})*</string>.</p>
<p dg="b1910-hexbin">The <termref def="dt-lexical-mapping"/> of
<dtref ref="hexBinary"/> is <pfref ref="f-hexBinaryMap"/>.</p>

<p diff="del" dg="b3736">
The <termref def="dt-canonical-representation"/> for <term>hexBinary</term> is defined by
prohibiting certain options from the
<specref ref="hexBinary-lexical-representation"/>.  Specifically,
the lower case hexadecimal digits ([a-f]) are not allowed.
</p>
<p diff="add" dg="b3736">The <termref def="dt-canonical-mapping"/> of
<dtref ref="hexBinary"/> is given formally in <pfref ref="f-hexBinaryCanonical"/>.</p>

</div4>

<div4 role="1.0" id="hexBinary-canonical-repr" diff="del" dg="b3736">
<head>Canonical Representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>hexBinary</term> is defined by
prohibiting certain options from the
<specref ref="hexBinary-lexical-representation"/>.  Specifically,
the lower case hexadecimal digits ([a-f]) are not allowed.
</p>
<p dg="b1910-hexbin">The <termref def="dt-canonical-mapping"/> of
<dtref ref="hexBinary"/> is given formally in <pfref ref="f-hexBinaryCanonical"/>.</p></div4>

<div4 role="1.0" id="hexBinary-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 role="1.0" id="base64Binary"><head>base64Binary</head>

<p><termdef id="dt-base64Binary" term="base64Binary" role="local">
<term>base64Binary</term> represents <phrase dg="b1911-b64b">arbitrary</phrase>
Base64-encoded <!--*
* material suppressed here by diff group b1911-b64b *
*--> binary
data.  <!--*
* material suppressed here by diff group b1911-b64b *
*--> 
For <term>base64Binary</term> data the entire binary stream is encoded
using the Base64 <!--*
* material suppressed here by diff group wd-19 *
*--><phrase dg="wd-19">Encoding
defined in <bibref ref="RFC3548"/>, which is derived from the encoding
described in <bibref ref="RFC2045"/></phrase>.</termdef></p>

<div4 dg="b1911-b64b-silent">
<head><phrase dg="b1911-b64b">Value Space</phrase></head>

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

<p dg="b1911-b64b-silent">The <termref def="dt-value-space"/> of
<dtref ref="base64Binary"/> is the set of <phrase diff="add" dg="b5625">possibly
empty</phrase> finite-length sequences of
binary octets.<phrase diff="add" dg="b3263">  The
length of a value is the number of octets.</phrase></p>
</div4>

<div4><head><phrase dg="b1911-b64b">Lexical
<phrase diff="del" dg="b3736">Representation</phrase><phrase diff="add" dg="b3736">Mapping</phrase></phrase></head>

<p>The <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b"><termref def="dt-lexical-representation">lexical representations</termref></phrase> of <term>base64Binary</term> values are
limited to the 65 characters of the Base64 Alphabet defined in 
<!--*
* material suppressed here by diff group wd-19 *
*--><bibref ref="RFC3548" dg="wd-19"/>,
i.e., <code>a-z</code>, <code>A-Z</code>,
<code>0-9</code>, the plus sign (+), the forward slash (/) and the
equal sign (=), together with 
<!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b">the space character
(#x20)</phrase>. No other characters are allowed.
</p>
<p>
For compatibility with older mail gateways, <bibref ref="RFC2045"/>
suggests that <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b">B</phrase>ase64 data should have lines limited to at most 76
characters in length.  This line-length limitation is not <phrase dg="wd-19">required by <bibref ref="RFC3548"/> and is
not</phrase> mandated in the <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b"><termref def="dt-lexical-representation">lexical representations</termref></phrase> of
<term>base64Binary</term> data<!--*
* material suppressed here by diff group wd-19 *
*--><phrase dg="wd-19">. It</phrase> <!--*
* material suppressed here by diff group wd-19 *
*--><phrase dg="wd-19"><rfc2119>must not</rfc2119></phrase> be enforced by XML Schema processors.
</p>
<p>
The <termref def="dt-lexical-space"/> of <term>base64Binary</term> is <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b">the set of literals
which <termref def="dt-match"/></phrase> the <term>Base64Binary</term> production.
</p>
<!--*
* material suppressed here by diff group b1911-b64b *
*-->
<p dg="b1911-b64b">
<defset>
<head>Lexical space of base64Binary</head>
<prod id="nt-Base64Binary">
<lhs>Base64Binary</lhs>
<rhs>(<nt def="nt-B64quad"/>* <nt def="nt-B64final"/>)?</rhs>
</prod>
<prod id="nt-B64quad">
<lhs>B64quad</lhs>
<rhs>(<nt def="nt-B64"/> <nt def="nt-B64"/> <nt def="nt-B64"/> 
<nt def="nt-B64"/>)
<com>B64quad represents three octets of binary data.</com>
</rhs>
</prod>
<prod id="nt-B64final">
<lhs>B64final</lhs>
<rhs><nt def="nt-B64finalquad"/> | <nt def="nt-Padded16"/> | <nt def="nt-Padded8"/></rhs>
</prod>
<prod id="nt-B64finalquad">
<lhs>B64finalquad</lhs>
<rhs>(<nt def="nt-B64"/> <nt def="nt-B64"/> <nt def="nt-B64"/> 
<nt def="nt-B64char"/>)
<com>B64finalquad represents three octets of binary data without trailing space.</com>
</rhs>
</prod>
<prod id="nt-Padded16">
<lhs>Padded16</lhs>
<rhs><nt def="nt-B64"/> <nt def="nt-B64"/> <nt def="nt-B16"/> <string>=</string>
<com>Padded16 represents a two-octet at the end of the data.</com>
</rhs>
</prod>
<prod id="nt-Padded8">
<lhs>Padded8</lhs>
<rhs><nt def="nt-B64"/> <nt def="nt-B04"/> <string>=</string> #x20? <string>=</string>
<com>Padded8 represents a single octet at the end of the data.</com>
</rhs>
</prod>
<prod id="nt-B64">
<lhs>B64</lhs><rhs><nt def="nt-B64char"/> #x20?</rhs>
</prod>
<prod id="nt-B64char">
<lhs>B64char</lhs><rhs>[A-Za-z0-9+/]</rhs>
</prod>
<prod id="nt-B16">
<lhs>B16</lhs><rhs><nt def="nt-B16char"/> #x20?</rhs>
</prod>
<prod id="nt-B16char">
<lhs>B16char</lhs><rhs>[AEIMQUYcgkosw048]
<com>Base64 characters whose bit-string value ends in '00'</com></rhs>
</prod>
<prod id="nt-B04">
<lhs>B04</lhs><rhs><nt def="nt-B04char"/> #x20?</rhs>
</prod>
<prod id="nt-B04char">
<lhs>B04char</lhs><rhs>[AQgw]
<com>Base64 characters whose bit-string value ends in '0000'</com></rhs>
</prod>
</defset>
</p>
<p diff="add" dg="b3659">
The <nt def="nt-Base64Binary"/> production is equivalent 
to the following regular expression.
<display role="shrink">
<code>((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?</code>
</display>
Note that each <string>?</string> except the last is preceded by a
single space character.
</p>
<p>
Note that this grammar requires the number of non-whitespace
characters in the <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b"><termref def="dt-lexical-representation"/></phrase> to be a multiple of four, and
for equals signs to appear only at the end of the
<!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b"><termref def="dt-lexical-representation"/></phrase>; <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b">literals</phrase> which do not meet these constraints
are not legal <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b"><termref def="dt-lexical-representation">lexical representations</termref></phrase> of <term>base64Binary</term><phrase diff="del" dg="b3262">
because they cannot successfully be decoded by <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b">B</phrase>ase64 decoders</phrase>.
</p>
<p dg="b1911-b64b">The <termref def="dt-lexical-mapping"/> for
<dtref ref="base64Binary"/> is as given in 
<bibref ref="RFC2045"/> and <bibref ref="RFC3548"/>.</p>
<note>
<p>The above definition of the <termref def="dt-lexical-space"/> is more restrictive than
that given in <bibref ref="RFC2045"/> as regards whitespace —
<phrase dg="wd-19">and less restrictive than <bibref ref="RFC3548"/>.</phrase> <!--*
* material suppressed here by diff group wd-19 *
*--><phrase dg="wd-19">This</phrase> is
not an issue in practice.  Any string compatible with <!--*
* material suppressed here by diff group wd-19 *
*--><phrase dg="wd-19">either</phrase> RFC can occur in an element or attribute
validated by this type, because the <termref def="dt-whiteSpace"/>
facet of this type is fixed to <pt>collapse</pt>, which means that all
leading and trailing whitespace will be stripped, and all internal
whitespace collapsed to single space characters, <emph>before</emph>
the above grammar is enforced. <phrase dg="wd-19">The
possibility of ignoring whitespace in <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b">B</phrase>ase64 data is foreseen in
clause 2.3 of <bibref ref="RFC3548"/>, but for the reasons given there
this specification does not allow implementations to ignore
non-whitespace characters which are not in the Base64
Alphabet.</phrase></p>
</note>
<p>
The canonical <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b"><termref def="dt-lexical-representation"/></phrase> of a <term>base64Binary</term> data value
is the <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b">B</phrase>ase64 encoding of the value which matches the
Canonical-base64Binary production in the following grammar:
</p>
<!--*
* material suppressed here by diff group b1911-b64b *
*-->
<p dg="b1911-b64b">
<defset>
<head>Canonical representation of base64Binary</head>
<prod id="nt-Canonical-base64Binary">
<lhs>Canonical-base64Binary</lhs>
<rhs><nt def="nt-CanonicalQuad"/>* <nt def="nt-CanonicalPadded"/>?</rhs>
</prod>
<prod id="nt-CanonicalQuad">
<lhs>CanonicalQuad</lhs>
<rhs><nt def="nt-B64char"/> <nt def="nt-B64char"/> <nt def="nt-B64char"/> <nt def="nt-B64char"/></rhs>
</prod>
<prod id="nt-CanonicalPadded">
<lhs>CanonicalPadded</lhs>
<rhs><nt def="nt-B64char"/> <nt def="nt-B64char"/> <nt def="nt-B16char"/> <string>=</string>
| <nt def="nt-B64char"/> <nt def="nt-B04char"/> <string>==</string></rhs>
</prod>
</defset></p>
<p dg="b1911-b64b">That is, the <termref def="dt-canonical-representation"/>
of a <dtref ref="base64Binary"/> value is the <termref def="dt-lexical-representation"/>
which maps to that value and contains no whitespace. The
<termref def="dt-canonical-mapping"/> for <dtref ref="base64Binary"/> is
thus the encoding algorithm for Base64 data given in <bibref ref="RFC2045"/> and <bibref ref="RFC3548"/>, with the proviso that no
characters except those in the Base64 Alphabet are to be written
out.</p>
<note>
<p>For some values the <termref def="dt-canonical-representation">canonical <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b">representation</phrase></termref> defined above does
not conform to <bibref ref="RFC2045"/>, which requires breaking with
linefeeds at appropriate intervals. <phrase dg="wd-19">It
does conform with <bibref ref="RFC3548"/>.</phrase></p>
</note>

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

<p>The length of a <term>base64Binary</term> value <phrase diff="del" dg="b3263">is the number of
octets it contains.  This </phrase>may be calculated from the <!--*
* material suppressed here by diff group b1911-b64b *
*--><phrase dg="b1911-b64b"><termref def="dt-lexical-representation"/></phrase> by
removing whitespace and padding characters and performing the
calculation shown in the pseudo-code below:</p>
<!-- the paragraph that begins "The length of a base64Binary value is
the number of octets it contains.  This may be calculated..." is changed to
read "The length of a base64Binary value may be calculated..." -->

<!-- I couldn't resist quietly making the following display wordwrap
a bit better for accessibility (i.e., very large fonts).  -DP -->
<p>
<code>
lex2   := killwhitespace(lexform) 
  -- remove whitespace characters<br/>
lex3   := strip_equals(lex2)      
  -- strip padding characters at end<br/>
length := floor (length(lex3) * 3 / 4)      
  -- calculate length
</code>
</p>
<p>
Note on encoding: <bibref ref="RFC2045"/> <phrase dg="wd-19">and
<bibref ref="RFC3548"/></phrase> explicitly 
reference<!--*
* material suppressed here by diff group wd-19 *
*--> US-ASCII encoding.  However,
decoding of <term>base64Binary</term> data in an XML entity is to be performed on the
Unicode characters obtained after character encoding processing as specified by
<bibref ref="XML"/>.
</p>
</div4>

<div4 role="1.0" id="base64Binary-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>
<div3 role="1.0" id="anyURI">
<head>anyURI</head>
<p>
<termdef id="dt-anyURI" term="anyURI" role="local">
<term>anyURI</term> represents <!--*
* material suppressed here by diff group wd25 *
*--><phrase dg="wd25">an
Internationalized Resource Identifier Reference
(IRI)</phrase>.  An <term>anyURI</term> value can be absolute or relative, and may
have an optional fragment identifier (i.e., it may be 
<!--*
* material suppressed here by diff group wd25 *
*--><phrase dg="wd25">an
IRI</phrase> Reference).  This type should be used 
<!--*
* material suppressed here by diff group wd25 *
*--><phrase dg="wd25">when</phrase> 
the value fulfills the role of 
<!--*
* material suppressed here by diff group wd25 *
*--><phrase dg="wd25">an IRI,
as defined in <bibref ref="RFC3987"/> or its successor(s) in the IETF
Standards Track</phrase>.
</termdef>
</p>
<note>
<p><phrase dg="wd25">IRIs may be used to locate resources
or simply to identify them. In the case where they are used to locate
resources using a URI, applications should use
the</phrase><!--*
* material suppressed here by diff group wd25 *
*--> mapping from <term>anyURI</term> 
values to URIs 
<!--*
* material suppressed here by diff group wd25 *
*--><phrase dg="wd25">given</phrase> 
by the URI reference escaping procedure defined in
<!--*
* material suppressed here by diff group wd25 *
*--><phrase dg="wd25">Section 
3.1 <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.ietf.org/rfc/rfc3987.txt">Mapping
of IRIs to URIs</xspecref> of <bibref ref="RFC3987"/>
or its successor(s) in the IETF Standards Track</phrase>. 
This means that a wide range of internationalized resource identifiers
can be specified when an <term>anyURI</term> is called for, and still
be understood as URIs per 
<!--*
* material suppressed here by diff group wd25 *
*--><phrase dg="wd25"><bibref ref="RFC3986"/>
and its successor(s)</phrase>.</p>
</note>

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

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

<div4 role="1.0" id="anyURI-lexical-representation">
<head>Lexical <!--*
* material suppressed here by diff group wd25 *
*--><phrase dg="wd25">mapping</phrase></head>
<p>
The <termref def="dt-lexical-space"/> of <term>anyURI</term> is
<phrase diff="add" dg="b5625">the set of
possibly empty</phrase> 
finite-length 
character sequences<!--*
* material suppressed here by diff group wd25 *
*-->.</p>

<note dg="wd25">
<p>For an <dtref ref="anyURI"/> value to be 
usable in practice as an IRI, the result of applying to it 
the algorithm defined in Section 3.1 of <bibref ref="RFC3987"/>
should <!--* NOT &should;, this is not a conformance criterion *-->
be a string which is a legal URI according
to <bibref ref="RFC3986"/>. (This is true at the time this document is published;
if in the future 
<bibref ref="RFC3987"/> and <bibref ref="RFC3986"/> are replaced by other specifications
in the IETF Standards Track, the relevant constraints will be those
imposed by those successor specifications.)</p>
<p>
Each URI scheme imposes specialized syntax rules
for URIs in that scheme, including restrictions on the syntax of
allowed fragment identifiers. Because it is impractical for processors
to check that a value is a context-appropriate URI reference, 
neither the syntactic constraints defined by the definitions of individual
schemes nor the generic syntactic constraints defined by
<bibref ref="RFC3987"/> and <bibref ref="RFC3986"/> and their
successors are part of this datatype as defined here.
Applications which depend on <dtref ref="anyURI"/> values
being legal according to the rules of 
<!--* <bibref ref="RFC3987"/>, <bibref ref="RFC3986"/> and their
successor(s) *-->
the relevant specifications <!--* ? check with NM *-->
should make arrangements to check values against the appropriate 
definitions of IRI, URI, and specific schemes.
</p>
</note>
<note>
<p>
Spaces are, in principle, allowed in the <termref def="dt-lexical-space"/>
of <term>anyURI</term>, however, their use is highly discouraged
(unless they are encoded by <string>%20</string>).
</p>
</note>
<p dg="wd25">The <termref def="dt-lexical-mapping"/> for <dtref ref="anyURI"/> is
the identity mapping.</p>
<note dg="wd25"><p>The definitions of URI in the current
IETF specifications define certain URIs as equivalent to each other.
Those equivalences are not part of this datatype as defined here:
if two <unusual>equivalent</unusual> URIs or IRIs are different character
sequences, they map to different values in this datatype.</p>
</note>
</div4>

<div4 role="1.0" id="anyURI-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="QName">
<head>QName</head>

<p><termdef id="dt-QName" term="QName" role="local">
<term>QName</term> represents
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#dt-qualname">XML qualified
names</xspecref><phrase dg="context">.
The <termref def="dt-value-space"/> of <term>QName</term> is the set of
tuples {<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#dt-NSName">namespace name</xspecref>,
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#dt-localname">local part</xspecref>},
where <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#dt-NSName">namespace name</xspecref>
is an <dtref ref="anyURI"/>
and <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#dt-localname">local part</xspecref> is
an <dtref ref="NCName"/>.
The <termref def="dt-lexical-space"/> of <term>QName</term> is the set
of strings that <termref def="dt-match"/> the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-QName">
QName</xnt> production of</phrase><!--*
* material suppressed here by diff group context *
*--> <bibref ref="XMLNS"/>.</termdef></p>

<p dg="b1838">It is <termref def="key-impl-def"/> whether an
implementation of this specification supports the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-QName">QName</xnt> production from 
<bibref ref="XMLNS"/>, or that from 
<bibref ref="XMLNS1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p>

<p diff="add" dg="b4395">
The mapping from lexical space to value space for a particular QName
literal depends on the namespace bindings in scope where the literal occurs.
<!--*
* material suppressed here by diff group wgi-20080606 *
*-->
</p>

<p diff="add" dg="b4395">
When QNames appear in an XML context, the bindings to be used in
the lexical mapping are those in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">in-scope namespaces</xpropref> property of the
relevant element<!--*
* material suppressed here by diff group wgi-20080606 *
*-->.
<!--* e.g. XPointer *-->
<!--* Dude, XPointer values don't have type QName. *-->
<!--* d'oh!. *-->
When this datatype is used in a non-XML host language, 
the host language <rfc2119>must</rfc2119> specify what namespace bindings
are to be used.</p>
<p diff="add" dg="b4395">
The host language, whether XML-based or otherwise, <rfc2119>may</rfc2119> specify whether
unqualified names are bound to the default namespace (if any)
or not; the host language may also place this under user control.
<!--* Like the QT specs *-->
If the host language does not specify otherwise,
unqualified names are bound to the default namespace.
</p>
<note diff="add" dg="b4395">
<p><!--*
* material suppressed here by diff group wgi-20080606 *
*--><phrase dg="wgi-20080606">The default</phrase> treatment of
unqualified names parallels that specified in
<bibref ref="XMLNS"/> for element names (as opposed to that specified
for attribute names).
</p>
</note>

<note dg="context">
<!--* context not approved, this is live text (2008-06) *-->
<p>
The mapping between <termref def="dt-literal">literals</termref> in the <termref def="dt-lexical-space"/> and
values in the <termref def="dt-value-space"/> of <term>QName</term> requires
a namespace declaration <!--*
* material suppressed here by diff group ep99 *
*--> to be in scope for the context 
in which <phrase dg="ep99"><term>QName</term></phrase><!--*
* material suppressed here by diff group ep99 *
*--> 
is used.
<!--*
* material suppressed here by diff group ep99 *
*--></p>
<p dg="wd-21">Because the lexical representations available for
any value of type <dtref ref="QName"/> vary with context, no 
<termref def="dt-canonical-representation"/> is defined for QName in this specification.</p>
</note>

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

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

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

<div4 id="QName-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>

<p>The use of <termref def="dt-length"/>, <termref def="dt-minLength"/> and
<termref def="dt-maxLength"/>
on <phrase dg="rq120"><dtref ref="QName"/> or</phrase>
datatypes derived from <dtref ref="QName"/> is
deprecated.  <phrase diff="add" dg="b3265">These
facets are meaningless for these datatypes, and all instances are 
facet-valid with respect to them.</phrase>
Future versions of this specification may
remove these facets for <phrase diff="del" dg="b3265">this</phrase><phrase diff="add" dg="b3265">these</phrase> 
datatype<phrase diff="add" dg="b3265">s</phrase>.</p>

</div4>
</div3>

<div3 id="NOTATION">
<head>NOTATION</head>
<p><termdef id="dt-NOTATION" term="NOTATION" role="local"><term>NOTATION</term>
represents the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" role="nt" href="http://www.w3.org/TR/xml11/#NT-NotationType">NOTATION</xnt>
attribute
type from <bibref ref="XML"/>.<phrase dg="context">
The <termref def="dt-value-space"/>
of <term>NOTATION</term> is the set of <dtref ref="QName"/>s
of notations declared in the current schema.
The <termref def="dt-lexical-space"/> of <term>NOTATION</term> is the set
of all names of <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#declare-notation">notations</xspecref>
declared in the current schema (in the form of
<dtref ref="QName"/>s).</phrase></termdef></p>

<note diff="add" dg="b3266">
<p>Because its <termref def="dt-value-space"/> depends on the notion of a 
<quote>current schema</quote>, as instantiated for example 
by <bibref ref="structural-schemas"/>, the <dtref ref="NOTATION"/> datatype is 
unsuitable for use in other contexts which lack the notion of a
current schema.
</p>
</note>

<p diff="add" dg="wgi-20080606">
The lexical mapping rules for <dtref ref="NOTATION"/> are as given for
<dtref ref="QName"/> in 
<specref ref="QName"/>.
</p>

<constraintnote type="cos" id="enumeration-required-notation">
<head>enumeration facet value required for NOTATION</head>
<p>
It is an <termref def="dt-error"/> for <term>NOTATION</term>
to be used directly in a schema.  Only datatypes that are
derived from <term>NOTATION</term> by
specifying a value for <termref def="dt-enumeration"/> can be used
in a schema.
</p>
</constraintnote>

<p><phrase dg="context">For compatibility (see <specref ref="terminology"/>)
<term>NOTATION</term></phrase><!--*
* material suppressed here by diff group context *
*-->
should be used only on attributes
and should only be used in schemas with no
target namespace.</p>

<p dg="context">
<note dg="wd-21">
<p>Because the lexical representations available for any given value
of <dtref ref="NOTATION"/> vary with context, this specification defines
no <termref def="dt-canonical-representation"/> for <dtref ref="NOTATION"/> values.</p>
</note>
</p>

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

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

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



<div4 id="NOTATION-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
<p>

The use of <termref def="dt-length"/>, <termref def="dt-minLength"/> and <termref def="dt-maxLength"/>
on <phrase dg="rq120"><dtref ref="NOTATION"/> or</phrase>
datatypes derived from <dtref ref="NOTATION"/> is
deprecated.  Future versions of this specification may
remove these facets for this datatype.

</p>
</div4>
</div3>
</div2>

<div2 role="1.0" id="ordinary-built-ins">
<!--* !!! n.b. newOrg gives this section the ID other-builtin-STDs.
    * I'm leaving the old ID for now. -msm 2005-01-09 *-->
<head><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Other Built-in Datatypes</phrase></head>
<p>
This section gives conceptual definitions for all
<termref def="dt-built-in"/> <!--*
* material suppressed here by diff group rq120 *
*--><!--*
* material suppressed here by diff group rq120c *
*--><termref dg="rq120o" def="dt-ordinary"/>
datatypes defined by this specification. The XML representation used to define
<!--*
* material suppressed here by diff group rq120 *
*--> 
<phrase diff="add" dg="ep26"><termref def="dt-ordinary"/></phrase>
datatypes (whether
<termref def="dt-built-in"/> or <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-user-defined"/>) is
given in <!--*
* material suppressed here by diff group rq120 *
*--><specref ref="xr-defn"/> 
and the complete
definitions of the <termref def="dt-built-in"/> <!--*
* material suppressed here by diff group rq120 *
*--><!--*
* material suppressed here by diff group rq120c *
*--><termref dg="rq120o" def="dt-ordinary"/>
datatypes are provided in <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">the appendix</phrase> <specref ref="schema"/>.
<!--* MSM reverts a change here.  I'd recast to avoid the point of
    * disagreement, but I don't see how.  But the specref without
    * introductory words 'the appendix' reads more awkwardly than
    * I'm willing to let stand.
    *-->
</p>

<div3 role="1.0" id="normalizedString">
<head>normalizedString</head>
<p>
<termdef id="dt-normalizedString" term="normalizedString" role="local">
<term>normalizedString</term>
represents white space normalized strings.
The <termref def="dt-value-space"/> of <term>normalizedString</term> is the
set of strings that do not
contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters.
The <termref def="dt-lexical-space"/> of <term>normalizedString</term> is the
set of strings that do not
contain the carriage return (#xD),
line feed (#xA)
nor tab (#x9) characters.
The <termref def="dt-basetype"/> of <term>normalizedString</term> is <baseref/>.
</termdef>
</p>

<div4 role="1.0" id="normalizedString-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="normalizedString-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>

<div3 role="1.0" id="token">
<head>token</head>
<p>
<termdef id="dt-token" term="token" role="local">
<term>token</term>
represents tokenized strings.
The <termref def="dt-value-space"/> of <term>token</term> is the
set of strings that do not
contain the
carriage return (#xD),
line feed (#xA) nor tab (#x9) characters, that have no
leading or trailing spaces (#x20) and that have no internal sequences
of two or more spaces.
The <termref def="dt-lexical-space"/> of <term>token</term> is the
set of strings that do not contain the
carriage return (#xD),
line feed (#xA) nor tab (#x9) characters, that have no
leading or trailing spaces (#x20) and that have no internal sequences
of two or more spaces.
The <termref def="dt-basetype"/> of <term>token</term> is <baseref/>.
</termdef>
</p>

<div4 role="1.0" id="token-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="token-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>

<div3 role="1.0" id="language">
<head>language</head>

<p><termdef id="dt-language" term="language" role="local">
<term>language</term>
represents <phrase dg="rq100">formal</phrase> 
natural language identifiers<phrase dg="rq100">,</phrase> 
as defined 
by <phrase diff="del" dg="b4850"><bibref ref="RFC3066"/><phrase dg="rq100">or its
successor(s) in the IETF Standards Track</phrase></phrase><phrase diff="add" dg="b4850"><bibref ref="BCP47"/> 
(currently represented by 
<bibref ref="RFC4646"/> and 
<bibref ref="RFC4647"/>)
or its successor(s)</phrase>.
</termdef>
<!--*
* material suppressed here by diff group rq100 *
*-->The 
<phrase dg="rq100"><termref def="dt-value-space"/>
and </phrase><termref def="dt-lexical-space"/> of
<term>language</term> 
<!--*
* material suppressed here by diff group rq100 *
*--><phrase dg="rq100">are</phrase> 
the set of all strings that conform to the pattern 
<display><code>[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*</code></display>
<phrase dg="rq100">
This is the set of strings accepted by the grammar given in
<bibref ref="RFC3066"/></phrase><phrase diff="add" dg="b4850">,
which is now obsolete; the current specification of language
codes is more restrictive</phrase>.
The <termref def="dt-basetype"/> of <term>language</term> is <baseref/>.
<!--* MSM moved end of termdef away from here because termdef cannot
contain a 'display' element.  That may have been The Wrong Thing;
if anyone thinks so, let us discuss it. *--></p>


<note dg="rq100">
<p>The regular expression above provides the only normative
  constraint on the lexical and value spaces of this type.  The
  additional constraints imposed on language identifiers by 
  <phrase diff="del" dg="b4850"><bibref ref="RFC3066"/></phrase><phrase diff="add" dg="b4850"><bibref ref="BCP47"/></phrase>
  and its successor(s), and in particular their requirement that language
  codes be registered with IANA or ISO if not given in ISO 639, are 
  not part of this datatype as defined here.</p>
</note>

<!--* (sniff)

<note diff="add" dg="rq100">
<p><bibref ref="RFC3066"/> imposes additional constraints on language codes
  which are not part of this datatype as defined here.  In particular,
  as defined here this datatype does not require that values not given 
  in ISO 639 be registered with the Internet Assigned Numbers Authority (IANA).
  Applications with that requirement should make appropriate arrangements
  at the application level.
</p>
</note>

*-->

<note dg="rq100">
<p><phrase diff="del" dg="b4850"><bibref ref="RFC3066"/></phrase><phrase diff="add" dg="b4850"><bibref ref="BCP47"/></phrase> specifies 
that language codes <quote>are to be treated as case insensitive; there
exist conventions for capitalization of some of 
<phrase diff="del" dg="b4850">them</phrase><phrase diff="add" dg="b4850">the
subtags</phrase>, but these <phrase diff="del" dg="b4850">should
not</phrase><phrase diff="add" dg="b4850">MUST NOT</phrase> be taken 
to carry meaning.<phrase diff="del" dg="b4850">  For instance, [ISO 3166] recommends
that country codes are capitalized (MN Mongolia), while [ISO 639]
recommends that language codes are written in lower case (mn
Mongolian).</phrase></quote>
Since the <dtref ref="language"/> datatype is
derived from <dtref ref="string"/>, it inherits from 
<dtref ref="string"/> a one-to-one mapping from lexical
representations to values. The literals <string>MN</string> and
<string>mn</string> <phrase diff="add" dg="b4850">(for 
Mongolian)</phrase>
therefore correspond to distinct values and
have distinct canonical forms.  Users of this specification should be
aware of this fact, the consequence of which is that the
case-insensitive treatment of language values prescribed by 
<phrase diff="del" dg="b4850"><bibref ref="RFC3066"/></phrase><phrase diff="add" dg="b4850"><bibref ref="BCP47"/></phrase> 
does not follow from the definition of
this datatype given here; applications which require
case-<phrase diff="add" dg="b4986">in</phrase>sensitivity 
should make appropriate adjustments.</p>
</note>

<note diff="add" dg="b2576" id="xml.lang.and.language">
<p>The empty string is not a member of the <termref def="dt-value-space"/>
of <dtref ref="language"/>.  Some constructs which normally
take language codes as their values, however, also allow the
empty string. The attribute <att>xml:lang</att> defined by 
<bibref ref="XML"/> is one example; there, the empty string
overrides a value which would otherwise be inherited, but
without specifying a new value.</p> 
<p>One way to define the desired set of possible values is
illustrated by the schema document for the XML namespace
at <loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/2001/xml.xsd">http://www.w3.org/2001/xml.xsd</loc>, which defines the
attribute <att>xml:lang</att> as having a type which is a union
of <dtref ref="language"/> and an anonymous type whose
only value is the empty string:<eg xml:space="preserve">
 &lt;xs:attribute name="lang"&gt;
   &lt;xs:annotation&gt;
     &lt;xs:documentation&gt;
       See RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt 
       and the IANA registry at 
       http://www.iana.org/assignments/lang-tag-apps.htm for
       further information.

       The union allows for the 'un-declaration' of xml:lang with
       the empty string.
     &lt;/xs:documentation&gt;
   &lt;/xs:annotation&gt;
   &lt;xs:simpleType&gt;
     &lt;xs:union memberTypes="xs:language"&gt;
       &lt;xs:simpleType&gt;    
         &lt;xs:restriction base="xs:string"&gt;
           &lt;xs:enumeration value=""/&gt;
         &lt;/xs:restriction&gt;
       &lt;/xs:simpleType&gt;
     &lt;/xs:union&gt;
   &lt;/xs:simpleType&gt;
 &lt;/xs:attribute&gt;
</eg></p>
</note>

<div4 role="1.0" id="language-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>


<div3 role="1.0" id="NMTOKEN">
<head>NMTOKEN</head>
<p>
<termdef id="dt-NMTOKEN" term="NMTOKEN" role="local">
<term>NMTOKEN</term> represents
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-TokenizedType">NMTOKEN attribute type</xnt>
from <bibref ref="XML"/>. The <termref def="dt-value-space"/> of
<term>NMTOKEN</term> is the set of tokens that <termref def="dt-match"/>
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Nmtoken">Nmtoken</xnt> production in
<bibref ref="XML"/>. The <termref def="dt-lexical-space"/> of
<term>NMTOKEN</term> is the set of strings that <termref def="dt-match"/>
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Nmtoken">Nmtoken</xnt> production in
<bibref ref="XML"/>.  The <termref def="dt-basetype"/> of
<term>NMTOKEN</term> is <baseref/>.
</termdef>
</p>

<p dg="b1838">It is <termref def="key-impl-def"/> whether an
implementation of this specification supports the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Nmtoken">NMTOKEN</xnt> production from 
<bibref ref="XML"/>, or that from 
<bibref ref="XML1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p>
<p>
For compatibility (see <specref ref="terminology"/>) <term>NMTOKEN</term>
should be used only on attributes.
</p>

<div4 role="1.0" id="NMTOKEN-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="NMTOKEN-derived-types">
<head><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Related</phrase> datatypes</head>
<subtypes/>
</div4>
</div3>

<div3 role="1.0" id="NMTOKENS">
<head>NMTOKENS</head>
<p>
<termdef id="dt-NMTOKENS" term="NMTOKENS" role="local">
<term>NMTOKENS</term>
represents the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-TokenizedType">NMTOKENS attribute
type</xnt> from <bibref ref="XML"/>. The <termref def="dt-value-space"/>
of <term>NMTOKENS</term> is the set of finite, non-zero-length sequences of
<termref def="dt-NMTOKEN"/>s.  The <termref def="dt-lexical-space"/>
of <term>NMTOKENS</term> is the set of space-separated lists of tokens,
of which each token is in the <termref def="dt-lexical-space"/> of
<dtref ref="NMTOKEN"/>.  The <termref def="dt-itemType"/> of
<term>NMTOKENS</term> is <itemTyperef/>.
</termdef>
</p>
<p>
For compatibility (see <specref ref="terminology"/>)
<term>NMTOKENS</term> should be used only on attributes.
</p>

<div4 role="1.0" id="NMTOKENS-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 role="1.0" id="Name">
<head>Name</head>
<p>
<termdef id="dt-Name" term="Name" role="local">
<term>Name</term>
represents <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-name">XML Names</xspecref>.
The <termref def="dt-value-space"/> of <term>Name</term> is
the set of all strings which <termref def="dt-match"/> the
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Name">Name</xnt> production of
<bibref ref="XML"/>.  The <termref def="dt-lexical-space"/> of
<term>Name</term> is the set of all strings which <termref def="dt-match"/>
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Name">Name</xnt> production of
<bibref ref="XML"/>. The <termref def="dt-basetype"/> of <term>Name</term>
is <baseref/>.
</termdef>
</p>
<p dg="b1838">It is <termref def="key-impl-def"/> whether an
implementation of this specification supports the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-Name">Name</xnt> production from 
<bibref ref="XML"/>, or that from 
<bibref ref="XML1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p>

<div4 role="1.0" id="Name-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="Name-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>

<div3 role="1.0" id="NCName">
<head>NCName</head>
<p>
<termdef id="dt-NCName" term="NCName" role="local">
<term>NCName</term> represents XML
"non-colonized" Names.  The <termref def="dt-value-space"/> of
<term>NCName</term> is the set of all strings which <termref def="dt-match"/>
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production of
<bibref ref="XMLNS"/>.  The <termref def="dt-lexical-space"/> of
<term>NCName</term> is the set of all strings which <termref def="dt-match"/>
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production of
<bibref ref="XMLNS"/>.  The <termref def="dt-basetype"/> of
<term>NCName</term> is <baseref/>.
</termdef>
</p>

<p dg="b1838">It is <termref def="key-impl-def"/> whether an
implementation of this specification supports the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production from 
<bibref ref="XMLNS"/>, or that from 
<bibref ref="XMLNS1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p>

<div4 role="1.0" id="NCName-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="NCName-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>

<div3 role="1.0" id="ID">
<head>ID</head>
<p>
<termdef id="dt-ID" term="ID" role="local">
<term>ID</term> represents the
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-TokenizedType">ID attribute type</xnt> from
<bibref ref="XML"/>.  The <termref def="dt-value-space"/> of
<term>ID</term> is the set of all strings that <termref def="dt-match"/>
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production in
<bibref ref="XMLNS"/>.  The
<termref def="dt-lexical-space"/> of <term>ID</term> is the set of all
strings that <termref def="dt-match"/> the
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production in
<bibref ref="XMLNS"/>.
The <termref def="dt-basetype"/> of <term>ID</term> is <baseref/>.
</termdef>
</p>
<note dg="b1838">
<p>It is <termref def="key-impl-def"/> whether an
implementation of this specification supports 
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production from 
<bibref ref="XMLNS"/>, or that from 
<bibref ref="XMLNS1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p>
</note>
<p>
For compatibility (see <specref ref="terminology"/>)
<term>ID</term> should be used only on attributes.
</p>
<note dg="rec12-main">
<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<p>Uniqueness of items validated as <dtref ref="ID"/> is not
part of this datatype as defined here.  
When this specification is used in conjunction with
<bibref ref="structural-schemas"/>, uniqueness is enforced at a
different level, not as part of datatype validity;
see <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#cvc-id">Validation Rule: Validation Root Valid (ID/IDREF)</xspecref> 
in <bibref ref="structural-schemas"/>.</p>
</note>

<div4 role="1.0" id="ID-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 role="1.0" id="IDREF">
<head>IDREF</head>
<p>
<termdef id="dt-IDREF" term="IDREF" role="local">
<term>IDREF</term> represents the
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-TokenizedType">IDREF attribute type</xnt> from
<bibref ref="XML"/>.  The <termref def="dt-value-space"/> of
<term>IDREF</term> is the set of all strings that <termref def="dt-match"/>
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production in
<bibref ref="XMLNS"/>.  The
<termref def="dt-lexical-space"/> of <term>IDREF</term> is the set of
strings that <termref def="dt-match"/> the
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production in
<bibref ref="XMLNS"/>.
The <termref def="dt-basetype"/> of <term>IDREF</term> is <baseref/>.
</termdef>
</p>

<note><p dg="b1838">It is <termref def="key-impl-def"/> whether an
implementation of this specification supports 
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production from 
<bibref ref="XMLNS"/>, or that from 
<bibref ref="XMLNS1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p></note>

<p>
For compatibility (see <specref ref="terminology"/>) this datatype
should be used only on attributes.
</p>
<note dg="rec12-main">
<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<p>Existence of referents for items validated as 
<dtref ref="IDREF"/> is not part of this
datatype as defined here.
When this specification is used in conjunction with
<bibref ref="structural-schemas"/>, referential integrity is enforced at a
different level, not as part of datatype validity;
see <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#cvc-id">Validation Rule: Validation
Root Valid (ID/IDREF)</xspecref> in <bibref ref="structural-schemas"/>.</p>
 </note>

<div4 role="1.0" id="IDREF-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="IDREF-derived-types">
<head><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Related</phrase> datatypes</head>
<subtypes/>
</div4>
</div3>

<div3 role="1.0" id="IDREFS">
<head>IDREFS</head>
<p>
<termdef id="dt-IDREFS" term="IDREFS" role="local">
<term>IDREFS</term> represents the
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-TokenizedType">IDREFS attribute type</xnt> from
<bibref ref="XML"/>.  The <termref def="dt-value-space"/> of
<term>IDREFS</term> is the set of finite, non-zero-length sequences of
<dtref ref="IDREF"/>s.
The <termref def="dt-lexical-space"/> of <term>IDREFS</term> is the
set of space-separated lists of tokens, of which each token is in the
<termref def="dt-lexical-space"/> of <dtref ref="IDREF"/>.
The <termref def="dt-itemType"/> of <term>IDREFS</term> is
<itemTyperef/>.
</termdef>
</p>
<p>
For compatibility (see <specref ref="terminology"/>) <term>IDREFS</term>
should be used only on attributes.
</p>
<note dg="rec12-main">
<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<p>Existence of referents for items validated as 
<dtref ref="IDREFS"/> is not
part of this datatype as defined here.  
When this specification is used in conjunction with
<bibref ref="structural-schemas"/>, referential integrity is enforced at a
different level, not as part of datatype validity;
see <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#cvc-id">Validation Rule: 
Validation Root Valid (ID/IDREF)</xspecref> in <bibref ref="structural-schemas"/>.</p>
 </note>

<div4 role="1.0" id="IDREFS-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 role="1.0" id="ENTITY">
<head>ENTITY</head>
<p>
<termdef id="dt-ENTITY" term="ENTITY" role="local">
<term>ENTITY</term> represents the
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-TokenizedType">ENTITY</xnt> attribute type from
<bibref ref="XML"/>.  The <termref def="dt-value-space"/> of
<term>ENTITY</term> is the set of all strings that <termref def="dt-match"/>
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production in
<bibref ref="XMLNS"/> and have been declared as an
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-unparsed">unparsed entity</xspecref> in
a <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-doctype">document type definition</xspecref>.
The <termref def="dt-lexical-space"/> of <term>ENTITY</term> is the set
of all strings that <termref def="dt-match"/> the
<xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production in
<bibref ref="XMLNS"/>.
The <termref def="dt-basetype"/> of <term>ENTITY</term> is <baseref/>.
</termdef>
</p>

<note><p dg="b1838">It is <termref def="key-impl-def"/> whether an
implementation of this specification supports 
the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml-names11/#NT-NCName">NCName</xnt> production from 
<bibref ref="XMLNS"/>, or that from 
<bibref ref="XMLNS1.0"/>, or both.  See 
<specref ref="intro-relatedWork"/>.
</p></note>

<note>
<p>
The <termref def="dt-value-space"/> of <term>ENTITY</term> is scoped
to a specific instance document.
</p>
</note>
<p>
For compatibility (see <specref ref="terminology"/>) <term>ENTITY</term>
should be used only on attributes.
</p>

<div4 role="1.0" id="ENTITY-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="ENTITY-derived-types">
<head><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">Related</phrase> datatypes</head>
<subtypes/>
</div4>
</div3>

<div3 role="1.0" id="ENTITIES">
<head>ENTITIES</head>
<p>
<termdef id="dt-ENTITIES" term="ENTITIES" role="local">
<term>ENTITIES</term>
represents the <xnt xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#NT-TokenizedType">ENTITIES attribute
type</xnt> from <bibref ref="XML"/>. The <termref def="dt-value-space"/>
of <term>ENTITIES</term> is the set of finite, non-zero-length sequences of
<termref def="dt-ENTITY"/>s that have been declared as
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-unparsed">unparsed entities</xspecref>
in a <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-doctype">document type definition</xspecref>.
The <termref def="dt-lexical-space"/> of <term>ENTITIES</term> is the
set of space-separated lists of tokens, of which each token is in the
<termref def="dt-lexical-space"/> of <dtref ref="ENTITY"/>.
The <termref def="dt-itemType"/> of <term>ENTITIES</term> is
<itemTyperef/>.
</termdef>
</p>
<note>
<p>
The <termref def="dt-value-space"/> of <term>ENTITIES</term> is scoped
to a specific instance document.
</p>
</note>
<p>
For compatibility (see <specref ref="terminology"/>) <term>ENTITIES</term>
should be used only on attributes.
</p>

<div4 role="1.0" id="ENTITIES-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 role="1.0" id="integer">
<head>integer</head>
<p>
<termdef id="dt-integer" term="integer" role="local">
<term>integer</term> is
derived from <dtref ref="decimal"/> by fixing the
value of <termref def="dt-fractionDigits"/> to be 0 and
disallowing the trailing decimal point.
This results in the standard
mathematical concept of the integer numbers. The
<termref def="dt-value-space"/> of <term>integer</term> is the infinite
set {...,-2,-1,0,1,2,...}.  The <termref def="dt-basetype"/> of
<term>integer</term> is <baseref/>.
</termdef>
</p>

<div4 role="1.0" id="integer-lexical-representation">
<head>Lexical representation</head>
<p>
<term>integer</term> has a lexical representation consisting of a finite-length sequence
of <phrase diff="add" dg="b5625">one or more</phrase> 
decimal digits (#x30-#x39) with an optional leading sign.  If the sign is omitted,
"+" is assumed.  For example: -1, 0, 12678967543233, +100000.
</p>
</div4>

<div4 role="1.0" id="integer-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>integer</term> is defined
by prohibiting certain options from the
<specref ref="integer-lexical-representation"/>.  Specifically, the preceding optional "+" sign is prohibited and leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="integer-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*--><phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="integer-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>
<div3 role="1.0" id="nonPositiveInteger">
<head>nonPositiveInteger</head>
<p>
<termdef id="dt-nonPositiveInteger" term="nonPositiveInteger" role="local">
<term>nonPositiveInteger</term> is derived from
<dtref ref="integer"/> by setting the value of
<termref def="dt-maxInclusive"/> to be 0.  This results in the
standard mathematical concept of the non-positive integers.
The <termref def="dt-value-space"/> of <term>nonPositiveInteger</term>
is the infinite set {...,-2,-1,0}.  The <termref def="dt-basetype"/>
of <term>nonPositiveInteger</term> is <baseref/>.
</termdef>
</p>

<div4 role="1.0" id="nonPositiveInteger-lexical-representation">
<head>Lexical representation</head>
<p>
<term>nonPositiveInteger</term> has a lexical representation consisting of
an optional preceding sign
followed by a <phrase diff="add" dg="b5625">non-empty</phrase>
finite-length sequence of decimal digits (#x30-#x39).
The sign may be "+" or may be omitted only for
lexical forms denoting zero; in all other lexical forms, the negative
sign (<string>-</string>) must be present.
For example: -1, 0, -12678967543233, -100000.
</p>
</div4>

<div4 role="1.0" id="nonPositiveInteger-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>nonPositiveInteger</term> is defined
by prohibiting certain options from the
<specref ref="nonPositiveInteger-lexical-representation"/>.

In the canonical form for zero, the sign must be
omitted.  Leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="nonPositiveInteger-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="nonPositiveInteger-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>
<div3 role="1.0" id="negativeInteger">
<head>negativeInteger</head>
<p>
<termdef id="dt-negativeInteger" term="negativeInteger" role="local">
<term>negativeInteger</term> is derived from
<dtref ref="nonPositiveInteger"/> by setting the value of
<termref def="dt-maxInclusive"/> to be -1.  This results in the
standard mathematical concept of the negative integers.  The
<termref def="dt-value-space"/> of <term>negativeInteger</term>
is the infinite set {...,-2,-1}.  The <termref def="dt-basetype"/>
of <term>negativeInteger</term>  is <baseref/>.
</termdef>
</p>

<div4 role="1.0" id="negativeInteger-lexical-representation">
<head>Lexical representation</head>
<p>
<term>negativeInteger</term> has a lexical representation consisting
of a negative sign (<string>-</string>) followed by a <phrase diff="add" dg="b5625">non-empty</phrase> finite-length sequence of
decimal digits (#x30-#x39).  For example: -1, -12678967543233,
-100000.
</p>
</div4>

<div4 role="1.0" id="negativeInteger-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>negativeInteger</term> is defined
by prohibiting certain options from the
<specref ref="negativeInteger-lexical-representation"/>.  Specifically,  leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="negativeInteger-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>
<div3 role="1.0" id="long">
<head>long</head>
<p>
<termdef id="dt-long" term="long" role="local">
<term>long</term> is
derived from <dtref ref="integer"/> by setting the
value of <termref def="dt-maxInclusive"/> to be 9223372036854775807
and <termref def="dt-minInclusive"/> to be -9223372036854775808.
The <termref def="dt-basetype"/> of <term>long</term> is
<baseref/>.
</termdef>
</p>

<div4 role="1.0" id="long-lexical-representation">
<head>Lexical representation</head>
<p>
<term>long</term> has a lexical representation consisting
of an optional sign followed by a <phrase diff="add" dg="b5625">non-empty</phrase> finite-length
sequence of decimal digits (#x30-#x39).  If the sign is omitted, "+" is assumed.
For example: -1, 0,
12678967543233, +100000.
</p>
</div4>

<div4 role="1.0" id="long-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>long</term> is defined
by prohibiting certain options from the
<specref ref="long-lexical-representation"/>.  Specifically, the
the optional "+" sign is prohibited and leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="long-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="long-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>
<div3 role="1.0" id="int">
<head>int</head>
<p>
<termdef id="dt-int" term="int" role="local">
<term>int</term>
is derived from <dtref ref="long"/> by setting the
value of <termref def="dt-maxInclusive"/> to be 2147483647 and
<termref def="dt-minInclusive"/> to be -2147483648.  The
<termref def="dt-basetype"/> of <term>int</term> is <baseref/>.
</termdef>
</p>

<div4 role="1.0" id="int-lexical-representation">
<head>Lexical representation</head>
<p>
<term>int</term> has a lexical representation consisting
of an optional sign followed by a <phrase diff="add" dg="b5625">non-empty</phrase> finite-length
sequence of decimal digits (#x30-#x39).  If the sign is omitted, "+" is assumed.
For example: -1, 0,
126789675, +100000.
</p>
</div4>

<div4 role="1.0" id="int-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>int</term> is defined
by prohibiting certain options from the
<specref ref="int-lexical-representation"/>.  Specifically, the
the optional "+" sign is prohibited and leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="int-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="int-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>
<div3 role="1.0" id="short">
<head>short</head>
<p>
<termdef id="dt-short" term="short" role="local">
<term>short</term> is
derived from <dtref ref="int"/> by setting the
value of <termref def="dt-maxInclusive"/> to be 32767 and
<termref def="dt-minInclusive"/> to be -32768.  The
<termref def="dt-basetype"/> of <term>short</term> is
<baseref/>.
</termdef>
</p>

<div4 role="1.0" id="short-lexical-representation">
<head>Lexical representation</head>
<p>
<term>short</term> has a lexical representation consisting
of an optional sign followed by a <phrase diff="add" dg="b5625">non-empty</phrase> finite-length sequence of decimal
digits (#x30-#x39).  If the sign is omitted, "+" is assumed.
For example: -1, 0, 12678, +10000.
</p>
</div4>

<div4 role="1.0" id="short-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>short</term> is defined
by prohibiting certain options from the
<specref ref="short-lexical-representation"/>.  Specifically, the
the optional "+" sign is prohibited and leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="short-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="short-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>
<div3 role="1.0" id="byte">
<head>byte</head>
<p>
<termdef id="dt-byte" term="byte" role="local">
<term>byte</term>
is derived from <dtref ref="short"/>
by setting the value of <termref def="dt-maxInclusive"/> to be 127
and <termref def="dt-minInclusive"/> to be -128.
The <termref def="dt-basetype"/> of <term>byte</term> is
<baseref/>.
</termdef>
</p>

<div4 role="1.0" id="byte-lexical-representation">
<head>Lexical representation</head>
<p>
<term>byte</term> has a lexical representation consisting
of an optional sign followed by a <phrase diff="add" dg="b5625">non-empty</phrase> finite-length
sequence of decimal digits (#x30-#x39).  If the sign is omitted, "+" is assumed.
For example: -1, 0,
126, +100.
</p>
</div4>

<div4 role="1.0" id="byte-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>byte</term> is defined
by prohibiting certain options from the
<specref ref="byte-lexical-representation"/>.  Specifically, the
the optional "+" sign is prohibited and leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="byte-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>
<div3 role="1.0" id="nonNegativeInteger">
<head>nonNegativeInteger</head>
<p>
<termdef id="dt-nonNegativeInteger" term="nonNegativeInteger" role="local">
<term>nonNegativeInteger</term> is derived from
<dtref ref="integer"/> by setting the value of
<termref def="dt-minInclusive"/> to be 0.  This results in the
standard mathematical concept of the non-negative integers. The
<termref def="dt-value-space"/> of <term>nonNegativeInteger</term>
is the infinite set {0,1,2,...}.  The <termref def="dt-basetype"/> of
<term>nonNegativeInteger</term> is <baseref/>.
</termdef>
</p>

<div4 role="1.0" id="nonNegativeInteger-lexical-representation">
<head>Lexical representation</head>
<p>
<term>nonNegativeInteger</term> has a lexical representation consisting of
an optional sign followed by a <phrase diff="add" dg="b5625">non-empty</phrase> finite-length
sequence of decimal digits (#x30-#x39).  If the sign is omitted,
the positive sign (<string>+</string>) is assumed.
If the sign is present, it must be "+" except for lexical forms
denoting zero, which may be preceded by a positive (<string>+</string>) or a negative (<string>-</string>) sign.
For example:
1, 0, 12678967543233, +100000.
</p>
</div4>

<div4 role="1.0" id="nonNegativeInteger-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>nonNegativeInteger</term> is defined
by prohibiting certain options from the
<specref ref="nonNegativeInteger-lexical-representation"/>.  Specifically, the
the optional "+" sign is prohibited and leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="nonNegativeInteger-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="nonNegativeInteger-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>
<div3 role="1.0" id="unsignedLong">
<head>unsignedLong</head>
<p>
<termdef id="dt-unsignedLong" term="unsignedLong" role="local">
<term>unsignedLong</term> is derived from
<dtref ref="nonNegativeInteger"/> by setting the value of
<termref def="dt-maxInclusive"/> to be 18446744073709551615.
The <termref def="dt-basetype"/> of <term>unsignedLong</term> is
<baseref/>.
</termdef>
</p>

<div4 role="1.0" id="unsignedLong-lexical-representation">
<head>Lexical representation</head>
<p>
<term>unsignedLong</term> has a lexical representation consisting of
<phrase dg="b1834">an optional sign followed by</phrase> a
<phrase diff="add" dg="b5625">non-empty</phrase>
finite-length sequence of decimal digits (#x30-#x39). <phrase dg="b1834">If the sign is omitted, the positive sign
(<string>+</string>) is assumed. If the sign is present, it must be
<string>+</string> except for lexical forms denoting zero, which may
be preceded by a positive (<string>+</string>) or a negative
(<string>-</string>) sign.</phrase> For example: 0, 12678967543233,
100000.
</p>

</div4>

<div4 role="1.0" id="unsignedLong-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>unsignedLong</term> is defined
by prohibiting certain options from the
<specref ref="unsignedLong-lexical-representation"/>.  Specifically,
leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="unsignedLong-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="unsignedLong-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>
<div3 role="1.0" id="unsignedInt">
<head>unsignedInt</head>
<p>
<termdef id="dt-unsignedInt" term="unsignedInt" role="local">
<term>unsignedInt</term> is derived from
<dtref ref="unsignedLong"/> by setting the value of
<termref def="dt-maxInclusive"/> to be 4294967295.  The
<termref def="dt-basetype"/> of <term>unsignedInt</term> is
<baseref/>.
</termdef>
</p>

<div4 role="1.0" id="unsignedInt-lexical-representation">
<head>Lexical representation</head>
<p>
<term>unsignedInt</term> has a lexical representation consisting
of <phrase dg="b1834">an optional sign followed by</phrase> a
<phrase diff="add" dg="b5625">non-empty</phrase>
finite-length sequence of decimal digits (#x30-#x39). <phrase dg="b1834">If the sign is omitted, the positive sign
(<string>+</string>) is assumed. If the sign is present, it must be
<string>+</string> except for lexical forms denoting zero, which may
be preceded by a positive (<string>+</string>) or a negative
(<string>-</string>) sign.</phrase>  For example: 0,
1267896754, 100000.
</p>
</div4>

<div4 role="1.0" id="unsignedInt-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>unsignedInt</term> is defined
by prohibiting certain options from the
<specref ref="unsignedInt-lexical-representation"/>.  Specifically,
leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="unsignedInt-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="unsignedInt-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>
<div3 role="1.0" id="unsignedShort">
<head>unsignedShort</head>
<p>
<termdef id="dt-unsignedShort" term="unsignedShort" role="local">
<term>unsignedShort</term> is derived from
<dtref ref="unsignedInt"/> by setting the value of
<termref def="dt-maxInclusive"/> to be 65535.  The
<termref def="dt-basetype"/> of <term>unsignedShort</term> is
<baseref/>.
</termdef>
</p>

<div4 role="1.0" id="unsignedShort-lexical-representation">
<head>Lexical representation</head>
<p>
<term>unsignedShort</term>  has a lexical representation consisting of
<phrase dg="b1834">an optional sign followed by</phrase> a
<phrase diff="add" dg="b5625">non-empty</phrase> finite-length
sequence of decimal digits (#x30-#x39). <phrase dg="b1834">If the sign is omitted, the positive sign
(<string>+</string>) is assumed. If the sign is present, it must be
<string>+</string> except for lexical forms denoting zero, which may
be preceded by a positive (<string>+</string>) or a negative
(<string>-</string>) sign.</phrase> For example: 0, 12678, 10000.
</p>
</div4>

<div4 role="1.0" id="unsignedShort-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>unsignedShort</term> is defined
by prohibiting certain options from the
<specref ref="unsignedShort-lexical-representation"/>.  Specifically, the
leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="unsignedShort-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="unsignedShort-derived-types">
<head>Derived datatypes</head>
<subtypes/>
</div4>
</div3>
<div3 role="1.0" id="unsignedByte">
<head>unsignedByte</head>
<p>
<termdef id="dt-unsignedByte" term="unsignedByte" role="local">
<term>unsignedByte</term> is derived from
<dtref ref="unsignedShort"/> by setting the value of
<termref def="dt-maxInclusive"/> to be 255. The
<termref def="dt-basetype"/> of <term>unsignedByte</term> is
<baseref/>.
</termdef>
</p>

<div4 role="1.0" id="unsignedByte-lexical-representation">
<head>Lexical representation</head>
<p>
<term>unsignedByte</term>  has a lexical representation consisting of
<phrase dg="b1834">an optional sign followed by</phrase> a
<phrase diff="add" dg="b5625">non-empty</phrase> finite-length
sequence of decimal digits (#x30-#x39). <phrase dg="b1834">If the sign is omitted, the positive sign
(<string>+</string>) is assumed. If the sign is present, it must be
<string>+</string> except for lexical forms denoting zero, which may
be preceded by a positive (<string>+</string>) or a negative
(<string>-</string>) sign.</phrase> For example: 0, 126, 100.
</p>
</div4>

<div4 role="1.0" id="unsignedByte-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>unsignedByte</term> is defined
by prohibiting certain options from the
<specref ref="unsignedByte-lexical-representation"/>.  Specifically,
leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="unisngedByte-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>
<div3 role="1.0" id="positiveInteger">
<head>positiveInteger</head>
<p>
<termdef id="dt-positiveInteger" term="positiveInteger" role="local">
<term>positiveInteger</term> is derived from
<dtref ref="nonNegativeInteger"/> by setting the value of
<termref def="dt-minInclusive"/> to be 1. This results in the standard
mathematical concept of the positive integer numbers.
The <termref def="dt-value-space"/> of <term>positiveInteger</term>
is the infinite set {1,2,...}.  The <termref def="dt-basetype"/> of
<term>positiveInteger</term> is <baseref/>.
</termdef>
</p>

<div4 role="1.0" id="positiveInteger-lexical-representation">
<head>Lexical representation</head>
<p>
<term>positiveInteger</term> has a lexical representation consisting
of an optional positive sign (<string>+</string>) followed by a 
<phrase diff="add" dg="b5625">non-empty</phrase> finite-length
sequence of decimal digits (#x30-#x39).
For example: 1, 12678967543233, +100000.
</p>
</div4>

<div4 role="1.0" id="positiveInteger-canonical-repr">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>positiveInteger</term> is defined
by prohibiting certain options from the
<specref ref="positiveInteger-lexical-representation"/>.  Specifically, the
optional "+" sign is prohibited and leading zeroes are prohibited.
</p>
</div4>

<div4 role="1.0" id="positiveInteger-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

 <!-- ****************************** BEGIN NEW 1.1 MATERIAL (duration derivatives) ********************************* -->
 

<div3 id="yearMonthDuration" dg="fpwd">
<head>yearMonthDuration</head>

<p>
<termdef id="dt-yearMonthDuration" term="yearMonthDuration" role="local">
<term>yearMonthDuration</term> is a datatype derived from
<dtref ref="duration"/> by restricting its <termref def="dt-lexical-representation">lexical representations</termref> to instances of
<nt def="nt-yearMonthDurationRep"/>.</termdef>  The <termref def="dt-value-space"/> of
<term>yearMonthDuration</term>
is therefore that of <dtref ref="duration"/> restricted to those whose <vpropref ref="vp-du-second"/>
property is 0.  This results in a duration datatype which is totally ordered.</p>

<note><p>The always-zero <vpropref ref="vp-du-second"/> is formally retained in order that
<dtref ref="yearMonthDuration"/>'s (abstract) value space truly be a subset of that of
<dtref ref="duration"/>  An obvious implementation optimization is to ignore the zero and implement
<dtref ref="yearMonthDuration"/> values simply as <dtref ref="integer"/> values.</p></note>

<div4 id="yearMonthDuration-lexical-mapping">
<head>The <dtref ref="yearMonthDuration"/> Lexical Mapping</head>

<p>
The lexical space is reduced from that of <dtref ref="duration"/> by
disallowing <nt def="nt-duDaFrag"/> and <nt def="nt-duTFrag"/>
fragments in the <termref def="dt-lexical-representation">lexical representations</termref>. 
<!--*
* material suppressed here by diff group du1 *
*-->

<defset><head>The <dtref ref="yearMonthDuration"/> Lexical
Representation</head>
<prodgroup>
<prod id="nt-yearMonthDurationRep"><lhs>yearMonthDurationLexicalRep</lhs>
<rhs><string>-</string>? <string>P</string> <nt def="nt-duYMFrag"/></rhs></prod>
</prodgroup></defset></p>

<p><!--*
* material suppressed here by diff group rq20 *
*--><phrase dg="rq20">The lexical 
space of <dtref ref="yearMonthDuration"/> consists of
strings which match the regular expression
<string>-?P((([0-9]+Y)([0-9]+M)?)|([0-9]+M))</string> or the
expression <string>-?P[0-9]+(Y([0-9]+M)?|M)</string>, but the
formal definition of <dtref ref="yearMonthDuration"/> uses a
simpler regular expression in its <phrase dg="ed-pattern"><termref def="dt-pattern"/></phrase><!--*
* material suppressed here by diff group ed-pattern *
*-->
facet: <string>[^DT]*</string>.  This pattern matches only 
strings of characters which contain no <mention>D</mention>
and no <mention>T</mention>, thus restricting the <termref def="dt-lexical-space"/>
of <dtref ref="duration"/> to strings with no day, hour,
minute, or seconds fields.</phrase>

<!--*
* material suppressed here by diff group du1 *
*-->
</p>

<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<!--*
* material suppressed here by diff group du2 *
*-->

<p>The <termref def="dt-canonical-mapping"/> is that of <dtref ref="duration"/> restricted in its 
range to the <termref def="dt-lexical-space"/> (which reduces its domain to omit any 
values not in the <dtref ref="yearMonthDuration"/> value space).

<!--*
* material suppressed here by diff group du1 *
*-->
</p>

<note>
<p>The <dtref ref="yearMonthDuration"/> value whose <vpropref ref="vp-du-month"/> and
  <vpropref ref="vp-du-second"/>
are both zero has no <termref def="dt-canonical-representation"/> in this datatype since its
<termref def="dt-canonical-representation"/> in <dtref ref="duration"/> (<string>PT0S</string>)
 is not in the 
<termref def="dt-lexical-space"/> of <dtref ref="yearMonthDuration"/>.</p>
</note>

</div4>

<div4 id="YearMonthDuration-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>

<facets/>

<note diff="add" dg="b3078">
<p>The <compref ref="ff-o"/> facet has the value
<pt>partial</pt> even though the datatype is
in fact totally ordered, because (as explained in
<specref ref="rf-ordered"/><!--* 4.2.1 ordered *-->),
the value of that facet is unchanged by derivation.
</p>
</note>
</div4>
</div3>

<div3 id="dayTimeDuration" dg="fpwd">
<head>dayTimeDuration</head>
<p>
<termdef id="dt-dayTimeDuration" term="dayTimeDuration" role="local">
<term>dayTimeDuration</term> is a datatype derived from
<dtref ref="duration"/> by restricting its <termref def="dt-lexical-representation">lexical representations</termref> to instances of
<nt def="nt-dayTimeDurationRep"/>.</termdef>  The <termref def="dt-value-space"/> of 
<term>dayTimeDuration</term>
is therefore that of <dtref ref="duration"/> restricted to those whose <vpropref ref="vp-du-month"/>
property is 0.  This results in a duration datatype which is totally ordered.</p>

<div4 id="dayTimeDuration-lexical-mapping">
<head>The <dtref ref="dayTimeDuration"/> Lexical Space</head>
<p>
The lexical space is reduced from that of <dtref ref="duration"/> by
disallowing <nt def="nt-duYrFrag"/> and <nt def="nt-duMoFrag"/>
fragments in the <termref def="dt-lexical-representation">lexical representations</termref>. 
<!--*
* material suppressed here by diff group du1 *
*-->
</p>

<p><defset><head>The <dtref ref="dayTimeDuration"/> Lexical Representation</head>
<prodgroup>
<prod id="nt-dayTimeDurationRep"><lhs>dayTimeDurationLexicalRep</lhs>
<rhs><string>-</string>? <string>P</string> <nt def="nt-duDTFrag"/></rhs></prod>
</prodgroup></defset></p>

<p><!--*
* material suppressed here by diff group rq20 *
*--><phrase dg="rq20">The lexical space of 
<dtref ref="dayTimeDuration"/> consists of
strings in the <termref def="dt-lexical-space"/> of <dtref ref="duration"/> which 
<!--* match the regular expression <string>[^YM]*(T.*)?</string>; *-->
match the regular expression <string>[^YM]*[DT].*</string>;
this pattern eliminates all durations with year or month fields,
leaving only those with day, hour, minutes, and/or seconds
fields.</phrase>

<!--*
* material suppressed here by diff group du1 *
*-->
</p>

<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<!--*
* material suppressed here by diff group du2 *
*-->

<p>
The <termref def="dt-canonical-mapping"/> is that of <dtref ref="duration"/> restricted 
<phrase dg="du2">in its 
range to the <termref def="dt-lexical-space"/> (which reduces its domain to omit any 
values not in</phrase><!--*
* material suppressed here by diff group du2 *
*--> 
the <phrase diff="del" dg="b3028"><dtref ref="yearMonthDuration"/></phrase><phrase diff="add" dg="b3028"><dtref ref="dayTimeDuration"/></phrase> value 
space<phrase dg="du2">)</phrase>.

<!--*
* material suppressed here by diff group du1 *
*--></p>
</div4>

<div4 id="dayTimeDuration-facets">
<head><!--*
* material suppressed here by diff group rec12-tableaux *
*-->
<phrase dg="rec12-tableaux">Facets</phrase></head>

<facets/>

<note diff="add" dg="b3078">
<p>The <compref ref="ff-o"/> facet has the value
<pt>partial</pt> even though the datatype is
in fact totally ordered, because (as explained in
<specref ref="rf-ordered"/><!--* 4.2.1 ordered *-->),
the value of that facet is unchanged by derivation.
</p>
</note>
</div4>
</div3>

 <!-- ****************************** END NEW 1.1 MATERIAL (duration derivatives) ********************************* -->
 
</div2>
</div1>

<div1 role="1.0" id="datatype-components">
<!--* !!! n.B. newOrg assigns this the id components-datatypes.
    * For now I've left the ID unchanged.
    *-->

<head>Datatype components</head>
<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<p dg="rec12-main">The preceding sections of this
specification have described datatypes in a way largely 
independent of their use in the particular context of 
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-va">schema-aware processing</xtermref> as 
defined in <bibref ref="structural-schemas"/>.</p>

<p dg="rec12-main">
This section presents the mechanisms necessary to integrate datatypes into 
the context of <bibref ref="structural-schemas"/>, mostly in terms of
the <phrase diff="del" dg="wgi-20080613"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-component">Schema Component</xtermref></phrase><phrase diff="add" dg="wgi-20080613"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#c">schema
component</xtermref></phrase>
abstraction introduced there.  The account of datatypes given in this
specification is also intended to be useful in other contexts.
Any specification or other formal system intending to use datatypes as
defined above, particularly if definition of new datatypes via
facet-based restriction is envisaged, will need to provide analogous
mechanisms for some, but not necessarily all, of what follows below.
For example, the <propref comp="std" prop="target namespace"/> and
<propref comp="std" prop="final"/> properties are required because of
particular aspects of <bibref ref="structural-schemas"/> which are not
in principle necessary for the use of datatypes as defined here.</p>

<p>The following sections provide full details on the properties and
significance of each kind of schema component involved in datatype
definitions. For each property, the kinds of values it is allowed to have is
specified.  Any property not identified as optional is required to
be present; optional properties which are not present have
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-null">absent</xspecref> as their value.
Any property identified as a having a set, subset or <termref def="dt-list"/>
value may have an empty value unless this is explicitly ruled out: this is
not the same as <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-null">absent</xspecref>.
Any property value identified as a superset or a subset of some set may
be equal to that set, unless a proper superset or subset is explicitly
called for.
</p>

<p>
For more information on the notion of <!--*
* material suppressed here by diff group rec12-main *
*-->schema<!--*
* material suppressed here by diff group rec12-main *
*--> components,
see <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#components">Schema Component Details</xspecref>
of <bibref ref="structural-schemas"/>.
</p>
 
 <p><termdef term="owner" id="dt-owner" dg="pattern-1929">A
component may be referred to as the <term>owner</term> of its properties, and of the values of
those properties.</termdef></p>

<div2 role="1.0" id="rf-defn">
<head>Simple Type Definition</head>
<p>
Simple Type Definitions provide for:
</p>
<!--*
* material suppressed here by diff group fa1.z *
*-->
<ulist dg="fa1.z"><item><p>In the case of 
<termref def="dt-primitive"/> datatypes, 
identifying a datatype with its definition in this specification.</p></item>
<item><p>In the case of <termref def="dt-constructed"/> datatypes, 
defining the datatype in terms of other datatypes.</p></item>
<item><p>Attaching a <dtref ref="QName"/> to the datatype.</p></item>
</ulist>

<div3 role="1.0" id="dc-defn">
<head>The Simple Type Definition Schema Component</head>
<p>The Simple Type Definition schema component has the following properties:</p>

<!--*
* material suppressed here by diff group dp200701 *
*-->
<!-- the change is actually in the "real" <compdef> in compDefs.xml -->

<compdef name="Simple Type Definition" abbrev="std" showAKO="false"/> 
<!--*
* material suppressed here by diff group ep01-p2.add.context-2337.del *
*-->
<!--* diff group changed from diff='del' dg='context-2337'.
    * context-2337 cannot delete something that has never been status-quo.
    * -MSM
    *-->
<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<p>
<!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main">Simple type definitions</phrase> are
identified by their <propref comp="std" prop="name"/> and <propref comp="std" prop="target namespace"/>.  Except for
anonymous <!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main"><compref ref="std"/>s</phrase> (those
with no
<propref comp="std" prop="name"/>), <!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main"><compref ref="std"/>s</phrase> <!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main"><rfc2119>must</rfc2119></phrase> be uniquely identified within a
schema.
<phrase dg="rec12-main">Within a valid schema, 
each <compref ref="std"/> uniquely determines
one datatype.  The <termref def="dt-value-space"/>, <termref def="dt-lexical-space"/>,
<termref def="dt-lexical-mapping"/>, etc., of a <compref ref="std"/>
are the <termref def="dt-value-space"/>, <termref def="dt-lexical-space"/>, etc., of the datatype
uniquely determined (or <unusual>defined</unusual>) 
by that <compref ref="std"/>.</phrase>
</p>
<p>
If <propref comp="std" prop="variety"/> is <termref def="dt-atomic"/>
then the <termref def="dt-value-space"/> of the datatype 
<!--* MSM notes that value space and lexical space are 
    * characteristic of datatypes; it was to be able to
    * talk about them extensionally (as here) that the 
    * current definition of 'datatype' was introduced.
    *
    * On the other hand, this graf would be much knarlier
    * if we forced ourselves not to say 'the value space of
    * the {base type definition}, insisting instead on
    * 'the value space of the datatype uniquely identified
    * by the {base type definition} in the context of a given
    * valid schema'.
    * To license the usage here, a paragraph was added to
    * section 2 after the definition of 'datatype.'
    *-->
defined will be a subset of the <termref def="dt-value-space"/> of
<propref comp="std" prop="base type definition"/> (which is a subset
of the <termref def="dt-value-space"/> of 
<propref comp="std" prop="primitive type definition"/>). If 
<propref comp="std" prop="variety"/> is <termref def="dt-list"/>
then the <termref def="dt-value-space"/> of the datatype 
defined will be the set of
<phrase diff="add" dg="b5625">(possibly empty)</phrase>
finite-length sequence<phrase dg="rec12-map-eff">s</phrase> 
of values from the 
<termref def="dt-value-space"/> of <propref comp="std" prop="item type definition"/>. 
If <propref comp="std" prop="variety"/> is <termref def="dt-union"/>
then the <termref def="dt-value-space"/> of the datatype
defined will be<phrase dg="b2044"> a subset
(possibly an improper subset) of</phrase> 
the union of the <termref def="dt-value-space">value spaces</termref> 
of each 
<!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main"><compref ref="std"/></phrase> 
in <propref comp="std" prop="member type definitions"/>.
</p>
<p>
If <propref comp="std" prop="variety"/> is <termref def="dt-atomic"/>
then the <propref comp="std" prop="variety"/> of <propref comp="std" prop="base type definition"/>
must be <termref def="dt-atomic"/><phrase dg="rec12-main">,
unless the <propref comp="std" prop="base type definition"/>
is <dtref ref="anySimpleType"/></phrase>.
If <propref comp="std" prop="variety"/> is <termref def="dt-list"/>
then the <propref comp="std" prop="variety"/> of <propref comp="std" prop="item type definition"/>
must be either <termref def="dt-atomic"/> or <termref def="dt-union"/><phrase dg="b2044">, and if <propref comp="std" prop="item type definition"/> is <termref def="dt-union"/>
then all its <termref def="dt-basicmember">basic members</termref>
<rfc2119>must</rfc2119> be <termref def="dt-atomic"/></phrase>.
If <propref comp="std" prop="variety"/> is <termref def="dt-union"/>
then
<propref comp="std" prop="member type definitions"/> must be a list of <!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main"><compref ref="std"/>s</phrase>.</p>

<!--* <ednote diff="del" dg="dpno">
<edtext>The definition of &facets; causes
it to contain both <termref def="dt-fundamental-facet">fundamental
facets</termref> and <termref def="dt-constraining-facet">constraining
facets</termref>.&ensp; I doubt this was
intended.&emsp;&mdash;DP</edtext>
</ednote> *-->

<!--* <p diff="add" dg="rec12-tt">[RQ-141b]</p> *-->
<!--*
* material suppressed here by diff group rec12-main *
*-->
<!--*
* material suppressed here by diff group rec12-main *
*-->

<p dg="rec12-main">The <propref comp="std" prop="facets"/> property
determines the <termref def="dt-value-space"/> and <termref def="dt-lexical-space"/> of the datatype
being defined by imposing constraints which must be satisfied by values and
<termref def="dt-lexical-representation">lexical representations</termref>.
</p>

<p dg="rec12-main">
The <propref comp="std" prop="fundamental facets"/> property provides some
basic information about the datatype being defined: its cardinality,
whether an ordering is defined for it by this specification,
whether it has upper and lower bounds, and whether it is numeric.
</p>

<p>
If <propref comp="std" prop="final"/> is the empty set then the type can be used
in deriving other types; the explicit values <pt>restriction</pt>,
<pt>list</pt> and <pt>union</pt> prevent further derivations<phrase dg="rec12-main"> of <compref ref="std"/>s</phrase>
by <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-fb-restriction"/>, <termref def="dt-list"/> and
<termref def="dt-union"/> respectively<!--*
* material suppressed here by diff group rec12-main *
*--><phrase dg="rec12-main">; the explicit value <pt>extension</pt> prevents any derivation of <compref ref="ctd" name="Complex Type Definitions"/> by extension.</phrase>
<!--* Problem: ctd is not an ID in this document, so we can't use 
    * <compref ref="ctd"/>, which would be the normal thing :-( (HST)
    *--> 
</p>
 <p dg="context-2337">The <propref comp="std" prop="context"/>
property is only relevant for anonymous type definitions, for which its value
is the component in which this type definition appears as the value of a
property, e.g. <propref comp="std" prop="item type definition"/> or <propref comp="std" prop="base type definition"/>.</p>
</div3>

<div3 role="1.0" id="xr-defn">
<head>XML Representation of Simple Type Definition Schema Components</head>

<p>
The XML representation for a <compref ref="std"/> schema component
is a <eltref ref="simpleType"/> element information item. The
correspondences between the properties of the information item and
properties of the component are as follows:
</p>
<reprdef>
 <reprelt eltname="simpleType" type="simpleType" dg="rec12-map"/>
 <!--*
* material suppressed here by diff group rec12-map *
*-->
 <reprelt eltname="restriction" dg="rec12-map"/>
 <reprelt eltname="list" dg="rec12-map"/>
 <reprelt eltname="union" dg="rec12-map"/>
<reprcomp abstract="Simple Type Definition" ref="dc-defn">
<propmap comp="std" prop="name">
The <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-vv">actual value</xtermref> of the 
<!--*
* material suppressed here by diff group rec12-map *
*--><phrase dg="rec12-map"><att>name</att></phrase> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if 
present<phrase dg="rec12-map"> on the <eltref ref="simpleType"/> element</phrase>,
otherwise <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-null"><!--*
* material suppressed here by diff group rec12-map *
*--><phrase dg="rec12-map">absent</phrase></xtermref>
</propmap>
 <propmap comp="std" prop="target namespace">
The <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-vv">actual value</xtermref> of the 
<!--*
* material suppressed here by diff group rec12-map *
*--><phrase dg="rec12-map"><att>targetNamespace</att></phrase> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>
of the parent <!--*
* material suppressed here by diff group rec12-map *
*--><phrase dg="rec12-map"><el>schema</el></phrase> element information 
item<phrase dg="rec12-map">, if present,
otherwise <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-null">absent</xtermref></phrase>.</propmap>
<propmap comp="std" prop="base type definition" dg="rec12-map">
<olist role="Caseval">
<item>
<p role="if">the <eltref ref="restriction"/> alternative is chosen</p>
<p role="then">the type definition <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#src-resolve">resolved</xtermref> to by the
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-vv">actual value</xtermref> of the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <eltref ref="restriction"/>, 
if present, otherwise the
type definition corresponding to the <eltref ref="simpleType"/> among
the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="restriction"/>.</p>
</item>
<item>
<p role="if">the <eltref ref="list"/> or <eltref ref="union"/> alternative is chosen</p>
<p role="then"><termref def="anySimpleType-def">anySimpleType</termref>.</p>
</item>
</olist>
</propmap>
<!--*
* material suppressed here by diff group rec12-map *
*-->
<propmap comp="std" prop="final" dg="rec12-map">
A subset of 
<code>{</code><pt>restriction</pt>, <pt>extension</pt>, <pt>list</pt>,
<pt>union</pt><code>}</code>, determined as follows.
<termdef role="local" term="FS" id="lt-vs">Let
<term>FS</term> be
the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-vv">actual value</xtermref> of the
<att>final</att> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, 
if present, otherwise the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-vv">actual value</xtermref> of the
<att>finalDefault</att> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the ancestor
<el>schema</el> element, 
if present, otherwise the empty string.</termdef>  Then the property value is
<olist role="caseval">
    <item>
     <p role="if"><termref def="lt-vs">FS</termref> is the empty string</p>
     <p role="then">the empty set;</p>
    </item>
    <item>
     <p role="if"><termref def="lt-vs">FS</termref> is <string>#all</string></p>
     <p role="then"><code>{</code><pt>restriction</pt>, <pt>extension</pt>, <pt>list</pt>,
<pt>union</pt><code>}</code>;</p>
    </item>
    <item>
     <p role="otherwise">Consider <termref def="lt-vs">FS</termref> as
a space-separated list, and include <pt>restriction</pt> if
<string>restriction</string> is in that list, and similarly for
<pt>extension</pt>, <pt>list</pt> and <pt>union</pt>.
</p>
      <!-- HST doesn't think this is actually true <p>Although the <att>finalDefault</att> &i-attribute; of
       <el>schema</el> may include other values,
       those values
       &must; be ignored in the determination of <propref comp="std" prop="final"/>
       </p> -->
</item>
</olist>
</propmap>
 <propmap comp="std" prop="context" dg="context-2337">
  <olist role="Caseval">
   <item>
    <p role="if">the
<att>name</att> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> is present</p>
    <p role="then"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-null">absent</xtermref></p>
   </item>
   <item>
    <p role="otherwise">
     <olist role="caseval">
     <item>
    <p role="if">the parent element information item is <eltref ref="attribute"/></p>
    <p role="then">the corresponding <compref name="Attribute Declaration" ref="ad"/></p>
   </item>
   <item>
    <p role="if">the parent element information item is <eltref ref="element"/></p>
    <p role="then">the corresponding <compref name="Element Declaration" ref="ed"/></p>
   </item>
   <item>
    <p role="if">the parent element information item is <eltref ref="list"/> or <eltref ref="union"/></p>
    <p role="then">the <compref name="Simple Type Definition" ref="std"/>
corresponding to the grandparent <eltref ref="simpleType"/> element information item</p>
   </item>
      <item>
    <p role="otherwise">(the parent element information item is <eltref ref="restriction"/>), 
     <olist role="caseval">
      <item>
       <p role="if">the grandparent element information item is <eltref ref="simpleType"/></p>
       <p role="then">the <compref name="Simple Type Definition" ref="std"/>
corresponding to the grandparent</p>
      </item>
      <item>
       <p role="otherwise">(the grandparent element information item is <eltref ref="simpleContent"/>), 
     the <compref name="Simple Type Definition" ref="std"/> which is the
<xpropref href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#ctd-content_type" role="comp">content type</xpropref> of the <compref name="Complex Type Definition" ref="ctd"/>
corresponding to the great-grandparent <eltref ref="complexType"/> element information item.</p>
      </item>
     </olist>
    </p>
   </item>
    </olist>
    </p>
   </item>
  </olist>
 </propmap>

<propmap comp="std" prop="variety" dg="rec12-map">If 
the <eltref ref="list"/> alternative is chosen,
then <pt>list</pt>, otherwise if the <eltref ref="union"/> alternative is
chosen, then <pt>union</pt>, otherwise (the <eltref ref="restriction"/>
alternative is chosen)<!--*
* material suppressed here by diff group rec12-map-eff *
*--> the <propref comp="std" prop="variety"/>
of the <propref comp="std" prop="base type definition"/>.</propmap>

<!--*
* material suppressed here by diff group rec12-map *
*-->

   <propmap comp="std" prop="facets" dg="rec12-map">
    <olist role="Caseval">
     <item>
<p role="if">the <eltref ref="restriction"/> alternative is chosen</p>
<p role="then">a set of <compref ref="f"/> components <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-facets-restriction">constituting a restriction</xtermref>
of the <propref comp="std" prop="facets"/> of the
<propref comp="std" prop="base type definition"/> with respect to a
set of <compref ref="f"/> components corresponding to the appropriate element information items among the
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="restriction"/> (i.e. those which specify facets, if any), as
defined in <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#st-restrict-facets">Schema Component Constraint: Simple Type Restriction (Facets)
</xspecref>.</p></item>
     <item dg="rec12-map-eff">
      <p role="if">the <eltref ref="list"/> alternative is chosen</p>
      <p role="then">a set with one member, a <compref ref="f-w"/> facet with 
<propref comp="f-w" prop="value"/> = <pt>collapse</pt> and <propref comp="f-w" prop="fixed"/> = <pt>true</pt>.</p>
     </item>
<item><p role="otherwise">the empty set</p></item></olist>
</propmap>

 <propmap comp="std" prop="fundamental facets" dg="eg-1852">Based on
<propref comp="std" prop="variety"/>, <propref comp="std" prop="facets"/>,
<propref comp="std" prop="base type definition"/> and <propref comp="std" prop="member type definitions"/>, a set of <compref ref="ff"/> components, one
each as specified in <specref ref="dc-ordered"/>, <specref ref="dc-bounded"/>,
<specref ref="dc-cardinality"/> and <specref ref="dc-numeric"/>.</propmap>

<propmap comp="std" prop="annotations" dg="rec12-map">
<phrase diff="del" dg="b3869">A sequence of <compref ref="a" name="Annotation"/> 
components corresponding to</phrase>
<olist diff="del" dg="b3869">
  <item><p>
 the <eltref ref="annotation"/>
element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present;</p></item>
  <item><p>If the <eltref ref="restriction"/> alternative is chosen,
then
 the <eltref ref="annotation"/>
element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of the <eltref ref="restriction"/>, if present;</p></item>
  <item><p>If the <eltref ref="list"/> alternative is chosen,
then
 the <eltref ref="annotation"/>
element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of the <eltref ref="list"/>,
 if present;</p></item>
  <item><p>If the <eltref ref="union"/> alternative is chosen,
then
 the <eltref ref="annotation"/>
element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of the <eltref ref="union"/>,
 if present.</p></item>
</olist>
<!--* MSM notes a certain amount of inconsistency and uncertainty
    * about tagging things 'el' or 'eltref' or ... 
    * HST observes that 'el' is for when the thing is not defined in part
    * 2, 'eltref' otherwise.
    *-->
<phrase diff="add" dg="b3869">
    The <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-am-set">annotation mapping</xtermref> of the set of elements containing the
    <eltref ref="simpleType"/>, and  
    the <eltref ref="restriction"/>, the
    <eltref ref="list"/>, or the <eltref ref="union"/> 
    <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">child</xpropref>,
    whichever is present,
    as defined in section <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#declare-annotation">XML Representation of Annotation Schema Components</xspecref>
    of <bibref ref="structural-schemas"/>.
</phrase>
</propmap>

</reprcomp>
<p dg="rec12-map"><!--*
* material suppressed here by diff group rec12-map-1853 *
*-->
<termdef term="ancestor" id="std-ancestor" dg="rec12-map-1853">The
<term>ancestors</term> of a 
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#td">type definition</xtermref> are its 
<!--* <xtermref href="&xsdl;#key-typeDefn">type definition</xtermref> are its  *-->
<propref comp="std" prop="base type definition"/> and the 
<termref def="std-ancestor">ancestors</termref> of its 
<propref comp="std" prop="base type definition"/>.</termdef>
<phrase dg="rec12-map-1853">(The ancestors of a 
<compref ref="std"/> <var>T</var> in the type hierarchy are themselves
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#td">type definitions</xtermref>; they are distinct from
<!--* <xtermref href="&xsdl;#key-typeDefn">type definitions</xtermref>; they are distinct from *-->
the XML elements which may be ancestors, in the XML document
hierarchy, of the <eltref ref="simpleType"/> element which 
declares <var>T</var>.)
</phrase></p>

<p dg="rec12-map">If the <propref comp="std" prop="variety"/> is <pt>atomic</pt>, the following additional property
<!--*
* material suppressed here by diff group rec12-map *
*--><phrase dg="rec12-map">mapping also applies</phrase>:</p>

  <reprcomp abstract="Atomic Simple Type Definition" ref="xr-defn" dg="rec12-map">
   <propmap comp="std" prop="primitive type definition"><!--*
* material suppressed here by diff group sfs-1933 *
*--><!--*
* material suppressed here by diff group rec12-map-eff *
*--><phrase dg="rec12-map-eff"><!--*
* material suppressed here by diff group sfs-1933 *
*--><phrase dg="sfs-1933">From among</phrase> the <termref def="std-ancestor">ancestors</termref> of this <compref ref="std"/>, that <compref ref="std"/> which corresponds to a <termref def="dt-primitive"/> datatype</phrase>.</propmap>
</reprcomp>

<note role="example" dg="rec12-map">
<p>
An electronic commerce schema might define a datatype called
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><string>SKU</string></phrase>
(the barcode number that appears on products) from the
<termref def="dt-built-in"/> datatype <dtref ref="string"/> by
supplying a value for the <phrase dg="ed-pattern"><termref def="dt-pattern"/></phrase><!--*
* material suppressed here by diff group ed-pattern *
*--> facet.
</p>
<eg xml:space="preserve">&lt;simpleType name='<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">SKU</phrase>'&gt;
    &lt;restriction base='string'&gt;
      &lt;pattern value='\d{3}-[A-Z]{2}'/&gt;
    &lt;/restriction&gt;
&lt;/simpleType&gt;</eg>
<p>
In this case, <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><string>SKU</string></phrase> is the name of the new
<!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-user-defined"/> datatype, <dtref ref="string" role="def"/> is
its <phrase dg="dpno"><termref def="dt-basetype"/></phrase><!--*
* material suppressed here by diff group dpno *
*--> 
and 
<phrase dg="dpno"><phrase dg="ed-pattern"><termref def="dt-pattern"/></phrase><!--*
* material suppressed here by diff group ed-pattern *
*--> is the facet.</phrase>
<!--*
* material suppressed here by diff group dpno *
*-->
</p>
</note>
  <p dg="rec12-map">If the <propref comp="std" prop="variety"/> is <pt>list</pt>, the following
additional property mappings also apply:</p>
  <reprcomp abstract="List Simple Type Definition" ref="xr-defn" dg="rec12-map">
   <propmap comp="std" prop="item type definition">
    <olist role="Caseval">
     <!--*
* material suppressed here by diff group rec12-map-eff *
*-->
     <item dg="rec12-map-eff">
      <p role="if">the <propref comp="std" prop="base type definition"/> is <termref def="anySimpleType-def">anySimpleType</termref></p>

      <p role="then">the <compref ref="std"/> (a) <!--*
* material suppressed here by diff group rec12-map *
*--><phrase dg="rec12-map"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#src-resolve">resolved</xtermref></phrase> to by the
<xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-vv">actual value</xtermref> of the <code>itemType</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <eltref ref="list"/>,
or (b) <!--* , MSM silently deletes stray comma inserted by mistake in WG-approved text *-->
corresponding to the <eltref ref="simpleType"/> among
the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="list"/>, whichever is present.
      <note>
<p><!--*
* material suppressed here by diff group rec12-map-eff-pentimenti *
*--><phrase dg="rec12-map-eff-pentimenti">In this
case, a</phrase> <eltref ref="list"/> element will invariably be present; it will
invariably have either an <code>itemType</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> or a <eltref ref="simpleType"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">child</xpropref>, but not both.</p>
</note>
      </p>
     </item>
     <!--*
* material suppressed here by diff group rec12-map-eff *
*-->
     <item dg="rec12-map-eff">
      <p role="otherwise">(that is, the <propref comp="std" prop="base type definition"/> is not <termref def="anySimpleType-def">anySimpleType</termref>), the <propref comp="std" prop="item type definition"/> of the <propref comp="std" prop="base type definition"/>.
<note dg="edinburgh.refuses.to.die">
<p>In this case, a <eltref ref="restriction"/> element will invariably be present.</p>
</note></p>
     </item>
    </olist>
   </propmap>
</reprcomp>
<note role="example" dg="rec12-map">
<p>
A system might want to store lists of floating point values.
</p>
<eg xml:space="preserve">&lt;simpleType name='listOfFloat'&gt;
  &lt;list itemType='float'/&gt;
&lt;/simpleType&gt;
</eg>
<p>
In this case, <emph>listOfFloat</emph> is the name of the new
<!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-user-defined"/> datatype, <dtref ref="float"/> is its
<termref def="dt-itemType"/> and <termref def="dt-list"/> is the
derivation method.
</p>
</note>
<p dg="rec12-map">If the <propref comp="std" prop="variety"/> is 
<pt>union</pt>, the following
additional property mappings also apply:</p>
<reprcomp abstract="Union Simple Type Definition" ref="xr-defn" dg="rec12-map">
<propmap comp="std" prop="member type definitions">
<olist role="Caseval">
<!--*
* material suppressed here by diff group rec12-map-eff *
*-->
<item dg="rec12-map-eff">
<p role="if">the <propref comp="std" prop="base type definition"/> is
<termref def="anySimpleType-def">anySimpleType</termref></p>
<p role="then"><!--*
* material suppressed here by diff group b2044 *
*--><!--* ... to here,
where it does make sense, and appears to be valid. *--><phrase dg="b2044">the sequence of (a) the <compref ref="std"/>s
(a) <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#src-resolve">resolved</xtermref> to by the items in the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-vv">actual value</xtermref> of the
<code>memberTypes</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of <eltref ref="union"/>, if
any, and (b) those corresponding to the <eltref ref="simpleType"/>s
among the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> of <eltref ref="union"/>, if any, in order.
</phrase> <!--*
* material suppressed here by diff group b2044 *
*-->
<note>
<p><!--*
* material suppressed here by diff group rec12-map-eff-pentimenti *
*--><phrase dg="rec12-map-eff-pentimenti">In this case, a</phrase>
<eltref ref="union"/> element will invariably be
present; it will invariably have either a <code>memberTypes</code>
<xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> or one or more <eltref ref="simpleType"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>,
or both.</p>
</note>
</p>
</item>
<!--*
* material suppressed here by diff group rec12-map-eff *
*-->
<item dg="rec12-map-eff">
<p role="otherwise">(that is, the <propref comp="std" prop="base type definition"/> is not <termref def="anySimpleType-def">anySimpleType</termref>), the <propref comp="std" prop="member type definitions"/> of the <propref comp="std" prop="base type definition"/>.
<note dg="edinburgh.refuses.to.die">
<p>In this case, a <eltref ref="restriction"/> element will invariably
be present.</p>
</note></p>
</item>
</olist>

<!--* N.B. the following note appears both here and in Structures.
    * Any changes must be made in both places.
    * Modified 2006-02-11 after consultation with HST.
    *-->
<ednote role="pf" dg="b2044-feedback">
<edtext>
Note that the rule just given allows <termref def="dt-union">unions</termref> to be members of other
<termref def="dt-union">unions</termref>.  This is a change from version 1.0 of this specification,
which prohibited <termref def="dt-union">unions</termref> in <propref comp="std" prop="member type definitions"/> and replaced
any reference to a <termref def="dt-union"/> <var>M</var>, in the XML declaration of a
second <termref def="dt-union"/> <var>U</var>, with the members of <var>M</var>.  This
had the unintended consequence that that if <var>M</var> had facets
they were lost, and <var>U</var> erroneously accepted values not
accepted by <var>M</var>.  In order to correct this error, this
version of this specification allows <termref def="dt-union">unions</termref> in
<propref comp="std" prop="member type definitions"/> and removes the wording which replaced
references to <termref def="dt-union">unions</termref> with their members.
<br/>
<!--* Dirtiest hack I've done recently. Bleagh.  I'm going to
    * go take a shower.
    *-->
<br/>
The XML Schema Working Group solicits input from implementors and
users of this specification as to whether this change is an acceptable
way of repairing the problem in version 1.0 of this specification, or
whether it would be preferable to allow <termref def="dt-union">unions</termref> as members of other
<termref def="dt-union">unions</termref> only if they have an empty <propref comp="std" prop="facets"/> property. If such a
change would make this specification more (or less) attractive to
users or implementors, please let us know.
</edtext>
</ednote>

</propmap>
</reprcomp>
<note role="example" dg="rec12-map">
<p>As an example, taken from a typical display oriented text markup language,
one might want to express font sizes as an integer between 8 and 72, or with
one of the tokens "small", "medium" or "large".  The <termref def="dt-union"/>
<!--*
* material suppressed here by diff group rq120 *
*--><compref ref="std"/>
below would accomplish that.</p>

<eg xml:space="preserve">
&lt;xsd:attribute name="size"&gt;
  &lt;xsd:simpleType&gt;
    &lt;xsd:union&gt;
      &lt;xsd:simpleType&gt;
        &lt;xsd:restriction base="xsd:positiveInteger"&gt;
          &lt;xsd:minInclusive value="8"/&gt;
          &lt;xsd:maxInclusive value="72"/&gt;
        &lt;/xsd:restriction&gt;
      &lt;/xsd:simpleType&gt;
      &lt;xsd:simpleType&gt;
        &lt;xsd:restriction base="xsd:NMTOKEN"&gt;
          &lt;xsd:enumeration value="small"/&gt;
          &lt;xsd:enumeration value="medium"/&gt;
          &lt;xsd:enumeration value="large"/&gt;
        &lt;/xsd:restriction&gt;
      &lt;/xsd:simpleType&gt;
    &lt;/xsd:union&gt;
  &lt;/xsd:simpleType&gt;
&lt;/xsd:attribute&gt;
</eg>
<eg xml:space="preserve">
&lt;p&gt;
&lt;font size='large'&gt;A header&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size='12'&gt;this is a test&lt;/font&gt;
&lt;/p&gt;
</eg>
</note>
</reprdef>
<!--* MSM untags the following div4 2005-08-27 in the belief that it's
    * artefactual, a hack to work around the deficiencies of our diff
    * markup.  MSM substitutes a different hack, making the diff groups
    * on all the following paragraphs into portmanteaus.
    *-->
<!--* <div4 diff="del" dg="rec12-map"><head>missing</head> *-->
<p dg="dpno.del.rec12-map.del">
A <!--*
* material suppressed here by diff group rq120 *
*--> datatype can be 
<!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-constructed"/> 
from <phrase dg="rq120c">a <termref def="dt-primitive"/> datatype or 
<!--*
* material suppressed here by diff group rq120o *
*--></phrase><phrase dg="rq120">an
<termref def="dt-ordinary"/></phrase> datatype by one of three means:
by <emph><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-fb-restriction"/></phrase></emph>, 
by <emph><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-list"/></phrase></emph> 
or by 
<emph><!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-union"/></phrase></emph>.</p>

<!--*
* material suppressed here by diff group dpno.add.rec12-map.del *
*-->
<!--*
* material suppressed here by diff group dpno.add.rec12-map.del *
*-->
<!--* </div4> *-->

<!--*
* material suppressed here by diff group rec12-map *
*-->

<!--*
* material suppressed here by diff group rec12-map *
*-->

<!--*
* material suppressed here by diff group rec12-map *
*-->
</div3>

<div3 role="1.0" id="defn-rep-constr">
<head>Constraints on XML Representation of Simple Type Definition<!--*
* material suppressed here by diff group rec12-main-excepted-rescinded *
*--></head>

<!--*
* material suppressed here by diff group eg-1852 *
*-->

<constraintnote type="src" id="src-list-itemType-or-simpleType">
<head>itemType attribute or simpleType child</head>
<p>
Either the <code>itemType</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> or the
<eltref ref="simpleType"/> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">child</xpropref> of the <eltref ref="list"/> element
must be present, but not both.
</p>
</constraintnote>

<constraintnote type="src" id="src-restriction-base-or-simpleType">
<head>base attribute or simpleType child</head>
<p>
Either the <code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> or the
<code>simpleType</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">child</xpropref> of the <eltref ref="restriction"/>
element must be present, but not both.
</p>
</constraintnote>

<constraintnote type="src" id="src-union-memberTypes-or-simpleTypes">
<head>memberTypes attribute or simpleType children</head>
<p>
Either the <code>memberTypes</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of the <eltref ref="union"/>
element must be non-empty or
there must be at least one <code>simpleType</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">child</xpropref>.
</p>
</constraintnote>
</div3>

<div3 role="1.0" id="defn-validation-rules">
<head>Simple Type Definition Validation Rules</head>

<constraintnote type="cvc" id="cvc-facet-valid">
<head>Facet Valid</head>
<p>
A value in a <termref def="dt-value-space"/> is facet-valid with
respect to a <termref def="dt-constraining-facet">constraining facet</termref> component 
if <phrase dg="iff">and only if</phrase>:
</p>
<olist>
<item>
<p>
the value is facet-valid with respect to the particular
<termref def="dt-constraining-facet">constraining facet</termref> as specified below.
</p>
</item>
</olist>
</constraintnote>

<constraintnote type="cvc" id="cvc-datatype-valid">
<head>Datatype Valid</head>

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

<p dg="b2449">
A <termref def="dt-literal"/> is datatype-valid with respect to a <compref ref="std"/>
if and only if it is a member of the <termref def="dt-lexical-space"/> of the
corresponding datatype.</p>
</constraintnote>

<note dg="b2449">

<p>
Since every value in the <termref def="dt-value-space"/> is denoted by some
<termref def="dt-literal"/>, and every <termref def="dt-literal"/> in the <termref def="dt-lexical-space"/> maps to
some value, the requirement that the <termref def="dt-literal"/> be in the
<termref def="dt-lexical-space"/> entails the requirement that the value it
maps to should fulfill all of the constraints imposed by the
<propref comp="std" prop="facets"/> of the datatype.  If
the datatype is a <termref def="dt-list"/>, the Datatype Valid constraint also
entails that each whitespace-delimited token in the list
be datatype-valid against the <termref def="dt-itemType"/> of the list.
If the datatype is a <termref def="dt-union"/>, the Datatype Valid constraint
entails that the <termref def="dt-literal"/> be datatype-valid against at
least one of the <termref def="dt-memberTypes"/>.</p>
<p>That is, the constraints on <compref ref="std"/>s and on
datatype derivation defined in this specification have as a
consequence that a <termref def="dt-literal"/> <var>L</var> is datatype-valid with
respect to a <compref ref="std"/> <var>T</var> if and only if
either <var>T</var> corresponds to a <termref def="dt-special"/> datatype or
<olist role="andtest">
<item id="dv_pattern" dg="b5030z">
<p>If there is a <compref ref="f-p"/> in <propref comp="std" prop="facets"/>, then
<var>L</var> is <specref ref="cvc-pattern-valid"/> with respect to the
<compref ref="f-p"/>.
<phrase diff="add" dg="b3251">If there are other <termref def="dt-lexical"/> facets
in <propref comp="std" prop="facets"/>, then <var>L</var> is facet-valid with respect
to them.</phrase></p>
</item>
<item id="dv_lv"><p>The appropriate case among the following is true:
<olist>
<item id="dv_atomic"><p>If the <propref comp="std" prop="variety"/> of <var>T</var> is <termref def="dt-atomic"/>,
then <var>L</var> is in the <termref def="dt-lexical-space"/> of the <!--* datatype
corresponding to the *--> <!--* determined by the *-->
<propref comp="std" prop="primitive type definition"/> of <var>T</var>, as defined in the
appropriate <phrase diff="del" dg="b3251">section of this 
specification</phrase><phrase diff="add" dg="b3251">documentation</phrase>.  
Let <var>V</var> be the
member of the <termref def="dt-value-space"/> of the <!--* datatype corresponding to the *-->
<propref comp="std" prop="primitive type definition"/> of <var>T</var> mapped to by <var>L</var>,
as defined in the appropriate <phrase diff="del" dg="b3251">section 
of this specification</phrase><phrase diff="add" dg="b3251">documentation</phrase>.</p>
<!--* simple type definitions do have value spaces -msm *-->
<note diff="add" dg="b3251">
<p>For <termref def="dt-built-in"/> <termref def="dt-primitive">primitives</termref>, the 
<quote>appropriate documentation</quote> is the relevant
section of this specification. For <termref def="key-impl-def"/> <termref def="dt-primitive">primitives</termref>,
it is the normative specification of the <termref def="dt-primitive"/>, which
will typically be included in, or referred to from, the
implementation's documentation.</p>
</note>
</item>
<item id="dv_list"><p>If the <propref comp="std" prop="variety"/> of <var>T</var> is <termref def="dt-list"/>, then
each space-delimited substring of <var>L</var> is Datatype Valid with
respect to the <propref comp="std" prop="item type definition"/> of <var>T</var>.  Let
<var>V</var> be the sequence consisting of the values identified by
Datatype Valid for each of those substrings, in order.</p></item>
<item id="dv_union"><p>If the <propref comp="std" prop="variety"/> of <var>T</var> is <termref def="dt-union"/>,
then <var>L</var> is Datatype Valid with respect to at least one
member of the <propref comp="std" prop="member type definitions"/>
of <var>T</var>. Let <var>B</var> be the <termref def="dt-active-basic-member"/> of <var>T</var> for <var>L</var>.  Let
<var>V</var> be the value identified by Datatype Valid for
<var>L</var> with respect to <var>B</var>.</p></item>
</olist>
</p></item>
<item id="dv_vfacets"><p><var>V</var>, as determined by the
appropriate sub-clause of <clauseref ref="dv_lv"/> above,
<!--*
* material suppressed here by diff group b5030z *
*-->
is <specref ref="cvc-facet-valid"/> with respect to each member of the
<propref comp="std" prop="facets"/> of <var>T</var> which is <phrase dg="b5030z"><phrase diff="add" dg="b3251">a
<termref def="dt-value-based"/> (and </phrase>not a <phrase diff="del" dg="b3251"><compref ref="f-p"/> 
or a <compref ref="f-w"/></phrase><phrase diff="add" dg="b3251"><termref def="dt-pre-lexical"/>
or <termref def="dt-lexical"/>)</phrase></phrase>
<!--*
* material suppressed here by diff group b5030z *
*-->
facet.</p></item>
</olist>
</p>
<p>Note that <compref ref="f-w"/> facets <phrase diff="add" dg="b3251">and
other <termref def="dt-pre-lexical"/> facets</phrase>
do not take part in checking Datatype
Valid.  In cases where this specification is used in conjunction with
schema-validation of XML documents, 
<phrase diff="del" dg="b3251"><compref ref="f-w"/></phrase><phrase diff="add" dg="b3251">such</phrase> facets are used to
normalize infoset values <emph>before</emph> the normalized results
are checked for datatype validity.  In the case of unions the
<phrase diff="del" dg="b3251"><compref ref="f-w"/> facet to use is the one</phrase><phrase diff="add" dg="b3251"><termref def="dt-pre-lexical"/> facets to use are those</phrase> 
associated with <var>B</var> in
<clauseref ref="dv_union"/> above.
<phrase diff="add" dg="b3251">When more than one <termref def="dt-pre-lexical"/> facet 
applies, the <compref ref="f-w"/> facet is applied first; the order in 
which <termref def="key-impl-def"/> facets
are applied is <termref def="key-impl-def"/>.</phrase></p>
<!--*
* material suppressed here by diff group b5030z *
*-->
</note>
</div3>

<div3 role="1.0" id="defn-coss">
<head>Constraints on Simple Type Definition Schema Components</head>

<constraintnote type="cos" id="cos-applicable-facets">
<head>Applicable Facets</head>

<p>
The <termref def="dt-constraining-facet">constraining facets</termref> which are allowed to be members of <propref comp="std" prop="facets"/>
<!--*
* material suppressed here by diff group wd-23 *
*--><phrase dg="wd-23">depend on
the <propref comp="std" prop="variety"/> and <propref comp="std" prop="primitive type definition"/> of the type, as
follows</phrase>:
</p>
<applicable-facets rend=" wd-23-post b5030-colour "/>
<!--*
* material suppressed here by diff group b5030-en *
*-->
 
 <note diff="add" dg="b3251">
<p>For any <termref def="key-impl-def"/> primitive types, 
it is <termref def="key-impl-def"/> which constraining facets are
applicable to them.
</p>
<p>Similarly, for any <termref def="key-impl-def"/> constraining facets,
it is <termref def="key-impl-def"/> which <termref def="dt-primitive">primitives</termref> they
apply to.
</p>
</note>
</constraintnote>

<!--*
* material suppressed here by diff group rec12-main-excepted *
*-->

<!--*
* material suppressed here by diff group rec12-main-excepted *
*-->
</div3>

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

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

<div3 id="builtin-stds" dg="aat">
<head>Built-in Simple Type Definitions</head>

<!--* !!! n.b. It's not clear where this material actually belongs.  For the
    * moment, I'm leaving it here where I found it, but it's not clear
    * that the approval of diff group 'aat' actually fixed this as the
    * appropriate location.  I have to check the minutes. 
    * [2005-01-21: minutes are clear: location was not discussed; the
    * text the WG approved was in section 4.]
    * Some smaller-order resequencing is noted in comments.
    *-->

<!--* !!! paragraph ast_radix_omnium was moved to this point in newOrg *-->

<!--* It's aatf that deletes the following paragraph and inserts the next.
    * Redone to tag this as a change to aat, rather than as aatf, so that
    * the final wording will be colored correctly. 
<p diff="del" dg="aatf">The <phrase diff="del" dg="dpno"><compref
ref="std"/> of <phrase role="UNSURE">anySimpleType</phrase></phrase>
<phrase diff="add" dg="dpno"><dtref role="def"
ref="anySimpleType"/></phrase> is present in every schema.&nbsp; It
has the following properties:</p>
*-->
<!--*
* material suppressed here by diff group rq120 *
*-->

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

<p dg="rec12-main-excepted">The <compref ref="std"/> of <dtref ref="anySimpleType"/> is
present in every schema.  It has the following properties:</p>

<schemaComp id="anySimpleType-def" dg="rec12-main">
<head>Simple type definition of <code>anySimpleType</code></head>
<pvlist>
<pvpair comp="std" prop="name"><string>anySimpleType</string></pvpair>
<pvpair comp="std" prop="target namespace"><string>http://www.w3.org/2001/XMLSchema</string></pvpair>
<pvpair comp="std" prop="final">The empty set</pvpair>
<!--*
* material suppressed here by diff group context-2337 *
*-->
<pvpair comp="std" prop="context" dg="context-2337"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="base type definition"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#any-type-itself">anyType</xtermref></pvpair>
<!--* old:
<pvpair comp="std" prop="base type definition"><xtermref href="&xsdl;#ur-type-itself">anyType</xtermref></pvpair>
*-->
<pvpair comp="std" prop="facets">The empty set</pvpair>
<pvpair comp="std" prop="fundamental facets">The empty set</pvpair>
<pvpair comp="std" prop="variety"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="primitive type definition" dg="ast-pim"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="item type definition" dg="ast-pim"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="member type definitions" dg="ast-pim"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="annotations">The empty sequence</pvpair>
</pvlist>
</schemaComp>

<p id="ast_radix_omnium">The 
definition of <dtref ref="anySimpleType"/>
is the root of the Simple Type Definition
hierarchy<!--*
* material suppressed here by diff group b2603 *
*--><phrase dg="b2603">;</phrase>
as such<phrase dg="b2603"> it</phrase> mediates between the other 
<phrase dg="dpno">simple type definitions</phrase><!--*
* material suppressed here by diff group dpno *
*-->, 
which all eventually trace back to it via their
<propref comp="std" prop="base type definition"/> properties, 
and<!--*
* material suppressed here by diff group b2603 *
*--> the 
definition of <dtref ref="anyType"/>, 
which is
<emph>its</emph> <propref comp="std" prop="base type definition"/>.</p>

<!--* !!! should the following material move to section 3? -msm *-->
<!--* following paragraph was in datatypes.xml.  MSM suppressed it
    * silently (except for this comment) because its adddition is
    * not attributed to any diff group.  It can't have been in
    * 2E; if it was in the July 2004 WD, then we'll need to bring it back. 
    * -msm 2005-01-09
    *-->
<!--* <p diff="add"><termdef term="anyAtomicType" id="dt-anyAtomicType"
>There is a simple type definition named <term>anyAtomicType</term> present in every
schema by definition</termdef>.  It has the following properties:</p> *-->

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

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

<p dg="rec12-main">The <compref ref="std"/> of <dtref ref="anyAtomicType"/> is
present in every schema.  It has the following properties:</p>

<schemaComp id="anyAtomicType-def" dg="rec12-main">
<head>Simple type definition of <code>anyAtomicType</code></head>
<pvlist>
<pvpair comp="std" prop="name"><string>anyAtomicType</string></pvpair>
<pvpair comp="std" prop="target namespace"><string>http://www.w3.org/2001/XMLSchema</string></pvpair>
<pvpair comp="std" prop="final">The empty set</pvpair>
<!--*
* material suppressed here by diff group context-2337 *
*-->
<pvpair comp="std" prop="context" dg="context-2337"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="base type definition"><dtref ref="anySimpleType"/></pvpair>
<pvpair comp="std" prop="facets">The empty set</pvpair>
<pvpair comp="std" prop="fundamental facets">The empty set</pvpair>
<pvpair comp="std" prop="variety"><!--*
* material suppressed here by diff group rec12-main *
*--><pt dg="rec12-main">atomic</pt></pvpair>
<pvpair comp="std" prop="primitive type definition"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="item type definition"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="member type definitions"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="annotations">The empty sequence</pvpair>
</pvlist>
</schemaComp>

<p>Simple type definitions for all the built-in primitive datatypes,
namely <dtref ref="string"/>, 
<dtref ref="boolean"/>, 
<dtref ref="float"/>, 
<dtref ref="double"/>, 
<dtref ref="decimal"/>, 
<dtref ref="precisionDecimal"/>, 
<dtref ref="dateTime"/>, 
<dtref ref="duration"/>, 
<dtref ref="time"/>, 
<dtref ref="date"/>, 
<dtref ref="gMonth"/>, 
<dtref ref="gMonthDay"/>, 
<dtref ref="gDay"/>, 
<dtref ref="gYear"/>, 
<dtref ref="gYearMonth"/>, 
<dtref ref="hexBinary"/>, 
<dtref ref="base64Binary"/>, 
<dtref ref="anyURI"/> 
are present by definition
in every schema.  All <!--*
* material suppressed here by diff group rec12-tableaux *
*--><phrase dg="rec12-tableaux">have a very similar structure, with only the
<propref comp="std" prop="name"/>, the <propref comp="std" prop="base type definition" diff="del" dg="ep26"/><propref comp="std" prop="primitive type definition" diff="add" dg="ep26"/> (which is self-referential), 
the <propref comp="std" prop="fundamental facets"/><phrase diff="add" dg="ep26">,</phrase> 
and in one case the <propref comp="std" prop="facets"/> varying from one to the 
next:</phrase></p>

<schemaComp id="dummy-def" dg="rec12-tableaux">
<head alt="Simple Type Definition corresponding to the built-in primitive datatypes"><compref ref="std"/> corresponding to the built-in primitive datatypes</head>

<pvlist>
<pvpair comp="std" prop="name">[as appropriate]</pvpair>
<pvpair comp="std" prop="target namespace"><string>http://www.w3.org/2001/XMLSchema</string></pvpair>
<pvpair comp="std" prop="base type definition"><!--* The *-->
<dtref ref="anyAtomicType" role="def"/></pvpair>
<pvpair comp="std" prop="final">The empty set</pvpair>
<pvpair comp="std" prop="variety"><pt>atomic</pt></pvpair>
<pvpair comp="std" prop="primitive type definition">[this <compref ref="std"/> 
itself]</pvpair>
<pvpair comp="std" prop="facets">{a <compref ref="f-w"/> facet with 
<propref comp="f-w" prop="value"/> = <pt>collapse</pt> and <propref comp="f-w" prop="fixed"/> = <pt>true</pt> in all cases except
<dtref ref="string"/>, which has <propref comp="f-w" prop="value"/> =
<pt>preserve</pt> and <propref comp="f-w" prop="fixed"/> = <pt>false</pt>}</pvpair>
<pvpair comp="std" prop="fundamental facets">[as appropriate]<!--{<ulist>
<item><p>an <compref ref="ff-o"/> facet
with <propref comp="ff-o" prop="value"/> = <pt>total</pt></p></item>
<item><p>a <compref ref="ff-b"/> facet
with <propref comp="ff-b" prop="value"/> = <pt>false</pt></p></item>
<item><p>a <compref ref="ff-c"/> facet
with <propref comp="ff-c" prop="value"/> = <pt>countable</pt></p></item>
<item><p>a <compref ref="ff-n"/> facet
with <propref comp="ff-n" prop="value"/> = <pt>true</pt></p></item>
</ulist>}-->
</pvpair>
<!--*
* material suppressed here by diff group context-2337 *
*-->
<pvpair comp="std" prop="context" dg="context-2337"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="item type definition"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="member type definitions"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="annotations">The empty sequence</pvpair>
</pvlist>
</schemaComp>

<p diff="add" dg="b3251">
<termref def="key-impl-def">Implementation-defined</termref> <termref def="dt-primitive">primitives</termref> <rfc2119>must</rfc2119> have a <compref ref="std"/> with
the values shown above, with the following exceptions.
<olist>
<!--*
<item>
<p>The <propref comp="std" prop="target namespace"/>
&mustnot; have the value <string>http://www.w3.org/2001/XMLSchema</string>.</p>
</item> *-->
<item>
<p>The <propref comp="std" prop="facets"/> property
<rfc2119>must</rfc2119> contain a <compref ref="f-w"/> facet, the value of which is 
<termref def="key-impl-def"/>.  It <rfc2119>may</rfc2119> contain other facets,
whether defined in this specification or <termref def="key-impl-def"/>.</p>
</item>
<item>
<p>The value of <propref comp="std" prop="fundamental facets"/>
is <termref def="key-impl-def"/>.</p>
</item>
<item>
<p>The value of <propref comp="std" prop="annotations"/>
<rfc2119>may</rfc2119> be empty, but need not be.</p>
</item>
</olist>
</p>
<note diff="add" dg="b3251">
<p>It is a consequence of the rule just given that each
<termref def="key-impl-def"/> <termref def="dt-primitive"/> will have an <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2004/REC-xml-names11-20040204/#dt-expname">expanded name</xspecref>
by which it can be referred to.</p>
</note>
<note diff="add" dg="b3251">
<p>
<termref def="key-impl-def">Implementation-defined</termref> datatypes will normally have a value
other than <string>http://www.w3.org/2001/XMLSchema</string> for the 
<propref comp="std" prop="target namespace"/>
property.  That namespace is controlled by the W3C and
datatypes will be added to it only by W3C or its designees.
</p>
</note>

<p>Similarly, <compref ref="std"/>s for all the built-in <termref def="dt-ordinary"/>
datatypes are present by definition in every schema, with properties
as specified in <specref ref="ordinary-built-ins"/> and as represented
in XML in <!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852"><specref ref="drvd.nxsd"/></phrase>.</p>

<schemaComp id="dummy-ddef" dg="rad-1933">
<head alt="Simple Type Definition corresponding to the built-in ordinary datatypes"><compref ref="std"/> corresponding to the <termref def="dt-ordinary"/> built-in datatypes</head>

<pvlist>
<pvpair comp="std" prop="name">[as appropriate]</pvpair>
<pvpair comp="std" prop="target namespace"><string>http://www.w3.org/2001/XMLSchema</string></pvpair>
<pvpair comp="std" prop="base type definition">[as specified in the appropriate
sub-section of <specref ref="ordinary-built-ins"/>]</pvpair>
<pvpair comp="std" prop="final">The empty set</pvpair>
<pvpair comp="std" prop="variety">[<pt>atomic</pt> or <pt>list</pt>, as specified in the appropriate
sub-section of <specref ref="ordinary-built-ins"/>]</pvpair>
<pvpair comp="std" prop="primitive type definition">[if <propref comp="std" prop="variety"/> is
<pt>atomic</pt>, then the <propref comp="std" prop="primitive type definition"/> of the <propref comp="std" prop="base type definition"/>, otherwise <pt>absent</pt>]</pvpair>
<pvpair comp="std" prop="facets">[as specified in the appropriate
sub-section of <specref ref="ordinary-built-ins"/>]</pvpair>
<pvpair comp="std" prop="fundamental facets">[as specified in the appropriate
sub-section of <specref ref="ordinary-built-ins"/>]</pvpair>
<pvpair comp="std" prop="context" dg="context-2337"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="item type definition">if <propref comp="std" prop="variety"/> is
<pt>atomic</pt>, then <pt>absent</pt>, otherwise as specified in the appropriate
sub-section of <specref ref="ordinary-built-ins"/>]</pvpair>
<pvpair comp="std" prop="member type definitions"><pt>absent</pt></pvpair>
<pvpair comp="std" prop="annotations">As shown in the XML representations
of the ordinary built-in datatypes in <!--*
* material suppressed here by diff group eg-1852 *
*--><phrase dg="eg-1852"><specref ref="drvd.nxsd"/></phrase></pvpair>
</pvlist>
</schemaComp>
</div3>

</div2>

<!--* 2005-08-27: MSM deletes this div2 and move the
    * (deleted) section on equality into the new
    * 'fundamental facets' section.  I have not reconstructed
    * the process by which we came to delete a section and
    * then create a section with the same name adjacent to it,
    * and move all but one of the old subsections into the new
    * section.  It presumably made sense at the time, and I don't
    * dispute that.  I only note that with the document in its
    * current state it makes no sense and can be reverted.
    *-->
<!--* <div2 id="del-rf-fund-facets" diff="del" dg="fa1"> *-->
<!--* <head>Fundamental Facets</head> *-->
<!--* div3 for 'equal' used to be here *-->
<!--* </div2> *-->

<!--ednote><edtext>We may require that information facets be tracked,
in which case we will change the following note accordingly.&nbsp; Similarly if we don't add the
new &cfacets; for precisionDecimal or whatever else might need them.</edtext></ednote-->

<div2 id="rf-fund-facets">
<!--* MSM deletes <phrase diff="add" dg="fa1"> around the termref, 2005-08-27.
    * Then MSM deletes the termref: it seems remarkably silly to have a 
    * hyperlink from the heading of a section to its first paragraph.
    * That's too high a price for the privilege of saying "all occurrences of
    * the string 'fundamental facet' are hyperlinked to the definition".
    * MSM also doubts that any reader expects hyperlinks from section titles.
    * If anyone does want to go back, at least tag the heading as shown in the
    * comment below, not the way it used to be, which messes up our diffs.

      <head alt="Fundamental Facets">
        <phrase diff="del" dg="fa1">Fundamental Facets</phrase>
        <phrase diff="add" dg="fa1">
          <termref def="dt-fundamental-facet">
            <phrase diff="add" dg="fpwd-rescinded-add">Information</phrase>
            <phrase diff="del" dg="fpwd-rescinded-del">Fundamental</phrase> Facets
          </termref>
       </phrase>
      </head>

    * If we ever want to reconstruct the first public working draft, this
    * will need work; it appeared as "Information Facets" there.  But at
    * the moment, we don't have any such commitment.  So I'm leaving this 
    * simple for now.
    *-->
<head alt="Fundamental Facets">Fundamental Facets</head>

<!--* <issue id="RQ-24-1i" role="1.1">
<p><loc href="&reqs;#fundamentals" target="reqs">RQ-24 (systematic approach to facets)</loc></p>
<p>The decision that the four informational facets, each of which have only one property,
will be lumped into one facet having four properties has been rescinded by the WG before it
made it into the text of this specification.</p>
</issue> *-->

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

<p dg="fa1">
<!--*
* material suppressed here by diff group fa1.z *
*-->
<!--* Compdef added by MSM 2008-06-15 to try to repair damage done
    * when change 3850 was made, breaking a number of compref
    * links to 'fundamental facet' *-->
<!--* <compdef name="fundamental facet" abbrev="ff" role="termdef"/> *-->
<!--* No luck; generates text. *-->
<phrase id="ff" diff="add" dg="b3850"/>
<phrase dg="fa1.z"><termdef term="fundamental facet" id="dt-fundamental-facet">
Each <term>fundamental facet</term> is a
schema component that provides a limited piece of information about
some aspect of each datatype.</termdef><phrase diff="add" dg="b3850">  All <termref def="dt-fundamental-facet">fundamental
facet</termref> components are defined in this section.</phrase> 

For example, <compref ref="ff-c"/> is a 
<termref def="dt-fundamental-facet"/>.  </phrase>
Most <termref def="dt-fundamental-facet"><!--*
* material suppressed here by diff group fa1.z *
*--><phrase dg="fa1.z">fundamental</phrase> facets</termref> 
are given a value
fixed with each primitive datatype's definition, and this value is not changed by
subsequent <termref def="dt-derived">derivations</termref> (even when
it would perhaps be reasonable to expect an application to give a more accurate value based
on the constraining facets used to define the <termref def="dt-derived">derivation</termref>).  The
<compref ref="ff-c"/>  and <compref ref="ff-b"/> facets
are exceptions to this rule; their values may change as a result of certain
<termref def="dt-derived">derivations</termref>.</p>

<note dg="fa1">
<p>Schema components are identified by kind.  <quote><!--*
* material suppressed here by diff group fa1.z *
*--><phrase dg="fa1.z">Fundamental</phrase></quote> 
is not a kind of component.  Each kind of <termref def="dt-fundamental-facet"/>
(<quote>ordered</quote>, 
<quote>bounded</quote>, etc.) is <!--*
* material suppressed here by diff group wdd *
*-->
a separate kind of schema component.</p>
</note>

<!-- This para was added by ep01-part2 in 2005 and deleted in 2006 by b3850.
If ep01-part2 is pre and b3850 is pre then this para should be pre.  ep01-b3850 pre.
(When ep01-part2 is pre then presumably b3850 can't be colour or post.)
If ep01-part2 is colour and b3850 is pre then this para should be add colour.  ep01-b3850 colour.
If ep01-part2 is colour and b3850 is colour then this para should be del colour outside of add colour.
    ep01-b3850-colours colour, ep01-b3850 pre.
(When ep01-part2 is colour then presumably b3850 can't be post.)
If ep01-part2 is post and b3850 is pre then this para should be post.  ep01-b3850 post.
If ep01-part2 is post and b3850 is colour then this para should be del colour.  ep-01-b3850 pre, ep01-b3850-rev colour.
If ep01-part2 is post and b3850 is post then this para should be pre.  epo1-b3850 pre.
   (ep01-b3850-colour is pre except in one instance each above.)
   (ep01-b3850-rev is post except in one instance each above.)

If ep01-part2 is pre and b3850 is pre then  ep01-b3850 should be pre, epo1-b3850-colours pre, ep01-b3850-rev post.
(When ep01-part2 is pre then presumably b3850 can't be colour or post.)
If ep01-part2 is colour and b3850 is pre then ep01-b3850 should be colour, epo1-b3850-colours pre, ep01-b3850-rev post.
If ep01-part2 is colour and b3850 is colour then ep01-b3850 should be pre, ep01-b3850-colours colour, ep01-b3850-rev post.
(When ep01-part2 is colour then presumably b3850 can't be post.)
If ep01-part2 is post and b3850 is pre then ep01-b3850 should be post, epo1-b3850-colours pre, ep01-b3850-rev post.
If ep01-part2 is post and b3850 is colour then ep-01-b3850 should be pre, epo1-b3850-colours pre, ep01-b3850-rev colour.
If ep01-part2 is post and b3850 is post then epo1-b3850 should be pre, epo1-b3850-colours pre, ep01-b3850-rev post.
   (ep01-b3850-colours should be pre except in one instance above.)
   (ep01-b3850-rev should be post except in one instance above.)
-->

<!--*
* material suppressed here by diff group ep01-b3850 *
*-->

<p diff="del" dg="ep01-b3850-rev">The term
<compdef name="Fundamental Facet" abbrev="del_del-ff" role="termdef" showAKO="true">
refers to any of the components defined in this section.</compdef></p>

<!--*
* material suppressed here by diff group ep01-b3850-colours *
*-->


<p dg="fa1">A <termref def="dt-fundamental-facet"/> can occur only
in the <propref comp="std" prop="fundamental facets"/> of a <compref ref="std"/>, and this is the
only place where <termref def="dt-fundamental-facet"/> components
occur.  <!--*
* material suppressed here by diff group pattern-1929 *
*-->  Each kind of <termref def="dt-fundamental-facet"/>
component occurs (once) in each <compref ref="std"/>'s <propref comp="std" prop="fundamental facets"/> set.</p>

<note dg="fa1">
<p>The value of any <termref def="dt-fundamental-facet"/> component can always
be calculated from other properties of its <termref def="dt-owner"/>.  
<phrase dg="wdd">Fundamental facets are not required for schema processing,
but some applications use them.</phrase><!--&nbsp; More &cfacets; have been added which do 
not constrain the value space of derived datatypes (and the whitespace facet never did).--></p></note>


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

<div3 id="rf-ordered"><head>ordered</head>

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

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

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

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

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

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

<p dg="fa1"><phrase diff="del" dg="b2947">Some datatypes
have a nontrivial order relation associated with their value spaces
(see <specref ref="order"/>).  (There is always a
<emph>trivial</emph> partial ordering wherein every value pair that is
not equal is incomparable, which could be associated with any value
space.)  The <emph>ordered</emph> facet value is a
"near-boolean": one of <pt>false</pt>, <pt>partial</pt>, and
<pt>total</pt>, as prescribed in <specref ref="app-fundamental-facets"/> for <termref def="dt-primitive"/> datatypes; all
<!--*
* material suppressed here by diff group rq120 *
*--><!--*
* material suppressed here by diff group rq120c *
*--><termref dg="rq120o" def="dt-ordinary"/> datatypes inherit this value without change. 
The <!--*
* material suppressed here by diff group fa1-fix *
*-->
<phrase dg="fa1-fix">value for a <termref def="dt-list"/></phrase> is always
<pt>false</pt> and the value for a <termref def="dt-union"/> is computed as described
below.</phrase><phrase diff="add" dg="b2947">For some datatypes,
this document specifies an order relation for their value spaces (see
<specref ref="order"/>); the <emph>ordered</emph> facet reflects
this.  It takes the values <pt>total</pt>, <pt>partial</pt>,
and <pt>false</pt>, with the meanings described below.
For the <termref def="dt-primitive"/> datatypes, 
the value of the <emph>ordered</emph> facet is
specified in <specref ref="app-fundamental-facets"/>.  
For <termref def="dt-ordinary"/> datatypes, the value is inherited without change
from the <termref def="dt-basetype"/>.
For a <termref def="dt-list"/>, the value is always <pt>false</pt>;
for a <termref def="dt-union"/>, the value is computed as described below.
</phrase></p>

<p dg="fa1">A <pt>false</pt> value means no order is prescribed; 
a <pt>total</pt> value
assures that the prescribed order is a total
order; a <pt>partial</pt> value means 
<!--*
* material suppressed here by diff group fa1-fix *
*-->
<phrase dg="fa1-fix">that the prescribed order is a partial
order, but not (for the primitive type in question) a total order.  
<phrase diff="del" dg="b2947">Derivation of new datatypes from datatypes 
with partial orders may impose constraints which make the
effective ordering either a trivial order or a non-trivial total order,
but the value of the <compref ref="ff-o"/> facet is not changed to
reflect this.</phrase>
</phrase> 
</p>

<note diff="add" dg="b2947">
<p>
The value <pt>false</pt> in the <emph>ordered</emph> facet does not
mean no partial or total ordering <emph>exists</emph> for the value
space, only that none is specified by this document for use in
checking upper and lower bounds.  Mathematically, any set of values
possesses least one trivial partial ordering, in which every value
pair that is not equal is incomparable.
</p>
</note>
<note diff="add" dg="b2947">
<p>When new datatypes are derived from datatypes with partial orders,
the constraints imposed can sometimes result in a value space
for which the ordering is total, or trivial.  The value of the 
<compref ref="ff-o"/> facet is not, however, changed to reflect this.
The value <pt>partial</pt> should therefore be interpreted with
appropriate caution.</p>
</note>
<p dg="fa1-fix">
<termdef id="dt-ordered" term="ordered">A
<termref def="dt-value-space"/>, and hence a datatype, is said to be
<term>ordered</term> if <phrase diff="del" dg="b2947">this 
specification prescribes a non-trivial order for that
<termref def="dt-value-space"/></phrase><phrase diff="add" dg="b2947"><!--*
* material suppressed here by diff group b5062 *
*--><phrase dg="b5062">some</phrase>
members of the <termref def="dt-value-space"/> are <!--*
* material suppressed here by diff group b5062 *
*--> 
drawn from <!--*
* material suppressed here by diff group b5062 *
*--><phrase dg="b5062">a</phrase> <termref def="dt-primitive"/> 
datatype<!--*
* material suppressed here by diff group b5062 *
*--><phrase dg="b5062"> for which</phrase> 
the table in <specref ref="app-fundamental-facets"/> specifies
the value <pt>total</pt> or <pt>partial</pt> for 
the <emph>ordered</emph> facet<!--*
* material suppressed here by diff group b5062 *
*--></phrase>.</termdef></p>

<note dg="fa1">
<p>Some of the <quote>real-world</quote> datatypes which are the basis for those defined herein
are ordered in some applications, even though no order is prescribed for schema-processing
purposes.  For example, <dtref ref="boolean"/> is sometimes ordered, and <dtref ref="string"/>
and <termref def="dt-list"/> datatypes <termref def="dt-constructed"/> from
ordered <termref def="dt-atomic"/> datatypes are sometimes given <quote>lexical</quote>
orderings.  They are <emph>not</emph> ordered for schema-processing purposes.</p>
</note>

<div4 id="dc-ordered"><head>The ordered Schema Component</head>

<compdef name="ordered" abbrev="ff-o" showAKO="true"/>

<!--* <ednote><edtext>The writeup here has been changed to look more like 
the way logic is currently presented in Part 1.&nbsp; Some find it 
<emph>harder</emph> to understand.&nbsp; The editors are trying to
harmonize the two.&nbsp; Until this is sorted out in "editors' 
committee", the other facet writeups are not going to change.&nbsp; 
This will not occur before second working draft.</edtext></ednote> *-->

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

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

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

<p dg="fa1"><propref comp="ff-o" prop="value"/> depends on 
the <termref def="dt-owner">owner's</termref> 
<propref comp="std" prop="variety"/>, <propref comp="std" prop="facets"/>, 
and <propref comp="std" prop="member type definitions"/>.

<olist role="Case">
<item id="x04042a"><p role="if">the 
<termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref>
<propref comp="std" prop="variety"/> is <pt>atomic</pt></p>
<p role="then">
 <olist role="case">
 <item id="x040428b">
 <p role="if">the <termref def="dt-owner"/> is <termref def="dt-primitive"/></p>
 <p role="then"><propref comp="ff-o" prop="value"/> is as specified in the
table in <specref ref="app-fundamental-facets"/>.</p>
 </item>

 <item>
 <p role="otherwise"><propref comp="ff-o" prop="value"/> is the <termref def="dt-owner">owner's</termref>
<propref comp="std" prop="base type definition"/>'s <compref ref="ff-o"/> <propref comp="ff-o" prop="value"/>.</p>
 </item>
 </olist>
</p>
</item>

<item>
<p role="if">the <termref def="dt-owner">owner's</termref>
<propref comp="std" prop="variety"/> is <pt>list</pt></p>
<p role="then"><propref comp="ff-o" prop="value"/> is <pt>false</pt>.</p>
</item>

<item>
<p role="otherwise">the <termref def="dt-owner">owner's</termref> <propref comp="std" prop="variety"/> is <pt>union</pt>;
<olist role="case">
<item id="x040428">
<p role="if">every <!--*
* material suppressed here by diff group b2044 *
*-->
<phrase dg="b2044"><termref def="dt-basicmember"/> of the 
<termref def="dt-owner"/></phrase>
<!--*
* material suppressed here by diff group aatg *
*--><phrase dg="aatg">has 
<propref comp="std" prop="variety"/> atomic and has the same
<propref comp="std" prop="primitive type definition"/></phrase></p>
<p role="then"><propref comp="ff-o" prop="value"/> is the same as the
<compref ref="ff-o"/> component's <propref comp="ff-o" prop="value"/> in that 
<!--*
* material suppressed here by diff group aatg *
*--><phrase dg="aatg">primitive 
type definition's</phrase> 
<propref comp="std" prop="fundamental facets"/>.</p>
 </item>

 <item>
 <p role="if">each member of the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> 
<propref comp="std" prop="member type definitions"/> has an <compref ref="ff-o"/>
component in its 
<propref comp="std" prop="fundamental facets"/> whose <propref comp="ff-o" prop="value"/> is <pt>false</pt></p>
 <p role="then"><propref comp="ff-o" prop="value"/> is
<pt>false</pt>.</p>
 </item>

 <item>
 <p role="otherwise"><propref comp="ff-o" prop="value"/> is
<pt>partial</pt>.</p>
 </item>
 </olist>
</p>
</item>
</olist>

</p>
</div4>
</div3>

<div3 id="rf-bounded">
<head>bounded</head>
 
<!--*
* material suppressed here by diff group fa1 *
*-->
<!--*
* material suppressed here by diff group fa1 *
*-->
<!--*
* material suppressed here by diff group fa1 *
*-->
<!--*
* material suppressed here by diff group fa1 *
*-->
<!--*
* material suppressed here by diff group fa1 *
*-->

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

<p dg="fa1">Some ordered datatypes have the property that
there is one value greater than or equal to every other value, and
another that <phrase dg="rq120">is</phrase>
less than or equal to every other value.  (In the case of 
<!--*
* material suppressed here by diff group rq120 *
*--><!--*
* material suppressed here by diff group rq120c *
*--><termref dg="rq120o" def="dt-ordinary"/>
datatypes, these two values 
<!--*
* material suppressed here by diff group fa1-fix *
*--> <phrase dg="fa1-fix">are
not necessarily</phrase> in the value space of the derived datatype,
but <phrase dg="fa1-fix">they</phrase> must be in the value
space of the primitive datatype from which they have been derived.)
The <emph>bounded</emph> facet value is <dtref ref="boolean"/> and is
generally <pt>true</pt> for such <emph>bounded</emph> datatypes. 
However, it will remain <pt>false</pt> when the mechanism for imposing
such a bound is difficult to detect, as, for example, when the
boundedness occurs because of derivation using a <compref ref="f-p"/>
component.</p>

<div4 id="dc-bounded">
<head>The bounded Schema Component</head>
<compdef name="bounded" abbrev="ff-b" showAKO="true"/>

<p><propref comp="ff-b" prop="value"/> depends on 
<phrase dg="fa1">the 
<termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref></phrase>
<propref comp="std" prop="variety"/>,
<propref comp="std" prop="facets"/> and 
<propref comp="std" prop="member type definitions"/><!--*
* material suppressed here by diff group fa1 *
*-->.</p>

<p>When <phrase dg="fa1">the <termref def="dt-owner"/>
is <termref def="dt-primitive"/>, 
<propref comp="ff-b" prop="value"/> is as specified in the
table in <specref ref="app-fundamental-facets"/>.  Otherwise, when the
<termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref></phrase>
<propref comp="std" prop="variety"/> is <pt>atomic</pt>,
if one of <compref ref="f-mii"/> or <compref ref="f-mie"/>
and one of <compref ref="f-mai"/> or <compref ref="f-mae"/>
are <!--*
* material suppressed here by diff group fa1 *
*--><phrase dg="fa1">members of
the <termref def="dt-owner">owner's</termref> <propref comp="std" prop="facets"/> set</phrase>, then
<propref comp="ff-b" prop="value"/> is <pt>true</pt>;
<!--*
* material suppressed here by diff group fa1 *
*--><phrase dg="fa1">otherwise</phrase>
<propref comp="ff-b" prop="value"/> is <pt>false</pt>.</p>

<p>When <phrase dg="fa1">the <termref def="dt-owner">owner's</termref>
</phrase><propref comp="std" prop="variety"/> is <pt>list</pt>,
<!--* !!! probable ID problems !!! *-->
<!--*
* material suppressed here by diff group fpwd *
*-->
<propref comp="ff-b" prop="value"/> is <pt>false</pt>.</p>

<p>
When the <phrase dg="fa1"><termref def="dt-owner">owner's</termref> </phrase><propref comp="std" prop="variety"/> is <pt>union</pt>, if
<propref comp="ff-b" prop="value"/> is <pt>true</pt> for every
member of <!--*
* material suppressed here by diff group fa1 *
*--><phrase dg="fa1">the <termref def="dt-owner">owner's</termref> <propref comp="std" prop="member type definitions"/> set and <!--*
* material suppressed here by diff group b2044 *
*--></phrase><!--*
* material suppressed here by diff group b2044 *
*--><phrase dg="b2044">all of the <termref def="dt-owner">owner's</termref> <termref def="dt-basicmember">basic members</termref> have the same 
<propref comp="std" prop="primitive type definition"/></phrase>, then <propref comp="ff-b" prop="value"/> is <pt>true</pt>; <!--*
* material suppressed here by diff group fa1 *
*--><phrase dg="fa1">otherwise</phrase>
<propref comp="ff-b" prop="value"/> is <pt>false</pt>.
</p>

</div4>
</div3>

<div3 id="rf-cardinality">
<head>cardinality</head>

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

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

<p dg="fa1">Every value space has a specific number of members.  This number can be characterized as 
<emph>finite</emph> or <emph>infinite</emph>.  (Currently there are no datatypes with infinite
value spaces larger than <emph>countable</emph>.)  The <emph>cardinality</emph> facet value is
either <pt>finite</pt> or <pt>countably infinite</pt> and is generally <pt>finite</pt> for datatypes with
finite value spaces.  However, it will remain <pt>countably infinite</pt> when the mechanism for
causing finiteness is difficult to detect, as, for example, when finiteness occurs because of a
derivation using a <compref ref="f-p"/> component.</p>

<div4 id="dc-cardinality">
<head>The cardinality Schema Component</head>
<compdef name="cardinality" abbrev="ff-c" showAKO="true"/>

<p>
<propref comp="ff-c" prop="value"/> depends on <phrase dg="fa1">the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> </phrase><propref comp="std" prop="variety"/>,
<propref comp="std" prop="facets"/>, and <propref comp="std" prop="member type definitions"/><!--*
* material suppressed here by diff group fa1 *
*-->.</p>

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

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

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

<p dg="fa1">When the <termref def="dt-owner"/> is
<termref def="dt-primitive"/>, <propref comp="ff-c" prop="value"/> is as specified in the
table in <specref ref="app-fundamental-facets"/>.  Otherwise, when
the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> <propref comp="std" prop="variety"/> is <pt>atomic</pt>,
<propref comp="ff-c" prop="value"/>
is <pt>countably infinite</pt> unless <strong>any</strong> of the following
conditions are true, in which case <propref comp="ff-c" prop="value"/> is
<pt>finite</pt>:

<olist role="orval">
<item>
<p>the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> <propref comp="std" prop="base type definition"/>'s
<compref ref="ff-c"/> <propref comp="ff-c" prop="value"/> is <pt>finite</pt>,</p>
</item>

<item>
<p>at least one of <compref ref="f-l"/>, <compref ref="f-mal"/>,
or <compref ref="f-td"/> is a member of the
<termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> <propref comp="std" prop="facets"/> set,</p>
</item>

<item>
<p><strong>all</strong> of the following are true:</p>
 <olist role="and">
 <item>
 <p>one of <compref ref="f-mii"/> or <compref ref="f-mie"/>
is a member of the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> <propref comp="std" prop="facets"/> set</p>
 </item>

 <item>
 <p>one of <compref ref="f-mai"/> or <compref ref="f-mae"/>
is a member of the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> <propref comp="std" prop="facets"/> set</p>
</item>

 <item>
 <p><strong>either</strong> of the following are true:</p>
  <olist role="orval">
  <item>
  <p><compref ref="f-fd"/> is a member of the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> <propref comp="std" prop="facets"/> set</p>
  </item>

  <item>
  <p><propref comp="std" prop="primitive type definition"/> is one of <dtref ref="date"/>,
  <dtref ref="gYearMonth"/>, <dtref ref="gYear"/>, <dtref ref="gMonthDay"/>,
  <dtref ref="gDay"/> or <dtref ref="gMonth"/></p>
  </item>
  </olist>
 </item>
 </olist>
</item>
</olist> 
 </p>

<!--ednote><edtext>The possible lists of items from an infinite
itemType is inherently infinite even when the list length is
bounded.&nbsp; This is a reported 1.0 bug.&nbsp; Alternatively, the
description of <specref ref="rf-cardinality"/> must be altered to
indicate that, for lists, the facet applies not to the value space but
to the possible <termref def="dt-length">lengths</termref> of the
values in that value space.</edtext></ednote-->

<p>
When <phrase dg="fpwd">the 
<termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref></phrase>
<propref comp="std" prop="variety"/> is <pt>list</pt>,
if <compref ref="f-l"/> or both <!--*
* material suppressed here by diff group fa1 *
*--><compref ref="f-mil"/> and <compref ref="f-mal"/>
are <!--*
* material suppressed here by diff group fa1 *
*--><phrase dg="fa1">members of the
<termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> <propref comp="std" prop="facets"/> set
and the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> <propref comp="std" prop="item type definition"/>'s
<compref ref="ff-c"/> <propref comp="ff-c" prop="value"/> is <pt>finite</pt></phrase>
then <propref comp="ff-c" prop="value"/> is <pt>finite</pt>;
<!--*
* material suppressed here by diff group fa1 *
*--><phrase dg="fa1">otherwise</phrase>
<propref comp="ff-c" prop="value"/> is <pt>countably infinite</pt>.
</p>

<p>
When the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> <propref comp="std" prop="variety"/> is <pt>union</pt>,
if <compref ref="ff-c"/>'s <propref comp="ff-c" prop="value"/> is <emph>finite</emph>
for every member of <phrase dg="fa1">the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> </phrase><propref comp="std" prop="member type definitions"/><phrase dg="fa1"> set</phrase> then
<propref comp="ff-c" prop="value"/> is <pt>finite</pt>,
<!--*
* material suppressed here by diff group fa1 *
*--><phrase dg="fa1">otherwise</phrase> <propref comp="ff-c" prop="value"/>
is <pt>countably infinite</pt>.
</p>
</div4>
</div3>

<div3 id="rf-numeric">
<head>numeric</head>

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

<!--
<p diff="add">Some ordered datatypes have the property that there is one value greater than or equal to
every other value, and another that less than or equal to every other value.&nbsp; (In the case of derived
datatypes, these two values may not be in the value space of the derived datatype, but must be in the
value space of the primitive datatype from which they have been derived.)  The <emph>bounded</emph>
facet value is <dtref ref="boolean"/> and is generally <pt>true</pt> for such <emph>bounded</emph> 
datatypes.&nbsp; However, it will remain <pt>false</pt> when the mechanism for imposing such a bound
is difficult to detect, as, for example, when the boundedness occurs because of derivation using a
<compref ref="rf-pattern"/> component.</p>
-->

<p dg="fa1">Some value spaces are made up of things that
are <!--*
* material suppressed here by diff group fa1-fix *
*-->
<phrase dg="fa1-fix">conceptually</phrase> 
<emph>numeric</emph>, others are
not. The <emph>numeric</emph> facet value indicates which are
considered numeric.
<!--* 
<phrase diff="add" dg="fa1-fix">In this specification, 
<termdef id="dt-numeric" term="numeric">a datatype is said to be
<term>numeric</term> if its <emph>numeric</emph> facet has the 
value <pt>true</pt></termdef>.
</phrase>
*-->
<!--* and otherwise non-numeric *-->
<!--* We don't seem to use 'non-numeric', so I won't restore
    * its definition. -msm *-->  
<!--* In fact, we don't actually use 'numeric' as a term at all.
    * The termrefs to dt-numeric should in fact all be property
    * references to comp="ff-n" -->
</p>

<div4 id="dc-numeric">
<head>The numeric Schema Component</head>
<compdef name="numeric" abbrev="ff-n" showAKO="true"/>

<p>
<propref comp="ff-n" prop="value"/> depends on <phrase dg="fa1">the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> </phrase><propref comp="std" prop="variety"/>,
<propref comp="std" prop="facets"/>, <propref comp="std" prop="base type definition"/> and
<propref comp="std" prop="member type definitions"/><!--*
* material suppressed here by diff group fa1 *
*-->.
</p>

<p>
When <phrase dg="fa1">the <termref def="dt-owner"/> is <termref def="dt-primitive"/>, <propref comp="ff-n" prop="value"/> is as specified in the
table in <specref ref="app-fundamental-facets"/>.  Otherwise, when the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> </phrase><propref comp="std" prop="variety"/> is <pt>atomic</pt>,
<propref comp="ff-n" prop="value"/> is inherited from
<phrase dg="fa1">the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> <propref comp="std" prop="base type definition"/>'s <compref ref="ff-n"/></phrase><propref comp="ff-n" prop="value"/><!--*
* material suppressed here by diff group fa1 *
*-->.
</p>

<p>
When <phrase dg="fa1">the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> </phrase><propref comp="std" prop="variety"/> is <pt>list</pt>,
<propref comp="ff-n" prop="value"/> is <pt>false</pt>.
</p>

<p>
When <phrase dg="fa1">the 
<termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> 
</phrase><propref comp="std" prop="variety"/> is <pt>union</pt>,
if <phrase dg="fa1"><compref ref="ff-n"/>'s </phrase><propref comp="ff-n" prop="value"/> is <pt>true</pt>
for every member of <phrase dg="fa1">the <termref def="dt-owner"><!--*
* material suppressed here by diff group wdd *
*--><phrase dg="wdd">owner's</phrase></termref> </phrase><propref comp="std" prop="member type definitions"/><phrase dg="fa1"> set</phrase> then
<propref comp="ff-n" prop="value"/> is <pt>true</pt>,
<!--*
* material suppressed here by diff group fa1 *
*--><phrase dg="fa1">otherwise</phrase> <propref comp="ff-n" prop="value"/> is <pt>false</pt>.
</p>

</div4>
</div3>
</div2>

<div2 role="1.0" id="rf-facets">
<head>Constraining Facets</head>

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

<p dg="fa1">
<!--* MSM adds compdef here to repair damage done by careless fix to 3850,
    * which broke all comprefs to constraining facets. *-->
<!--* <compdef name="Constraining Facet" abbrev="f" role="termdef"/> *-->
<phrase id="f" diff="add" dg="b3850"/>
<termdef term="constraining facet" id="dt-constraining-facet"><term><phrase>Constraining facets</phrase></term>
are schema components whose values may be set or changed
during <termref def="dt-derived">derivation</termref> (subject to facet-specific controls) 
to control various aspects of the derived datatype.</termdef> 
<phrase diff="add" dg="b3850">All <termref def="dt-constraining-facet">constraining facet</termref> components 
<phrase dg="b3251">defined by this specification</phrase>
are
defined in this section.  </phrase>For example, 
<compref ref="f-w"/> is a <termref def="dt-constraining-facet">constraining facet</termref>. 
<termref def="dt-constraining-facet"><phrase>Constraining Facets</phrase></termref> are given a value as part of
the <termref def="dt-derived">derivation</termref>
<!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120">when an <termref def="dt-ordinary"/> 
datatype is defined by <termref def="dt-fb-restriction">restricting</termref>
a <termref def="dt-primitive"/> or <termref def="dt-ordinary"/> datatype</phrase>; a few
<termref def="dt-constraining-facet">constraining facets</termref> have default values
that are also provided for <termref def="dt-primitive"/> datatypes.</p>

<note dg="fa1">
<p>Schema components are identified by kind.  <quote>Constraining</quote> 
is not a kind of component.  Each kind of <termref def="dt-constraining-facet">constraining facet</termref>
(<quote>whiteSpace</quote>, 
<quote>length</quote>, etc.) is a separate kind of schema component. </p>
</note>
 
<p diff="add" dg="b3251">
This specification distinguishes three kinds of constraining facets:<ulist>
<item>
<p><termdef id="dt-pre-lexical" term="pre-lexical">A constraining facet which
is used to normalize an initial <termref def="dt-literal"/> before checking
to see whether the resulting character sequence is a member of a datatype's
<termref def="dt-lexical-space"/> is a <term>pre-lexical</term> facet.</termdef></p>
<p>This specification defines just one <termref def="dt-pre-lexical"/> facet:
<compref ref="f-w"/>.</p>
</item>
<item>
<p><termdef id="dt-lexical" term="lexical">A constraining facet which
directly restricts the <termref def="dt-lexical-space"/> of a datatype 
is a <term>lexical</term> facet.</termdef></p>
<p>This specification defines <phrase dg="b5030z">just one</phrase>
<!--*
* material suppressed here by diff group b5030z *
*--> <termref def="dt-lexical"/> facet<!--*
* material suppressed here by diff group b5030z *
*-->:
<compref ref="f-p"/><!--*
* material suppressed here by diff group b5030z *
*-->.</p>
<note>
<p>As specified normatively elsewhere, <termref def="dt-lexical"/> facets can have an indirect
effect on the <termref def="dt-value-space"/>:  if every lexical representation of a value
is removed from the <termref def="dt-lexical-space"/>, the value itself is removed
from the <termref def="dt-value-space"/>.</p>
</note>
</item>
<item>
<p><termdef id="dt-value-based" term="value-based">A constraining facet which
directly restricts the <termref def="dt-value-space"/> of a datatype 
is a <term>value-based</term> facet.</termdef></p>
<p>Most of the constraining facets defined by this specification
<!--*
* material suppressed here by diff group b5030z *
*--> are <termref def="dt-value-based"/> facets.</p>
<note>
<p>As specified normatively elsewhere, <termref def="dt-value-based"/> facets can have an indirect
effect on the <termref def="dt-lexical-space"/>:  if a value
is removed from the <termref def="dt-value-space"/>, its lexical representations
are removed
from the <termref def="dt-lexical-space"/>.</p>
</note>
<!--*
* material suppressed here by diff group b5030z *
*-->
</item>
</ulist>
</p>
<p diff="add" dg="b3251">
Conforming processors <rfc2119>must</rfc2119>
support all the facets defined in this section.
It is <termref def="key-impl-def"/> whether a processor supports other
constraining facets.  <termdef id="dt-unknown-f" term="unknown">An
<!--* &impl-defined; *-->
<termref def="dt-constraining-facet">constraining facet</termref> which is not supported by
the processor in use is <term>unknown</term>.</termdef>
</p>
<note diff="add" dg="b3251">
<p>A reference to an <termref def="dt-unknown-f"/> facet might be a reference to
an <termref def="key-impl-def"/> facet supported by some other processor,
or might be the result of a typographic error, or might
have some other explanation.
</p>
</note>

<!-- This para was added by ep01-part2 in 2005 and deleted in 2006 by b3850.
If ep01-part2 is pre and b3850 is pre then this para should be pre.  ep01-b3850 pre.
(When ep01-part2 is pre then presumably b3850 can't be colour or post.)
If ep01-part2 is colour and b3850 is pre then this para should be add colour.  ep01-b3850 colour.
If ep01-part2 is colour and b3850 is colour then this para should be del colour outside of add colour.
    ep01-b3850-colours colour, ep01-b3850 pre.
(When ep01-part2 is colour then presumably b3850 can't be post.)
If ep01-part2 is post and b3850 is pre then this para should be post.  ep01-b3850 post.
If ep01-part2 is post and b3850 is colour then this para should be del colour.  ep-01-b3850 pre, ep01-b3850-rev colour.
If ep01-part2 is post and b3850 is post then this para should be pre.  epo1-b3850 pre.
   (ep01-b3850-colour is pre except in one instance each above.)
   (ep01-b3850-rev is post except in one instance each above.)

If ep01-part2 is pre and b3850 is pre then  ep01-b3850 should be pre, epo1-b3850-colours pre, ep01-b3850-rev post.
(When ep01-part2 is pre then presumably b3850 can't be colour or post.)
If ep01-part2 is colour and b3850 is pre then ep01-b3850 should be colour, epo1-b3850-colours pre, ep01-b3850-rev post.
If ep01-part2 is colour and b3850 is colour then ep01-b3850 should be pre, ep01-b3850-colours colour, ep01-b3850-rev post.
(When ep01-part2 is colour then presumably b3850 can't be post.)
If ep01-part2 is post and b3850 is pre then ep01-b3850 should be post, epo1-b3850-colours pre, ep01-b3850-rev post.
If ep01-part2 is post and b3850 is colour then ep-01-b3850 should be pre, epo1-b3850-colours pre, ep01-b3850-rev colour.
If ep01-part2 is post and b3850 is post then epo1-b3850 should be pre, epo1-b3850-colours pre, ep01-b3850-rev post.
   (ep01-b3850-colours should be pre except in one instance above.)
   (ep01-b3850-rev should be post except in one instance above.)
-->
<!--*
* material suppressed here by diff group ep01-b3850 *
*-->
<p diff="del" dg="ep01-b3850-rev">The term
<compdef name="Constraining Facet" abbrev="f-del" role="termdef" showAKO="true">
refers to any of the components defined in this section.</compdef></p>
<!--*
* material suppressed here by diff group ep01-b3850-colours *
*-->

<!--ednote><edtext>The WG agreed long ago to use 'information' rather
than 'fundamental' to describe fundamental facets.&nbsp; (We did not
come to an agreement on 'controlling' vs 'constraining', and I agreed
to make all references with an entity reference so that we can revert
all occurrences readily.)&nbsp; The question here is:&nbsp; Should we
change the simple type property from "{fundamental facets}" to
"{information facets}"?&emsp; &mdash;DP</edtext></ednote-->

<p diff="add" dg="b3251">The descriptions of individual facets given
below include both constraints on <compref ref="std"/> components
and rules for checking the datatype validity of a given literal against
a given datatype.  The validation rules typically depend upon having
a full knowledge of the datatype; full knowledge of the datatype,
in turn, depends on having a fully instantiated <compref ref="std"/>.
A full instantiation of the <compref ref="std"/>, and the checking
of the component constraints, require knowledge of the <termref def="dt-basetype"/>.
It follows that if a datatype's <termref def="dt-basetype"/> is <termref def="dt-unknown-dt"/>, the
<compref ref="std"/> defining the datatype will be incompletely
instantiated, and the datatype itself will be <termref def="dt-unknown-dt"/>.
Similarly, any datatype defined using an <termref def="dt-unknown-f"/> <termref def="dt-constraining-facet">constraining facet</termref>
will be <termref def="dt-unknown-dt"/>.  It is not possible to perform datatype validation
as defined here using <termref def="dt-unknown-dt"/> datatypes.</p>
<note diff="add" dg="b3251">
<p>The preceding paragraph does not forbid implementations from attempting
to make use of such partial information as they have about <termref def="dt-unknown-dt"/>
datatypes.  But the exploitation of such partial knowledge is not
datatype validity checking as defined here and is to be distinguished
from it in the implementation's documentation and interface.</p>
</note>


<div3 role="1.0" id="rf-length">
<head>length</head>

<!--* <issue id="RQ-147bi" role="1.1">
<p><loc href="&reqs;#E2-35-length-facet" target="reqs">RQ-147b (phase out length facet)</loc></p>
<p>The WG is considering the ramifications of removing the length &cfacet;, letting the schema document elements that currently set that
facet set both minLength and maxLength instead.</p>
</issue> *-->

<p>
<termdef id="dt-length" term="length" role="local">
<term>length</term> is the number
of <emph>units of length</emph>, where <emph>units of length</emph>
varies depending on the type that is being derived from.
The value of
<term>length</term> <termref def="dt-must"/> be a
<dtref ref="nonNegativeInteger"/>.
</termdef>
</p>
<p>
For <dtref ref="string"/> and datatypes derived from <dtref ref="string"/>,
<term>length</term> is measured in units of <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-character">
character</xtermref>s as defined in <bibref ref="XML"/>.
For <dtref ref="anyURI"/>, <term>length</term> is measured in units of
characters (as for <dtref ref="string"/>).
For <dtref ref="hexBinary"/> and <dtref ref="base64Binary"/> and datatypes 
derived from them,
<term>length</term> is measured in octets (8 bits) of binary data.
For datatypes <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-constructed"/> by <termref def="dt-list"/>,
<term>length</term> is measured in number of list items.
</p>
<note>
<p>
For <dtref ref="string"/> and datatypes derived from <dtref ref="string"/>,
<term>length</term> will not always coincide with "string length" as perceived
by some users or with the number of storage units in some digital representation.
Therefore, care should be taken when specifying a value for <term>length</term>
and in attempting to infer storage requirements from a given value for
<term>length</term>.
</p>
</note>

<p>
<termref def="dt-length"/> provides for:
</p>
<ulist>
<item>
<p>
Constraining a <termref def="dt-value-space"/>
to values with a specific number of <emph>units of length</emph>,
where <emph>units of length</emph>
varies depending on <propref comp="std" prop="base type definition"/>.
</p>
</item>
</ulist>

<note role="example">
<p>
The following is the definition of a <!--*
* material suppressed here by diff group rq120 *
*--><termref dg="rq120" def="dt-user-defined"/>
datatype to represent product codes which must be
exactly 8 characters in length.  By fixing the value of the
<term>length</term> facet we ensure that types derived from productCode can
change or set the values of other facets, such as <term>pattern</term>, but
cannot change the length.
</p>
<eg xml:space="preserve">&lt;simpleType name='productCode'&gt;
   &lt;restriction base='string'&gt;
     &lt;length value='8' fixed='true'/&gt;
   &lt;/restriction&gt;
&lt;/simpleType&gt;</eg>
</note>

<div4 role="1.0" id="dc-length">
<head>The length Schema Component</head>

<compdef name="length" abbrev="f-l" showAKO="true"/>

<p>
If <propref comp="f-l" prop="fixed"/> is <emph>true</emph>, then types for which
the current type is the <propref comp="std" prop="base type definition"/> cannot specify a
value for <compref ref="f-l"/> other than <propref comp="f-l" prop="value"/>.
</p>
<note diff="add" dg="b3950">
<p>The <propref comp="f-l" prop="fixed"/> property is defined for
parallelism with other facets and for compatiblity with version 1.0
of this specification. But it is a consequence of 
<specref ref="length-valid-restriction"/> that the value of
the <compref ref="f-l"/> facet cannot be changed, regardless of
whether <propref comp="f-l" prop="fixed"/> is 
<emph>true</emph> or <emph>false</emph>.
</p>
</note>
</div4>

<div4 role="1.0" id="xr-length">
<head>XML Representation of length Schema Components</head>

<p>
The XML representation for a <compref ref="f-l"/> schema
component is a <eltref ref="length"/> element information item. The
correspondences between the properties of the information item and
properties of the component are as follows:
</p>

<reprdef>
<reprelt eltname="length"/>
<reprcomp abstract="length" ref="dc-fractionDigits">
<propmap comp="f-l" prop="value">
The <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-vv">actual value</xtermref> of the <code>value</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>
</propmap>
<propmap comp="f-l" prop="fixed">
The <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-vv">actual value</xtermref> of the <code>fixed</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if present, otherwise <pt>false</pt>
</propmap>
<propmap comp="f-l" prop="annotations">
<phrase diff="del" dg="b3869">The annotations corresponding to all the <eltref ref="annotation"/> 
element information items in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if any.</phrase>
<phrase diff="add" dg="b3869">The <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#key-am-one">annotation mapping</xtermref> of the 
<eltref ref="length"/> 
element, as defined in 
  section <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-wd.html#declare-annotation">XML Representation of Annotation Schema Components</xspecref>
  of <bibref ref="structural-schemas"/>.</phrase>
</propmap>
</reprcomp>
</reprdef>

</div4>

<div4 role="1.0" id="length-validation-rules">
<head>length Validation Rules</head>

<constraintnote type="cvc" id="cvc-length-valid">
<head>Length Valid</head>
<p>
A value in a <termref def="dt-value-space"/> is facet-valid with
respect to <termref def="dt-length"/><!--*
* material suppressed here by diff group iff *
*-->
<phrase dg="iff">if and only if:</phrase>
</p>
<olist>
<item>
<p>
if the <propref comp="std" prop="variety"/> is <termref def="dt-atomic"/> then
<olist>
<item>
<p>
if <propref comp="std" prop="primitive type definition"/> is <dtref ref="string"/> or <dtref ref="anyURI"/>, then the length of the value,
as measured in <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/xml11/#dt-character">
character</xtermref>s 
<termref def="dt-must"/> be equal to <propref comp="f-l" prop="value"/>;
</p>
</item>
<item>
<p>
if <propref comp="std" prop="primitive type definition"/> is <dtref ref="hexBinary"/> or <dtref ref="base64Binary"/>, then the length of
the value, as measured in octets of the binary data, 
<termref def="dt-must"/> be 
equal to <propref comp="f-l" prop="value"/>;
</p>
</item>
<item>
<p>
if <propref comp="std" prop="primitive type definition"/> is <dtref ref="QName"/> or <dtref ref="NOTATION"/>, then any <propref comp="f-l" prop="value"/> is facet-valid.
</p>
</item>
</olist>
</p>
</item>
<item>
<p>
if the <propref comp="std" prop="variety"/> is <termref def="dt-list"/>,
then the length of the value, as measured in list items, 
<termref def="dt-must"/> be 
equal to <propref comp="f-l" prop="value"/>
</p>
</item>
</olist>
</constraintnote>
<p>

The use of <termref def="dt-length"/>
on <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><dtref ref="QName"/>, <dtref ref="NOTATION"/>, and datatypes derived from them</phrase>
is deprecated.  Future versions of this
specification may remove this facet for these datatypes.

</p>
</div4>

<div4 role="1.0" id="length-coss">
<head>Constraints on length Schema Components</head>
<constraintnote type="cos" id="length-minLength-maxLength">
<head>length and minLength or maxLength</head>

 <p>If <compref ref="f-l"/> is a member of <propref comp="std" prop="facets"/> then
  <olist>
   <item>
    <p>It is an error for <compref ref="f-mil"/> to be a member of
<propref comp="std" prop="facets"/> unless
     <olist>
      <item>
       <p>the <propref comp="f-mil" prop="value"/> of <compref ref="f-mil"/> &lt;= the <propref comp="f-l" prop="value"/> of <compref ref="f-l"/> and</p>
      </item>
      <item>
       <p>there is <phrase diff="add" dg="b4900">some</phrase>
         type definition from which this one is derived by
         one or more <!--*
* material suppressed here by diff group rq120 *
*--><phrase dg="rq120"><termref def="dt-restriction"/></phrase> steps in which <compref ref="f-mil"/> has the same
         <propref comp="f-mil" prop="value"/> and <compref ref="f-l"/> is not specified.</p>
      </item>
     </olist>
    </p>
   </item>
   <item>
    <p>It is an error for <compref ref="f-mal"/> to be a member of
<propref comp="std" prop="facets"/> unless
     <olist>
      <item>
       <p>the <propref comp="f-l" prop="value"/> of <compref ref="f-l"/> &lt;= the <propref comp="f-mal" prop="value"/> of <compref ref="f-mal"/> and</p>
      </item>
      <item>
       <p>there is <phrase diff="add" dg="b4900">some</phrase>
         type definition from which this one is derived by
         one or more restriction steps in which <compref ref="f-mal"/> has the same
         <propref comp="f-mal" prop="value"/> and <compref ref="f-l"/> is not specified.</p>
      </item>
     </olist>
    </p>
   </item>
  </olist>
 </p>
</constraintnote>

<constraintnote type="cos" id="length-valid-restriction">
<head>length valid restriction</head>
<p>
It is an <termref def="dt-error"/> if <compref ref="f-l"/>
is among the members of <propref comp="std" prop="facets"/> of
<propref comp="std" prop="base type definition"/> and <propref comp="f-l" prop="value"/> is
not equal to the <propref comp="