<?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-1.0.xml" dgdf_desc="differences from version 1.0 of this specification" w3c-doctype="wd" status="final" role="TR-copy" otherSpec="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-1.0.html" schemaDump="./XMLSchema.diff-1.0.xsd.dmp" drvdSchema="./derived.diff-1.0.nxsd" primSchema="./primitives.diff-1.0.nxsd" schemaProper="./XMLSchema.diff-1.0.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-1.0.xml">XML</loc>
<!--* 
<loc href="http://www.w3.org/TR/2008/WD-xmlschema11-2-20080620/datatypes.diff-1.0.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-1.0.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>
<loc xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/2001/XMLSchema-datatypes.xsd" diff="del" dg="dup-2214">A schema for built-in datatypes only, in a separate namespace</loc>
<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" diff="chg" 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<!--*
* material suppressed here by diff group wd4hax *
*--></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>.  <phrase diff="del" dg="wd4hax">It is intended to 
give an indication of the W3C XML
Schema Working Group's intentions for this new version of the XML
Schema language and our progress in achieving them.  It attempts to be
complete in indicating <emph>what</emph> will change from version 1.0,
but does <emph>not</emph> specify in all cases <emph>how</emph> things
will change.  </phrase> 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 diff="add" 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 diff="add" 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 diff="add" 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 diff="add" 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 diff="add" 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<phrase diff="del" dg="rq152a"> 1.0</phrase>, provides a superset of the
capabilities found in XML<phrase diff="del" dg="rq152a"> 1.0</phrase>
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">odiff-add</phrase>
  <phrase diff="add" dg="rec12-tableaux" role="hack" id="idiff_hack">idiff-add</phrase>
  <phrase diff="add" dg="rec12-tableaux" role="hack" id="arrow_hack">↑</phrase>
  <phrase diff="add" dg="rec12-tableaux" role="hack" id="odiff_del_hack">odiff-del</phrase>
  <phrase diff="add" dg="rec12-tableaux" role="hack" id="idiff_del_hack">idiff-del</phrase>
  <phrase diff="add" dg="rec12-tableaux" role="hack" id="del_arrow_hack">↓</phrase>
  <!--* 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 diff="add" 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 diff="add" 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 diff="add" 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" diff="add" 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" diff="add" 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><phrase diff="del" dg="fa1">Type</phrase><phrase diff="add" 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 diff="add" 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 <phrase diff="del" dg="fa1">computer representations of</phrase><phrase diff="add" 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 diff="add" dg="fa1">thoroughly </phrase>define these abstract concepts; many
other publications provide excellent definitions.<phrase diff="add" 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 diff="add" 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
    *-->
<p diff="del" dg="fa1">
<termdef id="del-dt-datatype" term="datatype">In this specification,
a <term>datatype</term> is a 3-tuple, consisting of
a) a set of distinct values, called its <termref def="dt-value-space"/>,
b) a set of lexical representations, called its
<termref def="dt-lexical-space"/>, and c) a set of <termref def="del-dt-facet"/>s
that characterize properties of the <termref def="dt-value-space"/>,
individual values or lexical items.
</termdef>
</p>


<p diff="add" 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 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 <!--*
* material suppressed here by diff group ep26 *
*--><phrase dg="ep26">mapping from</phrase> the <termref def="dt-lexical-space"/> 
<!--*
* material suppressed here by diff group ep26 *
*--><phrase 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 diff="add" 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 diff="add" 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 diff="add" 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 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<!--*
* material suppressed here by diff group b3251 *
*-->
the <termref def="dt-lexical-space"/> directly.  When more than one lexical
representation is provided for a given value, 
<!--*
* material suppressed here by diff group b3251 *
*--><phrase 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>

<p diff="del" dg="fa1"><termdef id="del-dt-value-space" term="value space">A <term>value space</term> is the set of values for a given
datatype. Each value in the <term>value space</term> of a datatype is
denoted by one or more literals in its <termref def="dt-lexical-space"/>. </termdef></p>

<p diff="add" 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 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 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 diff="add" 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 diff="add" 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 <phrase diff="del" dg="fa1">given </phrase>datatype can
be defined in one of the following ways:
<ulist>
<item><p>defined<phrase diff="add" dg="fa1"> elsewhere</phrase>
axiomatically from fundamental notions (intensional definition) [see
<termref def="dt-primitive"/>]</p>
</item>
<item><p>enumerated outright<phrase diff="add" 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>

<p diff="del" dg="fa1">
<termref def="dt-value-space">value spaces</termref> have certain properties.  For example, they always
have the property of <termref def="dt-cardinality"/>, some definition of
<emph>equality</emph> and might be <termref def="dt-ordered"/>, by
which individual values within the <termref def="dt-value-space"/> can be compared to
one another.  The properties of <termref def="dt-value-space">value spaces</termref> that are
recognized by this specification are defined in
<specref ref="del-fundamental-facets"/>.
</p>

<p diff="add" dg="fa1">The relations of <emph>identity</emph><!--*
* material suppressed here by diff group b2947 *
*--><phrase dg="b2947">
and</phrase>
<emph>equality</emph><!--*
* material suppressed here by diff group b2947 *
*--> 
are required for each
value space.  <phrase 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 diff="add" 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.  
<!--*
* material suppressed here by diff group b3222 *
*--></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 dg="b3223">0.1 nor 0.10000000009</phrase> is in the value space, and
each <phrase 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 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 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 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 diff="add" 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, <!--*
* material suppressed here by diff group b3224 *
*--><phrase 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 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.  
<!--*
* material suppressed here by diff group b3222 *
*-->
<phrase 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 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 diff="add" dg="fa1" id="order"><head>Order</head>

<p><!--*
* material suppressed here by diff group b2947 *
*--><phrase 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, 
<!--*
* material suppressed here by diff group b2947 *
*--><phrase dg="b2947">no order
is prescribed</phrase>; <!--*
* material suppressed here by diff group b2947 *
*--><phrase 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"/>) 
<!--*
* material suppressed here by diff group ep26 *
*--><phrase dg="ep26">ensures</phrase> 
that this is true.</p>
</note>

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

<p><!--*
* material suppressed here by diff group b3225 *
*--><phrase dg="b3225">For
purposes of this specification, the</phrase> value spaces of primitive datatypes are
<!--*
* material suppressed here by diff group b3225 *
*--><phrase 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 dg="ep26">s</phrase> defined <!--*
* material suppressed here by diff group b3225 *
*--><phrase dg="b3225">in this specification, values from
different</phrase> value spaces are <!--*
* material suppressed here by diff group b3225 *
*--><phrase 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> *-->
<!--*
* material suppressed here by diff group b3225 *
*--><phrase dg="b3225">decimal</phrase>
datatype and the float datatype.  In the order relation defined
here<!--*
* material suppressed here by diff group b3225 *
*-->,
<phrase dg="b3225">the </phrase>two in the decimal datatype
<!--*
* material suppressed here by diff group b3225 *
*--><phrase dg="b3225">is
not less than the</phrase> three in the float datatype<phrase dg="b3225">;
the two values</phrase> are
incomparable<!--*
* material suppressed here by diff group b3225 *
*-->.  Other
applications making use of these
datatypes may choose to consider values such as these comparable.</p>

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

<note 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>

<div2 diff="del" dg="fa1"><head>Lexical space</head>

<p>In addition to its <termref def="dt-value-space"/>, each datatype also has a lexical
space.
</p>
<p><termdef term="lexical space" id="del-dt-lexical-space">A
<term>lexical space</term> is the set of valid <emph>literals</emph>
for a datatype. </termdef></p>
<p>
For example, "100" and "1.0E2" are two different literals from the
<termref def="dt-lexical-space"/> of <dtref ref="float"/> which both denote the same
value. The type system defined in this specification provides a
mechanism for schema designers to control the set of values and the
corresponding set of acceptable literals of those values for a
datatype.
</p>
<note>
<p>
The literals in the <termref def="dt-lexical-space">lexical spaces</termref> defined in this specification
have the following characteristics:
</p>
<glist>
<gitem>
<label>Interoperability:</label>
<def>
<p>
The number of literals for each value has been kept small; for many
datatypes there is a one-to-one mapping between literals and values.
This makes it easy to exchange the values between different systems.
In many cases, conversion from locale-dependent representations will
be required on both the originator and the recipient side, both for
computer processing and for interaction with humans.
</p>
</def>
</gitem>
<gitem>
<label>Basic readability:</label>
<def>
<p>
Textual, rather than binary, literals are used. This makes hand
editing, debugging, and similar activities possible.
</p>
</def>
</gitem>
<gitem>
<label>Ease of parsing and serializing:</label>
<def>
<p>
Where possible, literals correspond to those found in common
programming languages and libraries.
</p>
</def>
</gitem>
</glist>
</note><div3 id="del-canonical-lexical-representation">
<head>Canonical Lexical Representation</head>
<p>
While the datatypes defined in this specification have, for the most
part, a single lexical representation i.e. each value in the
datatype's <termref def="dt-value-space"/> is denoted by a single literal in its
<termref def="dt-lexical-space"/>, this is not always the case.  The example in the
previous section showed two literals for the datatype
<dtref ref="float"/> which denote the same value.  Similarly,
there <termref def="dt-may"/> be several literals for one of the date
or time datatypes that denote the same value using different timezone
indicators.
</p>
<p>
<termdef term="canonical lexical representation" id="del-dt-canonical-representation">A 
<term>canonical lexical
representation</term> is a set of literals from among the valid set of
literals for a datatype such that there is a one-to-one mapping
between literals in the <term>canonical lexical representation</term>
and values in the <termref def="dt-value-space"/>. </termdef>
</p>
</div3></div2>

<div2 id="lexical-space" diff="add" 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 
<!--*
* material suppressed here by diff group b3227 *
*--><phrase 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 
<!--*
* material suppressed here by diff group b3227 *
*--><phrase dg="b3227">the prescribed set of strings
which</phrase>
<termref role="the" def="dt-lexical-mapping">the lexical
mapping</termref> for that datatype<phrase 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 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 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 <!--*
* material suppressed here by diff group b3227 *
*--><phrase 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>

<div2 id="del.facets" diff="del" dg="fa1.z">
<!--* !!! this section was not deleted in the first public working draft.  I think
    * this means fa1 should be split into pre-WD and post-WD bits.  This is a post-WD
    * bit of fa1. -msm *-->
<head>Facets</head>

<!--* <issue id="del-RQ-24-1i" role="1.1">
<p><loc href="&reqs;#fundamentals" target="reqs">RQ-24 (systematic approach to facets)</loc></p>
<p>This decision is not yet written up herein:&nbsp; The four
informational facets, each of which have only one property, will be
lumped into one facet having four properties.&nbsp; This will
represent a further technical change to the facet structure, but will
not result in any additional or lost information in a schema.</p>
</issue> *-->

<p>
<termdef id="del-dt-facet" term="facet">A <term>facet</term> is a single
defining aspect of a <termref def="dt-value-space"/>.  Generally
speaking, each facet characterizes a <termref def="dt-value-space"/>
along independent axes or dimensions.</termdef>
</p>
<p dg="fpwd-rescinded-del"><!--* !!! This para marked as 
   deleted in first public WD. -msm *-->
The facets of a datatype serve to distinguish those aspects of
one datatype which <emph>differ</emph> from other datatypes.
Rather than being defined solely in terms of a prose description
the datatypes in this specification are defined in terms of
the <emph>synthesis</emph> of facet values which together determine the
<termref def="dt-value-space"/> and properties of the datatype.
</p>
<p dg="fpwd-rescinded-del"><!--* !!! This para marked 
   as deleted in first public WD. -msm *-->
Facets are of two types: <emph>fundamental</emph> facets that define
the datatype and <emph>non-fundamental</emph> or <emph>constraining
</emph> facets that constrain the permitted values of a datatype.
</p>

<!--* !!! the following paragraph was marked 'add' in the first public WD
    * and subsequently (re-)deleted.
    * We'd need stronger diff markup than we currently have to make
    * that history clear.  So for the moment I content myself with giving
    * it a unique dg identifier. -->

<!--*
* material suppressed here by diff group fpwd-rescinded-add *
*-->
				
<!--* !!! the following paragraph was marked 'add' in the first public WD
    * and subsequently (re-)deleted. *-->

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

<!--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-->

<!--* !!! the following note was marked 'add' in the first public WD
    * and subsequently (re-)deleted. *-->
<!--*
* material suppressed here by diff group fpwd-rescinded-add *
*-->


<div3 id="del-fundamental-facets" dg="fa1">
<head>Fundamental facets</head>
<p>
<termdef id="del-dt-fundamental-facet" term="fundamental facet">
A <term>fundamental facet</term> is an abstract property which
serves to semantically characterize the values in a
<termref def="dt-value-space"/>.
</termdef>
</p>
<p>
All <term>fundamental facets</term> are fully described in
<specref ref="rf-fund-facets"/>.
</p>
</div3>

<div3 id="del-non-fundamental" dg="fa1">
<head>Constraining or Non-fundamental facets</head>
<p>
<termdef id="del-dt-constraining-facet" term="constraining facet">A
<term>constraining facet</term> is an optional property that can be
applied to a datatype to constrain its <termref def="dt-value-space"/>.
</termdef>
</p>
<p>
Constraining the <termref def="dt-value-space"/> consequently constrains
the <termref def="dt-lexical-space"/>.  Adding
<termref def="dt-constraining-facet">constraining facets</termref> to a <termref def="dt-basetype"/>
is described in <specref ref="derivation-by-restriction"/>.
</p>
<p>
<phrase dg="b3251">All</phrase><!--*
* material suppressed here by diff group b3251 *
*--> 
<term>constraining facets</term> <!--*
* material suppressed here by diff group b3251 *
*--> are fully described in
<specref ref="rf-facets"/>.
</p>

</div3>
</div2>

<div2 role="1.0" id="datatype-dichotomies" dg="trm1">
<head>Datatype
<phrase diff="del" dg="rq120">dichotomies</phrase><phrase diff="add" dg="rq120">Distinctions</phrase></head>

<p>It is useful to categorize the datatypes defined in this
specification along various dimensions, <phrase diff="del" dg="rq120">forming a set of characterization
dichotomies</phrase><phrase diff="add" 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>

<p diff="del" dg="rq120">
The first distinction to be made is that 
between 
<termref def="dt-atomic"/>, <termref def="dt-list"/> and 
<termref def="dt-union"/> datatypes.
</p>

<p diff="add" 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 <phrase dg="rq120">which are
regarded</phrase><!--*
* material suppressed here by diff group rq120 *
*--> by
this specification as <phrase dg="rq120">being</phrase>
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 diff="add" 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 diff="add" dg="rq120"> (or <phrase 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 diff="add" dg="b2044">(a) </phrase>those whose <phrase diff="del" dg="rq120"><termref def="dt-value-space">value spaces</termref> and
<termref def="dt-lexical-space">lexical spaces</termref></phrase><phrase diff="add" 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"/> <phrase diff="del" dg="rq120">could be the
value</phrase><phrase diff="add" dg="rq120">is in the value
space</phrase> of <phrase diff="del" dg="rq120">an</phrase><phrase diff="add" dg="rq120">the</phrase> <termref def="dt-atomic"/> datatype <phrase diff="del" dg="rq120">(</phrase><dtref ref="NMTOKEN"/><phrase diff="del" dg="rq120">);</phrase><phrase diff="add" dg="rq120">,</phrase> while a sequence of such tokens <phrase diff="del" dg="rq120">could be the value of a</phrase><phrase diff="add" dg="rq120">is in the value space of the</phrase> <termref def="dt-list"/>
datatype <phrase diff="del" dg="rq120">(</phrase><dtref ref="NMTOKENS"/><phrase diff="del" dg="rq120">)</phrase>.
</p>

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

<p diff="del" dg="b3230"><phrase dg="aatf"><termref def="dt-atomic"/> datatypes can be either
<termref def="dt-primitive"/> or derived.  The
<termref def="dt-value-space"/> of an <termref def="dt-atomic"/> datatype
is a set of <unusual>atomic</unusual> values, which for the purposes of this specification,
are not further decomposable.  </phrase><!--*
* material suppressed here by diff group aatf *
*--> 
The <termref def="dt-lexical-space"/> of
an <termref def="dt-atomic"/> datatype is a set of
<phrase dg="rq21-lit"><emph>literals</emph></phrase><!--*
* material suppressed here by diff group rq21-lit *
*-->
whose internal structure is specific to the datatype in question. 
<!--*
* material suppressed here by diff group aatf *
*--></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><phrase diff="del" dg="rq120"><termref def="dt-list"/></phrase><phrase diff="add" dg="rq120"><termref def="dt-list">List</termref></phrase> datatypes are always <termref diff="del" dg="rq120" def="dt-derived"/><termref diff="add" dg="rq120" def="dt-constructed"/><phrase diff="add" 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>  *-->
<phrase diff="del" dg="rq120">whose internal structure</phrase><phrase diff="add" 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
<phrase diff="del" dg="rq120"><termref def="dt-atomic"/> datatype of the items in the
<termref def="dt-list"/></phrase><phrase diff="add" 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 <phrase dg="rq120" diff="del">known as </phrase>the 
<term dg="rq120" diff="del">itemType</term><term diff="add" dg="rq120">item type</term> 
of that <termref def="dt-list"/> datatype.</termdef><phrase dg="rq120" diff="add">  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 
<termref def="dt-derived" diff="del" dg="rq120"/><termref def="dt-constructed" diff="add" dg="rq120"/>
from an <phrase diff="add" dg="aatf">ordinary 
</phrase><phrase diff="add" 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.
<phrase diff="del" dg="rq120">In such a case,
regardless of the input, list
items will be separated at space 
boundaries.</phrase><phrase diff="add" 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 
<phrase diff="del" dg="rq120">from</phrase><phrase diff="add" 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><phrase dg="rq120" diff="del">unit of </phrase>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 <phrase diff="del" dg="rq120">its</phrase><phrase diff="add" 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>.
*-->
<phrase diff="del" dg="rq120">Hence, a</phrase><phrase diff="add" 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 
<phrase diff="del" dg="rq120">is matched against
each literal of the <termref def="dt-list"/> 
datatype and not against the literals of the datatype that serves as its
<termref def="dt-itemType"/></phrase><phrase diff="add" 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 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>
<p dg="rq120" diff="del">
The <dtref ref="canonical-lexical-representation"/> for the
<termref def="dt-list"/> datatype is defined as the lexical form in which
each item in the <termref def="dt-list"/> has the canonical lexical
representation of its  <termref def="dt-itemType"/>.
</p>

<p dg="rq120" diff="add">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 diff="add" 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"><phrase diff="del" dg="b2044">The <termref def="dt-value-space"/> and <termref def="dt-lexical-space"/>
of a <termref def="dt-union"/> datatype are the union of the <phrase dg="rq120"><termref def="dt-value-space">value spaces</termref> and <termref def="dt-lexical-space">lexical spaces</termref> </phrase><!--*
* material suppressed here by diff group rq120 *
*--> of
its <termref def="dt-memberTypes"/>.</phrase> </phrase> <phrase diff="add" 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-1.0.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 diff="add" 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 <termref diff="del" dg="rq120" def="dt-derived"/><termref diff="add" dg="rq120" def="dt-constructed"/><phrase diff="add" 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-1.0.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-1.0.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 
<phrase dg="rq120">1</phrase><!--*
* material suppressed here by diff group rq120 *
*-->)</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 diff="add" dg="aatf">ordinary
</phrase><phrase diff="add" dg="rq120o"> or
<termref def="dt-primitive"/> </phrase><phrase diff="del" dg="b2044"><termref def="dt-atomic"/> 
or <termref def="dt-list"/></phrase>
<phrase diff="del" dg="rq120"><termref def="dt-datatype"/>s 
</phrase><phrase diff="add" 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
<term dg="rq120" diff="del">memberTypes</term><term diff="add" dg="rq120">member types</term> 
of that <termref def="dt-union"/> datatype.</termdef></p>

<p diff="add" 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 diff="add" 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 diff="add" 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"/> <!--*
* material suppressed here by diff group ep26 *
*--><phrase 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 diff="add" 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 diff="add" 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 <phrase dg="rq120" diff="del"><emph>memberTypes</emph> </phrase><phrase dg="rq120" diff="add"><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-1.0.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>

<p dg="rq120" diff="del"> The <dtref ref="canonical-lexical-representation"/> for a
<termref def="dt-union"/> datatype is defined as the lexical form in which
the values have the canonical lexical representation
of the appropriate  <termref def="dt-memberTypes"/>.</p>
<p dg="rq120" diff="add">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 diff="add" dg="rq120o">Special vs. </phrase>Primitive vs.
<phrase diff="del" dg="fa1.z">derived
datatypes</phrase><phrase diff="add" dg="fa1.z"><!--*
* material suppressed here by diff group rq120o *
*--><phrase dg="rq120o">Ordinary</phrase>
Datatypes</phrase></head>

<p diff="del" dg="rq120o">Next, we distinguish between 
<termref def="dt-primitive"/><!--*
* material suppressed here by diff group fa1.z *
*--><phrase dg="rq120"> and
derived</phrase> datatypes.</p>

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

<p diff="add" 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 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 diff="add" 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 diff="add" dg="rq120"><!--*
* material suppressed here by diff group rq120o *
*-->datatypes</phrase> that are not
<phrase diff="add" dg="rq120o"><termref def="dt-special"/> and are
not</phrase> defined in terms of other datatypes;
they exist <emph>ab initio</emph>.</termdef>
<phrase diff="add" 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 diff="add" 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>

<item diff="del" dg="rq120o">
<p dg="fa1.z"><termdef id="quondam-dt-derived" term="derived"><term>Derived</term>
datatypes are those that are defined in terms of other datatypes.</termdef></p>

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

<p>For example, in this specification, <dtref ref="float"/> is a 
<phrase diff="add" dg="rq120"><termref def="dt-primitive"/> datatype based on 
a </phrase>well-defined mathematical concept
<!-- find example other than float -->
<phrase diff="del" dg="rq120">that cannot be</phrase><phrase diff="add" dg="rq120">and
not</phrase> 
defined in terms of other datatypes, while<phrase diff="del" dg="rq120"> a</phrase>
<dtref ref="integer"/> is <phrase diff="del" dg="rq120">a special case
of</phrase><phrase diff="add" 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> *-->
  
<p diff="del" dg="rq120"><termdef id="del-dt-anySimpleType" term="anySimpleType" role="local">The
<phrase dg="aatf">simple ur-type
definition</phrase><!--*
* material suppressed here by diff group aatf *
*-->
is a special restriction of 
<phrase dg="aatf">the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-1.0.html#key-urType">ur-type definition</xtermref>
whose name is <term>anySimpleType</term> in the XML Schema
namespace</phrase><!--*
* material suppressed here by diff group aatf *
*-->. 
<phrase dg="aatg"><term>anySimpleType</term> can be
considered as the <termref def="dt-basetype"/> of all <termref def="dt-primitive"/>
datatypes.  </phrase><term>anySimpleType</term>
is considered to have an unconstrained lexical space and 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.
</termdef></p>

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

<p diff="del" dg="rq120">
In the example above, <dtref ref="integer"/> is derived
from <dtref ref="decimal"/>.
</p>
<!--* 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
<termref dg="rq120" def="dt-derived"/><!--*
* material suppressed here by diff group rq120 *
*-->
in this specification <!--*
* material suppressed here by diff group rq120 *
*--> 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. -->
<p diff="del" dg="rq120">As described in more detail in <specref ref="xr-defn"/>,
each <termref dg="rq120" def="dt-user-derived"/><!--*
* material suppressed here by diff group rq120 *
*--> datatype <termref def="dt-must"/> be 
<phrase dg="rq120">defined in terms
of</phrase><!--*
* material suppressed here by diff group rq120 *
*--> 
another datatype in one of three ways: 1) by assigning
<phrase dg="rq120"><termref def="dt-constraining-facet">constraining facets</termref> which serve 
to</phrase><!--*
* material suppressed here by diff group rq120 *
*--> <emph>restrict</emph> the
<termref def="dt-value-space"/><!--*
* material suppressed here by diff group rq120 *
*--> of the <termref dg="rq120" def="dt-user-derived"/><!--*
* material suppressed here by diff group rq120 *
*-->
datatype to <phrase dg="rq120">a subset of 
that</phrase><!--*
* material suppressed here by diff group rq120 *
*--> 
of the <termref def="dt-basetype"/><phrase dg="rq120">;
</phrase><!--*
* material suppressed here by diff group rq120 *
*--> 2) by creating
a <termref def="dt-list"/> datatype whose <termref def="dt-value-space"/>
consists of finite-length sequences of values of its
<termref def="dt-itemType"/><phrase dg="rq120">;
</phrase><!--*
* material suppressed here by diff group rq120 *
*--> or 3) by creating a <termref def="dt-union"/>
datatype whose <termref def="dt-value-space"/> consists of the union of the
<phrase dg="rq120"><termref def="dt-value-space">value spaces</termref>
</phrase><!--*
* material suppressed here by diff group rq120 *
*--> of its <termref def="dt-memberTypes"/>.</p>

<div4 role="1.0" id="restriction">
<head><phrase diff="del" dg="rq120">Derived by
restriction</phrase><phrase diff="add" 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.
    *-->
<p diff="del" dg="rq120"><termdef id="del-dt-restriction" term="restriction">A 
datatype is said to be derived by <term>restriction</term> 
from another datatype 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 its <termref def="dt-basetype"/>. </termdef></p>

<p diff="add" 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>
*-->

<p diff="del" dg="rq120"><termdef id="del1-dt-basetype" term="base type">Every
datatype that is derived by <termref def="dt-restriction"/> is
defined in terms of an existing datatype, referred to as its
<term>base type</term>. <term>Base type</term>s can be either
<termref def="dt-primitive"/> or derived.</termdef></p>

<!--* <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><phrase diff="del" dg="rq120">Derived by 
list</phrase><phrase diff="add" dg="rq120">Construction by List</phrase></head>

<p>A <termref def="dt-list"/> datatype can be <termref diff="del" dg="rq120" def="dt-derived"/><termref diff="add" 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 diff="add" 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><phrase diff="del" dg="rq120">Derived by
union</phrase><phrase diff="add" dg="rq120">Construction by Union</phrase></head>

<p>One datatype can be <termref diff="del" dg="rq120" def="dt-derived"/><termref diff="add" 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
<phrase diff="del" dg="rq120"><termref def="dt-union"/>ing</phrase><phrase diff="add" dg="rq120">unioning</phrase>
their <phrase diff="del" dg="b2044"><termref def="dt-value-space">value spaces</termref></phrase><phrase diff="add" dg="b2044"><termref def="dt-lexical-mapping">lexical mappings</termref></phrase>
and<phrase dg="rq120fix">, consequently, their</phrase>
<phrase diff="add" dg="b2044"><termref def="dt-value-space">value spaces</termref> and</phrase>
<phrase diff="del" dg="rq120"><termref def="dt-lexical-space">lexical spaces</termref></phrase><phrase diff="add" dg="rq120"><termref def="dt-lexical-space">lexical spaces</termref></phrase>. 
<phrase diff="add" 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 diff="add" 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 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 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 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 <!--*
* material suppressed here by diff group b3239a *
*--><phrase 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 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-<phrase diff="del" dg="rq120">Derived</phrase><phrase diff="add" 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<phrase diff="del" dg="rq120">,
and</phrase><phrase diff="add" dg="rq120">; they</phrase> can 
be <phrase diff="del" dg="rq120">either</phrase> 
<phrase diff="add" dg="rq120"><termref def="dt-special"/>,</phrase>
<termref def="dt-primitive"/><phrase diff="add" dg="rq120">,</phrase> or
<termref diff="del" dg="rq120" def="dt-derived"/><!--*
* material suppressed here by diff group rq120c *
*--><termref diff="add" dg="rq120o" def="dt-ordinary"/><phrase diff="add" dg="rq120"> datatypes
</phrase>.
</termdef>
</p>
</item>
<item>
<p diff="del" dg="rq120">
<termdef id="dt-user-derived" term="user-derived">
<term>User-derived</term> datatypes are those derived
datatypes that are defined by individual schema designers.
</termdef>
</p>
<p diff="add" 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-1.0.html#key-null">absent</xspecref>.
</p>
</note>

<p>
Conceptually there is no difference between the <!--*
* material suppressed here by diff group rq120c *
*--><termref diff="add" dg="rq120o" def="dt-ordinary"/>
<termref def="dt-built-in"/> <termref diff="del" dg="rq120" def="dt-derived"/> 
datatypes included in this specification and the <termref diff="del" dg="rq120" def="dt-user-derived"/><termref diff="add" dg="rq120" def="dt-user-defined"/>
datatypes which will be created by individual schema designers.
The <termref def="dt-built-in"/> <termref diff="del" dg="rq120" def="dt-derived"/><termref diff="add" 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
<phrase diff="del" dg="rq120"><unusual>reinventing</unusual></phrase><phrase diff="add" dg="rq120">reinventing</phrase> them.  Furthermore, including these
<termref diff="del" dg="rq120" def="dt-derived"/><termref diff="add" 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 
<phrase dg="rq120"><unusual>built-in</unusual></phrase><!--*
* material suppressed here by diff group rq120 *
*-->
datatype in any programming language used
to implement this specification.  Likewise, a datatype which is
<termref dg="rq120" def="dt-user-derived"/><!--*
* material suppressed here by diff group rq120 *
*--> in this specification need not be a 
<phrase dg="rq120"><unusual>user-derived</unusual></phrase><!--*
* material suppressed here by diff group rq120 *
*--> 
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><phrase diff="del" dg="rq120">Built-in datatypes</phrase><phrase diff="add" 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 <phrase diff="del" dg="rq120">(both
<termref def="dt-primitive"/> and
derived)</phrase> 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 <phrase diff="del" dg="rec12-main">datatype
definition</phrase>
<phrase diff="add" 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 
<phrase diff="del" dg="rec12-main">datatype</phrase><phrase diff="add" 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 diff="add" 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>
<p diff="del" dg="rq120">
This applies to both
<termref def="dt-built-in"/> <termref def="dt-primitive"/> and
<termref def="dt-built-in"/> derived datatypes.
</p>
<p diff="add" dg="rq120">
<!--*
* material suppressed here by diff group dup-2214 *
*--></p>
<note diff="add" 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 <termref diff="del" dg="rq120" def="dt-user-derived"/><termref diff="add" 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, <termref dg="rq120" def="dt-user-derived"/><!--*
* material suppressed here by diff group rq120 *
*--> 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-1.0.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" diff="add">
<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"/>. 
<!--*
* material suppressed here by diff group b3244 *
*--><phrase 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>
<!--*
* material suppressed here by diff group b3244 *
*-->
<p 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 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 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-1.0.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 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 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-1.0.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 diff="add" dg="b1902amend">is described;
</phrase><phrase diff="del" dg="b1902amend">and
</phrase><phrase diff="add" dg="b1902amend">the
</phrase><termref def="dt-lexical-space"/>
<phrase diff="del" dg="b1902amend">are</phrase><phrase diff="add" dg="b1902amend">is</phrase>
defined<phrase diff="del" dg="b1902amend">,</phrase> 
<phrase diff="add" 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 diff="add" dg="b1902amend">;</phrase> 
and any datatypes 
<termref def="dt-derived" diff="del" dg="rq120"/><termref def="dt-constructed" dg="rq120" diff="add"/>
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> <phrase diff="del" dg="rq120"><termref def="dt-primitive"/></phrase><phrase diff="add" 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.<phrase diff="del" dg="rq21-string"> 
The <termref def="dt-value-space"/>
of <term>string</term> is the set of finite-length sequences of
<!--*
* material suppressed here by diff group b5625 *
*-->
<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"/>.
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 code point, which is an integer.</phrase>
</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, <term diff="del" dg="rq21-string">string</term><dtref ref="string" diff="add" 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 diff="add" 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 diff="add" 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 diff="add" 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"><phrase diff="del" dg="fa1-fix"><termref def="dt-order-relation"/></phrase><phrase diff="add" 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" diff="add" 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 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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>
<phrase diff="del" dg="rq21-boolean">has the
<termref def="dt-value-space"/> required to support the mathematical
concept of binary-valued logic: {true,
false}</phrase><phrase diff="add" dg="rq21-boolean">represents the 
values of two-valued logic</phrase>.</termdef></p>

<div4 diff="add" 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>

<div4 id="boolean-lexical-representation" diff="del" dg="rq21-boolean">
<head>Lexical representation</head>
<p>An instance of a datatype that is defined as <termref def="dt-boolean"/>
can have the following legal literals {true, false, 1, 0}.</p>
</div4>

<div4 id="boolean-canonical-representation" diff="del" dg="rq21-boolean">
<head>Canonical representation</head>
<p>The <termref def="dt-canonical-representation"/> for <term>boolean</term> is the set of
literals {true, false}.</p>
</div4>

<div4 id="boolean-lexical-mapping" diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 
<phrase diff="del" dg="rq31m">multiplying</phrase><phrase diff="add" dg="rq31m">dividing</phrase> 
an integer by a non-<phrase diff="del" dg="rq31m">positive</phrase><phrase diff="add" dg="rq31m">negative</phrase>
power of ten, i.e., expressible as 
<phrase diff="del" dg="rq31m"><emph role="eq">i × 10^-n</emph></phrase><phrase diff="add" dg="rq31m"><var>i</var> / 10<sup><var>n</var></sup></phrase>
where <var>i</var> and <var>n</var> are integers
and 
<phrase diff="del" dg="rq31m"><emph role="eq">n &gt;= 0</emph></phrase><phrase diff="add" 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 diff="add" dg="rq31m">(The datatype <dtref ref="precisionDecimal"/> may be used
for values in which precision is significant.)</phrase>
The <phrase diff="del" dg="fa1-fix"><termref def="dt-order-relation"/></phrase><phrase diff="add" dg="fa1-fix">order relation</phrase> on <term>decimal</term>
is the order relation on real numbers, restricted
to this subset.</phrase></termdef></p>

<note diff="del" dg="partialfix">
<p>All <termref def="dt-minimally-conforming"/> processors
<termref def="dt-must"/> support decimal numbers with a minimum of
<phrase dg="rq31m">18</phrase><!--*
* material suppressed here by diff group rq31m *
*--> decimal digits 
(i.e., <phrase dg="rq31m">with a 
<termref def="dt-totalDigits"/></phrase> of 18<!--*
* material suppressed here by diff group rq31m *
*-->).  However,
<termref def="dt-minimally-conforming"/> processors <termref def="dt-may"/> set
an application-defined limit on the maximum number of decimal digits
they are prepared to support, in which case that application-defined
maximum number <termref def="dt-must"/> be clearly documented.</p>
</note>

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

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


<p diff="del" dg="rq31m.add.rq21-lexmaps.del">
The mapping from lexical representations to values is the usual
one for decimal numerals; it is given formally in:
<defsetsum ref="defs-decimalLexmap"/>
</p>

<p diff="add" 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 *
*-->
<!--*
* material suppressed here by diff group rq21-lexmaps.add.b3246.del *
*-->

<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>

<p dg="rq31m.add.rq21-lexmaps.del">
The mapping from values to <termref def="dt-canonical-representation">canonical representations</termref> 
is given formally in:
<defsetsum ref="defs-decimalCanmap"/>
</p>

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

</div4>

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

<div4 id="decimal-facets">
<head><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="decimal-derived-types">
<head><phrase diff="del" dg="rq31m">Derived datatypes</phrase><phrase diff="add" dg="rq31m">Datatypes based on decimal</phrase></head>
<subtypes/>
</div4>
</div3>

<div3 id="precisionDecimal" diff="add" 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 
<!--*
* material suppressed here by diff group b3249b *
*-->
values for positive and negative infinity and 
<phrase 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<!--*
* material suppressed here by diff group b3249c *
*--><phrase dg="b3249c">
and values</phrase>
are included<phrase 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 
<!--*
* material suppressed here by diff group b3249b *
*--><phrase 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 dg="b3249c"><string>NaN</string> is</phrase> the lexical
representation of the <dtref ref="precisionDecimal"/> value <!--*
* material suppressed here by diff group b3249c *
*--> whose <pfref ref="vp-pd-numVal"/> 
<!--*
* material suppressed here by diff group b3249c *
*--><phrase dg="b3249c">property 
has the <termref def="dt-specialvalue"/></phrase>
<pt>notANumber</pt><!--*
* material suppressed here by diff group b3249c *
*-->.  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 <!--*
* material suppressed here by diff group b3249c *
*--><phrase dg="b3249c">values</phrase> whose
<pfref ref="vp-pd-numVal"/> <!--*
* material suppressed here by diff group b3249c *
*--><phrase dg="b3249c">properties have
the <termref def="dt-specialvalue">special values</termref></phrase> <pt>positiveInfinity</pt> and
<pt>negativeInfinity</pt>.  These three <!--*
* material suppressed here by diff group b3249c *
*--><phrase 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 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 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 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 diff="add" dg="flfix">The
</phrase><term>float</term><phrase diff="add" dg="flfix"> datatype</phrase>
is<phrase diff="del" dg="flfix"> patterned after</phrase><phrase diff="add" dg="b5229"> 
patterned after</phrase> the IEEE 
single-precision 32-bit floating point <phrase diff="add" dg="flfix">data</phrase>type
<bibref ref="ieee754"/><phrase diff="del" dg="b5229"><!--*
* material suppressed here by diff group flfix *
*--></phrase>.<phrase diff="del" dg="flfix">  The
basic <phrase dg="rq140"><termref def="dt-value-space"/> of
<term>float</term> consists of the values
<emph role="eq">m × 2^e</emph></phrase><!--*
* material suppressed here by diff group rq140 *
*-->, 
where <var>m</var>
is an integer whose absolute value is less than
<phrase dg="rq140"><emph role="eq">2^24</emph></phrase><!--*
* material suppressed here by diff group rq140 *
*-->, and <var>e</var> is an integer
between -149 and 104, inclusive.  In addition to the basic
<phrase dg="rq140"><termref def="dt-value-space"/></phrase><!--*
* material suppressed here by diff group rq140 *
*--> described above, the
<termref def="dt-value-space"/> of <term>float</term> also contains the
following <phrase dg="rq140">three</phrase> 
<phrase dg="b3249b"><emph>special values</emph></phrase><!--*
* material suppressed here by diff group b3249b *
*-->: 
<!--*
* material suppressed here by diff group rq140 *
*-->
positive and negative infinity<!--*
* material suppressed here by diff group rq140 *
*--> 
and not-a-number (NaN). 
<phrase dg="rq140">The
<phrase dg="fa1-fix"><termref def="dt-order-relation"/></phrase><!--*
* material suppressed here by diff group fa1-fix *
*--> on <term>float</term>
is: <emph role="eq">x &lt; y iff y - x</emph> is positive
for <var>x</var> and <var>y</var> in the value space.</phrase>
<!--*
* material suppressed here by diff group rq140 *
*-->
Positive infinity is greater than all other non-NaN 
values<phrase dg="rq140">.</phrase><!--*
* material suppressed here by diff group rq140 *
*-->
NaN equals itself but is incomparable with (neither greater than nor less than)
any other value in the <termref def="dt-value-space"/>.
<!--*
* material suppressed here by diff group rq140 *
*--></phrase></termdef><phrase diff="add" dg="flfix"> 
<phrase 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 <!--*
* material suppressed here by diff group b3252 *
*-->are often used to 
approximate arbitrary real numbers.</phrase></p>

<note diff="del" dg="flfix">
<p dg="rq140">
"Equality" in this Recommendation is defined to be "identity" (i.e.,
values that are identical in the <termref def="dt-value-space"/> are
equal and vice versa). Identity must be used for the few operations
that are defined in this Recommendation. Applications using any of the
datatypes defined in this Recommendation may use different definitions
of equality for computational purposes; 
<bibref ref="ieee754"/>-based computation systems are examples. Nothing in
this Recommendation should be construed as requiring that such
applications use identity as their equality relationship when
computing.
</p>

<p>
Any value 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 other
<term>float</term> values are 
<termref def="dt-incomparable">comparable</termref> with it, 
the result is a <termref def="dt-value-space"/>
either having NaN as its only member (the inclusive cases) or that is empty
(the exclusive cases). 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.
</p>

<p>
This datatype differs from that of <bibref ref="ieee754"/> in that there is only one
NaN<phrase dg="rq140"> and only one zero</phrase>. 
This makes the equality and ordering of values in the data
space differ from that of <bibref ref="ieee754"/> <phrase dg="rq140">only</phrase>
in that for schema purposes NaN = NaN.
</p>
</note>

<p dg="flfix" diff="del">
A <termref def="dt-literal"/> in the <termref def="dt-lexical-space"/> representing a
decimal number <emph role="eq">d</emph> maps to the normalized value
in the <termref def="dt-value-space"/> of <term>float</term> that is
closest to <emph role="eq">d</emph> in the sense defined by
<bibref ref="clinger1990"/>; if <emph role="eq">d</emph> is
exactly halfway between two such values then the even value is chosen.
</p>

<div4 dg="flfix" diff="add"><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 <!--*
* material suppressed here by diff group b3249b *
*--><phrase 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
<!--*
* material suppressed here by diff group b3813 *
*--><phrase 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 <!--*
* material suppressed here by diff group b3222 *
*--><phrase dg="b3222">equivalent</phrase>
for purposes of enumerations and
identity constraints, <!--*
* material suppressed here by diff group b3222 *
*--><phrase 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
<!--*
* material suppressed here by diff group wgi-20080530 *
*--><phrase 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 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 role="1.0" id="float-lexical-representation" dg="flfix" diff="del">
<head>Lexical representation</head>
<p>
<term>float</term> values have a lexical representation
consisting of a mantissa followed, optionally, by the character
<string>E</string> or <string>e</string>, 
followed by an exponent.  The exponent <termref def="dt-must"/>
be an <dtref ref="integer"/>.  The mantissa must be a 
<dtref ref="decimal"/> number.  The representations
for exponent and mantissa must follow the lexical rules for
<dtref ref="integer"/> and <dtref ref="decimal"/>.  If the 
<string>E</string> or <string>e</string> and
the following exponent are omitted, an exponent value of 0 is assumed.
</p>
<p>
The <phrase dg="b3249b"><emph>special values</emph></phrase><!--*
* material suppressed here by diff group b3249b *
*-->
positive
and negative infinity and not-a-number have lexical representations
<code>INF</code>, <code>-INF</code> and
<code>NaN</code>, respectively.
Lexical representations for zero may take a positive or negative sign.
</p>
<p>
For example, <code>-1E4, 1267.43233E12, 12.78e-2, 12</code>
<code>, -0, 0</code>
and <code>INF</code> are all legal <termref def="dt-literal">literals</termref> for <term>float</term>.
</p>
</div4>

<div4 role="1.0" id="float-canonical-representation" dg="flfix" diff="del">
<head>Canonical representation</head>
<p dg="rq001">
The <termref def="dt-canonical-representation"/> for <term>float</term> is defined by
prohibiting certain options from the
<specref ref="float-lexical-representation"/>.  Specifically, the exponent
must be indicated by "E".  Leading zeroes and the preceding optional "+" sign
are prohibited in the exponent. 
If the exponent is zero, it must be indicated by "E0".
For the mantissa, the preceding optional "+" sign is prohibited
and the decimal point is required.
Leading and trailing zeroes are prohibited subject to the following:
number representations must
be normalized such that there is a single digit
which is non-zero
to the left of the decimal point and at least a single digit to the
right of the decimal point
unless the value being represented is zero. The <termref def="dt-canonical-representation"/> 
for zero is 0.0E0.
</p>

<!--* 2005-02-03 MSM sighs at the use of "mantissa" in the following
paragraph, which he believes is not quite right. The dictionary of
mathematics at mathworld.wolfram.com says

    For a real number x, the mantissa is defined as the positive
    fractional part x-\left\lfloor{x}\right\rfloor ={\tt frac(x)}, 
    where \left\lfloor{x}\right\rfloor denotes the floor function. 

But it's what the WG approved.  If an editorial proposal is made
to change it, change the other occurrences, too (e.g. in double).
*-->
<!--*
* material suppressed here by diff group rq001 *
*-->
</div4>

<div4 dg="flfix" diff="add"><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 dg="b3659"> (after whitespace is
removed from the regular expression)</phrase>:

<!--*
* material suppressed here by diff group b3659 *
*-->
<display 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 dg="b3025">is a function,</phrase>
satisfies the requirements of
<bibref ref="ieee754"/>, and correctly handles the 
<phrase dg="b3249b">mapping of the literals
<string>INF</string>, <string>NaN</string>, etc., to the</phrase>
<!--*
* material suppressed here by diff group b3249b *
*--><phrase dg="b3249b"><termref def="dt-specialvalue">special values</termref></phrase><!--*
* material suppressed here by diff group b3249b *
*-->,
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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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<phrase diff="del" dg="flfix"> patterned after</phrase><phrase diff="add" dg="b5229"> 
patterned after</phrase> the
IEEE double-precision 64-bit floating point <phrase diff="add" dg="flfix">data</phrase>type
<bibref ref="ieee754"/><phrase diff="del" dg="b5229"><!--*
* material suppressed here by diff group flfix *
*--></phrase>.<phrase diff="del" dg="flfix">  
<phrase dg="rq140">The basic <termref def="dt-value-space"/>
of <term>double</term> consists of the values
<emph role="eq">m × 2^e</emph>, </phrase><!--*
* material suppressed here by diff group rq140 *
*-->
where <emph role="eq">m</emph>
is an integer whose absolute value is less than
2<sup>53</sup>, and <var>e</var> is an
integer between -1075 and 970, inclusive.  In addition to the basic
<phrase dg="rq140"><termref def="dt-value-space"/></phrase><!--*
* material suppressed here by diff group rq140 *
*--> described above, the
<termref def="dt-value-space"/> of <term>double</term> also contains
the following
<phrase dg="rq140">three</phrase>
<phrase dg="b3249b"><emph>special values</emph></phrase><!--*
* material suppressed here by diff group b3249b *
*-->:
<!--*
* material suppressed here by diff group rq140 *
*-->
positive and negative infinity<!--*
* material suppressed here by diff group rq140 *
*-->
and not-a-number
(NaN).
<phrase dg="rq140">The 
<phrase dg="fa1-fix"><termref def="dt-order-relation"/></phrase><!--*
* material suppressed here by diff group fa1-fix *
*--> on <term>double</term>
is: <emph role="eq">x &lt; y iff y - x</emph> is positive
for x and y in the value space.</phrase>
<!--*
* material suppressed here by diff group rq140 *
*-->
Positive infinity is greater than all other non-NaN 
values<phrase dg="rq140">.</phrase><!--*
* material suppressed here by diff group rq140 *
*-->
NaN equals itself but is incomparable with (neither greater than nor less than)
any other value in the <termref def="dt-value-space"/>.
<!--*
* material suppressed here by diff group rq140 *
*--></phrase></termdef><phrase diff="add" dg="flfix"> 
<phrase dg="b3252">Each floating
point datatype has a value space that is a subset of the
rational numbers.  </phrase>Floating point numbers <!--*
* material suppressed here by diff group b3252 *
*-->are often used to 
approximate arbitrary real numbers.</phrase></p>

<note diff="add" 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>

<note diff="del" dg="flfix">
<p dg="rq140">
"Equality" in this Recommendation is defined to be "identity" (i.e.,
values that are identical in the <termref def="dt-value-space"/> are
equal and vice versa). Identity must be used for the few operations
that are defined in this Recommendation. Applications using any of the
datatypes defined in this Recommendation may use different definitions
of equality for computational purposes; 
<bibref ref="ieee754"/>-based computation systems are examples. Nothing in
this Recommendation should be construed as requiring that such
applications use identity as their equality relationship when
computing.
</p>

<p>
Any value 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 other
<term>double</term> values are 
<termref def="dt-incomparable">comparable</termref> with it, 
the result is a <termref def="dt-value-space"/>
either having NaN as its only member (the inclusive cases) or that is empty
(the exclusive cases). 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.

</p>

<p>
This datatype differs from that of <bibref ref="ieee754"/> in that
there is only one NaN<phrase dg="rq140"> and only one
zero</phrase>. This makes the equality and ordering of values in the
data space differ from that of <bibref ref="ieee754"/> 
<phrase dg="rq140">only</phrase> in that for schema purposes 
NaN = NaN.
</p>
</note>
<p diff="del" dg="flfix">
A <termref def="dt-literal"/> in the <termref def="dt-lexical-space"/> representing a
decimal number <emph role="eq">d</emph> maps to the normalized value
in the <termref def="dt-value-space"/> of <term>double</term> that is
closest to <emph role="eq">d</emph>; if <emph role="eq">d</emph> is
exactly halfway between two such values then the even value is chosen.
This is the <emph>best approximation</emph> of <emph role="eq">d</emph>
(<bibref ref="clinger1990"/>, <bibref ref="gay1990"/>), which is more
accurate than the mapping required by <bibref ref="ieee754"/>.
</p>

<div4 dg="flfix" diff="add"><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 <!--*
* material suppressed here by diff group b3249b *
*--><phrase 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
<!--*
* material suppressed here by diff group b3813 *
*--><phrase 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><!--*
* material suppressed here by diff group b3222 *
*--><phrase 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
<!--*
* material suppressed here by diff group wgi-20080530 *
*--><phrase 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 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 role="1.0" id="double-lexical-representation" diff="del" dg="flfix">
<head>Lexical representation</head>
<p>
<term>double</term> values have a lexical representation
consisting of a mantissa followed, optionally, by the character "E" or
"e", followed by an exponent.  The exponent <termref def="dt-must"/> be
an integer.  The mantissa must be 
a <dtref ref="decimal"/> number.  The representations
for exponent and mantissa must follow the lexical rules for
<dtref ref="integer"/> and 
<dtref ref="decimal"/>.  If the <string>E</string> or <string>e</string> and
the following exponent are omitted, an exponent value of 0 is assumed.
</p>
<p>
The <phrase dg="b3249b"><emph>special values</emph></phrase><!--*
* material suppressed here by diff group b3249b *
*-->
positive
and negative infinity and not-a-number have lexical representations
<code>INF</code>, <code>-INF</code> and
<code>NaN</code>, respectively.
Lexical representations for zero may take a positive or negative sign.
</p>
<p>
For example, <code>-1E4, 1267.43233E12, 12.78e-2, 12</code>
<code>, -0, 0</code>
and <code>INF</code>
are all legal <termref def="dt-literal">literals</termref> for <term>double</term>.
</p>
</div4>

<div4 id="double-canonical-representation" diff="del" dg="flfix">
<head>Canonical representation</head>
<p dg="rq001">
The <termref def="dt-canonical-representation"/> for <term>double</term> is defined by
prohibiting certain options from the
<specref ref="double-lexical-representation"/>.  Specifically, the exponent
must be indicated by "E".  Leading zeroes and the preceding optional "+" sign
are prohibited in the exponent.
If the exponent is zero, it must be indicated by "E0".
For the mantissa, the preceding optional "+" sign is prohibited
and the decimal point is required.
Leading and trailing zeroes are prohibited subject to the following:
number representations must
be normalized such that there is a single digit
which is non-zero
to the left of the decimal point and at least a single digit to the
right of the decimal point
unless the value being represented is zero. The <termref def="dt-canonical-representation"/> 
for zero is 0.0E0.
</p>
<!--*
* material suppressed here by diff group rq001 *
*-->
</div4>

<div4 dg="flfix" diff="add"><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 dg="b3659">
(after whitespace is eliminated from the expression)</phrase>:

<!--*
* material suppressed here by diff group b3659 *
*-->
<display 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 dg="b3025">is a function,</phrase>
satisfies the requirements of
<bibref ref="ieee754"/>, and correctly handles the 
<phrase dg="b3249b">mapping of the literals
<string>INF</string>, <string>NaN</string>, etc., to the</phrase>
<!--*
* material suppressed here by diff group b3249b *
*--><phrase dg="b3249b"><termref def="dt-specialvalue">special values</termref></phrase><!--*
* material suppressed here by diff group b3249b *
*-->,
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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>
 
<div3 id="duration">
<head>duration</head>

<p diff="del" dg="du0">
<termdef id="del-dt-duration" term="duration" role="local">
<term>duration</term> represents a duration of time.  The 
<termref def="dt-value-space"/> of <term>duration</term> is a six-dimensional
space where the coordinates designate the Gregorian year, month, day,
hour, minute, and second components defined in § 5.5.3.2 of
<bibref ref="ISO8601"/>, respectively.  These components are ordered
in their significance by their order of appearance i.e. as year,
month, day, hour, minute, and second.  </termdef></p>

<!--* !!! 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.
    *-->
<note id="del-year-sec-conformance" diff="del" dg="du0.ysc">
<p>
All <termref def="dt-minimally-conforming"/> processors 
<termref def="dt-must"/> support year values with a minimum of 4 digits (i.e.,
<code>YYYY</code>) and a minimum fractional second precision of
milliseconds or three decimal digits (i.e. <code>s.sss</code>).
However, <termref def="dt-minimally-conforming"/> processors 
<termref def="dt-may"/> set an application-defined limit on the maximum number
of digits they are prepared to support in these two cases, in which
case that application-defined maximum number <termref def="dt-must"/>
be clearly documented.
</p>
</note>
<!--* 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 diff="add" 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 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 diff="add" 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 <!--*
* material suppressed here by diff group b3255 *
*--><phrase 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>

<div4 id="duration-lexical-repr" diff="del" dg="du0">
<head>Lexical representation</head>
<p>
The lexical representation for <term>duration</term> is the
<bibref ref="ISO8601"/> extended format 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, where
<var>n</var>Y represents the number of years, <var>n</var>M the
number of months, <var>n</var>D the number of days, 'T' is the
date/time separator, <var>n</var>H the number of hours,
<var>n</var>M the number of minutes and <var>n</var>S the
number of seconds.  The number of seconds can include decimal digits
to arbitrary precision.</p>
<p>
The values of the
Year, Month, Day, Hour and Minutes components are not restricted but
allow an arbitrary
<!--*
* material suppressed here by diff group errata-2e *
*--> 
integer<!--*
* material suppressed here by diff group errata-2e *
*-->.
Similarly, the value of the Seconds component
allows an arbitrary <!--*
* material suppressed here by diff group errata-2e *
*--> decimal.
<!--*
* material suppressed here by diff group errata-2e *
*-->
Thus, the lexical representation of
<term>duration</term> does not follow the alternative
format of § 5.5.3.2.1 of <bibref ref="ISO8601"/>.</p>
<p>
An optional preceding minus sign ('-') is
allowed, to indicate a negative duration.  If the sign is omitted a
positive duration is indicated. See also <specref ref="isoformats"/>.
</p>
<p>
For example, to indicate a duration of 1 year, 2 months, 3 days, 10
hours, and 30 minutes, one would write: <code>P1Y2M3DT10H30M</code>.
One could also indicate a duration of minus 120 days as:
<code>-P120D</code>.
</p>
<p>
Reduced precision and truncated representations of this format are allowed
provided they conform to the following:
</p>
<ulist>
<item>
<p>
If the number of years, months, days, hours, minutes, or seconds in any
expression equals zero, the number and its corresponding designator <termref def="dt-may"/>
be omitted.  However, at least one number and its designator <termref def="dt-must"/>
be present.
</p>
</item>
<item>
<p>
The seconds part <termref def="dt-may"/> have a decimal fraction.
</p>
</item>
<!-- INTERIOR FIELDS DISALLOWED FOR TIME INSTANT NOT DURATION
<item>If a field is omitted either all fields to its left or to its right
must be omitted i.e. interior fields cannot be omitted.</item>  -->
<item>
<p>
The designator 'T' <!--*
* material suppressed here by diff group errata-2e *
*--><phrase dg="errata-2e">shall</phrase>
be absent if <!--*
* material suppressed here by diff group errata-2e *
*--> all of the time items are absent.
The designator 'P' must always be present.
</p>
</item>
</ulist>
<p>
For example, P1347Y, P1347M and P1Y2MT2H are all allowed;
P0Y1347M and P0Y1347M0D are allowed. P-1347M is not allowed although
-P1347M is allowed.  P1Y2MT is not allowed.
</p>

</div4>

<div4 id="duration-lexical-space" diff="add" dg="du0"><head>Lexical <!--*
* material suppressed here by diff group b3736 *
*--><phrase 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 
<!--*
* material suppressed here by diff group b3659 *
*-->
<display 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):
<!--*
* material suppressed here by diff group b3659 *
*-->
<eg 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>



<div4 id="duration-order" diff="del" dg="du0">
<head>Order relation on duration</head>
<p>
In general, the <termref def="dt-order-relation"/> on <term>duration</term>
is a partial order since there is no determinate relationship between certain
durations such as one month (P1M) and 30 days (P30D).
The <termref def="dt-order-relation"/>
of two <term>duration</term> values <emph role="eq">x</emph> and
<emph role="eq">y</emph> is <emph role="eq">x &lt; y iff s+x &lt; s+y</emph>
for each qualified <dtref ref="dateTime"/> <emph role="eq"> s</emph>
in the list below.  These values for <var>s</var> cause the greatest deviations in the addition of
dateTimes and durations.  Addition of durations to time instants is defined
in <specref ref="adding-durations-to-dateTimes"/>.
<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>
</p>
<p>
The following table shows the strongest relationship that can be determined
between example durations. The symbol &lt;&gt; means that the order relation is
indeterminate.  <phrase dg="noleap">Note that because of leap-seconds, 
a seconds field can vary
from 59 to 60. However, because of the way that addition is defined in
<specref ref="adding-durations-to-dateTimes"/>, they are still totally ordered.</phrase>
</p>
 <table border="1" cellspacing="0" cellpadding="4">
	<tbody>
    <tr>
      <th colspan="1" rowspan="1"> </th>
      <th colspan="7" style="background-color:#FFFF99" rowspan="1">Relation</th>
    </tr>
    <tr>
      <td style="background-color:#FFFF99" colspan="1" rowspan="1">P<strong>1Y</strong></td>
      <td colspan="1" rowspan="1">&gt; P<strong>364D</strong></td>
      <td colspan="1" rowspan="1">&lt;&gt; P<strong>365D</strong></td>
      <td colspan="3" rowspan="1"> </td>
      <td colspan="1" rowspan="1">&lt;&gt; P<strong>366D</strong></td>
      <td colspan="1" rowspan="1">&lt; P<strong>367D</strong></td>
    </tr>
    <tr>
      <td style="background-color:#FFFF99" colspan="1" rowspan="1">P<strong>1M</strong></td>
      <td colspan="1" rowspan="1">&gt; P<strong>27D</strong></td>
      <td colspan="1" rowspan="1">&lt;&gt; P<strong>28D</strong></td>
      <td colspan="2" rowspan="1">&lt;&gt; P<strong>29D</strong></td>
      <td colspan="1" rowspan="1">&lt;&gt; P<strong>30D</strong></td>
      <td colspan="1" rowspan="1">&lt;&gt; P<strong>31D</strong></td>
      <td colspan="1" rowspan="1">&lt; P<strong>32D</strong></td>
    </tr>
    <tr>
      <td style="background-color:#FFFF99" colspan="1" rowspan="1">P<strong>5M</strong></td>
      <td colspan="1" rowspan="1">&gt; P<strong>149D</strong></td>
      <td colspan="1" rowspan="1">&lt;&gt; P<strong>150D</strong></td>
      <td colspan="1" rowspan="1">&lt;&gt; P<strong>151D</strong></td>
      <td colspan="2" rowspan="1">&lt;&gt; P<strong>152D</strong></td>
      <td colspan="1" rowspan="1">&lt;&gt; P<strong>153D</strong></td>
      <td colspan="1" rowspan="1">&lt; P<strong>154D</strong></td>
    </tr>
    </tbody>
  </table>
<p>
Implementations are free to optimize the computation of the ordering relationship. For example, the following table can be used to
compare durations of a small number of months against days.
</p>
  <table border="1" cellspacing="0" cellpadding="2">
  	<tbody>
    <tr>
      <th align="center" colspan="1" rowspan="1"> </th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">Months</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">1</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">2</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">3</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">4</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">5</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">6</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">7</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">8</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">9</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">10</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">11</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">12</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">13</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">...</th>
    </tr>
    <tr>
      <th align="center" rowspan="2" style="background-color: #FFFF99" colspan="1">Days</th>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">Minimum</th>
      <td align="center" colspan="1" rowspan="1">28</td>
      <td align="center" colspan="1" rowspan="1">59</td>
      <td align="center" colspan="1" rowspan="1">89</td>
      <td align="center" colspan="1" rowspan="1">120</td>
      <td align="center" colspan="1" rowspan="1">150</td>
      <td align="center" colspan="1" rowspan="1">181</td>
      <td align="center" colspan="1" rowspan="1">212</td>
      <td align="center" colspan="1" rowspan="1">242</td>
      <td align="center" colspan="1" rowspan="1">273</td>
      <td align="center" colspan="1" rowspan="1">303</td>
      <td align="center" colspan="1" rowspan="1">334</td>
      <td align="center" colspan="1" rowspan="1">365</td>
      <td align="center" colspan="1" rowspan="1">393</td>
      <td align="center" colspan="1" rowspan="1">...</td>
    </tr>
    <tr>
      <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">Maximum</th>
      <td align="center" colspan="1" rowspan="1">31</td>
      <td align="center" colspan="1" rowspan="1">62</td>
      <td align="center" colspan="1" rowspan="1">92</td>
      <td align="center" colspan="1" rowspan="1">123</td>
      <td align="center" colspan="1" rowspan="1">153</td>
      <td align="center" colspan="1" rowspan="1">184</td>
      <td align="center" colspan="1" rowspan="1">215</td>
      <td align="center" colspan="1" rowspan="1">245</td>
      <td align="center" colspan="1" rowspan="1">276</td>
      <td align="center" colspan="1" rowspan="1">306</td>
      <td align="center" colspan="1" rowspan="1">337</td>
      <td align="center" colspan="1" rowspan="1">366</td>
      <td align="center" colspan="1" rowspan="1">397</td>
      <td align="center" colspan="1" rowspan="1">...</td>
    </tr>
	</tbody>
  </table>
</div4>

<div4 id="facet-comparison-for-durations" diff="del" dg="du0">
<head>Facet Comparison for durations</head>
<p>In comparing <term>duration</term>
values with <compref ref="f-mii"/>,  <compref ref="f-mie"/>,
<compref ref="f-mai"/> and <compref ref="f-mae"/> facet values,
indeterminate comparisons should be considered as "false".
</p>
<!--* 
<p>In comparing <term>duration</term>
values with <compref ref="dc-minInclusive"/>,  <compref ref="dc-minExclusive"/>,
<compref ref="dc-maxInclusive"/> and <compref ref="dc-maxExclusive"/> facet values,
indeterminate comparisons should be considered as "false".
</p>
*-->
</div4>

<!--* 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.
    *-->
<div4 id="total-order-durations" diff="del" dg="du0">
<head>Totally ordered durations</head>
<p>
Certain derived datatypes of durations can be guaranteed have a total order. For
this, they must have fields from only one row in the list below and the time zone
must either be required or prohibited.
</p>
<ulist>
<item><p>year, month</p></item>
<item><p>day, hour, minute, second</p></item>
</ulist>
<p>
For example, a datatype could be defined to correspond to the
<bibref ref="SQL"/> datatype Year-Month interval that required a four digit
year field and a two digit month field but required all other fields to be unspecified.  This datatype could be defined as below and would have a total order.
</p>
<eg xml:space="preserve">&lt;simpleType name='SQL-Year-Month-Interval'&gt;
    &lt;restriction base='duration'&gt;
      &lt;pattern value='P\p{Nd}{4}Y\p{Nd}{2}M'/&gt;
    &lt;/restriction&gt;
&lt;/simpleType&gt;</eg>
</div4>

<div4 id="duration-facets"><head><phrase diff="del" dg="rec12-tableaux">constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

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

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

<p dg="dt2" diff="del">
<termdef id="dt-dateTime" term="dateTime" role="local">
<term>dateTime</term> values 
may be viewed as objects with integer-valued
year, month, day, hour and minute properties,
a decimal-valued second property,
and a boolean timezoned property.
Each such object also has one decimal-valued
method or computed property, timeOnTimeline,
whose value is always a decimal
number; the values are dimensioned in seconds,
the integer 0 is 0001-01-01T00:00:00 and the value
of timeOnTimeline for other <term>dateTime</term>
values is computed using the Gregorian algorithm<phrase dg="noleap">
as modified for leap-seconds</phrase>.
The timeOnTimeline values form two related
"timelines", one for timezoned
values and one for non-timezoned values.
Each timeline is a copy of the <termref def="dt-value-space"/>
of <dtref ref="decimal"/>,
with integers given units of seconds.
</termdef></p>
<!--* 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" diff="add"><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>

<p diff="del" dg="dt2">
The <termref def="dt-value-space"/> of
<term>dateTime</term> is closely related
to the dates and times described in ISO 8601.
For clarity, the text above specifies a
particular origin point for the timeline.
It should be noted, however, that schema processors need not expose the
timeOnTimeline value to schema users, and there is no requirement that a
timeline-based implementation use the particular origin described here in
its internal representation.
Other interpretations of the <termref def="dt-value-space"/> which lead to the
same results (i.e., are isomorphic) are of course acceptable.
</p>

<p diff="del" dg="dt2">
All timezoned times are Coordinated Universal Time 
(<termref def="dt-utc"/>, sometimes called
"Greenwich Mean Time"). 
<!--*
* material suppressed here by diff group fa1-fix *
*-->
Other timezones indicated in lexical representations
are converted to <termref def="dt-utc"/>
during conversion of literals to values.
"Local" or untimezoned times are presumed to be
the time in the timezone of some
unspecified locality as prescribed
by the appropriate legal authority;
currently there are no legally prescribed
timezones which are durations
whose magnitude is greater than 14 hours.
The value of each numeric-valued property
(other than timeOnTimeline) is limited to
the maximum value within the interval
determined by the next-higher property.
For example, the day value can never be 32,
and cannot even be 29 for month 02 and year 2002 (February 2002).
</p>

<note id="year-zero" diff="del" dg="dt2">
 <p>The date and time datatypes described in this recommendation were inspired
by <bibref ref="ISO8601"/>.  '0001' is the lexical
representation of the year 1 of the Common Era
(1 CE, sometimes written "AD 1" or "1 AD").  There
is no year 0, and '0000' is not a valid lexical representation.
'-0001' is the lexical representation of the year 1 Before
Common Era (1 BCE, sometimes written "1 BC").</p>

<p>Those using this (1.0) version of this Recommendation to
represent negative years should be aware that the interpretation of lexical
representations beginning with a <code>'-'</code> is likely to change in
subsequent versions.</p>
<p>
 <bibref ref="ISO8601"/>
makes no mention of the year 0; in <bibref ref="ISO8601-1998"/>
the form '0000' was disallowed and this recommendation disallows it as well.
However, <bibref ref="ISO8601-2000"/>, which became
available just as we were completing version
1.0, allows the form '0000', representing the year
1 BCE.  A number of external commentators
have also suggested that '0000' be
allowed, as the lexical representation for 1 BCE,
which is the normal usage in
astronomical contexts.  
 It is the intention of the XML Schema
Working Group to allow '0000' as a lexical representation in the
<term>dateTime</term>, <term>date</term>, <term>gYear</term>, and
<term>gYearMonth</term> datatypes in a subsequent version
of this Recommendation. '0000' will be the lexical representation of 1
BCE (which is a leap year), '-0001' will become the lexical representation of 2
BCE (not 1 BCE as in this (1.0) version), '-0002' of 3 BCE, etc.
</p>
</note>

<note diff="del" dg="dt2">
<p>See the conformance note in <phrase dg="partialfix"><specref ref="year-sec-conformance"/></phrase><!--*
* material suppressed here by diff group partialfix *
*-->
which applies to this datatype as well.</p>
</note>

<div4 id="dateTime-value-space" diff="add" 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 dg="b3256">before the year 1
in the proleptic Gregorian calendar, traditionally referred to as 
1 BC or as</phrase>
1 BCE<phrase dg="b3256">,</phrase> was represented by a 
<pfref ref="vp-dt-year"/> value of −1, 2 BCE by −2, and so
forth. <phrase 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 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 dg="b3256">.</phrase><!--*
* material suppressed here by diff group b3256 *
*-->
<phrase dg="b3256">If</phrase> existing
schemas or data specify dates of 29 February for any years before the
common era<phrase 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"/>
<!--*
* material suppressed here by diff group b3257 *
*--><phrase 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>

<div4 role="1.0" id="dateTime-lexical-representation" diff="del" dg="dt2">
<head>Lexical representation</head>

<p>
The <termref def="dt-lexical-space"/> of <term>dateTime</term> consists of
finite-length sequences of characters of the form:
<code>'-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?</code>,
where 
</p>
 <ulist>
  <item><p>'-'? <emph>yyyy</emph> is a
four-or-more digit optionally negative-signed
numeral that represents the year; if more than four digits, leading zeroes
are prohibited, and '0000' is prohibited
(see the Note above <specref ref="year-zero"/>;
also note that a plus sign is <strong>not</strong> permitted);</p></item>
  <item><p>the remaining '-'s are separators between
parts of the date portion;</p></item>
  <item><p>the first <emph>mm</emph> is a two-digit
numeral that represents the month;</p></item>
  <item><p><emph>dd</emph> is a two-digit numeral
that represents the day;</p></item>
  <item><p>'T' is a separator indicating that time-of-day follows;</p></item>
  <item><p><emph>hh</emph> is a two-digit numeral
that represents the hour; '24' is permitted if the
minutes and seconds represented are zero,
and the <term>dateTime</term> value so
represented is the first instant of the following day (the hour property of a
<term>dateTime</term> object in the
<termref def="dt-value-space"/> cannot have
a value greater than 23);</p></item>
  <item><p>':' is a separator between parts of the time-of-day portion;</p></item>
  <item><p>the second <emph>mm</emph> is a 
two-digit numeral that represents the minute;</p></item>
  <item><p><emph>ss</emph> is a two-integer-digit numeral that represents the
whole seconds;</p></item>
  <item><p>'.' <emph>s+</emph> (if present) represents the
fractional seconds;</p></item>
  <item><p><emph>zzzzzz</emph> (if present) represents
the timezone (as described below).</p></item>
 </ulist>

<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 2002-10-10T17:00:00Z,
five hours later than 2002-10-10T12:00:00Z.
</p>

<p>
For further guidance on arithmetic with <term>dateTime</term>s and durations,
see <specref ref="adding-durations-to-dateTimes"/>.
</p>
</div4>

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

<p>
Except for trailing fractional zero digits in the seconds representation,
'24:00:00' time representations,
and timezone (for timezoned values), the mapping
from literals to values is one-to-one. Where there is more than
one possible representation, the <termref def="dt-canonical-representation"/> is as follows:

 <ulist>
  <item><p>The 2-digit numeral representing
the hour must not be '<code>24</code>';</p></item>
  <item><p>The fractional second string, if present,
must not end in '<code>0</code>';</p></item>
  <item><p>for timezoned values, the timezone must be represented with
'<code>Z</code>' (All timezoned <term>dateTime</term> values are
<termref def="dt-utc"/>.).</p></item>
 </ulist>
</p>
</div4>

<div4 id="dateTime-lexical-mapping" diff="add" dg="dt2">
<head>Lexical Mapping<!--*
* material suppressed here by diff group b3736 *
*--></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><!--*
* material suppressed here by diff group b3258 *
*--><phrase 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 *
*-->.
<!--*
* material suppressed here by diff group b3659 *
*-->
<eg 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 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>

<div4 role="1.0" id="dateTime-timezones" diff="del" dg="dt2">
<head>Timezones</head>

<p>
Timezones are durations with (integer-valued) hour and minute properties
(with the hour magnitude limited to at most 14, and the minute magnitude
limited to at most 59, except that if the hour magnitude is 14, the minute
value must be 0); they may be both positive or both negative.
</p>

<p>
The lexical representation of a timezone is a string of the form:
<code>(('+' | '-') hh ':' mm) | 'Z'</code>,
where</p>
 <ulist>
  <item><p><emph>hh</emph> is a two-digit numeral 
(with leading zeroes as required) that
represents the hours,</p></item>
  <item><p><emph>mm</emph> is a two-digit
numeral that represents the minutes,</p></item>
  <item><p>'+' indicates a nonnegative duration,</p></item>
  <item><p>'-' indicates a nonpositive duration.</p></item>
 </ulist>
 <p>The mapping so defined is one-to-one, except that '+00:00',
'-00:00', and 'Z' all represent the same zero-length duration
timezone, <termref def="dt-utc"/>; 'Z' is its <termref def="dt-canonical-representation"/>.</p>

<p>
When a timezone is added to a <termref def="dt-utc"/>
<term>dateTime</term>, the result is the date
and time "in that timezone".  For example, 2002-10-10T12:00:00+05:00 is
2002-10-10T07:00:00Z and 2002-10-10T00:00:00+05:00 is 2002-10-09T19:00:00Z.
</p>
</div4>

<div4 role="1.0" id="dateTime-order" diff="del" dg="dt2">
<head>Order relation on dateTime</head>
<p>
<term>dateTime</term> value objects on either
timeline are totally ordered by their timeOnTimeline
values; between the two timelines, <term>dateTime</term>
value objects are ordered by their
timeOnTimeline values when their timeOnTimeline values differ by more than
fourteen hours, with those whose difference is a duration of 14 hours or less
being incomparable.
</p>

<p>
In general, the
<phrase dg="fa1-fix"><termref def="dt-order-relation"/></phrase><!--*
* material suppressed here by diff group fa1-fix *
*--> on <term>dateTime</term>
is a partial order since there is no determinate relationship between certain
instants. For example, there is no determinate ordering between
(a) 2000-01-20T12:00:00 and (b) 2000-01-20T12:00:00<strong>Z</strong>. Based on
timezones currently in use, (c) could vary from 2000-01-20T12:00:00+12:00 to
2000-01-20T12:00:00-13:00. It is, however, possible for this range to expand or
contract in the future, based on local laws. Because of this, the following
definition uses a somewhat broader range of indeterminate values:
+14:00..-14:00.</p>

<p>The following definition uses the notation S[year] to represent the year
field of S, S[month] to represent the month field, and so on. The notation (Q
&amp; "-14:00") means adding the timezone -14:00 to Q, where Q did not
already have a timezone. <emph>This is a
logical explanation of the process. Actual
implementations are free to optimize as
long as they produce the same results.</emph>
</p>

<p>
The ordering between two <term>dateTime</term>s P
and Q is defined by the following algorithm:
</p>
  <p>A.Normalize P and Q. That is, if there is a timezone present, but
  it is not Z, convert it to Z using the addition operation defined in
  <specref ref="adding-durations-to-dateTimes"/></p>
  <ulist>
    <item><p>Thus 2000-03-04T23:00:00+03:00
normalizes to 2000-03-04T20:00:00Z</p></item>
  </ulist>
  <p>B. If P and Q either both have a time zone or both do not have a time
   zone, compare P and Q field by field from the year field down to the
   second field, and return a result as soon
as it can be determined. That is:</p>
  <olist>
    <item><p>For each i in {year, month, day, hour, minute, second}
      <olist>
        <item><p>If P[i] and Q[i] are both
not specified, continue to the next i</p></item>
        <item><p>If P[i] is not specified
and Q[i] is, or vice versa, stop and return
          P &lt;&gt; Q</p></item>
        <item><p>If P[i] &lt; Q[i], stop and return P &lt; Q</p></item>
        <item><p>If P[i] &gt; Q[i], stop and return P &gt; Q</p></item>
      </olist>
	</p>
    </item>
    <item><p>Stop and return P = Q</p></item>
  </olist>
  <p>C.Otherwise, if P contains a time zone and Q does not, compare
  as follows:
 </p>
    <olist>
      <item><p>P &lt; Q if P &lt; (Q with time zone +14:00)</p></item>
      <item><p>P &gt; Q if P &gt; (Q with time zone -14:00)</p></item>
      <item><p>P &lt;&gt; Q otherwise, that is, if (Q with time zone
+14:00) &lt; P &lt; (Q with time zone -14:00)</p></item>
     </olist>
   <p>D. Otherwise, if P does not contain a time zone and Q does, compare
  as follows:</p>
    <olist>
      <item><p> P &lt; Q if (P with time zone -14:00) &lt; Q.</p></item>
      <item><p> P &gt; Q if (P with time zone +14:00) &gt; Q.</p></item>
      <item><p> P &lt;&gt; Q otherwise, that is, if (P with
time zone +14:00) &lt; Q &lt; (P with time zone -14:00)</p></item>
    </olist>
<p>Examples:</p>
    <table border="1" cellspacing="0" cellpadding="4">
	<tbody>
      <tr>
        <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">Determinate</th>
        <th align="center" style="background-color: #FFFF99" colspan="1" rowspan="1">Indeterminate</th>
      </tr>
      <tr>
        <td align="center" colspan="1" rowspan="1">2000-01-15T00:00:00
<strong>&lt;</strong> 2000-02-15T00:00:00</td>
        <td align="center" colspan="1" rowspan="1">2000-01-01T12:00:00 <strong>&lt;&gt;</strong>
          1999-12-31T23:00:00Z</td>
      </tr>
      <tr>
        <td align="center" colspan="1" rowspan="1">2000-01-15T12:00:00
<strong>&lt;</strong> 2000-01-16T12:00:00Z</td>
        <td align="center" colspan="1" rowspan="1">2000-01-16T12:00:00 <strong>&lt;&gt;</strong>
          2000-01-16T12:00:00Z</td>
      </tr>
      <tr>
        <td align="center" colspan="1" rowspan="1"> </td>
        <td align="center" colspan="1" rowspan="1">2000-01-16T00:00:00
<strong>&lt;&gt;</strong> 2000-01-16T12:00:00Z</td>
      </tr>
      </tbody>
    </table>
</div4>

<div4 role="1.0" id="totally-ordered-instants" diff="del" dg="dt2">
<!--* 2005-02-07 : MSM experiments with restoring this section.
    * I won't lie down in the road for it, though. *-->
<!-- Let' just make the new para a note in the value space subsection -DP -->
<head>Totally ordered dateTimes</head>
<p>Certain derived types from <term>dateTime</term>
can be guaranteed have a total order. To
do so, they must require that a specific
set of fields are always specified, and
that remaining fields (if any) are always unspecified. For example, the date
datatype without time zone is defined to contain exactly year, month, and day.
Thus dates without time zone have a total order among themselves.
</p>
</div4>

<div4 id="dateTime-facets">
<head><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="time">
<head>time</head>
<p dg="dt2" diff="del">
<termdef id="dt-time" term="time" role="local"><term>time</term>
represents an instant of time that recurs every day.  The
<termref def="dt-value-space"/> of <term>time</term> is the space
of <emph>time of day</emph> values as defined in § 5.3 of
<bibref ref="ISO8601"/>.  Specifically, it is a set of zero-duration daily
time instances.</termdef>
</p>

<p diff="add" 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>

<p diff="del" dg="dt2">
Since the lexical representation allows an optional time zone
indicator, <term>time</term> values are partially ordered because it may
not be able to determine the order of two values one of which has a
time zone and the other does not.  The order relation on
<term>time</term> values is the
<specref ref="dateTime-order"/> using an arbitrary date. See also
<specref ref="adding-durations-to-dateTimes"/>.  Pairs
of <term>time</term> values with or without time
zone indicators are totally ordered.
</p>

<note diff="del" dg="dt2">
<p>See the conformance note in <phrase dg="partialfix"><specref ref="year-sec-conformance"/></phrase><!--*
* material suppressed here by diff group partialfix *
*-->
which applies to <phrase dg="partialfixfix">the seconds part 
of </phrase>this datatype as well.</p>
</note>

<div4 id="time-value-space" diff="add" 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>

<!--*
* material suppressed here by diff group b3027 *
*-->
<p 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>

<div4 role="1.0" id="time-lexical-repr" dg="dt2" diff="del">
<head>Lexical representation</head>
<p>
The lexical representation for <term>time</term> is the left
truncated lexical representation for <dtref ref="dateTime"/>:
hh:mm:ss.sss with optional
following time zone indicator.  For example,
to indicate 1:20 pm for Eastern
Standard Time which is 5 hours behind
Coordinated Universal Time (<termref def="dt-utc"/>),
one would write: 13:20:00-05:00. See also
<specref ref="isoformats"/>.
</p>
</div4>

<div4 role="1.0" id="time-canonical-repr" dg="dt2" diff="del">
<head>Canonical representation</head>
<p>
The <termref def="dt-canonical-representation"/> for <term>time</term> is defined
by prohibiting certain options from the
<specref ref="time-lexical-repr"/>. 
Specifically, either the time zone must
be omitted or, if present,  the time zone must be Coordinated Universal
Time (<termref def="dt-utc"/>) indicated by a "Z".
Additionally, the <termref def="dt-canonical-representation"/> for midnight is 00:00:00.
</p>
</div4>

<div4 id="time-lexical-mapping" diff="add" 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><!--*
* material suppressed here by diff group b3659 *
*-->
<phrase 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 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="date">
<head>date</head>
<p><termdef id="dt-date" term="date" role="local">
<phrase dg="dt2" diff="del">The
<termref def="dt-value-space"/> of <term>date</term>
consists of 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), i.e. '00:00:00', up
to but not including '24:00:00' (which is
identical with
'00:00:00'</phrase><phrase dg="dt2" diff="add"><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>

<p dg="dt2" diff="del">
A "date object" is an object with year,
month, and day properties just like those
of <dtref ref="dateTime"/> objects, plus
an optional <emph>timezone-valued</emph>
timezone property. (As with values of <dtref ref="dateTime"/> timezones are a
special case of durations.)
Just as a <dtref ref="dateTime"/> object corresponds to a point on one of the
timelines, a <term>date</term> object corresponds to an interval on one
of the two timelines as just described.
</p>

<p dg="dt2" diff="del">
Timezoned <term>date</term> values track the starting moment of their day, as
determined by their timezone; said timezone is generally recoverable for
<termref def="dt-canonical-representation">canonical representations</termref>.
<termdef id="recoverable-timezone" term="recoverable timezone" role="local">
The <term>recoverable timezone</term> is that duration which
is the result of subtracting the first moment (or any moment) of the timezoned
<term>date</term> from the first moment (or the
corresponding moment) <termref def="dt-utc"/> on the
same <term>date</term>.</termdef> <termref def="recoverable-timezone"/>s are
always durations between '+12:00' and
'-11:59'.  This "timezone normalization"
(which follows automatically from the definition of the <term>date</term>
<termref def="dt-value-space"/>) is explained more in
<specref ref="date-lexical-representation"/>.
</p>

<p dg="dt2" diff="del">
For example: the first moment of 2002-10-10+13:00 is 2002-10-10T00:00:00+13,
which is 2002-10-09T11:00:00Z, which is also the first moment of 2002-10-09-11:00.
Therefore 2002-10-10+13:00 is 2002-10-09-11:00;
<emph>they are the same interval</emph>.
</p>

<note dg="dt2" diff="del">
<p>
For most timezones, either the first moment or last moment of the day (a
<dtref ref="dateTime"/> value, always
<termref def="dt-utc"/>) will have a <term>date</term> portion
different from that of the <term>date</term> itself!
However, noon of that <term>date</term> (the midpoint of the interval) in that
(normalized) timezone will always have the same <term>date</term> portion as the
<term>date</term> itself, even when that noon point in time is normalized to
<termref def="dt-utc"/>.  For example,
2002-10-10-05:00 begins during 2002-10-09Z and 2002-10-10+05:00
ends during 2002-10-11Z, but noon of both 2002-10-10-05:00 and 2002-10-10+05:00
falls in the interval which is 2002-10-10Z.
</p>
</note>

<!--* 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.
    *-->
<note diff="del" dg="dt2">
 <p>See the conformance note in <specref ref="year-sec-conformance"/> which
applies to the year part of this datatype as well.</p>
</note>

<div4 id="date-value-space" diff="add" 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>

<div4 role="1.0" id="date-lexical-representation" diff="del" dg="dt2">
<head>Lexical representation</head>

<p>
For the following discussion, let the
"date portion" of a <dtref ref="dateTime"/>
or <term>date</term> object be an object
similar to a <dtref ref="dateTime"/> or
<term>date</term> object, with similar year, month, and day properties, but no
others, having the same value for these properties as the original
<dtref ref="dateTime"/> or <term>date</term> object.
</p>

<p>
The <termref def="dt-lexical-space"/> of
<term>date</term> consists of finite-length
sequences of characters of the form:
<code>'-'? yyyy '-' mm '-' dd zzzzzz?</code>
where the <term>date</term> and optional timezone are represented exactly the
same way as they are for <dtref ref="dateTime"/>.  The first moment of the
interval is that represented by:
<code>'-' yyyy '-' mm '-' dd 'T00:00:00' zzzzzz?</code>
and the least upper bound of the interval is the timeline point represented
(noncanonically) by:
<code>'-' yyyy '-' mm '-' dd 'T24:00:00' zzzzzz?</code>.
</p>

<note>
<p>
The <termref def="recoverable-timezone"/> of a <term>date</term> will always be
a duration between '+12:00' and 
'11:59'.  Timezone lexical representations, as
explained for <dtref ref="dateTime"/>, can range from '+14:00' to '-14:00'.
The result is that literals of <term>date</term>s with very large or very
negative timezones will map to a "normalized" <term>date</term> value with a
<termref def="recoverable-timezone"/>
different from that represented in the original
representation, and a matching difference
of +/- 1 day in the <term>date</term> itself.
</p>
</note>
</div4>

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

<p>
Given a member of the <term>date</term> <termref def="dt-value-space"/>, the
<term>date</term> portion of the <termref def="dt-canonical-representation"/> (the
entire representation for nontimezoned values, and all but the
timezone representation for timezoned values) is always the
<term>date</term> portion of the <dtref ref="dateTime"/>
<termref def="dt-canonical-representation"/> of the
interval midpoint (the <dtref ref="dateTime"/> representation,
truncated on the right to
eliminate 'T' and all following characters). For timezoned values,
append the canonical representation of the <termref def="recoverable-timezone"/>.
</p>
</div4>

<div4 id="date-lexical-mapping" diff="add" dg="dt2">
<head>Lexical Mapping<!--*
* material suppressed here by diff group b3736 *
*--></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 *
*-->:
<!--*
* material suppressed here by diff group b3659 *
*-->
<display 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>

<p dg="dt2" diff="del">
<termdef id="dt-gYearMonth" term="gYearMonth" role="local">
<term>gYearMonth</term> represents a specific gregorian month in a specific 
gregorian year.  The <termref def="dt-value-space"/> of
<term>gYearMonth</term> is the set of Gregorian calendar months as defined
in § 5.2.1 of <bibref ref="ISO8601"/>.  Specifically, it is a set
of one-month long, non-periodic instances e.g. 1999-10 to represent the whole
month of 1999-10, independent of how many days this month has.</termdef></p>

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

<p dg="dt2" diff="del">Since the lexical representation allows an optional
time zone indicator, <term>gYearMonth</term> values are partially ordered
because it may not be possible to unequivocally determine the order of two
values one of which has a time zone and the other does not.  If
<term>gYearMonth</term> values are considered as periods of time, the order
relation on <term>gYearMonth</term> values is the order relation on their
starting instants. This is discussed in <specref ref="dateTime-order"/>. 
See also <specref ref="adding-durations-to-dateTimes"/>.  Pairs of
<term>gYearMonth</term> values with or without time zone indicators are
totally ordered.</p>

<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>

<note diff="del" dg="dt2">
<p>See the conformance note in 
<phrase dg="partialfix"><specref ref="year-sec-conformance"/></phrase><!--*
* material suppressed here by diff group partialfix *
*-->
which applies to the year part of this datatype as well.</p>
</note>

<div4 id="gYearMonth-value-space" diff="add" 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
<phrase diff="del" dg="dt3">representation</phrase><phrase diff="add" dg="dt3">Mapping<!--*
* material suppressed here by diff group b3736 *
*--></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-->

<p dg="dt2" diff="del">
The lexical representation for <term>gYearMonth</term> is the reduced
(right truncated) lexical representation for <dtref ref="dateTime"/>:
CCYY-MM.  No left truncation is allowed.  An optional following time
zone qualifier is allowed.  To accommodate year values outside the
range from 0001 to 9999, additional digits
can be added to the left of this representation and a
preceding "-" sign is allowed.
</p>

<p dg="dt2" diff="del">
For example, to indicate the month of May 1999, one would write: 1999-05.
See also <specref ref="isoformats"/>.
</p>

<p dg="dt2" diff="add">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:
<!--*
* material suppressed here by diff group b3659 *
*-->
<display 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 *
*-->

<p diff="del" dg="dt3.add.rq21-lexmaps.del">The 
<termref def="dt-lexical-mapping"/> and <termref def="dt-canonical-mapping"/> 
for <dtref ref="gYearMonth"/> are the following functions:

<defsetsum ref="defs-gYearMonthLexmap"/>
<defsetsum ref="defs-gYearMonthCanmap"/>
</p>

<p diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

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

<p dg="dt2" diff="del">
<termdef id="dt-gYear" term="gYear" role="local">
<term>gYear</term> represents a
gregorian calendar year.  The <termref def="dt-value-space"/> of
<term>gYear</term> is the set of Gregorian calendar years as defined in
§ 5.2.1 of <bibref ref="ISO8601"/>. Specifically, it is a set of one-year
long, non-periodic instances
e.g. lexical 1999 to represent the whole year 1999, independent of
how many months and days this year has.</termdef>
</p>

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

<p dg="dt2" diff="del">
Since the lexical representation allows an optional time zone
indicator, <term>gYear</term> values are partially ordered because it may
not be possible to unequivocally determine
the order of two values one of which has a
time zone and the other does not.  If
<term>gYear</term> values are considered as periods of time, the order relation
on <term>gYear</term> values is the order relation on their starting instants.
This is discussed in <specref ref="dateTime-order"/>.  See also
<specref ref="adding-durations-to-dateTimes"/>.  Pairs of 
<term>gYear</term> values with or without time
zone indicators are totally ordered.
</p>
<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>
 <note diff="del" dg="dt2">
 <p>See the conformance note in <specref ref="year-sec-conformance"/> which
applies to the year part of this datatype<phrase dg="wdd">
as well</phrase>.</p>
</note>

<div4 id="gYear-value-space" diff="add" 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 
<phrase diff="del" dg="dt3">representation</phrase><phrase diff="add" dg="dt3">Mapping<!--*
* material suppressed here by diff group b3736 *
*--></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> *-->

<p diff="del" dg="dt2">
The lexical representation for <term>gYear</term> is the reduced (right
truncated) lexical representation for <dtref ref="dateTime"/>: CCYY.
No left truncation is allowed.  An optional following time
zone qualifier is allowed as for <dtref ref="dateTime"/>.   To
accommodate year values outside the range from 0001 to 9999, additional
digits can be added to the left of this representation and a preceding
"-" sign is allowed.
</p>
<p dg="dt2" diff="del">
For example, to indicate 1999, one would write: 1999.
See also <specref ref="isoformats"/>.
</p>

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

<p dg="dt2" diff="add">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"/><!--*
* material suppressed here by diff group b3848 *
*--> <nt def="nt-tzFrag"/>?</rhs>
</prod></defset>

The <nt def="nt-gYearRep"/> is equivalent to this regular expression:
<!--*
* material suppressed here by diff group b3659 *
*-->
<display 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 *
*-->

<p diff="del" dg="dt3.add.rq21-lexmaps.del">The <termref def="dt-lexical-mapping"/> 
and <termref def="dt-canonical-mapping"/> 
for <dtref ref="gYear"/> are the following functions:

<defsetsum ref="defs-gYearLexmap"/>
<defsetsum ref="defs-gYearCanmap"/>

</p>


<p diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

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

<p dg="dt2" diff="del">
<termdef id="dt-gMonthDay" term="gMonthDay" role="local">
<term>gMonthDay</term> is a gregorian date that recurs, specifically a day of
the year such as the third of May.  Arbitrary recurring dates are not
supported by this datatype.  The <termref def="dt-value-space"/> of
<term>gMonthDay</term> is the set of <emph>calendar
dates</emph>, as defined in § 3 of <bibref ref="ISO8601"/>.  Specifically,
it is a set of one-day long, annually periodic instances.
</termdef>
</p>

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

<p diff="add" 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 dg="b3259">  (Obviously,
days beyond 28 cannot occur in all Februaries; 29 is nonetheless
permitted.)</phrase></p>

<p diff="add" 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>

<p dg="dt3" diff="del">
Since the lexical representation allows an optional time zone
indicator, <term>gMonthDay</term> values are partially ordered because it may
not be possible to unequivocally determine the order of two values one of which has a
time zone and the other does not.  If
<term>gMonthDay</term> values are considered as periods of time,
in an arbitrary leap year, the order relation
on <term>gMonthDay</term> values is the order relation on their starting instants.
This is discussed in <specref ref="dateTime-order"/>.  See also
<specref ref="adding-durations-to-dateTimes"/>.  Pairs of <term>gMonthDay</term> values with or without time zone indicators are totally ordered.
</p>

<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" diff="add" 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 
<phrase diff="del" dg="dt3">representation</phrase><phrase diff="add" dg="dt3">Mapping<!--*
* material suppressed here by diff group b3736 *
*--></phrase></head>

<p dg="dt2" diff="del">
The lexical representation for <term>gMonthDay</term> is the left
truncated lexical representation for <dtref ref="date"/>: --MM-DD.
An optional following time
zone qualifier is allowed as for <dtref ref="date"/>.
No preceding sign is allowed.  No other formats are
allowed. See also <specref ref="isoformats"/>.
</p>

<p dg="dt2" diff="add">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
    *-->
<!--*
* material suppressed here by diff group b3659 *
*-->
<!--* 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 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 *
*-->

<p diff="del" dg="dt2">This datatype can be used to represent a
specific day in a month.  To say, for example, that my birthday occurs
on the 14th of September ever year.
</p>

<p diff="del" dg="dt3.add.rq21-lexmaps.del">The 
<termref def="dt-lexical-mapping"/> and <termref def="dt-canonical-mapping"/> 
for <dtref ref="gMonthDay"/> are the following functions:

<defsetsum ref="defs-gMonthDayLexmap"/>
<defsetsum ref="defs-gMonthDayCanmap"/>

</p>

<p diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

<div3 id="gDay">
<head>gDay</head>
<p diff="del" dg="dt1">
<termdef id="del-dt-gDay" term="gDay" role="local">
<term>gDay</term> is a gregorian day that recurs, specifically a day
of the month such as the 5th of the month.  Arbitrary recurring days
are not supported by this datatype.  The <termref def="dt-value-space"/>
of <term>gDay</term> is the space of a set of <emph>calendar
dates</emph> as defined in § 3 of <bibref ref="ISO8601"/>.  Specifically,
it is a set of one-day long, monthly periodic instances.
</termdef>
</p>
<p><termdef diff="add" 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 <phrase diff="del" dg="dt1">can
be</phrase><phrase diff="add" dg="dt1">is</phrase> used to represent a specific day of the month.
To <phrase diff="del" dg="dt1">say, for example, that I get my paycheck</phrase><phrase diff="add" dg="dt1">indicate, for example, that an employee gets a paycheck</phrase> on the 15th of each month.  <phrase diff="add" dg="dt1">(Obviously, days
beyond 28 cannot occur in <emph>all</emph> months; they are nonetheless permitted, up to 31.)</phrase></p>

<p diff="del" dg="dt1">
Since the lexical representation allows an optional time zone
indicator, <term>gDay</term> values are partially ordered because it may
not be possible to unequivocally determine the order of two values one of
which has a time zone and the other does not.  If
<term>gDay</term> values are considered as periods of time,
<phrase>in an arbitrary month that has 31 days,</phrase>
the order relation
on <term>gDay</term> values is the order relation on their starting instants.
This is discussed in <specref ref="dateTime-order"/>.  See also
<specref ref="adding-durations-to-dateTimes"/>.  Pairs of <term>gDay</term>
values with or without time zone indicators are totally ordered.
</p>

<!-- 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 diff="add" dg="dt1"><term>gday</term> </phrase>values<phrase diff="del" dg="dt1">
of this type</phrase> do not, in general, have any straightforward or
intuitive representation in terms of most 
<phrase diff="del" dg="dt1">other</phrase><phrase diff="add" dg="dt1">non-Gregorian</phrase> 
calendars. 
<phrase diff="del" dg="dt1">This 
type</phrase><phrase diff="add" dg="dt1"><term>gday</term></phrase> 
should therefore be used with caution in contexts where conversion to 
other calendars is desired.</p>
</note>

<div4 diff="add" 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>

<div4 id="gDay-lexical-repr" diff="del" dg="dt1">
<head>Lexical 
<phrase dg="dt3">representation</phrase><!--*
* material suppressed here by diff group dt3 *
*--></head>
<p>
The lexical representation for <term>gDay</term> is the left
truncated lexical representation for <dtref ref="date"/>: ---DD .
An optional following time
zone qualifier is allowed as for <dtref ref="date"/>.  No preceding sign is
allowed. No other formats are allowed.  See also <specref ref="isoformats"/>.
</p>
</div4>

<div4 id="gDay-lexical-mapping" diff="add" dg="dt1">
<head>Lexical Mapping<!--*
* material suppressed here by diff group b3736 *
*--></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:
<!--*
* material suppressed here by diff group b3659 *
*-->
<display 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><phrase diff="del" dg="rec12-tableaux">constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

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

<p dg="dt2" diff="del">
<termdef id="dt-gMonth" term="gMonth" role="local">
<term>gMonth</term> is a gregorian month that recurs every year.
The <termref def="dt-value-space"/>
of <term>gMonth</term> is the space of a set of <emph>calendar
months</emph> as defined in § 3 of <bibref ref="ISO8601"/>.  Specifically,
it is a set of one-month long, yearly periodic instances.
</termdef>
</p>

<p><phrase dg="dt2" diff="del">This datatype can be used to represent a 
specific month.  To say, for example, that Thanksgiving falls in the month of
November.</phrase><phrase dg="dt2" diff="add"><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 -->

<p dg="dt2" diff="del">
Since the lexical representation allows an optional time zone
indicator, <term>gMonth</term> values are partially ordered because it may
not be possible to unequivocally determine the order of two values one of which has a
time zone and the other does not.  If
<term>gMonth</term> values are considered as periods of time, the order relation
on <term>gMonth</term> is the order relation on their starting instants.
This is discussed in <specref ref="dateTime-order"/>.  See also
<specref ref="adding-durations-to-dateTimes"/>.  Pairs of <term>gMonth</term>
values with or without time zone indicators are totally ordered.
</p>

<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" diff="add" 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 
<phrase diff="del" dg="dt3">representation</phrase><phrase diff="add" dg="dt3">Mapping<!--*
* material suppressed here by diff group b3736 *
*--></phrase></head>

<p dg="dt2" diff="del">
The lexical representation for <term>gMonth</term> is the left
and right truncated lexical representation for <dtref ref="date"/>: --MM.
An optional following time
zone qualifier is allowed as for <dtref ref="date"/>.  No preceding sign is
allowed. No other formats are allowed.  See also <specref ref="isoformats"/>.
</p><p dg="dt2" diff="add">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:
<!--*
* material suppressed here by diff group b3659 *
*-->
<display 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 *
*-->

<p diff="del" dg="dt3.add.rq21-lexmaps.del">The 
<termref def="dt-lexical-mapping"/> and <termref def="dt-canonical-mapping"/>
for <dtref ref="gMonth"/> are defined as follows:

<defsetsum ref="defs-gMonthLexmap"/>
<defsetsum ref="defs-gMonthCanmap"/>

</p>

<p diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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 diff="add" 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 diff="add" 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 diff="add" 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>
<!--*
* material suppressed here by diff group b1910-hexbin *
*--></div4>

<div4 role="1.0" id="hexBinary-facets">
<head><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" dg="b1911-b64b">arbitrary</phrase>
Base64-encoded <phrase diff="del" dg="b1911-b64b">arbitrary</phrase> binary
data.  <phrase diff="del" dg="b1911-b64b">The <termref def="dt-value-space"/> of 
<term>base64Binary</term> is the set
of finite-length sequences of <!--*
* material suppressed here by diff group b5625 *
*--> binary octets.</phrase> 
For <term>base64Binary</term> data the entire binary stream is encoded
using the Base64 <phrase diff="del" dg="wd-19">Alphabet
in <bibref ref="RFC2045"/></phrase><phrase diff="add" 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 diff="add" 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 diff="add" dg="b1911-b64b">Lexical
<!--*
* material suppressed here by diff group b3736 *
*--><phrase dg="b3736">Mapping</phrase></phrase></head>

<p>The <phrase diff="del" dg="b1911-b64b">lexical forms</phrase><phrase diff="add" 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 
<bibref ref="RFC2045" diff="del" dg="wd-19"/><bibref ref="RFC3548" diff="add" 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 
<phrase diff="del" dg="b1911-b64b">the characters defined in <bibref ref="XML"/> as 
white space</phrase><phrase diff="add" 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 <phrase diff="del" dg="b1911-b64b">b</phrase><phrase diff="add" 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 diff="add" dg="wd-19">required by <bibref ref="RFC3548"/> and is
not</phrase> mandated in the <phrase diff="del" dg="b1911-b64b">lexical forms</phrase><phrase diff="add" dg="b1911-b64b"><termref def="dt-lexical-representation">lexical representations</termref></phrase> of
<term>base64Binary</term> data<phrase diff="del" dg="wd-19"> and
</phrase><phrase diff="add" dg="wd-19">. It</phrase> <phrase diff="del" dg="wd-19">must not</phrase><phrase diff="add" 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 <phrase diff="del" dg="b1911-b64b">given by the following grammar (the notation is that
used in <bibref ref="XML"/>); legal lexical forms must
match</phrase><phrase diff="add" dg="b1911-b64b">the set of literals
which <termref def="dt-match"/></phrase> the <term>Base64Binary</term> production.
</p>
<p diff="del" dg="b1911-b64b">
<code>Base64Binary  ::=  ((B64S B64S B64S B64S)*<br/>
                     ((B64S B64S B64S B64) |<br/>
                      (B64S B64S B16S '=') |<br/>
                      (B64S B04S '=' #x20? '=')))?<br/><br/>B64S         ::= B64 #x20?<br/><br/>
B16S         ::= B16 #x20?<br/><br/>
B04S         ::= B04 #x20?</code>
<code>
<br/><br/>
B04         ::=  [AQgw]<br/>
B16         ::=  [AEIMQUYcgkosw048]<br/>
B64         ::=  [A-Za-z0-9+/]
</code>
</p>
<p diff="add" 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 <phrase diff="del" dg="b1911-b64b">lexical form</phrase><phrase diff="add" 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
<phrase diff="del" dg="b1911-b64b">lexical form</phrase><phrase diff="add" dg="b1911-b64b"><termref def="dt-lexical-representation"/></phrase>; <phrase diff="del" dg="b1911-b64b">strings</phrase><phrase diff="add" dg="b1911-b64b">literals</phrase> which do not meet these constraints
are not legal <phrase diff="del" dg="b1911-b64b">lexical forms</phrase><phrase diff="add" 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 <phrase dg="b1911-b64b">b</phrase><!--*
* material suppressed here by diff group b1911-b64b *
*-->ase64 decoders</phrase>.
</p>
<p diff="add" 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 diff="add" dg="wd-19">and less restrictive than <bibref ref="RFC3548"/>.</phrase> <phrase diff="del" dg="wd-19">this</phrase><phrase diff="add" dg="wd-19">This</phrase> is
not an issue in practice.  Any string compatible with <phrase diff="del" dg="wd-19">the</phrase><phrase diff="add" 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 diff="add" 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 <phrase diff="del" dg="b1911-b64b">lexical form</phrase><phrase diff="add" dg="b1911-b64b"><termref def="dt-lexical-representation"/></phrase> of a <term>base64Binary</term> data value
is the <phrase diff="del" dg="b1911-b64b">b</phrase><phrase diff="add" dg="b1911-b64b">B</phrase>ase64 encoding of the value which matches the
Canonical-base64Binary production in the following grammar:
</p>
<p diff="del" dg="b1911-b64b">
<code>Canonical-base64Binary  ::=  (B64
B64 B64 B64)*<br/>
                               ((B64 B64 B16 '=') | (B64 B04 '=='))?</code>
</p>
<p diff="add" 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 diff="add" 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 <phrase diff="del" dg="b1911-b64b">form</phrase><phrase diff="add" dg="b1911-b64b">representation</phrase></termref> defined above does
not conform to <bibref ref="RFC2045"/>, which requires breaking with
linefeeds at appropriate intervals. <phrase diff="add" 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 <phrase diff="del" dg="b1911-b64b">lexical form</phrase><phrase diff="add" 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 diff="add" dg="wd-19">and
<bibref ref="RFC3548"/></phrase> explicitly 
reference<phrase diff="del" dg="wd-19">s</phrase> 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 <phrase diff="del" dg="wd25">a 
Uniform Resource Identifier Reference
(URI)</phrase><phrase diff="add" 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 
<phrase diff="del" dg="wd25">a URI</phrase><phrase diff="add" dg="wd25">an
IRI</phrase> Reference).  This type should be used 
<phrase diff="del" dg="wd25">to specify the intention 
that</phrase><phrase diff="add" dg="wd25">when</phrase> 
the value fulfills the role of 
<phrase diff="del" dg="wd25">a URI as defined by <bibref ref="RFC2396"/>, as amended by
<bibref ref="RFC2732"/></phrase><phrase diff="add" 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 diff="add" 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><phrase diff="del" dg="wd25">The</phrase> mapping from <term>anyURI</term> 
values to URIs 
<phrase diff="del" dg="wd25">is as defined</phrase><phrase diff="add" dg="wd25">given</phrase> 
by the URI reference escaping procedure defined in
<phrase diff="del" dg="wd25">Section 5.4 
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2001/REC-xlink-20010627/#link-locators">Locator Attribute</xspecref> 
of <bibref ref="XLink"/> (see also Section 
<phrase dg="fpwd">8</phrase><!--*
* material suppressed here by diff group fpwd *
*--> 
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2004/WD-charmod-20040225#sec-URIs">Character Encoding in URI
References</xspecref> of <bibref ref="CharMod"/>)</phrase><phrase diff="add" 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 
<phrase diff="del" dg="wd25"><bibref ref="RFC2396"/>, as amended by <bibref ref="RFC2732"/>, 
where appropriate to identify 
resources</phrase><phrase diff="add" dg="wd25"><bibref ref="RFC3986"/>
and its successor(s)</phrase>.</p>
</note>

<note diff="del" dg="wd25">
<p>
Section 5.4 <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2001/REC-xlink-20010627/#link-locators">Locator Attribute</xspecref>
of <bibref ref="XLink"/> requires that relative URI references be absolutized
as defined in <bibref ref="XBase"/> before use.  This is an XLink-specific
requirement and is not appropriate for XML Schema, since neither the
<termref def="dt-lexical-space"/> nor the <termref def="dt-value-space"/>
of the <dtref ref="anyURI"/> type are restricted to absolute URIs.  Accordingly
absolutization must not be performed by schema processors as part of schema
validation.
</p>
</note>

<note diff="del" dg="wd25">
<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, this specification follows the
lead of <bibref ref="RFC2396"/> (as amended by <bibref ref="RFC2732"/>)
in this matter: such rules and restrictions are not part of type validity
and are not checked by <termref def="dt-minimally-conforming"/> processors.
Thus in practice the above definition imposes only very modest obligations
on <termref def="dt-minimally-conforming"/> processors.
</p>
</note>

<div4 role="1.0" id="anyURI-lexical-representation">
<head>Lexical <phrase diff="del" dg="wd25">representation</phrase><phrase diff="add" 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<phrase diff="del" dg="wd25"> which,
when the algorithm defined in Section 5.4 of <bibref ref="XLink"/> is
applied to them, result in strings which are legal URIs according to
<bibref ref="RFC2396"/>, as amended by <bibref ref="RFC2732"/></phrase>.</p>

<note diff="add" 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 diff="add" dg="wd25">The <termref def="dt-lexical-mapping"/> for <dtref ref="anyURI"/> is
the identity mapping.</p>
<note diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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 diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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-1.0.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 diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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><phrase diff="del" dg="rq120">Derived datatypes</phrase><phrase diff="add" dg="rq120">Other Built-in Datatypes</phrase></head>
<p>
This section gives conceptual definitions for all
<termref def="dt-built-in"/> <termref diff="del" dg="rq120" def="dt-derived"/><!--*
* material suppressed here by diff group rq120c *
*--><termref diff="add" dg="rq120o" def="dt-ordinary"/>
datatypes defined by this specification. The XML representation used to define
<termref diff="del" dg="rq120" def="dt-derived"/> 
<phrase diff="add" dg="ep26"><termref def="dt-ordinary"/></phrase>
datatypes (whether
<termref def="dt-built-in"/> or <termref diff="del" dg="rq120" def="dt-user-derived"/><termref diff="add" dg="rq120" def="dt-user-defined"/>) is
given in <phrase diff="del" dg="rq120">section </phrase><specref ref="xr-defn"/> 
and the complete
definitions of the <termref def="dt-built-in"/> <termref diff="del" dg="rq120" def="dt-derived"/><!--*
* material suppressed here by diff group rq120c *
*--><termref diff="add" dg="rq120o" def="dt-ordinary"/>
datatypes are provided in <phrase diff="del" dg="rq120">Appendix A</phrase><phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" dg="rq100">formal</phrase> 
natural language identifiers<phrase diff="add" dg="rq100">,</phrase> 
as defined 
by <phrase diff="del" dg="b4850"><bibref ref="RFC3066"/><!--*
* material suppressed here by diff group rq100 *
*--></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>
<phrase diff="del" dg="rq100">The <termref def="dt-value-space"/> 
of <term>language</term> is the set of all strings that are 
valid language identifiers as defined
<bibref ref="RFC3066"/>.  </phrase>The 
<phrase diff="add" dg="rq100"><termref def="dt-value-space"/>
and </phrase><termref def="dt-lexical-space"/> of
<term>language</term> 
<phrase diff="del" dg="rq100">is</phrase><phrase diff="add" 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 diff="add" 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 diff="add" 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 
  <!--*
* material suppressed here by diff group b4850 *
*--><phrase 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 diff="add" dg="rq100">
<p><!--*
* material suppressed here by diff group b4850 *
*--><phrase 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 
<!--*
* material suppressed here by diff group b4850 *
*--><phrase dg="b4850">the
subtags</phrase>, but these <!--*
* material suppressed here by diff group b4850 *
*--><phrase dg="b4850">MUST NOT</phrase> be taken 
to carry meaning.<!--*
* material suppressed here by diff group b4850 *
*--></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 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 
<!--*
* material suppressed here by diff group b4850 *
*--><phrase dg="b4850"><bibref ref="BCP47"/></phrase> 
does not follow from the definition of
this datatype given here; applications which require
case-<phrase 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="NMTOKEN-derived-types">
<head><phrase diff="del" dg="rq120">Derived</phrase><phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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 diff="add" 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-1.0.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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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 diff="add" 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-1.0.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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="IDREF-derived-types">
<head><phrase diff="del" dg="rq120">Derived</phrase><phrase diff="add" 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 diff="add" 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-1.0.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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>

<div4 role="1.0" id="ENTITY-derived-types">
<head><phrase diff="del" dg="rq120">Derived</phrase><phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase><phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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 diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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 diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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 diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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 diff="add" 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 diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" 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><phrase diff="del" dg="rec12-tableaux">Constraining facets</phrase>
<phrase diff="add" dg="rec12-tableaux">Facets</phrase></head>
<facets/>
</div4>
</div3>

 <!-- ****************************** BEGIN NEW 1.1 MATERIAL (duration derivatives) ********************************* -->
 

<div3 id="yearMonthDuration" diff="add" 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 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" diff="add" 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 <!--*
* material suppressed here by diff group b3028 *
*--><phrase 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 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 diff="add" 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-1.0.html#key-va">schema-aware processing</xtermref> as 
defined in <bibref ref="structural-schemas"/>.</p>

<p diff="add" 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 <!--*
* material suppressed here by diff group wgi-20080613 *
*--><phrase 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-1.0.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-1.0.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-1.0.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 <phrase diff="del" dg="rec12-main">datatype (</phrase>schema<phrase diff="del" dg="rec12-main">)</phrase> components,
see <xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-1.0.html#components">Schema Component Details</xspecref>
of <bibref ref="structural-schemas"/>.
</p>
 
 <p><termdef term="owner" id="dt-owner" diff="add" 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>
<ulist diff="del" dg="fa1.z">
<item>
<p>
Establishing the <termref def="dt-value-space"/> and <termref def="dt-lexical-space"/>
of a datatype, through
the combined set of <termref def="dt-constraining-facet">constraining facets</termref> specified
in the definition;
</p>
</item>
<item>
<p>
Attaching a unique name (actually a <dtref ref="QName"/>) to the
<termref def="dt-value-space"/> and <termref def="dt-lexical-space"/>.
</p>
</item>
</ulist>
<ulist diff="add" 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>
<phrase diff="del" dg="rec12-main">Datatypes</phrase><phrase diff="add" 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 <phrase diff="del" dg="rec12-main">datatypes</phrase><phrase diff="add" dg="rec12-main"><compref ref="std"/>s</phrase> (those
with no
<propref comp="std" prop="name"/>), <phrase diff="del" dg="rec12-main">datatype definitions</phrase><phrase diff="add" dg="rec12-main"><compref ref="std"/>s</phrase> <phrase diff="del" dg="rec12-main"><termref def="dt-must"/></phrase><phrase diff="add" dg="rec12-main"><rfc2119>must</rfc2119></phrase> be uniquely identified within a
schema.
<phrase diff="add" 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 diff="add" 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 diff="add" dg="b2044"> a subset
(possibly an improper subset) of</phrase> 
the union of the <termref def="dt-value-space">value spaces</termref> 
of each 
<phrase diff="del" dg="rec12-main">datatype</phrase><phrase diff="add" 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 diff="add" 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 diff="add" 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 <phrase diff="del" dg="rec12-main">datatype definitions</phrase><phrase diff="add" 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> *-->
<p diff="del" dg="rec12-main">The value of <propref comp="std" prop="facets"/> consists of the set of
<phrase dg="fa1.z"><termref def="del-dt-facet"/>s</phrase><!--*
* material suppressed here by diff group fa1.z *
*--> 
specified directly in the datatype definition
unioned with the possibly empty set of <propref comp="std" prop="facets"/> of
<propref comp="std" prop="base type definition"/>.
</p>
<p diff="del" dg="rec12-main">
The value of <propref comp="std" prop="fundamental facets"/> consists of the set of
<phrase dg="dpno"><termref def="dt-fundamental-facet"/>s</phrase><!--*
* material suppressed here by diff group dpno *
*--> and their values.
</p>

<p diff="add" 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 diff="add" 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 diff="add" dg="rec12-main"> of <compref ref="std"/>s</phrase>
by <termref diff="del" dg="rq120" def="dt-restriction"/><termref diff="add" dg="rq120" def="dt-fb-restriction"/>, <termref def="dt-list"/> and
<termref def="dt-union"/> respectively<phrase diff="del" dg="rec12-main">.</phrase><phrase diff="add" 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 diff="add" 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" diff="add" dg="rec12-map"/>
 <reprelt eltname="old-simpleType" diff="del" dg="rec12-map"/>
 <reprelt eltname="restriction" diff="add" dg="rec12-map"/>
 <reprelt eltname="list" diff="add" dg="rec12-map"/>
 <reprelt eltname="union" diff="add" 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-1.0.html#key-vv">actual value</xtermref> of the 
<phrase diff="del" dg="rec12-map"><code>name</code></phrase><phrase diff="add" dg="rec12-map"><att>name</att></phrase> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>, if 
present<phrase diff="add" 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-1.0.html#key-null"><phrase diff="del" dg="rec12-map">null</phrase><phrase diff="add" 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-1.0.html#key-vv">actual value</xtermref> of the 
<phrase diff="del" dg="rec12-map"><code>targetNamespace</code></phrase><phrase diff="add" dg="rec12-map"><att>targetNamespace</att></phrase> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref>
of the parent <phrase diff="del" dg="rec12-map"><code>schema</code></phrase><phrase diff="add" dg="rec12-map"><el>schema</el></phrase> element information 
item<phrase diff="add" 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-1.0.html#key-null">absent</xtermref></phrase>.</propmap>
<propmap comp="std" prop="base type definition" diff="add" 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-1.0.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-1.0.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>
<propmap comp="std" prop="final" diff="del" dg="rec12-map">
A <phrase dg="dpno">set</phrase><!--*
* material suppressed here by diff group dpno *
*-->
corresponding to <!--*
* material suppressed here by diff group dpno *
*-->
the <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-1.0.html#key-vv">actual value</xtermref> of the
<phrase dg="dpno"><code>final</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></phrase><!--*
* material suppressed here by diff group dpno *
*-->, 
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-1.0.html#key-vv">actual value</xtermref> of the
<phrase dg="dpno"><code>finalDefault</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></phrase><!--*
* material suppressed here by diff group dpno *
*--> of the ancestor
<phrase dg="dpno"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-1.0.html#element-schema">schema</xtermref>
element information item</phrase><!--*
* material suppressed here by diff group dpno *
*-->, 
if present, <!--*
* material suppressed here by diff group dpno *
*--> 
<phrase dg="dpno">otherwise the empty string, as follows:</phrase>
   <glist dg="dpno">
    <gitem><label>the empty string</label>
     <def><p>the empty set;</p></def></gitem>
    <gitem><label><code>#all</code></label>
     <def><p><emph>{restriction, list, union}</emph>;</p></def></gitem>
    <gitem><label><emph>otherwise</emph></label>
     <def><p>a set with members drawn from the set above, each being present or
absent depending on whether the string contains an equivalently named
space-delimited substring.</p>
      <note dg="dpno">
       <p>Although the <code>finalDefault</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref> of
       <xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-1.0.html#element-schema">schema</xtermref> may include
       values other than
       <pt>restriction</pt>, <pt>list</pt> or <pt>union</pt>, those values
       are ignored in the determination of <propref comp="std" prop="final"/>
       </p>
      </note>
     </def>
    </gitem>
   </glist>
<!--*
* material suppressed here by diff group dpno *
*-->
<!--* 2005-08-27: the following Note was marked diff="add" dg="wdd",
    * but that appears to be in error: the movement of the note
    * from inside the list above, and its rephrasing, were part of
    * the newOrg material, as is clear in 1.7.2.94.  When I
    * fixed a validity error here in v.95, I mislabeled this
    * duplicate note as wdd instead of dpno. -MSM
    *-->
<!--*
* material suppressed here by diff group dpno *
*-->
</propmap>
<propmap comp="std" prop="final" diff="add" 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-1.0.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-1.0.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" diff="add" 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-1.0.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-1.0.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" diff="add" 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>

<propmap comp="std" prop="annotations" diff="del" dg="rec12-map">
<phrase dg="dpno">The annotation corresponding to the <eltref ref="annotation"/>
element information item in the <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref>, if present, otherwise
<xspecref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-1.0.html#key-null">null</xspecref></phrase>
<!--*
* material suppressed here by diff group dpno *
*-->
</propmap>

   <propmap comp="std" prop="facets" diff="add" 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-1.0.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-1.0.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" diff="add" 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" diff="add" dg="rec12-map">
<!--*
* material suppressed here by diff group b3869 *
*-->
<!--*
* material suppressed here by diff group b3869 *
*-->
<!--* 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 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-1.0.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-1.0.html#declare-annotation">XML Representation of Annotation Schema Components</xspecref>
    of <bibref ref="structural-schemas"/>.
</phrase>
</propmap>

</reprcomp>
<p diff="add" 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-1.0.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-1.0.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 diff="add" 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" diff="add" 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" diff="add" 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 diff="add" 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" diff="add" 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-1.0.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-1.0.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" diff="add" 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 diff="add" 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" diff="add" 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-1.0.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-1.0.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" diff="add" 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 <termref diff="del" dg="rq120" def="dt-derived"/> datatype can be 
<termref diff="del" dg="rq120" def="dt-derived"/><termref diff="add" dg="rq120" def="dt-constructed"/> 
from <phrase dg="rq120c">a <termref def="dt-primitive"/> datatype or 
<phrase diff="del" dg="rq120o">another
derived</phrase></phrase><phrase diff="add" dg="rq120">an
<termref def="dt-ordinary"/></phrase> datatype by one of three means:
by <emph><phrase diff="del" dg="rq120">restriction</phrase><phrase diff="add" dg="rq120"><termref def="dt-fb-restriction"/></phrase></emph>, 
by <emph><phrase diff="del" dg="rq120">list</phrase><phrase diff="add" dg="rq120"><termref def="dt-list"/></phrase></emph> 
or by 
<emph><phrase diff="del" dg="rq120">union</phrase><phrase diff="add" 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> *-->

<div4 role="1.0" id="derivation-by-restriction" diff="del" dg="rec12-map">
<head><phrase dg="rq120">Derivation by restriction</phrase><!--*
* material suppressed here by diff group rq120 *
*--></head>
<reprdef>
<reprelt eltname="del-restriction"/>
<reprcomp abstract="Simple Type Definition" ref="dc-defn">
<propmap comp="std" prop="variety">
The 
<phrase dg="dpno"><xtermref xmlns:xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/2008/WD-xmlschema11-1-20080620/structures.diff-1.0.html#key-vv">actual value</xtermref> of</phrase><!--*
* material suppressed here by diff group dpno *
*-->
<propref comp="std" prop="variety"/> of <propref comp="std" prop="base type definition"/>
</propmap>
<propmap comp="std" prop="facets">
<phrase dg="dpno">The <phrase dg="wd-11">union of the </phrase>set of 
<phrase dg="fa1"><specref ref="del.facets"/></phrase><!--*
* material suppressed here by diff group fa1 *
*-->
components</phrase><!--*
* material suppressed here by diff group dpno *
*-->
<phrase dg="rec12-map">resolved</phrase><!--*
* material suppressed here by diff group rec12-map *
*--> to by the 
facet <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref> merged with <propref comp="std" prop="facets"/>
from <propref comp="std" prop="base type definition"/>, subject to 
<phrase dg="dpno">the <phrase dg="fa1">Facet Restriction Valid</phrase><!--*
* material suppressed here by diff group fa1 *
*-->
constraint<phrase dg="fa1">s</phrase> specified in 
<phrase dg="fa1"><specref ref="del.facets"/></phrase><!--*
* material suppressed here by diff group fa1 *
*--></phrase><!--*
* material suppressed here by diff group dpno *
*-->.
</propmap>
<propmap comp="std" prop="base type definition" dg="rec12-map">
The <compref ref="std"/> component resolved 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-1.0.html#key-vv">actual value</xtermref> of the
<phrase dg="dpno"><code>base</code> <xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">attribute</xpropref></phrase><!--*
* material suppressed here by diff group dpno *
*--> 
or the <eltref ref="simpleType"/> <phrase dg="dpno"><xpropref href="http://www.w3.org/TR/xml-infoset/#infoitem.element">children</xpropref></phrase><!--*
* material suppressed here by diff group dpno *
*-->,
whichever is present.
</propmap>
</reprcomp>
</reprdef>

<note role="example">
<p>
An electronic commerce schema might define a datatype called
<emph dg="rq120">Sku</emph><!--*
* material suppressed here by diff group rq120 *
*-->
(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='<phrase dg="rq120">Sku</phrase><!--*
* material suppressed here by diff group rq120 *
*-->'&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, <emph dg="rq120">Sku</emph><!--*
* material suppressed here by diff group rq120 *
*--> is the name of the new
<termref dg="rq120" def="dt-user-derived"/><!--*
* material suppressed here by diff group rq120 *
*--> 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>
</div4>

<div4 role="1.0" id="construction-by-list" diff="del" dg="rec12-map">
<head><phrase dg="rq120">Derivation by list</phrase><!--*
* material suppressed here by diff group rq120 *
*--></head>
<reprdef>
 <reprelt eltname="old-list"/>
<reprcomp abstract="Simple Type Definition" ref="dc-defn">
<propmap comp="std" prop="variety">
list
</propmap>
<propmap comp="std" prop="item type definition">
The <compref ref="std"/> component <phrase dg="rec12-map">resolved</phrase><!--*
* material suppressed here by diff group rec12-map *
*--> 
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-1.0.html#key-vv">actual value</xtermref> of 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">children</xpropref>,
whichever is present.
</propmap>
</reprcomp>
</reprdef>

<p>
A <termref def="dt-list"/> datatype must be <termref dg="rq120" def="dt-derived"/><!--*
* material suppressed here by diff group rq120 *
*-->
from an <termref def="dt-atomic"/> or a <termref def="dt-union"/> datatype,
known as the
<termref def="dt-itemType"/> of the <termref def="dt-list"/> datatype.
This yields a datatype whose <termref def="dt-value-space"/> is composed of
finite-length sequences of <!--*
* material suppressed here by diff group b5625 *
*-->
values from the <termref def="dt-value-space"/> of the
<termref def="dt-itemType"/> and whose <termref def="dt-lexical-space"/> is
composed of space-separated lists of <termref def="dt-literal">literals</termref> of the
<termref def="dt-itemType"/>.
</p>
<note role="example">
<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
<termref dg="rq120" def="dt-user-derived"/><!--*
* material suppressed here by diff group rq120 *
*--> datatype, <dtref ref="float"/> is its
<termref def="dt-itemType"/> and <termref def="dt-list"/> is the
derivation method.
</p>
</note>
<p>
As mentioned in <specref ref="list-datatypes"/>,
when a datatype is derived from a
<termref def="dt-list"/> datatype<!--*
* material suppressed here by diff group rq120 *
*-->, the following
<termref def="dt-constraining-facet">constraining facets</termref> can be used:
</p>
<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>
<!--*
* material suppressed here by diff group b5030 *
*-->
</ulist>
<p>
regardless of the <termref def="dt-constraining-facet">constraining facets<