CINXE.COM

W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes

<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="EN" xml:lang="EN"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes</title> <style type="text/css" xml:space="preserve"> code { font-family: monospace; } div.constraint, div.issue, div.note, div.notice { margin-left: 2em; } ol.enumar { list-style-type: decimal; } ol.enumla { list-style-type: lower-alpha; } ol.enumlr { list-style-type: lower-roman; } ol.enumua { list-style-type: upper-alpha; } ol.enumur { list-style-type: upper-roman; } div.exampleInner pre { margin-left: 1em; margin-top: 0em; margin-bottom: 0em} div.exampleOuter {border: 4px double gray; margin: 0em; padding: 0em} div.exampleInner { background-color: #d5dee3; border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; border-bottom-width: 4px; border-bottom-style: double; border-bottom-color: #d3d3d3; padding: 4px; margin: 0em } div.exampleWrapper { margin: 4px } div.exampleHeader { font-weight: bold; margin: 4px} div.odiff-nsq-add { background-color: #DFDFDF; } div.odiff-nsq-del { display: none; background-color: #FFDFDF } div.idiff-nsq-del { display: none; text-decoration: line-through } div.odiff-nsq-chg { background-color: #DFDFDF } div.diff-nsq-off { } span.odiff-nsq-add { background-color: #DFDFDF; } span.diff-nsq-add { background-color: #DFDFDF; } span.odiff-nsq-del { display: none; background-color: #FFDFDF } span.idiff-nsq-del { display: none; text-decoration: line-through } span.diff-nsq-del { display: none; background-color: #FFDFDF ; text-decoration: line-through } span.odiff-nsq-chg { background-color: #DFDFDF } span.diff-nsq-chg { background-color: #DFFFDF } span.diff-nsq-off { } td.odiff-nsq-add { background-color: #DFDFDF; } td.odiff-nsq-del { display: none; background-color: #FFDFDF } td.odiff-nsq-chg { background-color: #DFDFDF } td.diff-nsq-off { } table { width: 100%; } img { color: white; border: none } span.rfc2119 { font-variant: small-caps } span.nav { float: right} span.arrow { font-style: normal; font-weight: bold } span.enumval { font-style: italic; font-weight: bold } code { font-family: monospace; font-size: 100%} span.propdef { font-weight: bold; font-family: monospace } span.termdef {color: #850021} div.termdef {color: #850021} a.termref:visited, a.termref:link {font-family: sans-serif; font-style: normal; color: black; text-decoration: none } a.eltref:visited, a.eltref:link { font-family: sans-serif; color: black; text-decoration: none } a.propref:visited, a.xpropref:visited, a.propref:link, a.xpropref:link { color: black; text-decoration: none; font-family: sans-serif } div.component {border: 2px solid black; margin-top: 1ex} span.propdef { font-weight: bold; font-family: monospace } div.ownDesc {margin-top: -2ex; margin-bottom: -2ex} a.compref {font-family: sans-serif; font-style: normal; color: black; text-decoration: none} dl.props, dl.psvi {margin-bottom: .5em; margin-top: 0em} div.toc1 {margin-left: 5ex} div.toc2 {margin-left: 2ex} div.tocLine{margin: 0em; text-indent: -6ex} h3.withToc {margin-bottom: 0em} div.constraintnote { margin-top: 1em } div.constraint { margin-left: 1em; } div.constraintlist { margin-left: 1em; margin-bottom: 0em } div.clnumber { text-indent: -1em; margin-top: 0em; margin-bottom: 0em } div.schemaComp { border: 4px double gray; margin: 0em 1em; padding: 0em } div.scHead { border: 4px double gray; border-bottom: 0px; text-align: center; margin-left: 1em; padding: .5em } div.compHeader { margin: 4px; font-weight: bold } span.schemaComp { color: #A52A2A } div.compBody { border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; padding: 4px ; margin: 0em} div.psviDef { border: 4px double gray; margin: 1em 1em; padding: 0em } div.psviHeader { margin: 4px; font-weight: bold } span.psviDef { color: #A52A2A } div.psviBody { border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; padding: 4px ; margin: 0em} div.reprdef { border: 4px double gray; margin: 0em 1em; padding: 0em } div.reprHeader { margin: 4px; font-weight: bold } span.reprdef { color: #A52A2A } div.reprBody, div.reprcompmulti, div.reprdep { border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; padding: 4px ; margin: 0em} div.reprcomp {padding: 4px ; margin: 0em} div.reprHead { text-align: center; } div.mapSep { font-size: 50% ; clear: both} div.mapProp {clear: left; float: left; width: 5em; max-width: 12em; min-width: 5em } div.mapRepr { margin-left: 6.5em } p.element-syntax-1 { font-family: monospace; margin-top: 0em; margin-bottom: .5em } p.element-syntax { font-family: monospace; border-top-width: 1px; border-top-style: solid; border-top-color: #d3d3d3; padding: 4px ; margin: 0em} div.element-syntax-1 { font-family: monospace; margin: 0em; margin-top: 0em; margin-bottom: .5em } div.element-syntax { font-family: monospace; margin: 1em 0em; border-top-width: 1px; border-top-style: solid; border-top-color: #d3d3d3; padding: 4px ; margin: 0em; } div.exampleInner pre { margin-left: 1em; margin-top: 0em; margin-bottom: 0em} div.exampleOuter {border: 4px double gray; margin: 0em; margin-bottom: 0.6em; padding: 0em} div.exampleInner { background-color: #d5dee3; border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; border-bottom-width: 4px; border-bottom-style: double; border-bottom-color: #d3d3d3; padding: 4px; margin: 0em } div.exampleWrapper { margin: 4px } div.exampleHeader { font-weight: bold; margin: 4px} table.restricts { margin-top: 1em; margin-bottom: 1em; margin-left: -2em} table.restricts th { margin-left: 0em } table.ubc td, table.ubc th { font-size: smaller } table.dtdemo th { text-align: center; background-color: #d5dee3} table.dtdemo pre { margin-left: 0em; margin-bottom: 0em} table.dtdemo td {background-color: #bedce6} table.scrap {margin: .5em; background-color: #f5dcb3} table.defset {background-color: #ffeedd } table.defset thead, table.diffed-defset thead { color: red; font-weight: bold } img { color: white; border: none } span.nav { float: right} span.arrow { font-style: normal; font-weight: bold } .shrink {font-size: 80% ; } .defset ul { margin-top: 0 ; margin-bottom: 0 ; } div.defset { margin: 4px ; border-width: 4px ; border-style: double ; border-color: gray ; } div.aux { background-color: #eeeeee ; color: #333333 ; } div.defset-head { font-weight: bold ; padding: 0.6em ; border-bottom-width: 4px ; border-bottom-style: double ; border-color: #cfcfcf ; } div.deftop {background-color: #d5dee3 ; margin-top: 1.5em; padding-bottom: 0.3em } div.defindent { margin-left: 1em ; margin-top: 0em ; margin-bottom: 0em ; } div.defargs { margin-left: 3em ; } div.prod { margin: 1em ; margin-left: 5em ; } .lhs { margin-left: -4em ; } table table, .defset table { margin: 0 ; border: 0 ; padding: 0 ; } .note { margin-left: 2em ; margin-top: 1em ; margin-bottom: 1em ; } div.issue { background-color: #d5bbbb} .giLabel, .pdName { margin-bottom: 0 ; font-weight: bold } .giDef, .pdDef { margin-left: 2.5em ; margin-top: 0} dd > .giDef { margin-left: 0em; } dd > div.giDef > div.p { margin-left: 0em; margin-top: 0em; margin-bottom: 0em;} div.pvlist { border: 4px double gray; margin-bottom: .5em; margin-left: 1em; padding: .5em; padding-right: 1em; padding-bottom: 1em } div.pvVal div.pvlist { border: 4px double gray; margin-top: 1.2em; margin-bottom: .5em; /* margin-left: -5em; */ margin-left: -1.3em; padding: .5em; padding-right: 1em; padding-bottom: 1em; } div.clnumber div.pvlist { border: 4px double gray; margin-bottom: .5em; margin-left: 1em; padding-top: .5em; text-indent: 0; padding-right: 1em; padding-bottom: 1em } div.mapRepr div.pvlist { border: 4px double gray; margin-top: .5em; margin-bottom: .5em; padding: .5em; padding-right: 1em; padding-bottom: 1em } div.pvSep { font-size: 50% ; clear: both} div.pvProp {clear: left; float: left; width: 7em; max-width: 12em; min-width: 7em } div.pvVal { margin-left: 8em } div.pvpair { clear: both; padding: 0.3em; padding-right: 0; } div.sfsScrap { border: 4px double gray; margin: 1em; padding: 0em; } div.sfsHead { margin: 4px; font-weight: bold } div.sfsBody { border-top-width: 4px; border-top-style: double; border-top-color: #d3d3d3; padding: 4px ; margin: 0em} div.ednote { display: block; margin: 1.33em 0; } a.scrapref { font-family: serif, sans-serif; } /* Added 2008-01-30. Value may be tweaked, but whatever it is, * make it the same for these three different ways of saying * 'paragraph'. */ p, div.p, div.block { margin: 1em 0; } p.image-caption { margin-left: 2em; margin-right: 2em; margin-bottom: 3em; font-style: italic; } var { /* color: green; */ color: navy; /* or perhaps try MediumBlue */ font-style: italic; font-weight: bold; } table.blocknames, table.blocknames td, table.blocknames th { border-style: solid; border-width: thin; empty-cells: show; } table.blocknames td, table.blocknames th { padding: 0.2em; } </style><link rel="stylesheet" type="text/css" href="https://www.w3.org/StyleSheets/TR/W3C-REC.css" /></head> <body> <div class="head"><p><a href="https://www.w3.org/" shape="rect"><img src="https://www.w3.org/Icons/w3c_home" alt="W3C" height="48" width="72" /></a></p> <h1><a name="title" id="title" shape="rect"></a>W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes</h1> <h2><a name="w3c-doctype" id="w3c-doctype" shape="rect"></a>W3C Recommendation 5 April 2012</h2><dl><dt>This version:</dt><dd> <a href="https://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/" shape="rect">http://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/</a> </dd><dt>Latest version:</dt><dd><a href="https://www.w3.org/TR/xmlschema11-2/" shape="rect">http://www.w3.org/TR/xmlschema11-2/</a></dd><dt>Previous version:</dt><dd> <a href="https://www.w3.org/TR/2012/PR-xmlschema11-2-20120119/" shape="rect">http://www.w3.org/TR/2012/PR-xmlschema11-2-20120119/</a> </dd><dt>Editors (Version 1.1):</dt><dd>David Peterson, invited expert (SGML<em>Works!</em>) <a href="mailto:davep@iit.edu" shape="rect">&lt;davep@iit.edu&gt;</a></dd><dd>Shudi (Sandy) Gao &#39640;&#27530;&#38237;, IBM <a href="mailto:sandygao@ca.ibm.com" shape="rect">&lt;sandygao@ca.ibm.com&gt;</a></dd><dd>Ashok Malhotra, Oracle Corporation <a href="mailto:ashokmalhotra@alum.mit.edu" shape="rect">&lt;ashokmalhotra@alum.mit.edu&gt;</a></dd><dd>C. M. Sperberg-McQueen, Black Mesa Technologies LLC <a href="mailto:cmsmcq@blackmesatech.com" shape="rect">&lt;cmsmcq@blackmesatech.com&gt;</a></dd><dd>Henry S. Thompson, University of Edinburgh <a href="mailto:ht@inf.ed.ac.uk" shape="rect">&lt;ht@inf.ed.ac.uk&gt;</a></dd><dt>Editors (Version 1.0):</dt><dd>Paul V. Biron, Kaiser Permanente, for Health Level Seven <a href="mailto:paul@sparrow-hawk.org" shape="rect">&lt;paul@sparrow-hawk.org&gt;</a></dd><dd>Ashok Malhotra, Oracle Corporation <a href="mailto:ashokmalhotra@alum.mit.edu" shape="rect">&lt;ashokmalhotra@alum.mit.edu&gt;</a></dd></dl><p>Please refer to the <a href="https://www.w3.org/XML/XMLSchema/v1.1/1e/errata.html" shape="rect"><strong>errata</strong></a> for this document, which may include some normative corrections.</p><p>See also <a href="https://www.w3.org/2003/03/Translations/byTechnology?technology=xmlschema" shape="rect"><strong>translations</strong></a>.</p><p>This document is also available in these non-normative formats: <a href="https://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/datatypes.xml" shape="rect">XML</a>, <a href="datatypes.diff-1.0.html" shape="rect">XHTML with changes since version 1.0 marked</a>, <a href="datatypes.diff-wd.html" shape="rect">XHTML with changes since previous Working Draft marked</a>, <a href="./XMLSchema.xsd" shape="rect">Independent copy of the schema for schema documents</a>, <a href="./XMLSchema.dtd" shape="rect">Independent copy of the DTD for schema documents</a>, and&#160;<a href="https://www.w3.org/2003/03/Translations/byTechnology?technology=xmlschema" shape="rect">List of translations</a>.</p><p class="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright" shape="rect">Copyright</a>&#160;&#169;&#160;2012&#160;<a href="https://www.w3.org/" shape="rect"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>&#174;</sup> (<a href="http://www.csail.mit.edu/" shape="rect"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/" shape="rect"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/" shape="rect">Keio</a>), All Rights Reserved. W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer" shape="rect">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks" shape="rect">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/copyright-documents" shape="rect">document use</a> rules apply.</p></div><hr /><div> <h2><a name="abstract" id="abstract" shape="rect"></a>Abstract</h2><p> <em>XML Schema: Datatypes</em> 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, provides a superset of the capabilities found in XML document type definitions (DTDs) for specifying datatypes on elements and attributes. </p></div><div class="sotd"> <h2><a name="status" id="status" shape="rect"></a>Status of this Document</h2><p><em>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 <a href="https://www.w3.org/TR/" shape="rect">W3C technical reports index</a> at http://www.w3.org/TR/.</em></p><p>This W3C Recommendation specifies the W3C XML Schema Definition Language (XSD) 1.1 Part 2: Datatypes. It is here made available for review by W3C members and the public. </p><p id="p-changes-since-prev-wd"> Changes since the previous public Working Draft include the following: </p><ul><li><div class="p">Some minor errors, typographic and otherwise, have been corrected.</div></li></ul><p>For those primarily interested in the changes since version 1.0, the appendix <a href="#changes" shape="rect">Changes since version 1.0 (&#167;I)</a> is the recommended starting point. 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.</p><p>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 <a href="https://www.w3.org/XML/2006/01/public-bugzilla" shape="rect">http://www.w3.org/XML/2006/01/public-bugzilla</a>. If access to Bugzilla is not feasible, please send your comments to the W3C XML Schema comments mailing list, <a href="mailto:www-xml-schema-comments@w3.org" shape="rect">www-xml-schema-comments@w3.org</a> (<a href="http://lists.w3.org/Archives/Public/www-xml-schema-comments/" shape="rect">archive</a>) and note explicitly that you have not made a Bugzilla entry for the comment. Each Bugzilla entry and email message should contain only one comment.</p><p>This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.</p><p> An <a href="http://lists.w3.org/Archives/Public/www-archive/2012Mar/0028.html" shape="rect">implementation report</a> for XSD 1.1 was prepared and used in the Director's decision to publish the previous version of this specification as a Proposed Recommendation. The Director's decision to publish this document as a W3C Recommendation is based on consideration of reviews of the Proposed Recommendation by the public and by the members of the W3C Advisory committee. </p><p>The W3C XML Schema Working Group intends to process comments made about this recommendation, with any approved changes being handled as errata to be published separately.</p><p>This document has been produced by the <a href="https://www.w3.org/XML/Schema" shape="rect">W3C XML Schema Working Group</a> as part of the W3C <a href="https://www.w3.org/XML/Activity" shape="rect">XML Activity</a>. The goals of the XML Schema language version 1.1 are discussed in the <a href="https://www.w3.org/TR/2003/WD-xmlschema-11-req-20030121/" shape="rect">Requirements for XML Schema 1.1</a> 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 by a group operating under the <a href="https://www.w3.org/Consortium/Patent-Policy-20040205/" shape="rect">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/19482/status" shape="rect">public list of any patent disclosures</a> made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential" shape="rect">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure" shape="rect">section 6 of the W3C Patent Policy</a>. </p><p>The English version of this specification is the only normative version. Information about translations of this document is available at <a href="https://www.w3.org/2003/03/Translations/byTechnology?technology=xmlschema" shape="rect">http://www.w3.org/2003/03/Translations/byTechnology?technology=xmlschema</a>.</p></div><div class="toc"> <h2><a name="contents" id="contents" shape="rect"></a>Table of Contents</h2><div class="toc">1 <a href="#Intro" shape="rect">Introduction</a><br clear="none" /> &#160;&#160;&#160;&#160;1.1 <a href="#intro1.1" shape="rect">Introduction to Version 1.1</a> <br clear="none" /> &#160;&#160;&#160;&#160;1.2 <a href="#purpose" shape="rect">Purpose</a> <br clear="none" /> &#160;&#160;&#160;&#160;1.3 <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications</a> <br clear="none" /> &#160;&#160;&#160;&#160;1.4 <a href="#requirements" shape="rect">Requirements</a> <br clear="none" /> &#160;&#160;&#160;&#160;1.5 <a href="#scope" shape="rect">Scope</a> <br clear="none" /> &#160;&#160;&#160;&#160;1.6 <a href="#terminology" shape="rect">Terminology</a> <br clear="none" /> &#160;&#160;&#160;&#160;1.7 <a href="#constraints-and-contributions" shape="rect">Constraints and Contributions</a> <br clear="none" /> 2 <a href="#typesystem" shape="rect">Datatype System</a><br clear="none" /> &#160;&#160;&#160;&#160;2.1 <a href="#datatype" shape="rect">Datatype</a> <br clear="none" /> &#160;&#160;&#160;&#160;2.2 <a href="#value-space" shape="rect">Value space</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#identity" shape="rect">Identity</a> &#183; <a href="#equality" shape="rect">Equality</a> &#183; <a href="#order" shape="rect">Order</a></div> &#160;&#160;&#160;&#160;2.3 <a href="#lexical-space" shape="rect">The Lexical Space and Lexical Mapping</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#canonical-lexical-representation" shape="rect">Canonical Mapping</a></div> &#160;&#160;&#160;&#160;2.4 <a href="#datatype-dichotomies" shape="rect">Datatype Distinctions</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#atomic-vs-list" shape="rect">Atomic vs. List vs. Union Datatypes</a> &#183; <a href="#primitive-vs-derived" shape="rect">Special vs. Primitive vs. Ordinary Datatypes</a> &#183; <a href="#derivation" shape="rect">Definition, Derivation, Restriction, and Construction</a> &#183; <a href="#built-in-vs-user-derived" shape="rect">Built-in vs. User-Defined Datatypes</a></div> 3 <a href="#built-in-datatypes" shape="rect">Built-in Datatypes and Their Definitions</a><br clear="none" /> &#160;&#160;&#160;&#160;3.1 <a href="#namespaces" shape="rect">Namespace considerations</a> <br clear="none" /> &#160;&#160;&#160;&#160;3.2 <a href="#special-datatypes" shape="rect">Special Built-in Datatypes</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#anySimpleType" shape="rect">anySimpleType</a> &#183; <a href="#anyAtomicType" shape="rect">anyAtomicType</a></div> &#160;&#160;&#160;&#160;3.3 <a href="#built-in-primitive-datatypes" shape="rect">Primitive Datatypes</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#string" shape="rect">string</a> &#183; <a href="#boolean" shape="rect">boolean</a> &#183; <a href="#decimal" shape="rect">decimal</a> &#183; <a href="#float" shape="rect">float</a> &#183; <a href="#double" shape="rect">double</a> &#183; <a href="#duration" shape="rect">duration</a> &#183; <a href="#dateTime" shape="rect">dateTime</a> &#183; <a href="#time" shape="rect">time</a> &#183; <a href="#date" shape="rect">date</a> &#183; <a href="#gYearMonth" shape="rect">gYearMonth</a> &#183; <a href="#gYear" shape="rect">gYear</a> &#183; <a href="#gMonthDay" shape="rect">gMonthDay</a> &#183; <a href="#gDay" shape="rect">gDay</a> &#183; <a href="#gMonth" shape="rect">gMonth</a> &#183; <a href="#hexBinary" shape="rect">hexBinary</a> &#183; <a href="#base64Binary" shape="rect">base64Binary</a> &#183; <a href="#anyURI" shape="rect">anyURI</a> &#183; <a href="#QName" shape="rect">QName</a> &#183; <a href="#NOTATION" shape="rect">NOTATION</a></div> &#160;&#160;&#160;&#160;3.4 <a href="#ordinary-built-ins" shape="rect">Other Built-in Datatypes</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#normalizedString" shape="rect">normalizedString</a> &#183; <a href="#token" shape="rect">token</a> &#183; <a href="#language" shape="rect">language</a> &#183; <a href="#NMTOKEN" shape="rect">NMTOKEN</a> &#183; <a href="#NMTOKENS" shape="rect">NMTOKENS</a> &#183; <a href="#Name" shape="rect">Name</a> &#183; <a href="#NCName" shape="rect">NCName</a> &#183; <a href="#ID" shape="rect">ID</a> &#183; <a href="#IDREF" shape="rect">IDREF</a> &#183; <a href="#IDREFS" shape="rect">IDREFS</a> &#183; <a href="#ENTITY" shape="rect">ENTITY</a> &#183; <a href="#ENTITIES" shape="rect">ENTITIES</a> &#183; <a href="#integer" shape="rect">integer</a> &#183; <a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a> &#183; <a href="#negativeInteger" shape="rect">negativeInteger</a> &#183; <a href="#long" shape="rect">long</a> &#183; <a href="#int" shape="rect">int</a> &#183; <a href="#short" shape="rect">short</a> &#183; <a href="#byte" shape="rect">byte</a> &#183; <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a> &#183; <a href="#unsignedLong" shape="rect">unsignedLong</a> &#183; <a href="#unsignedInt" shape="rect">unsignedInt</a> &#183; <a href="#unsignedShort" shape="rect">unsignedShort</a> &#183; <a href="#unsignedByte" shape="rect">unsignedByte</a> &#183; <a href="#positiveInteger" shape="rect">positiveInteger</a> &#183; <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> &#183; <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> &#183; <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a></div> 4 <a href="#datatype-components" shape="rect">Datatype components</a><br clear="none" /> &#160;&#160;&#160;&#160;4.1 <a href="#rf-defn" shape="rect">Simple Type Definition</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#dc-defn" shape="rect">The Simple Type Definition Schema Component</a> &#183; <a href="#xr-defn" shape="rect">XML Representation of Simple Type Definition Schema Components</a> &#183; <a href="#defn-rep-constr" shape="rect">Constraints on XML Representation of Simple Type Definition</a> &#183; <a href="#defn-validation-rules" shape="rect">Simple Type Definition Validation Rules</a> &#183; <a href="#defn-coss" shape="rect">Constraints on Simple Type Definition Schema Components</a> &#183; <a href="#builtin-stds" shape="rect">Built-in Simple Type Definitions</a></div> &#160;&#160;&#160;&#160;4.2 <a href="#rf-fund-facets" shape="rect">Fundamental Facets</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#rf-ordered" shape="rect">ordered</a> &#183; <a href="#rf-bounded" shape="rect">bounded</a> &#183; <a href="#rf-cardinality" shape="rect">cardinality</a> &#183; <a href="#rf-numeric" shape="rect">numeric</a></div> &#160;&#160;&#160;&#160;4.3 <a href="#rf-facets" shape="rect">Constraining Facets</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#rf-length" shape="rect">length</a> &#183; <a href="#rf-minLength" shape="rect">minLength</a> &#183; <a href="#rf-maxLength" shape="rect">maxLength</a> &#183; <a href="#rf-pattern" shape="rect">pattern</a> &#183; <a href="#rf-enumeration" shape="rect">enumeration</a> &#183; <a href="#rf-whiteSpace" shape="rect">whiteSpace</a> &#183; <a href="#rf-maxInclusive" shape="rect">maxInclusive</a> &#183; <a href="#rf-maxExclusive" shape="rect">maxExclusive</a> &#183; <a href="#rf-minExclusive" shape="rect">minExclusive</a> &#183; <a href="#rf-minInclusive" shape="rect">minInclusive</a> &#183; <a href="#rf-totalDigits" shape="rect">totalDigits</a> &#183; <a href="#rf-fractionDigits" shape="rect">fractionDigits</a> &#183; <a href="#rf-assertions" shape="rect">Assertions</a> &#183; <a href="#rf-explicitTimezone" shape="rect">explicitTimezone</a></div> 5 <a href="#conformance" shape="rect">Conformance</a><br clear="none" /> &#160;&#160;&#160;&#160;5.1 <a href="#hostlangs" shape="rect">Host Languages</a> <br clear="none" /> &#160;&#160;&#160;&#160;5.2 <a href="#independent-impl" shape="rect">Independent implementations</a> <br clear="none" /> &#160;&#160;&#160;&#160;5.3 <a href="#data-conformance" shape="rect">Conformance of data</a> <br clear="none" /> &#160;&#160;&#160;&#160;5.4 <a href="#partial-implementation" shape="rect">Partial Implementation of Infinite Datatypes</a> <br clear="none" /> </div> <h3><a name="appendices" id="appendices" shape="rect"></a>Appendices</h3><div class="toc">A <a href="#schema" shape="rect">Schema for Schema Documents (Datatypes) (normative)</a><br clear="none" /> B <a href="#dtd-for-datatypeDefs" shape="rect">DTD for Datatype Definitions (non-normative)</a><br clear="none" /> C <a href="#prim.nxsd" shape="rect">Illustrative XML representations for the built-in simple type definitions</a><br clear="none" /> &#160;&#160;&#160;&#160;C.1 <a href="#sec-prim-nxsd" shape="rect">Illustrative XML representations for the built-in primitive type definitions</a> <br clear="none" /> &#160;&#160;&#160;&#160;C.2 <a href="#drvd.nxsd" shape="rect">Illustrative XML representations for the built-in ordinary type definitions</a> <br clear="none" /> D <a href="#constructedValueSpaces" shape="rect">Built-up Value Spaces</a><br clear="none" /> &#160;&#160;&#160;&#160;D.1 <a href="#sec-numericalValues" shape="rect">Numerical Values</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#sec-exactmaps" shape="rect">Exact Lexical Mappings</a></div> &#160;&#160;&#160;&#160;D.2 <a href="#d-t-values" shape="rect">Date/time Values</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model</a> &#183; <a href="#rf-lexicalMappings-datetime" shape="rect">Lexical Mappings</a></div> E <a href="#ap-funcDefs" shape="rect">Function Definitions</a><br clear="none" /> &#160;&#160;&#160;&#160;E.1 <a href="#sec-generic-number-functions" shape="rect">Generic Number-related Functions</a> <br clear="none" /> &#160;&#160;&#160;&#160;E.2 <a href="#sec-duration-functions" shape="rect">Duration-related Definitions</a> <br clear="none" /> &#160;&#160;&#160;&#160;E.3 <a href="#sec-dt-functions" shape="rect">Date/time-related Definitions</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#sec-normalization" shape="rect">Normalization of property values</a> &#183; <a href="#sec-aux-functions" shape="rect">Auxiliary Functions</a> &#183; <a href="#sec-dt-arith" shape="rect">Adding durations to dateTimes</a> &#183; <a href="#sec-timeontimeline" shape="rect">Time on timeline</a> &#183; <a href="#sec-dt-lexmaps" shape="rect">Lexical mappings</a> &#183; <a href="#sec-dt-canmaps" shape="rect">Canonical Mappings</a></div> &#160;&#160;&#160;&#160;E.4 <a href="#sec-misc-lexmaps" shape="rect">Lexical and Canonical Mappings for Other Datatypes</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#sec-hexbin-lexmaps" shape="rect">Lexical and canonical mappings for </a></div> F <a href="#sec-datatypes-and-facets" shape="rect">Datatypes and Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;F.1 <a href="#app-fundamental-facets" shape="rect">Fundamental Facets</a> <br clear="none" /> G <a href="#regexs" shape="rect">Regular Expressions</a><br clear="none" /> &#160;&#160;&#160;&#160;G.1 <a href="#regex-branch" shape="rect">Regular expressions and branches</a> <br clear="none" /> &#160;&#160;&#160;&#160;G.2 <a href="#regex-piece" shape="rect">Pieces, atoms, quantifiers</a> <br clear="none" /> &#160;&#160;&#160;&#160;G.3 <a href="#regex-char-metachar" shape="rect">Characters and metacharacters</a> <br clear="none" /> &#160;&#160;&#160;&#160;G.4 <a href="#charcter-classes" shape="rect">Character Classes</a> <div style="margin-left: 4em; margin-top: 0; margin-bottom: 0;"> <a href="#charclassexps" shape="rect">Character class expressions</a> &#183; <a href="#cces" shape="rect">Character Class Escapes</a></div> H <a href="#idef-idep" shape="rect">Implementation-defined and implementation-dependent features (normative)</a><br clear="none" /> &#160;&#160;&#160;&#160;H.1 <a href="#impl-def" shape="rect">Implementation-defined features</a> <br clear="none" /> &#160;&#160;&#160;&#160;H.2 <a href="#impl-dep" shape="rect">Implementation-dependent features</a> <br clear="none" /> I <a href="#changes" shape="rect">Changes since version 1.0</a><br clear="none" /> &#160;&#160;&#160;&#160;I.1 <a href="#sec-chdtfacets" shape="rect">Datatypes and Facets</a> <br clear="none" /> &#160;&#160;&#160;&#160;I.2 <a href="#sec-chnum" shape="rect">Numerical Datatypes</a> <br clear="none" /> &#160;&#160;&#160;&#160;I.3 <a href="#sec-chdt" shape="rect">Date/time Datatypes</a> <br clear="none" /> &#160;&#160;&#160;&#160;I.4 <a href="#sec-chother" shape="rect">Other changes</a> <br clear="none" /> J <a href="#normative-glossary" shape="rect">Glossary (non-normative)</a><br clear="none" /> K <a href="#biblio" shape="rect">References</a><br clear="none" /> &#160;&#160;&#160;&#160;K.1 <a href="#normative-biblio" shape="rect">Normative</a> <br clear="none" /> &#160;&#160;&#160;&#160;K.2 <a href="#non-normative-biblio" shape="rect">Non-normative</a> <br clear="none" /> L <a href="#acknowledgments" shape="rect">Acknowledgements (non-normative)</a><br clear="none" /> </div></div><hr /><div class="body"><div class="div1"> <h2><a name="Intro" id="Intro" shape="rect"></a>1 Introduction</h2><div class="div2"> <h3><span class="nav"> <a href="#purpose" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="intro1.1" id="intro1.1" shape="rect"></a>1.1 Introduction to Version 1.1</h3><p>The Working Group has two main goals for this version of W3C XML Schema:</p><ul><li><div class="p">Significant improvements in simplicity of design and clarity of exposition <em>without</em> loss of backward <em>or</em> forward compatibility; </div></li><li><div class="p">Provision of support for versioning of XML languages defined using the XML Schema specification, including the XML transfer syntax for schemas itself.</div></li></ul><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><ol class="enumar"><li><div class="p">Add support for versioning (acknowledging that this <em>may</em> be slightly disruptive to the XML transfer syntax at the margins)</div></li><li><div class="p">Allow bug fixes (unless in specific cases we decide that the fix is too disruptive for a point release)</div></li><li><div class="p">Allow editorial changes</div></li><li><div class="p">Allow design cleanup to change behavior in edge cases</div></li><li><div class="p">Allow relatively non-disruptive changes to type hierarchy (to better support current and forthcoming international standards and W3C recommendations)</div></li><li><div class="p">Allow design cleanup to change component structure (changes to functionality restricted to edge cases)</div></li><li><div class="p">Do not allow any significant changes in functionality</div></li><li><div class="p">Do not allow any changes to XML transfer syntax except those required by version control hooks and bug fixes</div></li></ol><p>The overall aim as regards compatibility is that</p><ul><li><div class="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);</div></li><li><div class="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); </div></li></ul></div><div class="div2"> <h3><span class="nav"><a href="#intro1.1" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#intro-relatedWork" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="purpose" id="purpose" shape="rect"></a>1.2 Purpose</h3><p> The <a href="#XML" shape="rect">[XML]</a> 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 <em>documents</em> and those transporting <em>data</em> 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 rowspan="1" colspan="1">Data oriented</th><th rowspan="1" colspan="1">Document oriented</th></tr></thead><tbody><tr><td rowspan="1" colspan="1"> <pre 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;</pre> </td><td rowspan="1" colspan="1"> <pre 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;</pre> </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).&#160; 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").&#160; 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.&#160; The limited datatyping facilities in XML have prevented validating XML processors from supplying the rigorous type checking required in these situations.&#160; The result has been that individual applications writers have had to implement type checking in an ad hoc manner.&#160; 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.&#160; As discussed below, these datatypes could be used in other XML-related standards as well. </p></div><div class="div2"> <h3><span class="nav"><a href="#purpose" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#requirements" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="intro-relatedWork" id="intro-relatedWork" shape="rect"></a>1.3 Dependencies on Other Specifications</h3><p>Other specifications on which this one depends are listed in <a href="#biblio" shape="rect">References (&#167;K)</a>.</p><p>This specification defines some datatypes which depend on definitions in <a href="#XML" shape="rect">[XML]</a> and <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>; those definitions, and therefore the datatypes based on them, vary between version 1.0 (<a href="#XML1.0" shape="rect">[XML 1.0]</a>, <a href="#XMLNS1.0" shape="rect">[Namespaces in XML 1.0]</a>) and version 1.1 (<a href="#XML" shape="rect">[XML]</a>, <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>) 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 <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a>. </p><p> Conforming implementations of this specification may 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 <span class="rfc2119">should</span> be under user control. </p><div class="note"><div class="p"><b>Note:</b> When this specification is used to check the datatype validity of XML input, implementations <span class="rfc2119">may</span> 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 <span class="rfc2119">should</span> 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. </div></div><p id="loc5321">This specification makes use of the EBNF notation used in the <a href="#XML" shape="rect">[XML]</a> specification.&#160;Note that some constructs of the EBNF notation used here resemble the regular-expression syntax defined in this specification (<a href="#regexs" shape="rect">Regular Expressions (&#167;G)</a>), but that they are not identical: there are differences. For a fuller description of the EBNF notation, see <a href="https://www.w3.org/TR/xml11/#sec-notation" shape="rect">Section 6.&#160;Notation</a> of the <a href="#XML" shape="rect">[XML]</a> specification.</p></div><div class="div2"> <h3><span class="nav"><a href="#intro-relatedWork" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#scope" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="requirements" id="requirements" shape="rect"></a>1.4 Requirements</h3><p> The <a href="#schema-requirements" shape="rect">[XML Schema Requirements]</a> document spells out concrete requirements to be fulfilled by this specification, which state that the XML Schema Language must: </p><ol class="enumar"><li><div class="p"> provide for primitive data typing, including byte, date, integer, sequence, SQL and Java primitive datatypes, etc.; </div></li><li><div class="p"> define a type system that is adequate for import/export from database systems (e.g., relational, object, OLAP); </div></li><li><div class="p"> distinguish requirements relating to lexical data representation vs. those governing an underlying information set; </div></li><li><div class="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). </div></li></ol></div><div class="div2"> <h3><span class="nav"><a href="#requirements" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#terminology" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="scope" id="scope" shape="rect"></a>1.5 Scope</h3><p> This specification defines datatypes that can be used in an XML Schema.&#160; These datatypes can be specified for element content that would be specified as <a href="https://www.w3.org/TR/xml11/#dt-chardata" shape="rect">#PCDATA</a> and attribute values of <a href="https://www.w3.org/TR/xml11/#sec-attribute-types" shape="rect">various types </a> in a DTD.&#160; 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 <a href="#XSL" shape="rect">[XSL]</a> and <a href="#RDFSchema" shape="rect">[RDF Schema]</a>. </p></div><div class="div2"> <h3><span class="nav"><a href="#scope" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#constraints-and-contributions" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="terminology" id="terminology" shape="rect"></a>1.6 Terminology</h3><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><div class="glist"><div class="gitem"><div class="giLabel"> <span class="termdef"><a name="dt-compatibility" id="dt-compatibility" title="" shape="rect">[Definition:]&#160;&#160;</a>for compatibility</span> </div><div class="giDef"><div class="p"> A feature of this specification included solely to ensure that schemas which use this feature remain compatible with <a href="#XML" shape="rect">[XML]</a>. </div></div></div><div class="gitem"><div class="giLabel"> <span class="termdef"><a name="dt-match" id="dt-match" title="" shape="rect">[Definition:]&#160;&#160;</a><b>match</b></span> </div><div class="giDef"><div class="p"> <em>(Of strings or names:)</em> 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. </div><div class="p"><em>(Of strings and rules in the grammar:)</em> A string matches a grammatical production if and only if it belongs to the language generated by that production. </div></div></div><div class="gitem"><div class="giLabel"> <span class="termdef"><a name="dt-may" id="dt-may" title="" shape="rect">[Definition:]&#160;&#160;</a><span class="rfc2119">may</span></span> </div><div class="giDef"><div class="p"> Schemas, schema documents, and processors are permitted to but need not behave as described. </div></div></div><div class="gitem"><div class="giLabel"><span class="termdef"><a name="dt-should" id="dt-should" title="" shape="rect">[Definition:]&#160;&#160;</a><span class="rfc2119">should</span></span></div><div class="giDef"><div class="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.</div></div></div><div class="gitem"><div class="giLabel"> <span class="termdef"><a name="dt-must" id="dt-must" title="" shape="rect">[Definition:]&#160;&#160;</a><span class="rfc2119">must</span></span> </div><div class="giDef"><div class="p"> <em>(Of schemas and schema documents:)</em> Schemas and documents are required to behave as described; otherwise they are in <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a>. </div><div class="p"><em>(Of processors:)</em> Processors are required to behave as described. </div></div></div><div class="gitem"><div class="giLabel"><span class="termdef"><a name="dt-mustnot" id="dt-mustnot" title="" shape="rect">[Definition:]&#160;&#160;</a><span class="rfc2119">must not</span></span></div><div class="giDef"><div class="p">Schemas, schema documents and processors are forbidden to behave as described; schemas and documents which nevertheless do so are in <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a>.</div></div></div><div class="gitem"><div class="giLabel"> <span class="termdef"><a name="dt-error" id="dt-error" title="" shape="rect">[Definition:]&#160;&#160;</a><b>error</b></span> </div><div class="giDef"><div class="p">A failure of a schema or schema document to conform to the rules of this specification.</div><div class="p"> Except as otherwise specified, processors <span class="rfc2119">must</span> distinguish error-free (conforming) schemas and schema documents from those with errors; if a schema used in type-validation or a schema document used in constructing a schema is in error, processors <span class="rfc2119">must</span> report the fact; if more than one is in error, it is <a href="#key-impl-dep" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-dependent<span class="arrow">&#183;</span></a> 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 <a href="#key-impl-dep" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-dependent<span class="arrow">&#183;</span></a> how many of the violations, and which, are reported. </div><div class="note"><div class="p"><b>Note:</b> 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. </div></div></div></div><div class="gitem"><div class="giLabel"> <span class="termdef"><a name="dt-useroption" id="dt-useroption" title="" shape="rect">[Definition:]&#160;&#160;</a><b>user option</b></span> </div><div class="giDef"><div class="p">A choice left under the control of the user of a processor, rather than being fixed for all users or uses of the processor. </div><div class="p">Statements in this specification that "Processors <span class="rfc2119">may</span> at user option" behave in a certain way mean that processors <span class="rfc2119">may</span> provide mechanisms to allow users (i.e. invokers of the processor) to enable or disable the behavior indicated. Processors which do not provide such user-operable controls <span class="rfc2119">must not</span> behave in the way indicated. Processors which do provide such user-operable controls <span class="rfc2119">must</span> make it possible for the user to disable the optional behavior. </div><div class="note"><div class="p"><b>Note:</b> The normal expectation is that the default setting for such options will be to disable the optional behavior in question, enabling it only when the user explicitly requests it. This is not, however, a requirement of conformance: if the processor's documentation makes clear that the user can disable the optional behavior, then invoking the processor without requesting that it be disabled can be taken as equivalent to a request that it be enabled. It is required, however, that it in fact be possible for the user to disable the optional behavior. </div></div><div class="note"><div class="p"><b>Note:</b> Nothing in this specification constrains the manner in which processors allow users to control user options. Command-line options, menu choices in a graphical user interface, environment variables, alternative call patterns in an application programming interface, and other mechanisms may all be taken as providing user options. </div></div></div></div></div></div><div class="div2"> <h3><span class="nav"><a href="#terminology" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="constraints-and-contributions" id="constraints-and-contributions" shape="rect"></a>1.7 Constraints and Contributions</h3><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><div class="glist"><div class="gitem"><div class="giLabel"> <span class="termdef"><a name="dt-cos" id="dt-cos" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>Constraint on Schemas</b> </span> </div><div class="giDef"><div class="p"> Constraints on the schema components themselves, i.e. conditions components <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> satisfy to be components at all. Largely to be found in <a href="#datatype-components" shape="rect">Datatype components (&#167;4)</a>. </div></div></div><div class="gitem"><div class="giLabel"> <span class="termdef"><a name="dt-src" id="dt-src" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>Schema Representation Constraint</b> </span> </div><div class="giDef"><div class="p"> Constraints on the representation of schema components in XML.&#160; Some but not all of these are expressed in <a href="#schema" shape="rect">Schema for Schema Documents (Datatypes) (normative) (&#167;A)</a> and <a href="#dtd-for-datatypeDefs" shape="rect">DTD for Datatype Definitions (non-normative) (&#167;B)</a>. </div></div></div><div class="gitem"><div class="giLabel"> <span class="termdef"><a name="dt-cvc" id="dt-cvc" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>Validation Rule</b> </span> </div><div class="giDef"><div class="p"> Constraints expressed by schema components which information items <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> satisfy to be schema-valid.&#160; Largely to be found in <a href="#datatype-components" shape="rect">Datatype components (&#167;4)</a>. </div></div></div></div></div></div><div class="div1"> <h2><a name="typesystem" id="typesystem" shape="rect"></a>2 Datatype System</h2><p>This section describes the conceptual framework behind the datatype system defined in this specification.&#160; The framework has been influenced by the <a href="#ISO11404" shape="rect">[ISO 11404]</a> standard on language-independent datatypes as well as the datatypes for <a href="#SQL" shape="rect">[SQL]</a> and for programming languages such as Java.</p><p>The datatypes discussed in this specification are for the most part well known abstract concepts such as <em>integer</em> and <em>date</em>. It is not the place of this specification to thoroughly define these abstract concepts; many other publications provide excellent definitions. 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.</p><div class="note"><div class="p"><b>Note:</b> 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.&#160; For example, the description herein of the <a href="#float" shape="rect">float</a> datatype does not define addition or multiplication, much less all of the operations defined for that datatype in <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a> on which it is based.&#160; For some datatypes (e.g. <a href="#language" shape="rect">language</a> or <a href="#anyURI" shape="rect">anyURI</a>) 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. </div></div><div class="div2"> <h3><span class="nav"> <a href="#value-space" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="datatype" id="datatype" shape="rect"></a>2.1 Datatype</h3><div class="p"><div class="termdef"><a name="dt-datatype" id="dt-datatype" title="" shape="rect">[Definition:]&#160;&#160;</a>In this specification, a <b>datatype</b> has three properties: <ul><li><div class="p">A <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, which is a set of values. </div></li><li><div class="p">A <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, which is a set of <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> used to denote the values.</div></li><li><div class="p">A small collection of <em>functions, relations, and procedures</em> associated with the datatype.&#160; Included are equality and (for some datatypes) order relations on the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, and a <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a>, which is a mapping from the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> into the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.</div></li></ul> </div> </div><div class="note"><div class="p"><b>Note:</b> This specification only defines the operations and relations needed for schema processing.&#160; 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&#8212;i.e., how to recognize the "real world" datatypes and their variants for which the datatypes defined herein are meant to be used for data interchange.</div></div><p>Along with the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> it is often useful to have an inverse which provides a standard <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> for each value.&#160; Such a <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> 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. For some datatypes, notably <a href="#QName" shape="rect">QName</a> and <a href="#NOTATION" shape="rect">NOTATION</a>, the mapping from lexical representations to values is context-dependent; for these types, no <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is defined.</p><div class="note"><div class="p"><b>Note:</b> Where <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mappings<span class="arrow">&#183;</span></a> are defined in this specification, they are defined for <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes. When a datatype is derived using facets which directly constrain the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, then for each value eliminated from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, the corresponding lexical representations are dropped from the lexical space. The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> for such a datatype is a subset of the <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> for its <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> type and provides a <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for each value remaining in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>. </div><div class="p"> The <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> facet, on the other hand, and any other (<a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a>) <a href="#dt-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical<span class="arrow">&#183;</span></a> facets, restrict the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> directly. When more than one lexical representation is provided for a given value, such facets may remove the <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> while permitting a different lexical representation; in this case, the value remains in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> but has no <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>. This specification provides no recourse in such situations. Applications are free to deal with it as they see fit. </div></div><div class="note"><div class="p"><b>Note:</b> This specification sometimes uses the shorter form "type" where one might strictly speaking expect the longer form "datatype" (e.g. in the phrases "union type", "list type", "base type", "item type", etc. No systematic distinction is intended between the forms of these phrase with "type" and those with "datatype"; the two forms are used interchangeably.</div><div class="p">The distinction between "datatype" and "simple type definition", by contrast, carries more information: the datatype is characterized by its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a>, etc., as just described, independently of the specific facets or other definitional mechanisms used in the simple type definition to describe that particular <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> or <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>. Different simple type definitions with different selections of facets can describe the same datatype. </div></div></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#datatype" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#lexical-space" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="value-space" id="value-space" shape="rect"></a>2.2 Value space</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.2.1 <a href="#identity" shape="rect">Identity</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.2.2 <a href="#equality" shape="rect">Equality</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.2.3 <a href="#order" shape="rect">Order</a><br clear="none" /> </div><p><span class="termdef"><a name="dt-value-space" id="dt-value-space" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>value space</b> <em>of a datatype</em> is the set of values for that datatype.</span>&#160; Associated with each value space are selected operations and relations necessary to permit proper schema processing.&#160; Each value in the value space of a <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> or <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatype is denoted by one or more character strings in its <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, according to <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>the lexical mapping<span class="arrow">&#183;</span></a>; <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> datatypes, by contrast, may include "ineffable" values not mapped to by any lexical representation. (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>The value spaces of datatypes are abstractions, and are defined in <a href="#built-in-datatypes" shape="rect">Built-in Datatypes and Their Definitions (&#167;3)</a> to the extent needed to clarify them for readers.&#160; For example, in defining the numerical datatypes, we assume some general numerical concepts such as number and integer are known.&#160; In many cases we provide references to other documents providing more complete definitions.</p><div class="note"><div class="p"><b>Note:</b> <em>The value spaces and the values therein are abstractions.</em>&#160; This specification does not prescribe any particular internal representations that must be used when implementing these datatypes.&#160; 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.</div><div class="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 <em>for schema processing the relations and operations used are those defined herein</em>.</div></div><div class="block">The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of a datatype can be defined in one of the following ways: <ul><li><div class="p">defined elsewhere axiomatically from fundamental notions (intensional definition) [see <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>]</div></li><li><div class="p">enumerated outright from values of an already defined datatype (extensional definition) [see <a href="#dt-enumeration" class="termref" shape="rect"><span class="arrow">&#183;</span>enumeration<span class="arrow">&#183;</span></a>]</div></li><li><div class="p">defined by restricting the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of an already defined datatype to a particular subset with a given set of properties [see <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a>]</div></li><li><div class="p">defined as a combination of values from one or more already defined <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>(s) by a specific construction procedure [see <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> and <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>]</div></li></ul></div><p>The relations of <em>identity</em> and <em>equality</em> are required for each value space. An order relation is specified for some value spaces, but not all. A very few datatypes have other relations or operations prescribed for the purposes of this specification.</p><div class="div3"> <h4><a name="identity" id="identity" shape="rect"></a>2.2.1 Identity</h4><p>The identity relation is always defined. Every value space inherently has an identity relation. Two things are <em>identical</em> if and only if they are actually the same thing: i.e., if there is no way whatever to tell them apart.&#160; </p><div class="note"><div class="p"><b>Note:</b> This does not preclude implementing datatypes by using more than one <em>internal</em> 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.</div></div><p>In the identity relation defined herein, values from different <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes' <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> are made artificially distinct if they might otherwise be considered identical.&#160; For example, there is a number <em>two</em> in the <a href="#decimal" shape="rect">decimal</a> datatype and a number <em>two</em> in the <a href="#float" shape="rect">float</a> datatype.&#160; In the identity relation defined herein, these two values are considered distinct.&#160; Other applications making use of these datatypes may choose to consider values such as these identical, but for the view of <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes' <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> used herein, they are distinct.</p><p><em>WARNING:</em>&#160; Care must be taken when identifying values across distinct primitive datatypes.&#160; The <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> '<code>0.1</code>' and '<code>0.10000000009</code>' map to the same value in <a href="#float" shape="rect">float</a> (neither 0.1 nor 0.10000000009 is in the value space, and each literal is mapped to the nearest value, namely 0.100000001490116119384765625), but map to distinct values in <a href="#decimal" shape="rect">decimal</a>.</p><div class="note"><div class="p"><b>Note:</b> Datatypes <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> do not create new values; they define subsets of some <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype's <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>. A consequence of this fact is that the <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> '<code>+2</code>', treated as a <a href="#decimal" shape="rect">decimal</a>, '<code>+2</code>', treated as an <a href="#integer" shape="rect">integer</a>, and '<code>+2</code>', treated as a <a href="#byte" shape="rect">byte</a>, all denote the same value. They are not only equal but identical.</div></div><p>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><div class="note"><div class="p"><b>Note:</b> 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 <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> <a href="#decimal" shape="rect">decimal</a> and an empty list declared as having <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> <a href="#string" shape="rect">string</a> are not only equal but identical. </div></div></div><div class="div3"> <h4><a name="equality" id="equality" shape="rect"></a>2.2.2 Equality</h4><p>Each <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype has prescribed an equality relation for its value space.&#160; The equality relation for most datatypes is the identity relation.&#160; In the few cases where it is not, equality has been carefully defined so that for most operations of interest to the datatype, 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.</p><p>On the other hand, equality need not cover the entire value space of the datatype (though it usually does). In particular, NaN is not equal to itself in the <a href="#float" shape="rect">float</a> and <a href="#double" shape="rect">double</a> datatypes.</p><p>This equality relation is used in conjunction with identity when making <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restrictions<span class="arrow">&#183;</span></a> by <em>enumeration</em>, when checking identity constraints (in the context of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>) and when checking value constraints. It is used in conjunction with order when making <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restrictions<span class="arrow">&#183;</span></a> involving order. The equality relation used in the evaluation of XPath expressions may differ.&#160; When <a href="https://www.w3.org/TR/xpath20/#id-expression-processing" shape="rect">processing XPath expressions</a> as part of XML schema-validity <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-va" shape="rect">assessment</a> or otherwise testing membership in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of a datatype whose derivation involves <a href="#dt-assertions" class="termref" shape="rect"><span class="arrow">&#183;</span>assertions<span class="arrow">&#183;</span></a>, equality (like all other relations) within those expressions is interpreted using the rules of XPath (<a href="#XPATH2" shape="rect">[XPath 2.0]</a>).&#160; All comparisons for "sameness" prescribed by this specification test for either equality or identity, not for identity alone.</p><div class="note"><div class="p"><b>Note:</b> In the prior version of this specification (1.0), equality was always identity.&#160; This has been changed to permit the datatypes defined herein to more closely match the "real world" datatypes for which they are intended to be used as transmission formats.</div><div class="p">For example, the <a href="#float" shape="rect">float</a> datatype has an equality which is not the identity (&#160;&#8722;0&#160;=&#160;+0&#160;, but they are not identical&#8212;although they <em>were</em> identical in the 1.0 version of this specification), and whose domain excludes one value, NaN, so that&#160; NaN&#160;&#8800;&#160;NaN&#160;.</div><div class="p">For another example, the <a href="#dateTime" shape="rect">dateTime</a> datatype previously lost any time-zone offset information in the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> as the value was converted to <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a>; now the time zone offset is retained and two values representing the same "moment in time" but with different remembered time zone offsets are now <em>equal</em> but not <em>identical</em>.</div></div><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.&#160; For example, there is a number <em>two</em> in the <a href="#decimal" shape="rect">decimal</a> datatype and a number <em>two</em> in the <a href="#float" shape="rect">float</a> datatype.&#160; In the equality relation defined herein, these two values are considered unequal.&#160; Other applications making use of these datatypes may choose to consider values such as these equal; nonetheless, in the equality relation defined herein, they are unequal.</p><p>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).&#160; The <em>equality</em> relation is denoted by '=' and its negation by '&#8800;', each used as a binary infix predicate:&#160; <var>x</var>&#160;=&#160;<var>y</var>&#160; and&#160; <var>x</var>&#160;&#8800;&#160;<var>y</var>&#160;.&#160; On the other hand, <em>identity</em> relationships are always described in words.</p></div><div class="div3"> <h4><a name="order" id="order" shape="rect"></a>2.2.3 Order</h4><p>For some datatypes, an order relation is prescribed for use in checking upper and lower bounds of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.&#160; This order may be a <em>partial</em> order, which means that there may be values in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> which are neither equal, less-than, nor greater-than.&#160; Such value pairs are <em>incomparable</em>.&#160; In many cases, no order is prescribed; each pair of values is either equal or <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a>. <span class="termdef"><a name="dt-incomparable" id="dt-incomparable" title="" shape="rect">[Definition:]&#160;&#160;</a>Two values that are neither equal, less-than, nor greater-than are <b>incomparable</b>. Two values that are not <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> are <b>comparable</b>.</span></p><p>The order relation is used in conjunction with equality when making <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restrictions<span class="arrow">&#183;</span></a> involving order.&#160; This is the only use of this order relation for schema processing.&#160; Of course, when <a href="https://www.w3.org/TR/xpath20/#id-expression-processing" shape="rect">processing XPath expressions</a> as part of XML schema-validity <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-va" shape="rect">assessment</a> or otherwise testing membership in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of a datatype whose derivation involves <a href="#dt-assertions" class="termref" shape="rect"><span class="arrow">&#183;</span>assertions<span class="arrow">&#183;</span></a>, order (like all other relations) within those expressions is interpreted using the rules of XPath (<a href="#XPATH2" shape="rect">[XPath 2.0]</a>).</p><p>In this specification, this less-than order relation is denoted by '&lt;' (and its inverse by '&gt;'), the weak order by '&#8804;' (and its inverse by '&#8805;'), and the resulting <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> relation by '&lt;&gt;', each used as a binary infix predicate:&#160; <var>x</var>&#160;&lt;&#160;<var>y</var>&#160;,&#160; <var>x</var>&#160;&#8804;&#160;<var>y</var>&#160;,&#160; <var>x</var>&#160;&gt;&#160;<var>y</var>&#160;,&#160; <var>x</var>&#160;&#8805;&#160;<var>y</var>&#160;, and&#160; <var>x</var>&#160;&lt;&gt;&#160;<var>y</var>&#160;.</p><div class="note"><div class="p"><b>Note:</b> The weak order "less-than-or-equal" means "less-than" or "equal" <em>and one can tell which</em>.&#160; For example, the <a href="#duration" shape="rect">duration</a> P1M (one month) is <em>not</em> less-than-or-equal P31D (thirty-one days) because P1M is not less than P31D, nor is P1M equal to P31D.&#160; Instead, P1M is <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> with P31D.)&#160; The formal definition of order for <a href="#duration" shape="rect">duration</a> (<a href="#duration" shape="rect">duration (&#167;3.3.6)</a>) ensures that this is true.</div></div><p>For purposes of this specification, the value spaces of primitive datatypes are disjoint, even in cases where the abstractions they represent might be thought of as having values in common.&#160; In the order relations defined in this specification, values from different value spaces are <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a>.&#160; For example, the numbers two and three are values in both the decimal datatype and the float datatype.&#160; In the order relation defined here, the two in the decimal datatype is not less than the three in the float datatype; the two values are incomparable.&#160; Other applications making use of these datatypes may choose to consider values such as these comparable.</p><div class="note"><div class="p"><b>Note:</b> Comparison of values from different <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes can sometimes be an error and sometimes not, depending on context. </div><div class="p"> When made for purposes of checking an enumeration constraint, such a comparison is not in itself an error, but since no two values from different <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> are equal, any comparison of <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> values will invariably be false. </div><div class="p"> Specifying an upper or lower bound which is of the wrong primitive datatype (and therefore <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> 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 <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> that in conforming simple type definitions, the values of upper and lower bounds, and enumerated values, <span class="rfc2119">must</span> be drawn from the value space of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>, which necessarily means from the same <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype. </div><div class="p"> Comparison of <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> 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 <a href="#F_O" shape="rect">[XQuery 1.0 and XPath 2.0 Functions and Operators]</a> for details.</div></div></div></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#value-space" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#datatype-dichotomies" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="lexical-space" id="lexical-space" shape="rect"></a>2.3 The Lexical Space and Lexical Mapping</h3><p><span class="termdef"><a name="dt-lexical-mapping" id="dt-lexical-mapping" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>lexical mapping</b> for a datatype is a prescribed relation which maps from the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of the datatype into its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.</span></p><p><span class="termdef"><a name="dt-lexical-space" id="dt-lexical-space" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>lexical space</b> of a datatype is the prescribed set of strings which <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>the lexical mapping<span class="arrow">&#183;</span></a> for that datatype maps to values of that datatype.</span></p><p><span class="termdef"><a name="dt-lexical-representation" id="dt-lexical-representation" title="" shape="rect">[Definition:]&#160;&#160;</a>The members of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> are <b>lexical representations</b> of the values to which they are mapped.</span></p><div class="note"><div class="p"><b>Note:</b> For the <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> datatypes, the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> defined here map from the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> into, but not onto, the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> of the <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> datatypes include "ineffable" values for which the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> defined in this specification provide no lexical representation.</div><div class="p">For the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> and <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> atomic datatypes, the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> is a (total) function on the entire <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> <em>onto</em> (not merely <em>into</em>) the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>: every member of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> maps into the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, and every value is mapped to by some member of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>.</div><div class="p">For <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatypes, the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> is not necessarily a function, since the same <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> may map to different values in different member types. For <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatypes, the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> is a function if and only if the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> of the list's <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> is a function. </div></div><p> <span class="termdef"><a name="dt-literal" id="dt-literal" title="" shape="rect">[Definition:]&#160;&#160;</a>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 <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of a given datatype and thus a <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> of a given value in that datatype's <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, is referred to as a <b>literal</b>.</span> The term is used indifferently both for character sequences which are members of a particular <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> and for those which are not.</p><p>If a derivation introduces a <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facet value (a new value for <a href="#f-w" class="compref" shape="rect">whiteSpace</a> or an implementation-defined <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facet), the corresponding <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> transformation of a character string, if indeed it changed that string, could prevent that string from ever having the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> of the derived datatype applied to it.&#160; Character strings that a <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> transformation blocks in this way (i.e., they are not in the range of the <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facet's transformation) are always dropped from the derived datatype's <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>.</p><div class="note"><div class="p"><b>Note:</b> One should be aware that in the context of XML schema-validity <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-va" shape="rect">assessment</a>, there are <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> transformations of the input character string (controlled by the <a href="#f-w" class="compref" shape="rect">whiteSpace</a> facet and any implementation-defined <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facets) which result in the intended <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a>.&#160; Systems other than XML schema-validity <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-va" shape="rect">assessment</a> utilizing this specification may or may not implement these transformations.&#160; If they do not, then input character strings that would have been transformed into correct <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a>, when taken "raw", may not be correct <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a>.</div></div><p>Should a derivation be made using a derivation mechanism that removes <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> from the<a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> to the extent that one or more values cease to have any <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, then those values are dropped from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.</p><div class="note"><div class="p"><b>Note:</b> This could happen by means of a <a href="#f-p" class="compref" shape="rect">pattern</a> or other <a href="#dt-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical<span class="arrow">&#183;</span></a> facet, or by a <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facet as described above.</div></div><p>Conversely, should a derivation remove values then their <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> are dropped from the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> unless there is a facet value whose impact is defined to cause the otherwise-dropped <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> to be mapped to another value instead.</p><div class="note"><div class="p"><b>Note:</b> There are currently no facets with such an impact.&#160; There may be in the future.</div></div><p>For example, '100' and '1.0E2' are two different <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> from the <a href="#float" shape="rect">float</a> datatype which both denote the same value.&#160; The datatype system defined in this specification provides mechanisms for schema designers to control the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and the corresponding set of acceptable <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> of those values for a datatype.</p><div class="div3"> <h4><a name="canonical-lexical-representation" id="canonical-lexical-representation" shape="rect"></a>2.3.1 Canonical Mapping</h4><p>While the datatypes defined in this specification often have a single <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> for each value (i.e., each value in the datatype's <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is denoted by a single <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>representation<span class="arrow">&#183;</span></a> in its <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>), this is not always the case.&#160; The example in the previous section shows two <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> from the <a href="#float" shape="rect">float</a> datatype which denote the same value.</p><p><span class="termdef"><a name="dt-canonical-mapping" id="dt-canonical-mapping" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>canonical mapping</b> is a prescribed subset of the inverse of a <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> which is one-to-one and whose domain (where possible) is the entire range of the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> (the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>).</span>&#160; Thus a <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> selects one <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> for each value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.</p><p><span class="termdef"><a name="dt-canonical-representation" id="dt-canonical-representation" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>canonical representation</b> of a value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of a datatype is the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> associated with that value by the datatype's <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a></span>.</p><p><a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>Canonical mappings<span class="arrow">&#183;</span></a> are not available for datatypes whose <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> are context dependent (i.e., mappings for which the value of a <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> depends on the context in which it occurs, or for which a character string may or may not be a valid <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> similarly depending on its context)</p><div class="note"><div class="p"><b>Note:</b> <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>Canonical representations<span class="arrow">&#183;</span></a> are provided where feasible for the use of other applications; they are not required for schema processing itself.&#160; <em>A conforming schema processor implementation is not required to implement <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mappings<span class="arrow">&#183;</span></a>.</em></div></div></div></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#lexical-space" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="datatype-dichotomies" id="datatype-dichotomies" shape="rect"></a>2.4 Datatype Distinctions</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.4.1 <a href="#atomic-vs-list" shape="rect">Atomic vs. List vs. Union Datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.4.1.1 <a href="#atomic" shape="rect">Atomic Datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.4.1.2 <a href="#list-datatypes" shape="rect">List Datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.4.1.3 <a href="#union-datatypes" shape="rect">Union datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.4.2 <a href="#primitive-vs-derived" shape="rect">Special vs. Primitive vs. Ordinary Datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.4.2.1 <a href="#restriction" shape="rect">Facet-based Restriction</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.4.2.2 <a href="#list" shape="rect">Construction by List</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.4.2.3 <a href="#union" shape="rect">Construction by Union</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.4.3 <a href="#derivation" shape="rect">Definition, Derivation, Restriction, and Construction</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2.4.4 <a href="#built-in-vs-user-derived" shape="rect">Built-in vs. User-Defined Datatypes</a><br clear="none" /> </div><p>It is useful to categorize the datatypes defined in this specification along various dimensions, defining terms which can be used to characterize datatypes and the <a href="#std" shape="rect">Simple Type Definition</a>s which define them.</p><div class="div3"> <h4><a name="atomic-vs-list" id="atomic-vs-list" shape="rect"></a>2.4.1 Atomic vs. List vs. Union Datatypes</h4><p>First, we distinguish <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a>, <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, and <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatypes.</p><p><span class="termdef"><a name="dt-atomic-value" id="dt-atomic-value" title="" shape="rect">[Definition:]&#160;&#160;</a>An <b>atomic value</b> is an elementary value, not constructed from simpler values by any user-accessible means defined by this specification.</span></p><ul><li><div class="p"><span class="termdef"><a name="dt-atomic" id="dt-atomic" title="" shape="rect">[Definition:]&#160;&#160;</a><b>Atomic</b> datatypes are those whose <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> contain only <a href="#dt-atomic-value" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic values<span class="arrow">&#183;</span></a>.&#160; <b>Atomic</b> datatypes are <a href="#anyAtomicType" shape="rect">anyAtomicType</a> and all datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from it.</span></div></li><li><div class="p"><span class="termdef"><a name="dt-list" id="dt-list" title="" shape="rect">[Definition:]&#160;&#160;</a><b>List</b> datatypes are those having values each of which consists of a finite-length (possibly empty) sequence of <a href="#dt-atomic-value" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic values<span class="arrow">&#183;</span></a>. The values in a list are drawn from some <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype (or from a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> of <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatypes), which is the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> of the <b>list</b>. </span></div><div class="note"><div class="p"><b>Note:</b> It is a consequence of constraints normatively specified elsewhere in this document (in particular, the component properties specified in <a href="#dc-defn" shape="rect">The Simple Type Definition Schema Component (&#167;4.1.1)</a>) that the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> of a list <span class="rfc2119">may</span> be any <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype, or any <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype whose <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic members<span class="arrow">&#183;</span></a> are all <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatypes (so a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> of <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatypes is possible, but not a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> of <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>lists<span class="arrow">&#183;</span></a>). The <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> of a list <span class="rfc2119">must not</span> itself be a list datatype.</div></div></li><li><div class="p"><span class="termdef"><a name="dt-union" id="dt-union" title="" shape="rect">[Definition:]&#160;&#160;</a><b>Union</b> datatypes are (a) those whose <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a>, and <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> are the union of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a>, and <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> of one or more other datatypes, which are the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of the union, or (b) those derived by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> of another union datatype. </span></div><div class="note"><div class="p"><b>Note:</b> It is a consequence of constraints normatively specified elsewhere in this document (in particular, the component properties specified in <a href="#dc-defn" shape="rect">The Simple Type Definition Schema Component (&#167;4.1.1)</a>) that any <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> or <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatype <span class="rfc2119">may</span> occur among the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>. (In particular, <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatypes may themselves be members of <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>unions<span class="arrow">&#183;</span></a>, as may <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>lists<span class="arrow">&#183;</span></a>.) The only prohibition is that no <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> datatype may be a member of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>. </div></div></li></ul><p>For example, a single token which <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>matches<span class="arrow">&#183;</span></a> <a href="https://www.w3.org/TR/xml11/#NT-Nmtoken" shape="rect">Nmtoken</a> from <a href="#XML" shape="rect">[XML]</a> is in the value space of the <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype <a href="#NMTOKEN" shape="rect">NMTOKEN</a>, while a sequence of such tokens is in the value space of the <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype <a href="#NMTOKENS" shape="rect">NMTOKENS</a>. </p><div class="div4"> <h5><a name="atomic" id="atomic" shape="rect"></a>2.4.1.1 Atomic Datatypes</h5><p>An <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype has a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> consisting of a set of "atomic" or elementary values.</p><div class="note"><div class="p"><b>Note:</b> Atomic values are sometimes regarded, and described, as "not decomposable", 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.</div></div><p> The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of an <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype is a set of <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> whose internal structure is specific to the datatype in question.</p><p>There is one <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype (<a href="#anyAtomicType" shape="rect">anyAtomicType</a>), and a number of <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatypes which have <a href="#anyAtomicType" shape="rect">anyAtomicType</a> as their <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>.&#160; All other <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatypes are <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> either from one of the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatypes or from another <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype.&#160; No <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype <span class="rfc2119">may</span> have <a href="#anyAtomicType" shape="rect">anyAtomicType</a> as its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>.</p></div><div class="div4"> <h5><a name="list-datatypes" id="list-datatypes" shape="rect"></a>2.4.1.2 List Datatypes</h5><p><a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>List<span class="arrow">&#183;</span></a> datatypes are always <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from some other type; they are never <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype is the set of finite-length sequences of zero or more <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> values where each <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> value is drawn from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the lists's <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> and has a <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> containing no whitespace. The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype is a set of <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> each of which is a space-separated sequence of <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> of the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a>.</p><p><span class="termdef"><a name="dt-itemType" id="dt-itemType" title="" shape="rect">[Definition:]&#160;&#160;</a> The <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> or <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype that participates in the definition of a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype is the <b>item type</b> of that <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype.</span>&#160; If the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> is a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, each of its <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic members<span class="arrow">&#183;</span></a> <span class="rfc2119">must</span> be <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a>.</p><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleInner"> <pre xml:space="preserve"> &lt;simpleType name='sizes'&gt; &lt;list itemType='decimal'/&gt; &lt;/simpleType&gt; </pre></div><div class="exampleInner"> <pre xml:space="preserve"> &lt;cerealSizes xsi:type='sizes'&gt; 8 10.5 12 &lt;/cerealSizes&gt; </pre></div></div><p>A <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype can be <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from an ordinary or <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype whose <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> allows whitespace (such as <a href="#string" shape="rect">string</a> or <a href="#anyURI" shape="rect">anyURI</a>) or a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype any of whose <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a>'s <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> allows space. Since <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> items are separated at whitespace before the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> of the items are mapped to values, no whitespace will ever occur in the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> of a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> item, even when the item type would in principle allow it.&#160; For the same reason, when every possible <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> of a given value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> includes whitespace, that value can never occur as an item in any value of the <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype.</p><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleInner"> <pre xml:space="preserve"> &lt;simpleType name='listOfString'&gt; &lt;list itemType='string'/&gt; &lt;/simpleType&gt; </pre></div><div class="exampleInner"> <pre 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; </pre></div><div class="exampleWrapper"> <div class="p">In the above example, the value of the <em>someElement</em> element is not a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> of <a href="#dt-length" class="termref" shape="rect"><span class="arrow">&#183;</span>length<span class="arrow">&#183;</span></a> 3; rather, it is a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> of <a href="#dt-length" class="termref" shape="rect"><span class="arrow">&#183;</span>length<span class="arrow">&#183;</span></a> 18.</div></div></div><div class="block">When a datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restricting<span class="arrow">&#183;</span></a> a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype, the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> apply: <ul><li><div class="p"><a href="#dt-length" class="termref" shape="rect"><span class="arrow">&#183;</span>length<span class="arrow">&#183;</span></a></div></li><li><div class="p"><a href="#dt-maxLength" class="termref" shape="rect"><span class="arrow">&#183;</span>maxLength<span class="arrow">&#183;</span></a></div></li><li><div class="p"><a href="#dt-minLength" class="termref" shape="rect"><span class="arrow">&#183;</span>minLength<span class="arrow">&#183;</span></a></div></li><li><div class="p"><a href="#dt-enumeration" class="termref" shape="rect"><span class="arrow">&#183;</span>enumeration<span class="arrow">&#183;</span></a></div></li><li><div class="p"><a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a></div></li><li><div class="p"><a href="#dt-whiteSpace" class="termref" shape="rect"><span class="arrow">&#183;</span>whiteSpace<span class="arrow">&#183;</span></a></div></li><li><div class="p"><a href="#dt-assertions" class="termref" shape="rect"><span class="arrow">&#183;</span>assertions<span class="arrow">&#183;</span></a></div></li></ul> </div><p>For each of <a href="#dt-length" class="termref" shape="rect"><span class="arrow">&#183;</span>length<span class="arrow">&#183;</span></a>, <a href="#dt-maxLength" class="termref" shape="rect"><span class="arrow">&#183;</span>maxLength<span class="arrow">&#183;</span></a> and <a href="#dt-minLength" class="termref" shape="rect"><span class="arrow">&#183;</span>minLength<span class="arrow">&#183;</span></a>, the <em>length</em> is measured in number of list items.&#160; The value of <a href="#dt-whiteSpace" class="termref" shape="rect"><span class="arrow">&#183;</span>whiteSpace<span class="arrow">&#183;</span></a> is fixed to the value <b><i>collapse</i></b>.</p><p>For <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatypes the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> is composed of space-separated <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> of the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a>.&#160; Any <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> specified when a new datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype applies to the members of the <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype's <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, not to the members of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a>.&#160; Similarly, enumerated values are compared to the entire <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, not to individual list items, and <a href="#f-a" class="compref" shape="rect">assertions</a> apply to the entire <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> too. 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 a list of length one whose item is an atomic value <var>V1</var> is equal or identical to an atomic value <var>V2</var> if and only if <var>V1</var> is equal or identical to <var>V2</var>. </p><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleInner"> <pre 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; </pre></div></div><p>The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> of a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype maps each value onto the space-separated concatenation of the <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representations<span class="arrow">&#183;</span></a> of all the items in the value (in order), using the <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> of the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a>.</p></div><div class="div4"> <h5><a name="union-datatypes" id="union-datatypes" shape="rect"></a>2.4.1.3 Union datatypes</h5><p> </p><p> Union types may be defined in either of two ways. When a union type is <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> by <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, and <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> are the "ordered unions" of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a>, and <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> of its <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a>.</p><p>It will be observed that the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> of a union, so defined, is not necessarily a function: a given <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> may map to one value or to several values of different <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> 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 <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, the <code>xsi:type</code> attribute defined by that specification in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#xsi_type" shape="rect">xsi:type</a> can be used to indicate which value a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> 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>When a union type is defined by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restricting<span class="arrow">&#183;</span></a> another <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, and <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> are subsets of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a>, and <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> of its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>.</p><p><a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>Union<span class="arrow">&#183;</span></a> datatypes are always <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from other datatypes; they are never <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>. Currently, there are no <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a>&#160;<a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatypes.</p><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p">A prototypical example of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> type is the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#p-max_occurs" shape="rect">maxOccurs attribute</a> on the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-element" shape="rect">element element</a> in XML Schema itself: it is a union of nonNegativeInteger and an enumeration with the single member, the string "unbounded", as shown below.</div></div><div class="exampleInner"> <pre 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; </pre></div></div><p>Any number (zero or more) of ordinary or <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> <a href="#dt-datatype" class="termref" shape="rect"><span class="arrow">&#183;</span>datatypes<span class="arrow">&#183;</span></a> can participate in a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> type.</p><p><span class="termdef"><a name="dt-memberTypes" id="dt-memberTypes" title="" shape="rect">[Definition:]&#160;&#160;</a> The datatypes that participate in the definition of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype are known as the <b>member types</b> of that <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype.</span></p><div class="note"><div class="p"><b>Note:</b> When datatypes are represented using XSD schema components, as described in <a href="#datatype-components" shape="rect">Datatype components (&#167;4)</a>, the member types of a union are those simple type definitions given in the <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a> property. </div></div><p><span class="termdef"><a name="dt-transitivemembership" id="dt-transitivemembership" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>transitive membership</b> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> is the set of its own <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a>, and the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of its members, and so on. More formally, if <var>U</var> is a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, then (a) its <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> 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 <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of <var>T1</var>, then <var>T2</var> is also in the transitive membership of <var>U</var>.</span></p><p>The <a href="#dt-transitivemembership" class="termref" shape="rect"><span class="arrow">&#183;</span>transitive membership<span class="arrow">&#183;</span></a> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> <span class="rfc2119">must not</span> contain the <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> itself, nor any datatype <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> or <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from the <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>. </p><p><span class="termdef"><a name="dt-basicmember" id="dt-basicmember" title="" shape="rect">[Definition:]&#160;&#160;</a>Those members of the <a href="#dt-transitivemembership" class="termref" shape="rect"><span class="arrow">&#183;</span>transitive membership<span class="arrow">&#183;</span></a> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype <var>U</var> which are themselves not <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatypes are the <b>basic members</b> of <var>U</var>.</span></p><p><span class="termdef"><a name="dt-interveningunion" id="dt-interveningunion" title="" shape="rect">[Definition:]&#160;&#160;</a>If a datatype <var>M</var> is in the <a href="#dt-transitivemembership" class="termref" shape="rect"><span class="arrow">&#183;</span>transitive membership<span class="arrow">&#183;</span></a> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype <var>U</var>, but not one of <var>U</var>'s <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a>, then a sequence of one or more <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatypes necessarily exists, such that the first is one of the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of <var>U</var>, each is one of the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of its predecessor in the sequence, and <var>M</var> is one of the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of the last in the sequence. The <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatypes in this sequence are said to <b>intervene</b> 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 <b>intervening unions</b>. When <var>M</var> is one of the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of <var>U</var>, the set of <b>intervening unions</b> is the empty set. </span> </p><p> <span class="termdef"><a name="dt-active-member" id="dt-active-member" title="" shape="rect">[Definition:]&#160;&#160;</a>In a valid instance of any <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, the first of its members in order which accepts the instance as valid is the <b>active member type</b>.</span> <span class="termdef"><a name="dt-active-basic-member" id="dt-active-basic-member" title="" shape="rect">[Definition:]&#160;&#160;</a>If the <a href="#dt-active-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active member type<span class="arrow">&#183;</span></a> is itself a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, one of <em>its</em> members will be <em>its</em> <a href="#dt-active-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active member type<span class="arrow">&#183;</span></a>, and so on, until finally a <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic (non-union) member<span class="arrow">&#183;</span></a> is reached. That <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic member<span class="arrow">&#183;</span></a> is the <b>active basic member</b> of the union.</span> </p><p>The order in which the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> are specified in the definition (that is, in the case of datatypes defined in a schema document, the order of the &lt;simpleType&gt; children of the &lt;union&gt; element, or the order of the <a href="#QName" shape="rect">QName</a>s in the <code>memberTypes</code> attribute) is significant. During validation, an element or attribute's value is validated against the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> in the order in which they appear in the definition until a match is found.&#160; As noted above, the evaluation order can be overridden with the use of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#xsi_type" shape="rect">xsi:type</a>.</p><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p">For example, given the definition below, the first instance of the &lt;size&gt; element validates correctly as an <a href="#integer" shape="rect">integer (&#167;3.4.13)</a>, the second and third as <a href="#string" shape="rect">string (&#167;3.3.1)</a>.</div></div><div class="exampleInner"> <pre xml:space="preserve"> &lt;xs:element name='size'&gt; &lt;xs:simpleType&gt; &lt;xs:union&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base='integer'/&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base='string'/&gt; &lt;/xs:simpleType&gt; &lt;/xs:union&gt; &lt;/xs:simpleType&gt; &lt;/xs:element&gt; </pre></div><div class="exampleInner"> <pre xml:space="preserve"> &lt;size&gt;1&lt;/size&gt; &lt;size&gt;large&lt;/size&gt; &lt;size xsi:type='xs:string'&gt;1&lt;/size&gt; </pre></div></div><p>The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype maps each value onto the <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> of that value obtained using the <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> of the first <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member type<span class="arrow">&#183;</span></a> in whose value space it lies.</p><div class="block"> When a datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restricting<span class="arrow">&#183;</span></a> a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype, the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> apply: <ul><li><div class="p"><a href="#dt-enumeration" class="termref" shape="rect"><span class="arrow">&#183;</span>enumeration<span class="arrow">&#183;</span></a></div></li><li><div class="p"><a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a></div></li><li><div class="p"><a href="#dt-assertions" class="termref" shape="rect"><span class="arrow">&#183;</span>assertions<span class="arrow">&#183;</span></a></div></li></ul> </div></div></div><div class="div3"> <h4><a name="primitive-vs-derived" id="primitive-vs-derived" shape="rect"></a>2.4.2 Special vs. Primitive vs. Ordinary Datatypes</h4><p>Next, we distinguish <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a>, <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, and <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> (or <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a>) datatypes.&#160; Each datatype defined by or in accordance with this specification falls into exactly one of these categories.</p><ul><li><div class="p"><span class="termdef"><a name="dt-special" id="dt-special" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>special</b> datatypes are <a href="#anySimpleType" shape="rect">anySimpleType</a> and <a href="#anyAtomicType" shape="rect">anyAtomicType</a>.</span> They are special by virtue of their position in the type hierarchy.</div></li><li><div class="p"><span class="termdef"><a name="dt-primitive" id="dt-primitive" title="" shape="rect">[Definition:]&#160;&#160;</a><b>Primitive</b> datatypes are those datatypes that are not <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> and are not defined in terms of other datatypes; they exist <em>ab initio</em>.</span> All <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes have <a href="#anyAtomicType" shape="rect">anyAtomicType</a> as their <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>, but their <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a> must be given in prose; they cannot be described as <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restrictions<span class="arrow">&#183;</span></a> of <a href="#anyAtomicType" shape="rect">anyAtomicType</a> by the application of particular <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>.</div><div class="note"><div class="p"><b>Note:</b> As normatively specified elsewhere, conforming processors <span class="rfc2119">must</span> support all the primitive datatypes defined in this specification; it is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether other primitive datatypes are supported.</div><div class="p">Processors <span class="rfc2119">may</span>, for example, support the floating-point decimal datatype specified in <a href="#pd-note" shape="rect">[Precision Decimal]</a>. </div></div></li><li><div class="p"><span class="termdef"><a name="dt-ordinary" id="dt-ordinary" title="" shape="rect">[Definition:]&#160;&#160;</a><b>Ordinary</b> datatypes are all datatypes other than the <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> and <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes.</span>&#160; <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>Ordinary<span class="arrow">&#183;</span></a> datatypes can be understood fully in terms of their <a href="#std" class="compref" shape="rect">Simple Type Definition</a> and the properties of the datatypes from which they are <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a>.</div></li></ul><p>For example, in this specification, <a href="#float" shape="rect">float</a> is a <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype based on a well-defined mathematical concept and not defined in terms of other datatypes, while <a href="#integer" shape="rect">integer</a> is <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from the more general datatype <a href="#decimal" shape="rect">decimal</a>.</p><div class="div4"> <h5><a name="restriction" id="restriction" shape="rect"></a>2.4.2.1 Facet-based Restriction</h5><p><span class="termdef"><a name="dt-fb-restriction" id="dt-fb-restriction" title="" shape="rect">[Definition:]&#160;&#160;</a>A datatype is defined by <b>facet-based restriction</b> of another datatype (its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>), when values for zero or more <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> are specified that serve to constrain its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and/or its <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> to a subset of those of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>.</span> The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of a <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> <span class="rfc2119">must</span> be a <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> or <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatype.</p></div><div class="div4"> <h5><a name="list" id="list" shape="rect"></a>2.4.2.2 Construction by List</h5><p>A <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype can be <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from another datatype (its <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a>) by creating a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> that consists of finite-length sequences of zero or more values of its <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a>. Datatypes so <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> have <a href="#anySimpleType" shape="rect">anySimpleType</a> as their <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. Note that since the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of any <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype are necessarily subsets of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#anySimpleType" shape="rect">anySimpleType</a>, any datatype <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> as a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> is a <a href="#dt-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restriction<span class="arrow">&#183;</span></a> of its base type. </p></div><div class="div4"> <h5><a name="union" id="union" shape="rect"></a>2.4.2.3 Construction by Union</h5><p>One datatype can be <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from one or more datatypes by unioning their <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> and, consequently, their <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a>.&#160; Datatypes so <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> also have <a href="#anySimpleType" shape="rect">anySimpleType</a> as their <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. Note that since the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of any <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype are necessarily subsets of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#anySimpleType" shape="rect">anySimpleType</a>, any datatype <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> as a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> is a <a href="#dt-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restriction<span class="arrow">&#183;</span></a> of its base type. </p></div></div><div class="div3"> <h4><a name="derivation" id="derivation" shape="rect"></a>2.4.3 Definition, Derivation, Restriction, and Construction</h4><p>Definition, derivation, restriction, and construction are conceptually distinct, although in practice they are frequently performed by the same mechanisms.</p><p>By 'definition' is meant the explicit identification of the relevant properties of a datatype, in particular its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, and <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a>. </p><p>The properties of the <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> and the standard <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes are defined by this specification. A <a href="#std" class="compref" shape="rect">Simple Type Definition</a> 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 <em>define</em> the datatype.</p><div class="note"><div class="p"><b>Note:</b> The properties of any <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes are given not here but in the documentation for the implementation in question. Alternatively, a primitive datatype not specified in this document can be specified in a document of its own not tied to a particular implementation; <a href="#pd-note" shape="rect">[Precision Decimal]</a> is an example of such a document. </div></div><p>For all other datatypes, a <a href="#std" class="compref" shape="rect">Simple Type Definition</a> does suffice. The properties of an <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatype can be inferred from the datatype's <a href="#std" class="compref" shape="rect">Simple Type Definition</a> and the properties of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>, <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> if any, and <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> if any. All <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes can be defined in this way.</p><p>By 'derivation' is meant the relation of a datatype to its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>, or to the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>, and so on.</p><p><span class="termdef"><a id="dt-basetype" name="dt-basetype" title="" shape="rect"></a>Every datatype other than <a href="#anySimpleType" shape="rect">anySimpleType</a> is associated with another datatype, its <b>base type</b>. <b>Base types</b> can be <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a>, <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, or <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a>. </span> </p><p><span class="termdef"><a name="dt-immediately-derived" id="dt-immediately-derived" title="" shape="rect">[Definition:]&#160;&#160;</a>A datatype <var>T</var> is <b>immediately derived</b> from another datatype <var>X</var> if and only if <var>X</var> is the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <var>T</var>.</span> </p><div class="note"><div class="p"><b>Note:</b> The above does not preclude the <a href="#std" class="compref" shape="rect">Simple Type Definition</a> for <a href="#anySimpleType" shape="rect">anySimpleType</a> from having a value for its <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.&#160; (It does, and its value is <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#any-type-itself" shape="rect">anyType</a>.)</div></div><div class="p"> More generally, <div class="termdef"><a id="dt-derived" name="dt-derived" title="" shape="rect"></a>A datatype <var>R</var> is <b>derived</b> from another datatype <var>B</var> if and only if one of the following is true: <ul><li><div class="p"><var>B</var> is the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <var>R</var>. </div></li><li><div class="p">There is some datatype <var>X</var> such that <var>X</var> is the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <var>R</var>, and <var>X</var> is derived from <var>B</var>.</div></li></ul> </div> </div><p>A datatype <span class="rfc2119">must not</span> be <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from itself. That is, the base type relation must be acyclic.</p><p>It is a consequence of the above that every datatype other than <a href="#anySimpleType" shape="rect">anySimpleType</a> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#anySimpleType" shape="rect">anySimpleType</a>.</p><p>Since each datatype has exactly one <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>, and every datatype other than <a href="#anySimpleType" shape="rect">anySimpleType</a> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> directly or indirectly from <a href="#anySimpleType" shape="rect">anySimpleType</a>, it follows that the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> relation arranges all simple types into a tree structure, which is conventionally referred to as the <em>derivation hierarchy</em>.</p><p>By 'restriction' is meant the definition of a datatype whose <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> are subsets of those of its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>.</p><div class="block">Formally, <span class="termdef"><a id="dt-restriction" name="dt-restriction" title="" shape="rect"></a>A datatype <var>R</var> is a <b>restriction</b> of another datatype <var>B</var> when</span> <ul><li><div class="p">the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <var>R</var> is a subset of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <var>B</var>, and </div></li><li><div class="p">the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <var>R</var> is a subset of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <var>B</var>. </div></li></ul> </div><p> Note that all three forms of datatype <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>construction<span class="arrow">&#183;</span></a> produce <a href="#dt-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restrictions<span class="arrow">&#183;</span></a> of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>: <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> does so by means of <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>, while <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>construction<span class="arrow">&#183;</span></a> by <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> or <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> does so because those <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructions<span class="arrow">&#183;</span></a> take <a href="#anySimpleType" shape="rect">anySimpleType</a> as the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. It follows that all datatypes are <a href="#dt-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restrictions<span class="arrow">&#183;</span></a> of <a href="#anySimpleType" shape="rect">anySimpleType</a>. This specification provides no means by which a datatype may be defined so as to have a larger <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> or <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> than its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. </p><p></p><p>By 'construction' is meant the creation of a datatype by defining it in terms of another.</p><p> <span class="termdef"><a name="dt-constructed" id="dt-constructed" title="" shape="rect">[Definition:]&#160;&#160;</a>All <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes are defined in terms of, or <b>constructed</b> from, other datatypes, either by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restricting<span class="arrow">&#183;</span></a> the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> or <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of a <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> using zero or more <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> or by specifying the new datatype as a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> of items of some <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a>, or by defining it as a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> of some specified sequence of <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a>.</span> These three forms of <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>construction<span class="arrow">&#183;</span></a> are often called "<a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a>", "<a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>construction<span class="arrow">&#183;</span></a> by <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>", and "<a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>construction<span class="arrow">&#183;</span></a> by <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>", 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 <a href="#std" class="compref" shape="rect">Simple Type Definition</a>. This distinguishes <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes from the <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> and <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes, which can be understood only in the light of documentation (namely, their descriptions elsewhere in this specification, or, for <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitives<span class="arrow">&#183;</span></a>, in the appropriate implementation-specific documentation). All <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes are <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a>, and all <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> datatypes are <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a>. </p></div><div class="div3"> <h4><a name="built-in-vs-user-derived" id="built-in-vs-user-derived" shape="rect"></a>2.4.4 Built-in vs. User-Defined Datatypes</h4><ul><li><div class="p"> <span class="termdef"><a name="dt-built-in" id="dt-built-in" title="" shape="rect">[Definition:]&#160;&#160;</a><b>Built-in</b> datatypes are those which are defined in this specification; they can be <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a>, <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, or <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes . </span> </div></li><li><div class="p"> <span class="termdef"><a name="dt-user-defined" id="dt-user-defined" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>User-defined</b> datatypes are those datatypes that are defined by individual schema designers. </span> </div></li></ul><p>The <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> 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 <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, the <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes are automatically included in every valid schema. Other host languages <span class="rfc2119">should</span> specify that all of the datatypes decribed here as built-ins are automatically available; they <span class="rfc2119">may</span> specify that additional datatypes are also made available automatically.</p><div class="note"><div class="p"><b>Note:</b> <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>Implementation-defined<span class="arrow">&#183;</span></a> datatypes, whether <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> or <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a>, may sometimes be included automatically in any schemas processed by that implementation; nevertheless, they are not built in to <em>every</em> schema, and are thus not included in the term 'built-in', as that term is used in this specification. </div></div><p>The mechanism for making <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatypes available for use is not defined in this specification; if <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatypes are to be available, some such mechanism <span class="rfc2119">must</span> be specified by the host language.</p><p><span class="termdef"><a name="dt-unknown-dt" id="dt-unknown-dt" title="" shape="rect">[Definition:]&#160;&#160;</a>A datatype which is not available for use is said to be <b>unknown</b>.</span> </p><div class="note"><div class="p"><b>Note:</b> From the schema author's perspective, a reference to a datatype which proves to be <a href="#dt-unknown-dt" class="termref" shape="rect"><span class="arrow">&#183;</span>unknown<span class="arrow">&#183;</span></a> might reflect any of the following causes, or others: <div class="constraintlist"><div class="clnumber">1<a id="unkown.type" name="unkown.type" shape="rect"> </a><span class="p">An error has been made in giving the name of the datatype.</span></div> <div class="clnumber">2<a id="unkown.sdoc" name="unkown.sdoc" shape="rect"> </a><span class="p">The datatype is a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> 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).</span></div> <div class="clnumber">3<a id="unkown.id-primitive" name="unkown.id-primitive" shape="rect"> </a><span class="p">The datatype is an <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype not supported by the implementation being used.</span></div> <div class="clnumber">4<a id="unkown.id-derived" name="unkown.id-derived" shape="rect"> </a><span class="p">The datatype is an <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatype which is made automatically available by some implementations, but not by the implementation being used.</span></div> <div class="clnumber">5<a id="unkown.contaminated" name="unkown.contaminated" shape="rect"> </a><span class="p">The datatype is a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatype whose base type is <a href="#dt-unknown-dt" class="termref" shape="rect"><span class="arrow">&#183;</span>unknown<span class="arrow">&#183;</span></a></span></div> </div> From the point of view of the implementation, these cases are likely to be indistinguishable. </div></div><div class="note"><div class="p"><b>Note:</b> In the terminology of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, the datatypes here called <a href="#dt-unknown-dt" class="termref" shape="rect"><span class="arrow">&#183;</span>unknown<span class="arrow">&#183;</span></a> are referred to as <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-null" shape="rect">absent</a>. </div></div><p> Conceptually there is no difference between the <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes included in this specification and the <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatypes which will be created by individual schema designers. The <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> 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 reinventing them.&#160; Furthermore, including these <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> datatypes in this specification serves to demonstrate the mechanics and utility of the datatype generation facilities of this specification. </p></div></div></div><div class="div1"> <h2><a name="built-in-datatypes" id="built-in-datatypes" shape="rect"></a>3 Built-in Datatypes and Their Definitions</h2><div class="image-plus-caption"><object data="type-hierarchy-201104.svg" width="810" height="1060" standby="Loading Built-in Datatype Hierarchy ..." title="Built-in Datatype Hierarchy" type="image/svg+xml"><img src="type-hierarchy-201104.png" width="810" height="1060" alt="Built-in Datatype Hierarchy diagram" longdesc="type-hierarchy-201104.longdesc.html" usemap="#built-in-datatype-hierarchy-image-map" /></object><p class="image-caption">Diagram showing the derivation relations in the built-in type hierarchy. (A <a href="type-hierarchy-201104.longdesc.html" shape="rect">long description of the diagram</a> is available separately.) </p></div><map name="built-in-datatype-hierarchy-image-map" id="built-in-datatype-hierarchy-image-map"><area href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-anyType" coords="10, 10, 210, 30" title="anyType" alt="anyType" shape="rect" /> <area href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#Complex_Type_Definitions" coords="40, 40, 240, 60" title="all complex types" alt="all complex types" shape="rect" /> <area href="#anySimpleType" coords="40, 70, 240, 90" title="anySimpleType" alt="anySimpleType" shape="rect" /> <area href="#anyAtomicType" coords="70, 100, 270, 120" title="anyAtomicType" alt="anyAtomicType" shape="rect" /> <area href="#anyURI" coords="100, 130, 300, 150" title="anyURI" alt="anyURI" shape="rect" /> <area href="#base64Binary" coords="100, 160, 300, 180" title="base64Binary" alt="base64Binary" shape="rect" /> <area href="#boolean" coords="100, 190, 300, 210" title="boolean" alt="boolean" shape="rect" /> <area href="#date" coords="100, 220, 300, 240" title="date" alt="date" shape="rect" /> <area href="#dateTime" coords="100, 250, 300, 270" title="dateTime" alt="dateTime" shape="rect" /> <area href="#dateTimeStamp" coords="130, 280, 330, 300" title="dateTimeStamp" alt="dateTimeStamp" shape="rect" /> <area href="#decimal" coords="100, 310, 300, 330" title="decimal" alt="decimal" shape="rect" /> <area href="#integer" coords="350, 340, 550, 360" title="integer" alt="integer" shape="rect" /> <area href="#long" coords="380, 370, 580, 390" title="long" alt="long" shape="rect" /> <area href="#int" coords="410, 400, 610, 420" title="int" alt="int" shape="rect" /> <area href="#short" coords="440, 430, 640, 450" title="short" alt="short" shape="rect" /> <area href="#byte" coords="470, 460, 670, 480" title="byte" alt="byte" shape="rect" /> <area href="#nonNegativeInteger" coords="380, 490, 580, 510" title="nonNegativeInteger" alt="nonNegativeInteger" shape="rect" /> <area href="#positiveInteger" coords="410, 520, 610, 540" title="positiveInteger" alt="positiveInteger" shape="rect" /> <area href="#unsignedLong" coords="410, 550, 610, 570" title="unsignedLong" alt="unsignedLong" shape="rect" /> <area href="#unsignedInt" coords="440, 580, 640, 600" title="unsignedInt" alt="unsignedInt" shape="rect" /> <area href="#unsignedShort" coords="470, 610, 670, 630" title="unsignedShort" alt="unsignedShort" shape="rect" /> <area href="#unsignedByte" coords="500, 640, 700, 660" title="unsignedByte" alt="unsignedByte" shape="rect" /> <area href="#nonPositiveInteger" coords="380, 670, 580, 690" title="nonPositiveInteger" alt="nonPositiveInteger" shape="rect" /> <area href="#negativeInteger" coords="410, 700, 610, 720" title="negativeInteger" alt="negativeInteger" shape="rect" /> <area href="#double" coords="100, 370, 300, 390" title="double" alt="double" shape="rect" /> <area href="#duration" coords="100, 400, 300, 420" title="duration" alt="duration" shape="rect" /> <area href="#dayTimeDuration" coords="130, 430, 330, 450" title="dayTimeDuration" alt="dayTimeDuration" shape="rect" /> <area href="#yearMonthDuration" coords="130, 460, 330, 480" title="yearMonthDuration" alt="yearMonthDuration" shape="rect" /> <area href="#float" coords="100, 490, 300, 510" title="float" alt="float" shape="rect" /> <area href="#gDay" coords="100, 520, 300, 540" title="gDay" alt="gDay" shape="rect" /> <area href="#gMonth" coords="100, 550, 300, 570" title="gMonth" alt="gMonth" shape="rect" /> <area href="#gMonthDay" coords="100, 580, 300, 600" title="gMonthDay" alt="gMonthDay" shape="rect" /> <area href="#gYear" coords="100, 610, 300, 630" title="gYear" alt="gYear" shape="rect" /> <area href="#gYearMonth" coords="100, 640, 300, 660" title="gYearMonth" alt="gYearMonth" shape="rect" /> <area href="#hexBinary" coords="100, 670, 300, 690" title="hexBinary" alt="hexBinary" shape="rect" /> <area href="#NOTATION" coords="100, 700, 300, 720" title="NOTATION" alt="NOTATION" shape="rect" /> <area href="#QName" coords="100, 730, 300, 750" title="QName" alt="QName" shape="rect" /> <area href="#string" coords="100, 760, 300, 780" title="string" alt="string" shape="rect" /> <area href="#normalizedString" coords="350, 790, 550, 810" title="normalizedString" alt="normalizedString" shape="rect" /> <area href="#token" coords="380, 820, 580, 840" title="token" alt="token" shape="rect" /> <area href="#language" coords="410, 850, 610, 870" title="language" alt="language" shape="rect" /> <area href="#Name" coords="410, 880, 610, 900" title="Name" alt="Name" shape="rect" /> <area href="#NCName" coords="440, 910, 640, 930" title="NCName" alt="NCName" shape="rect" /> <area href="#ENTITY" coords="470, 940, 670, 960" title="ENTITY" alt="ENTITY" shape="rect" /> <area href="#ID" coords="470, 970, 670, 990" title="ID" alt="ID" shape="rect" /> <area href="#IDREF" coords="470, 1000, 670, 1020" title="IDREF" alt="IDREF" shape="rect" /> <area href="#NMTOKEN" coords="410, 1030, 610, 1050" title="NMTOKEN" alt="NMTOKEN" shape="rect" /> <area href="#time" coords="100, 820, 300, 840" title="time" alt="time" shape="rect" /> <area href="#ENTITIES" coords="70, 850, 270, 870" title="ENTITIES" alt="ENTITIES" shape="rect" /> <area href="#IDREFS" coords="70, 880, 270, 900" title="IDREFS" alt="IDREFS" shape="rect" /> <area href="#NMTOKENS" coords="70, 910, 270, 930" title="NMTOKENS" alt="NMTOKENS" shape="rect" /> </map><div class="block">Each built-in datatype defined in this specification can be uniquely addressed via a URI Reference constructed as follows: <ol class="enumar"><li><div class="p">the base URI is the URI of the XML Schema namespace</div></li><li><div class="p">the fragment identifier is the name of the datatype</div></li></ol> </div><div class="block">For example, to address the <a href="#int" shape="rect">int</a> datatype, the URI is: <ul><li><div class="p"><code>http://www.w3.org/2001/XMLSchema#int</code></div></li></ul> </div><div class="block">Additionally, each facet definition element can be uniquely addressed via a URI constructed as follows: <ol class="enumar"><li><div class="p">the base URI is the URI of the XML Schema namespace</div></li><li><div class="p">the fragment identifier is the name of the facet</div></li></ol> </div><div class="block">For example, to address the maxInclusive facet, the URI is: <ul><li><div class="p"><code>http://www.w3.org/2001/XMLSchema#maxInclusive</code></div></li></ul> </div><div class="block">Additionally, each facet usage in a built-in <a href="#std" class="compref" shape="rect">Simple Type Definition</a> can be uniquely addressed via a URI constructed as follows: <ol class="enumar"><li><div class="p">the base URI is the URI of the XML Schema namespace</div></li><li><div class="p">the fragment identifier is the name of the <a href="#std" class="compref" shape="rect">Simple Type Definition</a>, followed by a period ('<code>.</code>') followed by the name of the facet</div></li></ol> </div><div class="block">For example, to address the usage of the maxInclusive facet in the definition of int, the URI is: <ul><li><div class="p"><code>http://www.w3.org/2001/XMLSchema#int.maxInclusive</code></div></li></ul> </div><div class="div2"> <h3><span class="nav"> <a href="#special-datatypes" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="namespaces" id="namespaces" shape="rect"></a>3.1 Namespace considerations</h3><p> The <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> 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 <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes in this specification have the namespace name: </p><ul><li><div class="p">http://www.w3.org/2001/XMLSchema</div></li></ul><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 <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is also defined in the namespace whose URI is: </p><ul><li><div class="p">http://www.w3.org/2001/XMLSchema-datatypes</div></li></ul><p> </p><p> Each <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype may also be associated with a target namespace.&#160; If it is constructed from a schema document, then its namespace is typically the target namespace of that schema document. (See <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-schema" shape="rect">XML Representation of Schemas</a> in <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>.) </p></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#namespaces" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#built-in-primitive-datatypes" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="special-datatypes" id="special-datatypes" shape="rect"></a>3.2 Special Built-in Datatypes</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.2.1 <a href="#anySimpleType" shape="rect">anySimpleType</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.2.1.1 <a href="#sec-ast-vs" shape="rect">Value space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.2.1.2 <a href="#sec-ast-lex" shape="rect">Lexical mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.2.1.3 <a href="#sec-ast-f" shape="rect">Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.2.2 <a href="#anyAtomicType" shape="rect">anyAtomicType</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.2.2.1 <a href="#sec-aat-vs" shape="rect">Value space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.2.2.2 <a href="#sec-aat-lex" shape="rect">Lexical mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.2.2.3 <a href="#sec-aat-f" shape="rect">Facets</a><br clear="none" /> </div><p>The two datatypes at the root of the hierarchy of simple types are <a href="#anySimpleType" shape="rect">anySimpleType</a> and <a href="#anyAtomicType" shape="rect">anyAtomicType</a>.</p><div class="div3"> <h4><a name="anySimpleType" id="anySimpleType" shape="rect"></a>3.2.1 anySimpleType</h4><p><span class="termdef"><a id="dt-anySimpleType" name="dt-anySimpleType" title="" shape="rect"></a> The definition of <b>anySimpleType</b> is a special <a href="#dt-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restriction<span class="arrow">&#183;</span></a> of <b><i>anyType</i></b>.&#160; The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>anySimpleType</b> is the set of all sequences of Unicode characters, and its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> includes all <a href="#dt-atomic-value" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic values<span class="arrow">&#183;</span></a> and all finite-length lists of zero or more <a href="#dt-atomic-value" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic values<span class="arrow">&#183;</span></a>.</span></p><p>For further details of <a href="#anySimpleType" shape="rect">anySimpleType</a> and its representation as a <a href="#std" class="compref" shape="rect">Simple Type Definition</a>, see <a href="#builtin-stds" shape="rect">Built-in Simple Type Definitions (&#167;4.1.6)</a>.</p><div class="div4"> <h5><a name="sec-ast-vs" id="sec-ast-vs" shape="rect"></a>3.2.1.1 Value space</h5><p>The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#anySimpleType" shape="rect">anySimpleType</a> is the set of all <a href="#dt-atomic-value" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic values<span class="arrow">&#183;</span></a> and of all finite-length lists of zero or more <a href="#dt-atomic-value" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic values<span class="arrow">&#183;</span></a>.</p><div class="note"><div class="p"><b>Note:</b> It is a consequence of this definition, together with the definition of the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> in the next section, that some values of this datatype have no <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> using the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> defined by this specification. That is, the "potential" <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and the "effable" or "nameable" <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> diverge for this datatype. As far as this specification is concerned, there is no operational difference between the potential and effable <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> 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 <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, the difference may have practical importance in some contexts. In those contexts, the term <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> should unless otherwise qualified be taken to mean the potential <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>. </div></div></div><div class="div4"> <h5><a name="sec-ast-lex" id="sec-ast-lex" shape="rect"></a>3.2.1.2 Lexical mapping</h5><p>The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#anySimpleType" shape="rect">anySimpleType</a> is the set of all finite-length sequences of zero or more <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect">character</a>s (as defined in <a href="#XML" shape="rect">[XML]</a>) that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a> production from <a href="#XML" shape="rect">[XML]</a>. This is equivalent to the union of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a> of all <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> and all possible <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes. </p><p>It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a> production from <a href="#XML" shape="rect">[XML]</a>, or that from <a href="#XML1.0" shape="rect">[XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </p><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> of <a href="#anySimpleType" shape="rect">anySimpleType</a> is the union of the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> of all <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes and all list datatypes. It will be noted that this mapping is not a function: a given <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> may map to one value or to several values of different <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> 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 <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, the <code>xsi:type</code> attribute defined by that specification in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#xsi_type" shape="rect">xsi:type</a> can be used to indicate which value a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> 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></div><div class="div4"> <h5><a name="sec-ast-f" id="sec-ast-f" shape="rect"></a>3.2.1.3 Facets</h5><p>When a new datatype is defined by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a>, <a href="#anySimpleType" shape="rect">anySimpleType</a> <span class="rfc2119">must not</span> be used as the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. So no <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> are directly applicable to <a href="#anySimpleType" shape="rect">anySimpleType</a>. </p></div></div><div class="div3"> <h4><a name="anyAtomicType" id="anyAtomicType" shape="rect"></a>3.2.2 anyAtomicType</h4><p><span class="termdef"><a name="dt-anyAtomicType" id="dt-anyAtomicType" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>anyAtomicType</b> is a special <a href="#dt-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restriction<span class="arrow">&#183;</span></a> of <a href="#anySimpleType" shape="rect">anySimpleType</a>. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a> of <b>anyAtomicType</b> are the unions of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a> of all the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes, and <b>anyAtomicType</b> is their <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. </span> </p><p>For further details of <a href="#anyAtomicType" shape="rect">anyAtomicType</a> and its representation as a <a href="#std" class="compref" shape="rect">Simple Type Definition</a>, see <a href="#builtin-stds" shape="rect">Built-in Simple Type Definitions (&#167;4.1.6)</a>.</p><div class="div4"> <h5><a name="sec-aat-vs" id="sec-aat-vs" shape="rect"></a>3.2.2.1 Value space</h5><p>The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#anyAtomicType" shape="rect">anyAtomicType</a> is the union of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> of all the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes defined here or supplied as <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitives<span class="arrow">&#183;</span></a>.</p></div><div class="div4"> <h5><a name="sec-aat-lex" id="sec-aat-lex" shape="rect"></a>3.2.2.2 Lexical mapping</h5><p>The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#anyAtomicType" shape="rect">anyAtomicType</a> is the set of all finite-length sequences of zero or more <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect">character</a>s (as defined in <a href="#XML" shape="rect">[XML]</a>) that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a> production from <a href="#XML" shape="rect">[XML]</a>. This is equivalent to the union of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a> of all <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes. </p><p>It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a> production from <a href="#XML" shape="rect">[XML]</a>, or that from <a href="#XML1.0" shape="rect">[XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </p><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> of <a href="#anyAtomicType" shape="rect">anyAtomicType</a> is the union of the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> of all <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes. It will be noted that this mapping is not a function: a given <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> may map to one value or to several values of different <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> 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 <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, the <code>xsi:type</code> attribute defined by that specification in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#xsi_type" shape="rect">xsi:type</a> can be used to indicate which value a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> 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></div><div class="div4"> <h5><a name="sec-aat-f" id="sec-aat-f" shape="rect"></a>3.2.2.3 Facets</h5><p>When a new datatype is defined by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a>, <a href="#anyAtomicType" shape="rect">anyAtomicType</a> <span class="rfc2119">must not</span> be used as the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. So no <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> are directly applicable to <a href="#anyAtomicType" shape="rect">anyAtomicType</a>. </p></div></div></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#special-datatypes" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#ordinary-built-ins" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="built-in-primitive-datatypes" id="built-in-primitive-datatypes" shape="rect"></a>3.3 Primitive Datatypes</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.1 <a href="#string" shape="rect">string</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.1.1 <a href="#sec-vs-string" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.1.2 <a href="#string-lexical-mapping" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.1.3 <a href="#string-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.1.4 <a href="#string-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.2 <a href="#boolean" shape="rect">boolean</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.2.1 <a href="#sec-vs-boolean" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.2.2 <a href="#boolean-lexical-mapping" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.2.3 <a href="#boolean-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.3 <a href="#decimal" shape="rect">decimal</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.3.1 <a href="#decimal-lexical-representation" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.3.2 <a href="#decimal-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.3.3 <a href="#decimal-derived-types" shape="rect">Datatypes based on decimal</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.4 <a href="#float" shape="rect">float</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.4.1 <a href="#sec-vs-float" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.4.2 <a href="#sec-lex-float" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.4.3 <a href="#float-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.5 <a href="#double" shape="rect">double</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.5.1 <a href="#sec-vs-double" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.5.2 <a href="#sec-lex-double" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.5.3 <a href="#double-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.6 <a href="#duration" shape="rect">duration</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.6.1 <a href="#sec-vs-duration" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.6.2 <a href="#duration-lexical-space" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.6.3 <a href="#duration-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.6.4 <a href="#duration-derived-types" shape="rect">Related Datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.7 <a href="#dateTime" shape="rect">dateTime</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.7.1 <a href="#dateTime-value-space" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.7.2 <a href="#dateTime-lexical-mapping" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.7.3 <a href="#dateTime-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.7.4 <a href="#dateTime-derived-types" shape="rect">Related Datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.8 <a href="#time" shape="rect">time</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.8.1 <a href="#time-value-space" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.8.2 <a href="#time-lexical-mapping" shape="rect">Lexical Mappings</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.8.3 <a href="#time-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.9 <a href="#date" shape="rect">date</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.9.1 <a href="#date-value-space" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.9.2 <a href="#date-lexical-mapping" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.9.3 <a href="#date-facets" shape="rect">Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.10 <a href="#gYearMonth" shape="rect">gYearMonth</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.10.1 <a href="#gYearMonth-value-space" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.10.2 <a href="#gYearMonth-lexical-repr" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.10.3 <a href="#gYearMonth-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.11 <a href="#gYear" shape="rect">gYear</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.11.1 <a href="#gYear-value-space" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.11.2 <a href="#gYear-lexical-repr" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.11.3 <a href="#gYear-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.12 <a href="#gMonthDay" shape="rect">gMonthDay</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.12.1 <a href="#gMonthDay-value-space" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.12.2 <a href="#gMonthDay-lexical-repr" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.12.3 <a href="#gMonthDay-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.13 <a href="#gDay" shape="rect">gDay</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.13.1 <a href="#sec-vs-gDay" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.13.2 <a href="#gDay-lexical-mapping" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.13.3 <a href="#gDay-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.14 <a href="#gMonth" shape="rect">gMonth</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.14.1 <a href="#gMonth-value-space" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.14.2 <a href="#gMonth-lexical-repr" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.14.3 <a href="#gMonth-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.15 <a href="#hexBinary" shape="rect">hexBinary</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.15.1 <a href="#sec-vs-hexbin" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.15.2 <a href="#hexBinary-lexical-representation" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.15.3 <a href="#hexBinary-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.16 <a href="#base64Binary" shape="rect">base64Binary</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.16.1 <a href="#sec-vs-b46b" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.16.2 <a href="#sec-lex-b64b" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.16.3 <a href="#base64Binary-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.17 <a href="#anyURI" shape="rect">anyURI</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.17.1 <a href="#anyURI-vs" shape="rect">Value Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.17.2 <a href="#anyURI-lexical-representation" shape="rect">Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.17.3 <a href="#anyURI-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.18 <a href="#QName" shape="rect">QName</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.18.1 <a href="#QName-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.19 <a href="#NOTATION" shape="rect">NOTATION</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.3.19.1 <a href="#NOTATION-facets" shape="rect"> Facets</a><br clear="none" /> </div><p> The <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes defined by this specification are described below.&#160; For each datatype, the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is described; the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> is defined using an extended Backus Naur Format grammar (and in most cases also a regular expression using the regular expression language of <a href="#regexs" shape="rect">Regular Expressions (&#167;G)</a>); <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> which apply to the datatype are listed; and any datatypes <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from this datatype are specified. </p><p> Conforming processors <span class="rfc2119">must</span> support the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes defined in this specification; it is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether they support others. <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>Primitive<span class="arrow">&#183;</span></a> datatypes may be added by revisions to this specification. </p><div class="note"><div class="p"><b>Note:</b> Processors <span class="rfc2119">may</span>, for example, support the floating-point decimal datatype specified in <a href="#pd-note" shape="rect">[Precision Decimal]</a>.</div></div><div class="div3"> <h4><a name="string" id="string" shape="rect"></a>3.3.1 string</h4><p><span class="termdef"><a name="dt-string" id="dt-string" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>string</b> datatype represents character strings in XML. </span></p><div class="note"><div class="p"><b>Note:</b> Many human languages have writing systems that require child elements for control of aspects such as bidirectional formatting or ruby annotation (see <a href="#ruby" shape="rect">[Ruby]</a> and Section 8.2.4 <a href="https://www.w3.org/TR/html401/struct/dirlang.html#h-8.2.4" shape="rect">Overriding the bidirectional algorithm: the BDO element</a> of <a href="#html4" shape="rect">[HTML 4.01]</a>).&#160; Thus, <a href="#string" shape="rect">string</a>, 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 <a href="https://www.w3.org/TR/2001/REC-xmlschema-0-20010502/#textType" shape="rect">Any Element, Any Attribute</a> of <a href="#schema-primer" shape="rect">[XML Schema Language: Part 0 Primer]</a>.</div></div><div class="div4"> <h5><a name="sec-vs-string" id="sec-vs-string" shape="rect"></a>3.3.1.1 Value Space</h5><p>The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#string" shape="rect">string</a> is the set of finite-length sequences of zero or more <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect">character</a>s (as defined in <a href="#XML" shape="rect">[XML]</a>) that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a> production from <a href="#XML" shape="rect">[XML]</a>. A <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect">character</a> is an atomic unit of communication; it is not further specified except to note that every <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect">character</a> has a corresponding Universal Character Set (UCS) code point, which is an integer.</p><p>It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a> production from <a href="#XML" shape="rect">[XML]</a>, or that from <a href="#XML1.0" shape="rect">[XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </p><p>Equality for <a href="#string" shape="rect">string</a> is identity. No order is prescribed.</p><div class="note"><div class="p"><b>Note:</b> As noted in <a href="#ff-o" class="compref" shape="rect">ordered</a>, the fact that this specification does not specify an order relation for <a href="#dt-string" class="termref" shape="rect"><span class="arrow">&#183;</span>string<span class="arrow">&#183;</span></a> does not preclude other applications from treating strings as being ordered.</div></div></div><div class="div4"> <h5><a name="string-lexical-mapping" id="string-lexical-mapping" shape="rect"></a>3.3.1.2 Lexical Mapping</h5><div class="block">The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#string" shape="rect">string</a> is the set of finite-length sequences of zero or more <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect">character</a>s (as defined in <a href="#XML" shape="rect">[XML]</a>) that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a> production from <a href="#XML" shape="rect">[XML]</a>. <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-stringRep" id="nt-stringRep" shape="rect"></a><span class="lhs">[1] &#160; <i>stringRep</i></span>&#160;::= <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a>*&#160; <div class="bnf_comment">/* <i class="com">(as defined in <a href="#XML" shape="rect">[XML]</a>)</i> */</div></div></div> </div><p>It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a> production from <a href="#XML" shape="rect">[XML]</a>, or that from <a href="#XML1.0" shape="rect">[XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </p><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#string" shape="rect">string</a> is <a href="#f-stringLexmap" shape="rect"><i><span class="arrow">&#183;</span>stringLexicalMap<span class="arrow">&#183;</span></i></a>, and the <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is <a href="#f-stringCanmap" shape="rect"><i><span class="arrow">&#183;</span>stringCanonicalMap<span class="arrow">&#183;</span></i></a>; each is a subset of the identity function. </p></div><div class="div4"> <h5><a name="string-facets" id="string-facets" shape="rect"></a>3.3.1.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#string" shape="rect">string</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-whiteSpace" name="string.whiteSpace" shape="rect" id="string.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>preserve</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#string" shape="rect">string</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#string" shape="rect">string</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="string-derived-types" id="string-derived-types" shape="rect"></a>3.3.1.4 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#string" shape="rect">string</a></p><ul><li><a href="#normalizedString" shape="rect">normalizedString</a></li></ul></div></div><div class="div3"> <h4><a name="boolean" id="boolean" shape="rect"></a>3.3.2 boolean</h4><p><span class="termdef"><a name="dt-boolean" id="dt-boolean" title="" shape="rect">[Definition:]&#160;&#160;</a><b>boolean</b> represents the values of two-valued logic.</span></p><div class="div4"> <h5><a name="sec-vs-boolean" id="sec-vs-boolean" shape="rect"></a>3.3.2.1 Value Space</h5><p><a href="#boolean" shape="rect">boolean</a> has the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of two-valued logic:&#160; {<b><i>true</i></b>, <b><i>false</i></b>}.</p></div><div class="div4"> <h5><a name="boolean-lexical-mapping" id="boolean-lexical-mapping" shape="rect"></a>3.3.2.2 Lexical Mapping</h5><div class="block"><a href="#boolean" shape="rect">boolean</a>'s lexical space is a set of four <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a>: <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-booleanRep" id="nt-booleanRep" shape="rect"></a><span class="lhs">[2] &#160; <i>booleanRep</i></span>&#160;::= '<code>true</code>'&#160;| '<code>false</code>'&#160;| '<code>1</code>'&#160;| '<code>0</code>'</div></div> </div><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#boolean" shape="rect">boolean</a> is <a href="#f-booleanLexmap" shape="rect"><i><span class="arrow">&#183;</span>booleanLexicalMap<span class="arrow">&#183;</span></i></a>; the <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is <a href="#f-booleanCanmap" shape="rect"><i><span class="arrow">&#183;</span>booleanCanonicalMap<span class="arrow">&#183;</span></i></a>. </p></div><div class="div4"> <h5><a name="boolean-facets" id="boolean-facets" shape="rect"></a>3.3.2.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#boolean" shape="rect">boolean</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="boolean.whiteSpace" shape="rect" id="boolean.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#boolean" shape="rect">boolean</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#boolean" shape="rect">boolean</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="decimal" id="decimal" shape="rect"></a>3.3.3 decimal</h4><p><span class="termdef"><a name="dt-decimal-datatype" id="dt-decimal-datatype" title="" shape="rect">[Definition:]&#160;&#160;</a><b>decimal</b> represents a subset of the real numbers, which can be represented by decimal numerals. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>decimal</b> is the set of numbers that can be obtained by dividing an integer by a non-negative power of ten, i.e., expressible as <var>i</var>&#160;/&#160;10<sup><var>n</var></sup> where <var>i</var> and <var>n</var> are integers and <var>n</var>&#160;&#8805;&#160;0. Precision is not reflected in this value space; the number 2.0 is not distinct from the number 2.00. The order relation on <b>decimal</b> is the order relation on real numbers, restricted to this subset.</span></p><div class="note"><div class="p"><b>Note:</b> For a decimal datatype whose values do reflect precision, see <a href="#pd-note" shape="rect">[Precision Decimal]</a>.</div></div><div class="div4"> <h5><a name="decimal-lexical-representation" id="decimal-lexical-representation" shape="rect"></a>3.3.3.1 Lexical Mapping</h5><p><b>decimal</b> has a lexical representation consisting of a non-empty finite-length sequence of decimal digits (#x30&#8211;#x39) separated by a period as a decimal indicator.&#160; An optional leading sign is allowed.&#160; If the sign is omitted, "+" is assumed.&#160; Leading and trailing zeroes are optional.&#160; If the fractional part is zero, the period and following zero(es) can be omitted. For example:&#160; '<code>-1.23</code>', '<code>12678967.543233</code>', '<code>+100000.00</code>', '<code>210</code>'. </p><div class="block"><div class="defset"> <div class="defset-head">The <a href="#decimal" shape="rect">decimal</a> Lexical Representation</div> <div class="prod"> <a name="nt-decimalRep" id="nt-decimalRep" shape="rect"></a><span class="lhs">[3] &#160; <i>decimalLexicalRep</i></span>&#160;::= <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a>&#160;| <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a></div></div> </div><div class="block">The lexical space of decimal is the set of lexical representations which match the grammar given above, or (equivalently) the regular expression <blockquote><blockquote><p> <code>(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)</code></p></blockquote></blockquote> </div><p> The mapping from lexical representations to values is the usual one for decimal numerals; it is given formally in <a href="#f-decimalLexmap" shape="rect"><i><span class="arrow">&#183;</span>decimalLexicalMap<span class="arrow">&#183;</span></i></a>. </p><p>The definition of the <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> has the effect of prohibiting certain options from the <a href="#decimal-lexical-representation" shape="rect">Lexical Mapping (&#167;3.3.3.1)</a>.&#160; Specifically, for integers, the decimal point and fractional part are prohibited. For other values, the preceding optional "+" sign is prohibited.&#160; The decimal point is required.&#160; In all cases, leading and trailing zeroes are prohibited subject to the following:&#160; there <span class="rfc2119">must</span> be at least one digit to the right and to the left of the decimal point which may be a zero.</p><p> The mapping from values to <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representations<span class="arrow">&#183;</span></a> is given formally in <a href="#f-decimalCanmap" shape="rect"><i><span class="arrow">&#183;</span>decimalCanonicalMap<span class="arrow">&#183;</span></i></a>. </p></div><div class="div4"> <h5><a name="decimal-facets" id="decimal-facets" shape="rect"></a>3.3.3.2 Facets</h5><p><span class="normal"><span class="normal">The <a href="#decimal" shape="rect">decimal</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="decimal.whiteSpace" shape="rect" id="decimal.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#decimal" shape="rect">decimal</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#decimal" shape="rect">decimal</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="decimal-derived-types" id="decimal-derived-types" shape="rect"></a>3.3.3.3 Datatypes based on decimal</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#decimal" shape="rect">decimal</a></p><ul><li><a href="#integer" shape="rect">integer</a></li></ul></div></div><div class="div3"> <h4><a name="float" id="float" shape="rect"></a>3.3.4 float</h4><p><span class="termdef"><a name="dt-float" id="dt-float" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>float</b> datatype is patterned after the IEEE single-precision 32-bit floating point datatype <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>.</span>&#160; Its value space is a subset of the rational numbers.&#160; Floating point numbers are often used to approximate arbitrary real numbers.</p><div class="div4"> <h5><a name="sec-vs-float" id="sec-vs-float" shape="rect"></a>3.3.4.1 Value Space</h5><p>The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#float" shape="rect">float</a> contains the non-zero numbers&#160; <var>m</var>&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;, 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 &#8722;149 and 104, inclusive.&#160; In addition to these values, the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#float" shape="rect">float</a> also contains the following <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a>:&#160; <b><i>positiveZero</i></b>, <b><i>negativeZero</i></b>, <b><i>positiveInfinity</i></b>, <b><i>negativeInfinity</i></b>, and <b><i>notANumber</i></b>.</p><div class="note"><div class="p"><b>Note:</b> As explained below, the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> of the <a href="#float" shape="rect">float</a> value <b><i>notANumber</i></b> is '<code>NaN</code>'.&#160; Accordingly, in English text we generally use 'NaN' to refer to that value.&#160; Similarly, we use 'INF' and '&#8722;INF' to refer to the two values <b><i>positiveInfinity</i></b> and <b><i>negativeInfinity</i></b>, and '0' and '&#8722;0' to refer to <b><i>positiveZero</i></b> and <b><i>negativeZero</i></b>.</div></div><div class="block">Equality and order for <a href="#float" shape="rect">float</a> are defined as follows: <ul><li><div class="p">Equality is identity, except that&#160; 0&#160;=&#160;&#8722;0&#160; (although they are not identical) and&#160; NaN&#160;&#8800;&#160;NaN&#160; (although NaN is of course identical to itself).</div><div class="p">0 and &#8722;0 are thus equivalent for purposes of enumerations and identity constraints, as well as for minimum and maximum values.</div></li><li><div class="p">For the basic values, the order relation on float is the order relation for rational numbers.&#160; INF is greater than all other non-NaN values; &#8722;INF is less than all other non-NaN values.&#160; NaN is <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> with any value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> including itself.&#160; 0 and &#8722;0 are greater than all the negative numbers and less than all the positive numbers.</div></li></ul> </div><div class="note"><div class="p"><b>Note:</b> Any value <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> with the value used for the four bounding facets (<a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a>, <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a>, <a href="#dt-minExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minExclusive<span class="arrow">&#183;</span></a>, and <a href="#dt-maxExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxExclusive<span class="arrow">&#183;</span></a>) will be excluded from the resulting restricted <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.&#160; In particular, when NaN is used as a facet value for a bounding facet, since no <a href="#float" shape="rect">float</a> values are <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>comparable<span class="arrow">&#183;</span></a> with it, the result is a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> that is empty.&#160; If any other value is used for a bounding facet, NaN will be excluded from the resulting restricted <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>; to add NaN back in requires union with the NaN-only space (which may be derived using the pattern '<code>NaN</code>').</div></div><div class="note"><div class="p"><b>Note:</b> The Schema 1.0 version of this datatype did not differentiate between 0 and &#8722;0 and NaN was equal to itself.&#160; The changes were made to make the datatype more closely mirror <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>.</div></div></div><div class="div4"> <h5><a name="sec-lex-float" id="sec-lex-float" shape="rect"></a>3.3.4.2 Lexical Mapping</h5><div class="block">The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#float" shape="rect">float</a> is the set of all decimal numerals with or without a decimal point, numerals in scientific (exponential) notation, and the <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> '<code>INF</code>', '<code>+INF</code>', '<code>-INF</code>', and '<code>NaN</code>' <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-floatRep" id="nt-floatRep" shape="rect"></a><span class="lhs">[4] &#160; <i>floatRep</i></span>&#160;::= <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a>&#160;| <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a>&#160;| <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a>&#160;| <a href="#nt-numSpecReps" shape="rect"><i>numericalSpecialRep</i></a></div></div> The <a href="#nt-floatRep" shape="rect"><i>floatRep</i></a> production is equivalent to this regular expression (after whitespace is removed from the regular expression): <blockquote class="shrink"><p><code>(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?<br clear="none" /> |(\+|-)?INF|NaN</code></p></blockquote> </div><p>The <a href="#float" shape="rect">float</a> datatype is designed to implement for schema processing the single-precision floating-point datatype of <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>.&#160; That specification does not specify specific <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a>, but does prescribe requirements on any <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> used.&#160; Any <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> that maps the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> just described onto the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, is a function, satisfies the requirements of <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>, and correctly handles the mapping of the literals '<code>INF</code>', '<code>NaN</code>', etc., to the <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a>, 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 <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a>.</p><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> <a href="#f-floatLexmap" shape="rect"><i><span class="arrow">&#183;</span>floatLexicalMap<span class="arrow">&#183;</span></i></a> is provided as an example of a simple algorithm that yields a conformant mapping, and that provides the most accurate rounding possible&#8212;and is thus useful for insuring inter-implementation reproducibility and inter-implementation round-tripping.&#160; The simple rounding algorithm used in <a href="#f-floatLexmap" shape="rect"><i><span class="arrow">&#183;</span>floatLexicalMap<span class="arrow">&#183;</span></i></a> may be more efficiently implemented using the algorithms of <a href="#clinger1990" shape="rect">[Clinger, WD (1990)]</a>.</p><div class="note"><div class="p"><b>Note:</b> The Schema 1.0 version of this datatype did not permit rounding algorithms whose results differed from <a href="#clinger1990" shape="rect">[Clinger, WD (1990)]</a>.</div></div><p>The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> <a href="#f-floatCanmap" shape="rect"><i><span class="arrow">&#183;</span>floatCanonicalMap<span class="arrow">&#183;</span></i></a> is provided as an example of a mapping that does not produce unnecessarily long <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representations<span class="arrow">&#183;</span></a>.&#160; Other algorithms which do not yield identical results for mapping from float values to character strings are permitted by <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>.</p></div><div class="div4"> <h5><a name="float-facets" id="float-facets" shape="rect"></a>3.3.4.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#float" shape="rect">float</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="float.whiteSpace" shape="rect" id="float.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#float" shape="rect">float</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#float" shape="rect">float</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>true</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="double" id="double" shape="rect"></a>3.3.5 double</h4><p> <span class="termdef"><a name="dt-double" id="dt-double" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>double</b> datatype is patterned after the IEEE double-precision 64-bit floating point datatype <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>.</span>&#160; Each floating point datatype has a value space that is a subset of the rational numbers.&#160; Floating point numbers are often used to approximate arbitrary real numbers.</p><div class="note"><div class="p"><b>Note:</b> The only significant differences between float and double are the three defining constants 53 (vs 24), &#8722;1074 (vs &#8722;149), and 971 (vs 104).</div></div><div class="div4"> <h5><a name="sec-vs-double" id="sec-vs-double" shape="rect"></a>3.3.5.1 Value Space</h5><p>The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#double" shape="rect">double</a> contains the non-zero numbers&#160; <var>m</var>&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;, where <var>m</var> is an integer whose absolute value is less than 2<sup>53</sup>, and <var>e</var> is an integer between &#8722;1074 and 971, inclusive.&#160; In addition to these values, the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#double" shape="rect">double</a> also contains the following <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a>:&#160; <b><i>positiveZero</i></b>, <b><i>negativeZero</i></b>, <b><i>positiveInfinity</i></b>, <b><i>negativeInfinity</i></b>, and <b><i>notANumber</i></b>.</p><div class="note"><div class="p"><b>Note:</b> As explained below, the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> of the <a href="#double" shape="rect">double</a> value <b><i>notANumber</i></b> is '<code>NaN</code>'.&#160; Accordingly, in English text we generally use 'NaN' to refer to that value.&#160; Similarly, we use 'INF' and '&#8722;INF' to refer to the two values <b><i>positiveInfinity</i></b> and <b><i>negativeInfinity</i></b>, and '0' and '&#8722;0' to refer to <b><i>positiveZero</i></b> and <b><i>negativeZero</i></b>.</div></div><div class="block">Equality and order for <a href="#double" shape="rect">double</a> are defined as follows: <ul><li><div class="p">Equality is identity, except that&#160; 0&#160;=&#160;&#8722;0&#160; (although they are not identical) and&#160; NaN&#160;&#8800;&#160;NaN&#160; (although NaN is of course identical to itself).</div><div class="p">0 and &#8722;0 are thus equivalent for purposes of enumerations, identity constraints, and minimum and maximum values. </div></li><li><div class="p">For the basic values, the order relation on double is the order relation for rational numbers.&#160; INF is greater than all other non-NaN values; &#8722;INF is less than all other non-NaN values.&#160; NaN is <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> with any value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> including itself.&#160; 0 and &#8722;0 are greater than all the negative numbers and less than all the positive numbers.</div></li></ul> </div><div class="note"><div class="p"><b>Note:</b> Any value <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> with the value used for the four bounding facets (<a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a>, <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a>, <a href="#dt-minExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minExclusive<span class="arrow">&#183;</span></a>, and <a href="#dt-maxExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxExclusive<span class="arrow">&#183;</span></a>) will be excluded from the resulting restricted <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.&#160; In particular, when NaN is used as a facet value for a bounding facet, since no <a href="#double" shape="rect">double</a> values are <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>comparable<span class="arrow">&#183;</span></a> with it, the result is a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> that is empty.&#160; If any other value is used for a bounding facet, NaN will be excluded from the resulting restricted <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>; to add NaN back in requires union with the NaN-only space (which may be derived using the pattern '<code>NaN</code>').</div></div><div class="note"><div class="p"><b>Note:</b> The Schema 1.0 version of this datatype did not differentiate between 0 and &#8722;0 and NaN was equal to itself.&#160; The changes were made to make the datatype more closely mirror <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>.</div></div></div><div class="div4"> <h5><a name="sec-lex-double" id="sec-lex-double" shape="rect"></a>3.3.5.2 Lexical Mapping</h5><div class="block">The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#double" shape="rect">double</a> is the set of all decimal numerals with or without a decimal point, numerals in scientific (exponential) notation, and the <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> '<code>INF</code>', '<code>+INF</code>', '<code>-INF</code>', and '<code>NaN</code>' <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-doubleRep" id="nt-doubleRep" shape="rect"></a><span class="lhs">[5] &#160; <i>doubleRep</i></span>&#160;::= <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a>&#160;| <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a>&#160;| <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a>&#160;| <a href="#nt-numSpecReps" shape="rect"><i>numericalSpecialRep</i></a></div></div> The <a href="#nt-doubleRep" shape="rect"><i>doubleRep</i></a> production is equivalent to this regular expression (after whitespace is eliminated from the expression): <blockquote class="shrink"><p> <code>(\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)? |(\+|-)?INF|NaN</code> </p></blockquote> </div><p>The <a href="#double" shape="rect">double</a> datatype is designed to implement for schema processing the double-precision floating-point datatype of <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>.&#160; That specification does not specify specific <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a>, but does prescribe requirements on any <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> used.&#160; Any <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> that maps the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> just described onto the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, is a function, satisfies the requirements of <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>, and correctly handles the mapping of the literals '<code>INF</code>', '<code>NaN</code>', etc., to the <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a>, 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 <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a>.</p><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> <a href="#f-doubleLexmap" shape="rect"><i><span class="arrow">&#183;</span>doubleLexicalMap<span class="arrow">&#183;</span></i></a> is provided as an example of a simple algorithm that yields a conformant mapping, and that provides the most accurate rounding possible&#8212;and is thus useful for insuring inter-implementation reproducibility and inter-implementation round-tripping.&#160; The simple rounding algorithm used in <a href="#f-doubleLexmap" shape="rect"><i><span class="arrow">&#183;</span>doubleLexicalMap<span class="arrow">&#183;</span></i></a> may be more efficiently implemented using the algorithms of <a href="#clinger1990" shape="rect">[Clinger, WD (1990)]</a>.</p><div class="note"><div class="p"><b>Note:</b> The Schema 1.0 version of this datatype did not permit rounding algorithms whose results differed from <a href="#clinger1990" shape="rect">[Clinger, WD (1990)]</a>.</div></div><p>The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> <a href="#f-doubleCanmap" shape="rect"><i><span class="arrow">&#183;</span>doubleCanonicalMap<span class="arrow">&#183;</span></i></a> is provided as an example of a mapping that does not produce unnecessarily long <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representations<span class="arrow">&#183;</span></a>.&#160; Other algorithms which do not yield identical results for mapping from float values to character strings are permitted by <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>.</p></div><div class="div4"> <h5><a name="double-facets" id="double-facets" shape="rect"></a>3.3.5.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#double" shape="rect">double</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="double.whiteSpace" shape="rect" id="double.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#double" shape="rect">double</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#double" shape="rect">double</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>true</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="duration" id="duration" shape="rect"></a>3.3.6 duration</h4><p> <span class="termdef"><a name="dt-duration" id="dt-duration" title="" shape="rect">[Definition:]&#160;&#160;</a><b>duration</b> is a datatype that represents durations of time.</span>&#160; The concept of duration being captured is drawn from those of <a href="#ISO8601" shape="rect">[ISO 8601]</a>, specifically <em>durations without fixed endpoints</em>.&#160; For example, "15 days" (whose most common lexical representation in <a href="#duration" shape="rect">duration</a> is "'<code>P15D</code>'") is a <a href="#duration" shape="rect">duration</a> value; "15 days beginning 12 July 1995" and "15 days ending 12 July 1995" are not <a href="#duration" shape="rect">duration</a> values.&#160; <a href="#duration" shape="rect">duration</a> can provide addition and subtraction operations between <a href="#duration" shape="rect">duration</a> values and between <a href="#duration" shape="rect">duration</a>/<a href="#dateTime" shape="rect">dateTime</a> value pairs, and can be the result of subtracting <a href="#dateTime" shape="rect">dateTime</a> values.&#160; However, only addition to <a href="#dateTime" shape="rect">dateTime</a> is required for XML Schema processing and is defined in the function <a href="#vp-dt-dateTimePlusDuration" shape="rect"><i><span class="arrow">&#183;</span>dateTimePlusDuration<span class="arrow">&#183;</span></i></a>.</p><div class="div4"> <h5><a name="sec-vs-duration" id="sec-vs-duration" shape="rect"></a>3.3.6.1 Value Space</h5><div class="block"> 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 <a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> value <span class="rfc2119">must not</span> be negative if the <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> value is positive and <span class="rfc2119">must not</span> be positive if the <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> is negative. <div class="defset"> <div class="defset-head">Properties of <a href="#duration" shape="rect">duration</a> Values</div> <div class="deftop"> <b><a name="vp-du-month" id="vp-du-month" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a></b></div> <div class="defindent"><a href="#integer" shape="rect">integer</a></div> <div class="deftop"> <b><a name="vp-du-second" id="vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a></b></div> <div class="defindent">a <a href="#decimal" shape="rect">decimal</a> value; <span class="rfc2119">must not</span> be negative if <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> is positive, and <span class="rfc2119">must not</span> be positive if <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> is negative.</div> </div> <a href="#duration" shape="rect">duration</a> is partially ordered.&#160; Equality of <a href="#duration" shape="rect">duration</a> is defined in terms of equality of <a href="#dateTime" shape="rect">dateTime</a>; order for <a href="#duration" shape="rect">duration</a> is defined in terms of the order of <a href="#dateTime" shape="rect">dateTime</a>. Specifically, the equality or order of two <a href="#duration" shape="rect">duration</a> values is determined by adding each <a href="#duration" shape="rect">duration</a> in the pair to each of the following four <a href="#dateTime" shape="rect">dateTime</a> values: <ul><li><div class="p">1696-09-01T00:00:00Z</div></li><li><div class="p">1697-02-01T00:00:00Z</div></li><li><div class="p">1903-03-01T00:00:00Z</div></li><li><div class="p">1903-07-01T00:00:00Z</div></li></ul> If all four resulting <a href="#dateTime" shape="rect">dateTime</a> value pairs are ordered the same way (less than, equal, or greater than), then the original pair of <a href="#duration" shape="rect">duration</a> values is ordered the same way; otherwise the original pair is <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a>.</div><div class="note"><div class="p"><b>Note:</b> 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:&#160; 1697-02-01T00:00:00Z&#160;+&#160;P1M&#160;&lt;&#160;1697-02-01T00:00:00Z&#160;+&#160;P30D&#160;, but 1903-03-01T00:00:00Z&#160;+&#160;P1M&#160;&gt;&#160;1903-03-01T00:00:00Z&#160;+&#160;P30D&#160;, so that&#160; P1M&#160;&lt;&gt;&#160;P30D&#160;.&#160; If two <a href="#duration" shape="rect">duration</a> values are ordered the same way when added to each of these four <a href="#dateTime" shape="rect">dateTime</a> values, they will retain the same order when added to <em>any</em> other <a href="#dateTime" shape="rect">dateTime</a> values.&#160; Therefore, two <a href="#duration" shape="rect">duration</a> values are incomparable if and only if they can <em>ever</em> result in different orders when added to <em>any</em> <a href="#dateTime" shape="rect">dateTime</a> value.</div></div><p>Under the definition just given, two <a href="#duration" shape="rect">duration</a> values are equal if and only if they are identical.</p><div class="note"><a name="two_totally_ordered_subtypes" id="two_totally_ordered_subtypes" shape="rect"></a><div class="p"><b>Note:</b> Two totally ordered datatypes (<a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> and <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a>) are derived from <a href="#duration" shape="rect">duration</a> in <a href="#ordinary-built-ins" shape="rect">Other Built-in Datatypes (&#167;3.4)</a>.</div></div><div class="note"><div class="p"><b>Note:</b> There are many ways to implement <a href="#duration" shape="rect">duration</a>, some of which do not base the implementation on the two-component model.&#160; This specification does not prescribe any particular implementation, as long as the visible results are isomorphic to those described herein.</div></div><div class="note"><div class="p"><b>Note:</b> See the conformance notes in <a href="#partial-implementation" shape="rect">Partial Implementation of Infinite Datatypes (&#167;5.4)</a>, which apply to this datatype.</div></div></div><div class="div4"> <h5><a name="duration-lexical-space" id="duration-lexical-space" shape="rect"></a>3.3.6.2 Lexical Mapping</h5><div class="block">The <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> of <a href="#duration" shape="rect">duration</a> are more or less based on the pattern: <blockquote class="shrink"><p><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></p></blockquote> </div><div class="block">More precisely, the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#duration" shape="rect">duration</a> is the set of character strings that satisfy <a href="#nt-durationRep" shape="rect"><i>durationLexicalRep</i></a> as defined by the following productions: <div class="defset"> <div class="defset-head"> Lexical Representation Fragments</div> <div class="prod"> <a name="nt-duYrFrag" id="nt-duYrFrag" shape="rect"></a><span class="lhs">[6] &#160; <i>duYearFrag</i></span>&#160;::= <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>&#160;'<code>Y</code>'</div><div class="prod"> <a name="nt-duMoFrag" id="nt-duMoFrag" shape="rect"></a><span class="lhs">[7] &#160; <i>duMonthFrag</i></span>&#160;::= <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>&#160;'<code>M</code>'</div><div class="prod"> <a name="nt-duDaFrag" id="nt-duDaFrag" shape="rect"></a><span class="lhs">[8] &#160; <i>duDayFrag</i></span>&#160;::= <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>&#160;'<code>D</code>'</div><div class="prod"> <a name="nt-duHrFrag" id="nt-duHrFrag" shape="rect"></a><span class="lhs">[9] &#160; <i>duHourFrag</i></span>&#160;::= <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>&#160;'<code>H</code>'</div><div class="prod"> <a name="nt-duMiFrag" id="nt-duMiFrag" shape="rect"></a><span class="lhs">[10] &#160; <i>duMinuteFrag</i></span>&#160;::= <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>&#160;'<code>M</code>'</div><div class="prod"> <a name="nt-duSeFrag" id="nt-duSeFrag" shape="rect"></a><span class="lhs">[11] &#160; <i>duSecondFrag</i></span>&#160;::= (<a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>&#160;|&#160;<a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a>)&#160;'<code>S</code>'</div><div class="prod"> <a name="nt-duYMFrag" id="nt-duYMFrag" shape="rect"></a><span class="lhs">[12] &#160; <i>duYearMonthFrag</i></span>&#160;::= (<a href="#nt-duYrFrag" shape="rect"><i>duYearFrag</i></a>&#160;<a href="#nt-duMoFrag" shape="rect"><i>duMonthFrag</i></a>?)&#160;| <a href="#nt-duMoFrag" shape="rect"><i>duMonthFrag</i></a></div><div class="prod"> <a name="nt-duTFrag" id="nt-duTFrag" shape="rect"></a><span class="lhs">[13] &#160; <i>duTimeFrag</i></span>&#160;::= '<code>T</code>'&#160;((<a href="#nt-duHrFrag" shape="rect"><i>duHourFrag</i></a>&#160;<a href="#nt-duMiFrag" shape="rect"><i>duMinuteFrag</i></a>?&#160;<a href="#nt-duSeFrag" shape="rect"><i>duSecondFrag</i></a>?)&#160;| (<a href="#nt-duMiFrag" shape="rect"><i>duMinuteFrag</i></a>&#160;<a href="#nt-duSeFrag" shape="rect"><i>duSecondFrag</i></a>?)&#160;| <a href="#nt-duSeFrag" shape="rect"><i>duSecondFrag</i></a>)</div><div class="prod"> <a name="nt-duDTFrag" id="nt-duDTFrag" shape="rect"></a><span class="lhs">[14] &#160; <i>duDayTimeFrag</i></span>&#160;::= (<a href="#nt-duDaFrag" shape="rect"><i>duDayFrag</i></a>&#160;<a href="#nt-duTFrag" shape="rect"><i>duTimeFrag</i></a>?)&#160;| <a href="#nt-duTFrag" shape="rect"><i>duTimeFrag</i></a></div></div> <div class="defset"> <div class="defset-head">Lexical Representation</div> <div class="prod"> <a name="nt-durationRep" id="nt-durationRep" shape="rect"></a><span class="lhs">[15] &#160; <i>durationLexicalRep</i></span>&#160;::= '<code>-</code>'?&#160;'<code>P</code>'&#160;((<a href="#nt-duYMFrag" shape="rect"><i>duYearMonthFrag</i></a>&#160;<a href="#nt-duDTFrag" shape="rect"><i>duDayTimeFrag</i></a>?)&#160;|&#160;<a href="#nt-duDTFrag" shape="rect"><i>duDayTimeFrag</i></a>)</div></div> </div><p>Thus, a <a href="#nt-durationRep" shape="rect"><i>durationLexicalRep</i></a> consists of one or more of a <a href="#nt-duYrFrag" shape="rect"><i>duYearFrag</i></a>, <a href="#nt-duMoFrag" shape="rect"><i>duMonthFrag</i></a>, <a href="#nt-duDaFrag" shape="rect"><i>duDayFrag</i></a>, <a href="#nt-duHrFrag" shape="rect"><i>duHourFrag</i></a>, <a href="#nt-duMiFrag" shape="rect"><i>duMinuteFrag</i></a>, and/or <a href="#nt-duSeFrag" shape="rect"><i>duSecondFrag</i></a>, in order, with letters '<code>P</code>' and '<code>T</code>' (and perhaps a '<code>-</code>') where appropriate.</p><div class="block">The language accepted by the <a href="#nt-durationRep" shape="rect"><i>durationLexicalRep</i></a> production is the set of strings which satisfy all of the following three regular expressions: <ul><li><div class="p">The expression <blockquote class="shrink"><p> <code>-?P[0-9]+Y?([0-9]+M)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(\.[0-9]+)?S)?)?</code> </p></blockquote> matches only strings in which the fields occur in the proper order.</div></li><li><div class="p">The expression '<code>.*[YMDHS].*</code>' matches only strings in which at least one field occurs.</div></li><li><div class="p">The expression '<code>.*[^T]</code>' matches only strings in which '<code>T</code>' is not the final character, so that if '<code>T</code>' appears, something follows it. The first rule ensures that what follows '<code>T</code>' will be an hour, minute, or second field.</div></li></ul> The intersection of these three regular expressions is equivalent to the following (after removal of the white space inserted here for legibility): </div><div class="block"> <pre xml:space="preserve"> -?P( ( ( [0-9]+Y([0-9]+M)?([0-9]+D)? | ([0-9]+M)([0-9]+D)? | ([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) ) ) ) </pre> </div><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#duration" shape="rect">duration</a> is <a href="#f-durationMap" shape="rect"><i><span class="arrow">&#183;</span>durationMap<span class="arrow">&#183;</span></i></a>. </p><p><a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>The canonical mapping<span class="arrow">&#183;</span></a> for <a href="#duration" shape="rect">duration</a> is <a href="#f-durationCanMap" shape="rect"><i><span class="arrow">&#183;</span>durationCanonicalMap<span class="arrow">&#183;</span></i></a>. </p></div><div class="div4"> <h5><a name="duration-facets" id="duration-facets" shape="rect"></a>3.3.6.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#duration" shape="rect">duration</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="duration.whiteSpace" shape="rect" id="duration.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#duration" shape="rect">duration</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#duration" shape="rect">duration</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="duration-derived-types" id="duration-derived-types" shape="rect"></a>3.3.6.4 Related Datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes are <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#duration" shape="rect">duration</a></p><ul><li><a href="#yearMonthDuration" shape="rect">yearMonthDuration</a></li><li><a href="#dayTimeDuration" shape="rect">dayTimeDuration</a></li></ul></div></div><div class="div3"> <h4><a name="dateTime" id="dateTime" shape="rect"></a>3.3.7 dateTime</h4><p><a href="#dateTime" shape="rect">dateTime</a> represents instants of time, optionally marked with a particular time zone offset.&#160; Values representing the same instant but having different time zone offsets are equal but not identical.</p><div class="div4"> <h5><a name="dateTime-value-space" id="dateTime-value-space" shape="rect"></a>3.3.7.1 Value Space</h5><p><a href="#dateTime" shape="rect">dateTime</a> uses the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>, with no properties except <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> permitted to be <b><i>absent</i></b>. The <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> property remains <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a>.</p><div class="note"><div class="p"><b>Note:</b> In version 1.0 of this specification, the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> property was not permitted to have the value zero. The year before the year 1 in the proleptic Gregorian calendar, traditionally referred to as 1 BC or as 1 BCE, was represented by a <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> value of &#8722;1, 2 BCE by &#8722;2, and so forth. 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 "old style" calendar; the two correspond approximately but not exactly to each other. </div><div class="p"> In this version of this specification, two changes are made in order to agree with existing usage. First, <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> is permitted to have the value zero. Second, the interpretation of <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> values is changed accordingly: a <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> value of zero represents 1 BCE, &#8722;1 represents 2 BCE, etc. This representation simplifies interval arithmetic and leap-year calculation for dates before the common era (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 <a href="#ISO8601" shape="rect">[ISO 8601]</a>. </div><div class="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. If existing schemas or data specify dates of 29 February for any years before the common era, 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. With that possible exception, schemas and data valid under the old interpretation remain valid under the new. </div></div><div class="constraintnote"><a id="con-dateTime-dayValue" name="con-dateTime-dayValue" shape="rect"></a><b>Constraint: Day-of-month Values</b><br clear="none" /><div class="constraint"><div class="p">The <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> value <span class="rfc2119">must</span> be no more than 30 if <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> is one of 4, 6, 9, or 11; no more than 28 if <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> is 2 and <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> is not divisible by 4, or is divisible by 100 but not by 400; and no more than 29 if <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> is 2 and <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> is divisible by 400, or by 4 but not by 100.</div></div></div><div class="note"><div class="p"><b>Note:</b> See the conformance note in <a href="#partial-implementation" shape="rect">Partial Implementation of Infinite Datatypes (&#167;5.4)</a> which applies to the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> and <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> values of this datatype.</div></div><p>Equality and order are as prescribed in <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model (&#167;D.2.1)</a>.&#160; <a href="#dateTime" shape="rect">dateTime</a> values are ordered by their <a href="#vp-dt-timeOnTimeline" shape="rect"><i><span class="arrow">&#183;</span>timeOnTimeline<span class="arrow">&#183;</span></i></a> value.</p><div class="note"><div class="p"><b>Note:</b> Since the order of a <a href="#dateTime" shape="rect">dateTime</a> value having a <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> relative to another value whose <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b> is determined by imputing time zone offsets of both +14:00 and &#8722;14:00 to the value with no time zone offset, many such combinations will be <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> because the two imputed time zone offsets yield different orders.</div><div class="p">Although <a href="#dateTime" shape="rect">dateTime</a> and other types related to dates and times have only a partial order, it is possible for datatypes derived from <a href="#dateTime" shape="rect">dateTime</a> to have total orders, if they are restricted (e.g. using the <a href="#f-p" class="compref" shape="rect">pattern</a> facet) to the subset of values with, or the subset of values without, time zone offsets. 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 <a href="#std" class="compref" shape="rect">Simple Type Definition</a>, in the <a href="#ff-o" class="compref" shape="rect">ordered</a> facet.</div></div><div class="note"><div class="p"><b>Note:</b> Order and equality are essentially the same for <a href="#dateTime" shape="rect">dateTime</a> in this version of this specification as they were in version 1.0.&#160; However, since values now distinguish time zone offsets, equal values with different <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>s are not <em>identical</em>, and values with extreme <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>s may no longer be equal to any value with a smaller <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>.</div></div></div><div class="div4"> <h5><a name="dateTime-lexical-mapping" id="dateTime-lexical-mapping" shape="rect"></a>3.3.7.2 Lexical Mapping</h5><div class="block">The lexical representations for <a href="#dateTime" shape="rect">dateTime</a> are as follows: <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-dateTimeRep" id="nt-dateTimeRep" shape="rect"></a><span class="lhs">[16] &#160; <i>dateTimeLexicalRep</i></span>&#160;::= <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>&#160;'<code>-</code>'&#160;<a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>&#160;'<code>-</code>'&#160;<a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>&#160;'<code>T</code>'&#160;((<a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>&#160;'<code>:</code>'&#160;<a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>&#160;'<code>:</code>'&#160;<a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a>)&#160;| <a href="#nt-eodFrag" shape="rect"><i>endOfDayFrag</i></a>) <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>?&#160;&#160; <b>Constraint:</b>&#160; Day-of-month Representations</div></div> <div class="constraintnote"><a id="con-dateTime-day" name="con-dateTime-day" shape="rect"></a><b>Constraint: Day-of-month Representations</b><br clear="none" /><div class="constraint"><div class="p">Within a <a href="#nt-dateTimeRep" shape="rect"><i>dateTimeLexicalRep</i></a>, a <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a> <span class="rfc2119">must not</span> begin with the digit '<code>3</code>' or be '<code>29</code>' unless the value to which it would map would satisfy the value constraint on <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> values ("Constraint: Day-of-month Values") given above.</div></div></div> In such representations: <ul><li><div class="p"><a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a> is a numeral consisting of at least four decimal digits, optionally preceded by a minus sign; leading '<code>0</code>' digits are prohibited except to bring the digit count up to four.&#160; It represents the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> value.</div></li><li><div class="p">Subsequent '<code>-</code>', '<code>T</code>', and '<code>:</code>', separate the various numerals.</div></li><li><div class="p"><a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>, <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>, <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>, and <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a> are numerals consisting of exactly two decimal digits.&#160; They represent the <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>, and <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a> values respectively.</div></li><li><div class="p"><a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a> is a numeral consisting of exactly two decimal digits, or two decimal digits, a decimal point, and one or more trailing digits.&#160; It represents the <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> value.</div></li><li><div class="p">Alternatively, <a href="#nt-eodFrag" shape="rect"><i>endOfDayFrag</i></a> combines the <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>, <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>, <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>, and their separators to represent midnight of the day, which is the first moment of the next day.</div></li><li><div class="p"><a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>, if present, specifies an offset between UTC and local time. Time zone offsets are a count of minutes (expressed in <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a> as a count of hours and minutes) that are added or subtracted from UTC time to get the "local" time.&#160; '<code>Z</code>' is an alternative representation of the time zone offset '<code>00:00</code>', which is, of course, zero minutes from UTC.</div><div class="p">For example, 2002-10-10T12:00:00&#8722;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.</div><div class="note"><div class="p"><b>Note:</b> For the most part, this specification adopts the distinction between 'timezone' and 'timezone offset' laid out in <a href="#ref-timezones" shape="rect">[Timezones]</a>. Version 1.0 of this specification did not make this distinction, but used the term 'timezone' for the time zone offset information associated with date- and time-related datatypes. Some traces of the earlier usage remain visible in this and other specifications. The names <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a> and <a href="#f-tz" class="compref" shape="rect">explicitTimezone</a> are such traces ; others will be found in the names of functions defined in <a href="#F_O" shape="rect">[XQuery 1.0 and XPath 2.0 Functions and Operators]</a>, or in references in this specification to "timezoned" and "non-timezoned" values.</div></div></li></ul> </div><div class="block">The <a href="#nt-dateTimeRep" shape="rect"><i>dateTimeLexicalRep</i></a> production is equivalent to this regular expression once whitespace is removed. <pre 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))?</pre> Note that neither the <a href="#nt-dateTimeRep" shape="rect"><i>dateTimeLexicalRep</i></a> production nor this regular expression alone enforce the constraint on <a href="#nt-dateTimeRep" shape="rect"><i>dateTimeLexicalRep</i></a> given above.</div><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#dateTime" shape="rect">dateTime</a> is <a href="#vp-dateTimeLexRep" shape="rect"><i><span class="arrow">&#183;</span>dateTimeLexicalMap<span class="arrow">&#183;</span></i></a>. The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is <a href="#vp-dateTimeCanRep" shape="rect"><i><span class="arrow">&#183;</span>dateTimeCanonicalMap<span class="arrow">&#183;</span></i></a>. </p></div><div class="div4"> <h5><a name="dateTime-facets" id="dateTime-facets" shape="rect"></a>3.3.7.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#dateTime" shape="rect">dateTime</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="dateTime.whiteSpace" shape="rect" id="dateTime.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#dateTime" shape="rect">dateTime</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-explicitTimezone" name="dateTime.explicitTimezone" shape="rect" id="dateTime.explicitTimezone">explicitTimezone</a><span class="normal"><span class="normal"> = <b><i>optional</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#dateTime" shape="rect">dateTime</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#dateTime" shape="rect">dateTime</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="dateTime-derived-types" id="dateTime-derived-types" shape="rect"></a>3.3.7.4 Related Datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#dateTime" shape="rect">dateTime</a></p><ul><li><a href="#dateTimeStamp" shape="rect">dateTimeStamp</a></li></ul></div></div><div class="div3"> <h4><a name="time" id="time" shape="rect"></a>3.3.8 time</h4><p><a href="#time" shape="rect">time</a> represents instants of time that recur at the same point in each calendar day, or that occur in some arbitrary calendar day.</p><div class="div4"> <h5><a name="time-value-space" id="time-value-space" shape="rect"></a>3.3.8.1 Value Space</h5><p><a href="#time" shape="rect">time</a> uses the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>, with <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>, and <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> required to be <b><i>absent</i></b>.&#160; <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> remains <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a>.</p><div class="note"><div class="p"><b>Note:</b> See the conformance note in <a href="#partial-implementation" shape="rect">Partial Implementation of Infinite Datatypes (&#167;5.4)</a> which applies to the <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> value of this datatype.</div></div><p>Equality and order are as prescribed in <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model (&#167;D.2.1)</a>.&#160; <a href="#time" shape="rect">time</a> values (points in time in an "arbitrary" day) are ordered taking into account their <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>.</p><p>A calendar (or "local time") day with a larger positive time zone offset begins earlier than the same calendar day with a smaller (or negative) time zone offset. Since the time zone offsets allowed spread over 28 hours, it is possible for the period denoted by a given calendar day with one time zone offset to be completely disjoint from the period denoted by the same calendar day with a different offset &#8212; the earlier day ends before the later one starts.&#160; 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 time zone offset to the end of that day in the &#8722;14:00 time zone offset.</p><div class="note"><div class="p"><b>Note:</b> The relative order of two <a href="#time" shape="rect">time</a> values, one of which has a <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> of <b><i>absent</i></b> is determined by imputing time zone offsets of both +14:00 and &#8722;14:00 to the value without an offset. Many such combinations will be <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> because the two imputed time zone offsets yield different orders.&#160; However, for a given non-timezoned value, there will always be timezoned values at one or both ends of the 52-hour interval that are <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>comparable<span class="arrow">&#183;</span></a> (because the interval of <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparability<span class="arrow">&#183;</span></a> is only 28 hours wide).</div><div class="p"> Some pairs of <a href="#time" shape="rect">time</a> literals which in the 1.0 version of this specification denoted the same value now (in this version) denote distinct values instead, because values now include time zone offset information. Some such pairs, such as '<code>05:00:00-03:00</code>' and '<code>10:00:00+02:00</code>', now denote equal though distinct values (because they identify the same points on the time line); others, such as '<code>23:00:00-03:00</code>' and '<code>02:00:00Z</code>', now denote unequal values (23:00:00&#8722;03:00 &gt; 02:00:00Z because 23:00:00&#8722;03:00 on any given day is equal to 02:00:00Z on <em>the next day</em>). </div></div></div><div class="div4"> <h5><a name="time-lexical-mapping" id="time-lexical-mapping" shape="rect"></a>3.3.8.2 Lexical Mappings</h5><div class="block">The lexical representations for <a href="#time" shape="rect">time</a> are "projections" of those of <a href="#dateTime" shape="rect">dateTime</a>, as follows: <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-timeRep" id="nt-timeRep" shape="rect"></a><span class="lhs">[17] &#160; <i>timeLexicalRep</i></span>&#160;::= ((<a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>&#160;'<code>:</code>'&#160;<a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>&#160;'<code>:</code>'&#160;<a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a>)&#160;| <a href="#nt-eodFrag" shape="rect"><i>endOfDayFrag</i></a>) <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>?</div></div> The <a href="#nt-timeRep" shape="rect"><i>timeLexicalRep</i></a> production is equivalent to this regular expression, once whitespace is removed: <blockquote><blockquote><p><code> (([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))?</code></p></blockquote></blockquote> Note that neither the <a href="#nt-timeRep" shape="rect"><i>timeLexicalRep</i></a> production nor this regular expression alone enforce the constraint on <a href="#nt-timeRep" shape="rect"><i>timeLexicalRep</i></a> given above. </div><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#time" shape="rect">time</a> is <a href="#vp-timeLexRep" shape="rect"><i><span class="arrow">&#183;</span>timeLexicalMap<span class="arrow">&#183;</span></i></a>; the <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is <a href="#vp-timeCanRep" shape="rect"><i><span class="arrow">&#183;</span>timeCanonicalMap<span class="arrow">&#183;</span></i></a>. </p><div class="note"><div class="p"><b>Note:</b> The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> maps '<code>00:00:00</code>' and '<code>24:00:00</code>' to the same value, namely midnight (<a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>&#160;=&#160;0&#160;, <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>&#160;=&#160;0&#160;, <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a>&#160;=&#160;0).</div></div></div><div class="div4"> <h5><a name="time-facets" id="time-facets" shape="rect"></a>3.3.8.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#time" shape="rect">time</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="time.whiteSpace" shape="rect" id="time.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#time" shape="rect">time</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-explicitTimezone" name="time.explicitTimezone" shape="rect" id="time.explicitTimezone">explicitTimezone</a><span class="normal"><span class="normal"> = <b><i>optional</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#time" shape="rect">time</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#time" shape="rect">time</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="date" id="date" shape="rect"></a>3.3.9 date</h4><p><span class="termdef"><a name="dt-date" id="dt-date" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>date</b> represents top-open intervals of exactly one day in length on the timelines of <a href="#dateTime" shape="rect">dateTime</a>, beginning on the beginning moment of each day, up to but not including the beginning moment of the next day).&#160; For non-timezoned values, the top-open intervals disjointly cover the non-timezoned timeline, one per day.&#160; For timezoned values, the intervals begin at every minute and therefore overlap. </span> </p><div class="div4"> <h5><a name="date-value-space" id="date-value-space" shape="rect"></a>3.3.9.1 Value Space</h5><p><a href="#date" shape="rect">date</a> uses the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>, with <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>, and <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> required to be <b><i>absent</i></b>.&#160; <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> remains <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a>.</p><div class="constraintnote"><a id="con-date-dayValue" name="con-date-dayValue" shape="rect"></a><b>Constraint: Day-of-month Values</b><br clear="none" /><div class="constraint"><div class="p">The <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> value <span class="rfc2119">must</span> be no more than 30 if <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> is one of 4, 6, 9, or 11, no more than 28 if <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> is 2 and <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> is not divisible by 4, or is divisible by 100 but not by 400, and no more than 29 if <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> is 2 and <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> is divisible by 400, or by 4 but not by 100.</div></div></div><div class="note"><div class="p"><b>Note:</b> See the conformance note in <a href="#partial-implementation" shape="rect">Partial Implementation of Infinite Datatypes (&#167;5.4)</a> which applies to the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> value of this datatype.</div></div><p>Equality and order are as prescribed in <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model (&#167;D.2.1)</a>.</p><div class="note"><div class="p"><b>Note:</b> In version 1.0 of this specification, <a href="#date" shape="rect">date</a> values did not retain a time zone offset explicitly, but for offsets not too far from zero their time zone offset could be recovered based on their value's first moment on the timeline.&#160; The <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> retains all time zone offsets.</div><div class="p">Some <a href="#date" shape="rect">date</a> values with different time zone offsets that were identical in the 1.0 version of this specification, such as 2000-01-01+13:00 and 1999-12-31&#8722;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 time zone offsets).&#160; This situation will arise for dates only if one has a far-from-zero time zone offset and hence in 1.0 its "recoverable time zone offset" was different from the the time zone offset which is retained in the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> used in this version of this specification.</div></div></div><div class="div4"> <h5><a name="date-lexical-mapping" id="date-lexical-mapping" shape="rect"></a>3.3.9.2 Lexical Mapping</h5><div class="block">The lexical representations for <a href="#date" shape="rect">date</a> are "projections" of those of <a href="#dateTime" shape="rect">dateTime</a>, as follows: <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-dateRep" id="nt-dateRep" shape="rect"></a><span class="lhs">[18] &#160; <i>dateLexicalRep</i></span>&#160;::= <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>&#160;'<code>-</code>'&#160;<a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>&#160;'<code>-</code>'&#160;<a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a> <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>?&#160;&#160; <b>Constraint:</b>&#160; Day-of-month Representations</div></div> <div class="constraintnote"><a id="con-date-day" name="con-date-day" shape="rect"></a><b>Constraint: Day-of-month Representations</b><br clear="none" /><div class="constraint"><div class="p">Within a <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a>, a <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a> <span class="rfc2119">must not</span> begin with the digit '<code>3</code>' or be '<code>29</code>' unless the value to which it would map would satisfy the value constraint on <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> values ("Constraint: Day-of-month Values") given above.</div></div></div> The <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a> production is equivalent to this regular expression: <blockquote class="shrink"><p> <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> </p></blockquote> Note that neither the <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a> production nor this regular expression alone enforce the constraint on <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a> given above.</div><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#date" shape="rect">date</a> is <a href="#vp-dateLexRep" shape="rect"><i><span class="arrow">&#183;</span>dateLexicalMap<span class="arrow">&#183;</span></i></a>. The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is <a href="#vp-dateCanRep" shape="rect"><i><span class="arrow">&#183;</span>dateCanonicalMap<span class="arrow">&#183;</span></i></a>. </p></div><div class="div4"> <h5><a name="date-facets" id="date-facets" shape="rect"></a>3.3.9.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#date" shape="rect">date</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="date.whiteSpace" shape="rect" id="date.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#date" shape="rect">date</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-explicitTimezone" name="date.explicitTimezone" shape="rect" id="date.explicitTimezone">explicitTimezone</a><span class="normal"><span class="normal"> = <b><i>optional</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#date" shape="rect">date</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#date" shape="rect">date</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="gYearMonth" id="gYearMonth" shape="rect"></a>3.3.10 gYearMonth</h4><p> <b>gYearMonth</b> represents specific whole Gregorian months in specific Gregorian years.</p><div class="note"><div class="p"><b>Note:</b> 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.&#160; This type should therefore be used with caution in contexts where conversion to other calendars is desired.</div></div><div class="div4"> <h5><a name="gYearMonth-value-space" id="gYearMonth-value-space" shape="rect"></a>3.3.10.1 Value Space</h5><p><a href="#gYearMonth" shape="rect">gYearMonth</a> uses the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>, with <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>, and <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> required to be <b><i>absent</i></b>.&#160; <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> remains <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a>.</p><div class="note"><div class="p"><b>Note:</b> See the conformance note in <a href="#partial-implementation" shape="rect">Partial Implementation of Infinite Datatypes (&#167;5.4)</a> which applies to the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> value of this datatype.</div></div><p>Equality and order are as prescribed in <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model (&#167;D.2.1)</a>.</p></div><div class="div4"> <h5><a name="gYearMonth-lexical-repr" id="gYearMonth-lexical-repr" shape="rect"></a>3.3.10.2 Lexical Mapping</h5><div class="block">The lexical representations for <a href="#gYearMonth" shape="rect">gYearMonth</a> are "projections" of those of <a href="#dateTime" shape="rect">dateTime</a>, as follows: <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-gYearMonthRep" id="nt-gYearMonthRep" shape="rect"></a><span class="lhs">[19] &#160; <i>gYearMonthLexicalRep</i></span>&#160;::= <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a> '<code>-</code>'&#160;<a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>&#160;<a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>?</div></div> The <a href="#nt-gYearMonthRep" shape="rect"><i>gYearMonthLexicalRep</i></a> is equivalent to this regular expression: <blockquote class="shrink"><p> <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> </p></blockquote> </div><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#gYearMonth" shape="rect">gYearMonth</a> is <a href="#vp-gYearMonthLexRep" shape="rect"><i><span class="arrow">&#183;</span>gYearMonthLexicalMap<span class="arrow">&#183;</span></i></a>. The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is <a href="#vp-gYearMonthCanRep" shape="rect"><i><span class="arrow">&#183;</span>gYearMonthCanonicalMap<span class="arrow">&#183;</span></i></a>. </p></div><div class="div4"> <h5><a name="gYearMonth-facets" id="gYearMonth-facets" shape="rect"></a>3.3.10.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#gYearMonth" shape="rect">gYearMonth</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="gYearMonth.whiteSpace" shape="rect" id="gYearMonth.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#gYearMonth" shape="rect">gYearMonth</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-explicitTimezone" name="gYearMonth.explicitTimezone" shape="rect" id="gYearMonth.explicitTimezone">explicitTimezone</a><span class="normal"><span class="normal"> = <b><i>optional</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#gYearMonth" shape="rect">gYearMonth</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#gYearMonth" shape="rect">gYearMonth</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="gYear" id="gYear" shape="rect"></a>3.3.11 gYear</h4><p><b>gYear</b> represents Gregorian calendar years.</p><div class="note"><div class="p"><b>Note:</b> 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.&#160; This type should therefore be used with caution in contexts where conversion to other calendars is desired. </div></div><div class="div4"> <h5><a name="gYear-value-space" id="gYear-value-space" shape="rect"></a>3.3.11.1 Value Space</h5><p><a href="#gYear" shape="rect">gYear</a> uses the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>, with <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>, and <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> required to be <b><i>absent</i></b>.&#160; <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> remains <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a>.</p><div class="note"><div class="p"><b>Note:</b> See the conformance note in <a href="#partial-implementation" shape="rect">Partial Implementation of Infinite Datatypes (&#167;5.4)</a> which applies to the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> value of this datatype.</div></div><p>Equality and order are as prescribed in <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model (&#167;D.2.1)</a>.</p></div><div class="div4"> <h5><a name="gYear-lexical-repr" id="gYear-lexical-repr" shape="rect"></a>3.3.11.2 Lexical Mapping</h5><div class="block">The lexical representations for <a href="#gYear" shape="rect">gYear</a> are "projections" of those of <a href="#dateTime" shape="rect">dateTime</a>, as follows: <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-gYearRep" id="nt-gYearRep" shape="rect"></a><span class="lhs">[20] &#160; <i>gYearLexicalRep</i></span>&#160;::= <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>&#160;<a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>?</div></div> The <a href="#nt-gYearRep" shape="rect"><i>gYearLexicalRep</i></a> is equivalent to this regular expression: <blockquote class="shrink"><p> <code>-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</code> </p></blockquote> </div><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#gYear" shape="rect">gYear</a> is <a href="#vp-gYearLexRep" shape="rect"><i><span class="arrow">&#183;</span>gYearLexicalMap<span class="arrow">&#183;</span></i></a>. The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is <a href="#vp-gYearCanRep" shape="rect"><i><span class="arrow">&#183;</span>gYearCanonicalMap<span class="arrow">&#183;</span></i></a>. </p></div><div class="div4"> <h5><a name="gYear-facets" id="gYear-facets" shape="rect"></a>3.3.11.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#gYear" shape="rect">gYear</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="gYear.whiteSpace" shape="rect" id="gYear.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#gYear" shape="rect">gYear</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-explicitTimezone" name="gYear.explicitTimezone" shape="rect" id="gYear.explicitTimezone">explicitTimezone</a><span class="normal"><span class="normal"> = <b><i>optional</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#gYear" shape="rect">gYear</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#gYear" shape="rect">gYear</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="gMonthDay" id="gMonthDay" shape="rect"></a>3.3.12 gMonthDay</h4><p><a href="#gMonthDay" shape="rect">gMonthDay</a> represents whole calendar days that recur at the same point in each calendar year, or that occur in some arbitrary calendar year.&#160; (Obviously, days beyond 28 cannot occur in all Februaries; 29 is nonetheless permitted.)</p><p>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><div class="note"><div class="p"><b>Note:</b> 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. </div></div><div class="div4"> <h5><a name="gMonthDay-value-space" id="gMonthDay-value-space" shape="rect"></a>3.3.12.1 Value Space</h5><p><a href="#gMonthDay" shape="rect">gMonthDay</a> uses the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>, with <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>, and <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> required to be <b><i>absent</i></b>.&#160; <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> remains <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a>.</p><div class="constraintnote"><a id="con-gMonthDay-dayValue" name="con-gMonthDay-dayValue" shape="rect"></a><b>Constraint: Day-of-month Values</b><br clear="none" /><div class="constraint"><div class="p">The <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> value <span class="rfc2119">must</span> be no more than 30 if <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> is one of 4, 6, 9, or 11, and no more than 29 if <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> is 2.</div></div></div><p>Equality and order are as prescribed in <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model (&#167;D.2.1)</a>.</p><div class="note"><div class="p"><b>Note:</b> In version 1.0 of this specification, <a href="#gMonthDay" shape="rect">gMonthDay</a> values did not retain a time zone offset explicitly, but for time zone offsets not too far from <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a> their time zone offset could be recovered based on their value's first moment on the timeline.&#160; The <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> retains all time zone offsets.</div><div class="p">An example that shows the difference from version 1.0 (see <a href="#gMonthDay-lexical-repr" shape="rect">Lexical Mapping (&#167;3.3.12.2)</a> for the notations): <ul><li><div class="p">A day is a calendar (or "local time") day offset from <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a> by the appropriate interval; this is now true for all <a href="#vp-dt-day" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> values, including those with time zone offsets outside the range +12:00 through -11:59 inclusive:</div><div class="p">--12-12+13:00&#160;&lt; --12-12+11:00&#160; (just as --12-12+12:00 has always been less than --12-12+11:00, but in version 1.0&#160; --12-12+13:00&#160;&gt; --12-12+11:00&#160;, since --12-12+13:00's "recoverable time zone offset" was &#8722;11:00)</div></li></ul> </div></div></div><div class="div4"> <h5><a name="gMonthDay-lexical-repr" id="gMonthDay-lexical-repr" shape="rect"></a>3.3.12.2 Lexical Mapping</h5><div class="block">The lexical representations for <a href="#gMonthDay" shape="rect">gMonthDay</a> are "projections" of those of <a href="#dateTime" shape="rect">dateTime</a>, as follows: <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-gMonthDayRep" id="nt-gMonthDayRep" shape="rect"></a><span class="lhs">[21] &#160; <i>gMonthDayLexicalRep</i></span>&#160;::= '<code>--</code>'&#160;<a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>&#160;'<code>-</code>'&#160;<a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a> <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>?&#160;&#160; <b>Constraint:</b>&#160; Day-of-month Representations</div></div> <div class="constraintnote"><a id="con-gMonthDay-day" name="con-gMonthDay-day" shape="rect"></a><b>Constraint: Day-of-month Representations</b><br clear="none" /><div class="constraint"><div class="p">Within a <a href="#nt-gMonthDayRep" shape="rect"><i>gMonthDayLexicalRep</i></a>, a <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a> <span class="rfc2119">must not</span> begin with the digit '<code>3</code>' or be '<code>29</code>' unless the value to which it would map would satisfy the value constraint on <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> values ("Constraint: Day-of-month Values") given above.</div></div></div> The <a href="#nt-gMonthDayRep" shape="rect"><i>gMonthDayLexicalRep</i></a> is equivalent to this regular expression: <blockquote class="shrink"><p> <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></p></blockquote> Note that neither the <a href="#nt-gMonthDayRep" shape="rect"><i>gMonthDayLexicalRep</i></a> production nor this regular expression alone enforce the constraint on <a href="#nt-gMonthDayRep" shape="rect"><i>gMonthDayLexicalRep</i></a> given above.</div><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#gMonthDay" shape="rect">gMonthDay</a> is <a href="#vp-gMonthDayLexRep" shape="rect"><i><span class="arrow">&#183;</span>gMonthDayLexicalMap<span class="arrow">&#183;</span></i></a>. The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is <a href="#vp-gMonthDayCanRep" shape="rect"><i><span class="arrow">&#183;</span>gMonthDayCanonicalMap<span class="arrow">&#183;</span></i></a>. </p></div><div class="div4"> <h5><a name="gMonthDay-facets" id="gMonthDay-facets" shape="rect"></a>3.3.12.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#gMonthDay" shape="rect">gMonthDay</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="gMonthDay.whiteSpace" shape="rect" id="gMonthDay.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#gMonthDay" shape="rect">gMonthDay</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-explicitTimezone" name="gMonthDay.explicitTimezone" shape="rect" id="gMonthDay.explicitTimezone">explicitTimezone</a><span class="normal"><span class="normal"> = <b><i>optional</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#gMonthDay" shape="rect">gMonthDay</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#gMonthDay" shape="rect">gMonthDay</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="gDay" id="gDay" shape="rect"></a>3.3.13 gDay</h4><p><span class="termdef"><a name="dt-gday" id="dt-gday" title="" shape="rect">[Definition:]&#160;&#160;</a><b>gDay</b> represents whole days within an arbitrary month&#8212;days that recur at the same point in each (Gregorian) month.</span> This datatype is used to represent a specific day of the month. To indicate, for example, that an employee gets a paycheck on the 15th of each month.&#160; (Obviously, days beyond 28 cannot occur in <em>all</em> months; they are nonetheless permitted, up to 31.)</p><div class="note"><div class="p"><b>Note:</b> Because days in one calendar only rarely correspond to days in other calendars, <a href="#gDay" shape="rect">gDay</a> values do not, in general, have any straightforward or intuitive representation in terms of most non-Gregorian calendars. <a href="#gDay" shape="rect">gDay</a> should therefore be used with caution in contexts where conversion to other calendars is desired.</div></div><div class="div4"> <h5><a name="sec-vs-gDay" id="sec-vs-gDay" shape="rect"></a>3.3.13.1 Value Space</h5><p><a href="#gDay" shape="rect">gDay</a> uses the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>, with <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>, and <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> required to be <b><i>absent</i></b>.&#160; <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> remains <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a> and <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> <span class="rfc2119">must</span> be between 1 and 31 inclusive.</p><p>Equality and order are as prescribed in <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model (&#167;D.2.1)</a>.&#160; Since <a href="#gDay" shape="rect">gDay</a> values (days) are ordered by their first moments, it is possible for apparent anomalies to appear in the order when <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> values differ by at least 24 hours.&#160; (It is possible for <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> values to differ by up to 28 hours.)</p><div class="block"> Examples that may appear anomalous (see <a href="#gDay-lexical-mapping" shape="rect">Lexical Mapping (&#167;3.3.13.2)</a> for the notations): <ul><li><div class="p">---15&#160;&lt;&#160;---16&#160;, but&#160; ---15&#8722;13:00&#160;&gt;&#160;---16+13:00</div></li><li><div class="p">---15&#8722;11:00&#160;=&#160;---16+13:00</div></li><li><div class="p">---15&#8722;13:00&#160;&lt;&gt;&#160;---16&#160;, because&#160; ---15&#8722;13:00&#160;&gt;&#160;---16+14:00&#160; and ---15&#8722;13:00&#160;&lt;&#160;16&#8722;14:00</div></li></ul> </div><div class="note"><div class="p"><b>Note:</b> Time zone offsets do not cause wrap-around at the end of the month:&#160; the last day of a given month with a time zone offset of &#8722;13:00 may start after the first day of the <em>next</em> month with offset +13:00, as measured on the global timeline, but nonetheless&#160; ---01+13:00&#160;&lt;&#160;---31&#8722;13:00&#160;.</div></div></div><div class="div4"> <h5><a name="gDay-lexical-mapping" id="gDay-lexical-mapping" shape="rect"></a>3.3.13.2 Lexical Mapping</h5><div class="block"> The lexical representations for <a href="#gDay" shape="rect">gDay</a> are "projections" of those of <a href="#dateTime" shape="rect">dateTime</a>, as follows: <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-gDayRep" id="nt-gDayRep" shape="rect"></a><span class="lhs">[22] &#160; <i>gDayLexicalRep</i></span>&#160;::= '<code>---</code>'&#160;<a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>&#160;<a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>?</div></div> The <a href="#nt-gDayRep" shape="rect"><i>gDayLexicalRep</i></a> is equivalent to this regular expression: <blockquote class="shrink"><p> <code>---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</code> </p></blockquote> </div><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#gDay" shape="rect">gDay</a> is <a href="#vp-gDayLexRep" shape="rect"><i><span class="arrow">&#183;</span>gDayLexicalMap<span class="arrow">&#183;</span></i></a>. The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is <a href="#vp-gDayCanRep" shape="rect"><i><span class="arrow">&#183;</span>gDayCanonicalMap<span class="arrow">&#183;</span></i></a>. </p></div><div class="div4"> <h5><a name="gDay-facets" id="gDay-facets" shape="rect"></a>3.3.13.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#gDay" shape="rect">gDay</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="gDay.whiteSpace" shape="rect" id="gDay.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#gDay" shape="rect">gDay</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-explicitTimezone" name="gDay.explicitTimezone" shape="rect" id="gDay.explicitTimezone">explicitTimezone</a><span class="normal"><span class="normal"> = <b><i>optional</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#gDay" shape="rect">gDay</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#gDay" shape="rect">gDay</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="gMonth" id="gMonth" shape="rect"></a>3.3.14 gMonth</h4><p><b>gMonth</b> represents whole (Gregorian) months within an arbitrary year&#8212;months that recur at the same point in each year.&#160; 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).</p><div class="note"><div class="p"><b>Note:</b> 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. </div></div><div class="div4"> <h5><a name="gMonth-value-space" id="gMonth-value-space" shape="rect"></a>3.3.14.1 Value Space</h5><p><a href="#gMonth" shape="rect">gMonth</a> uses the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>, with <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>, and <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> required to be <b><i>absent</i></b>.&#160; <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> remains <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a>.</p><p>Equality and order are as prescribed in <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model (&#167;D.2.1)</a>.</p></div><div class="div4"> <h5><a name="gMonth-lexical-repr" id="gMonth-lexical-repr" shape="rect"></a>3.3.14.2 Lexical Mapping</h5><div class="block">The lexical representations for <a href="#gMonth" shape="rect">gMonth</a> are "projections" of those of <a href="#dateTime" shape="rect">dateTime</a>, as follows: <div class="defset"> <div class="defset-head">Lexical Space</div> <div class="prod"> <a name="nt-gMonthRep" id="nt-gMonthRep" shape="rect"></a><span class="lhs">[23] &#160; <i>gMonthLexicalRep</i></span>&#160;::= '<code>--</code>'&#160;<a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>&#160;<a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>?</div></div> The <a href="#nt-gMonthRep" shape="rect"><i>gMonthLexicalRep</i></a> is equivalent to this regular expression: <blockquote class="shrink"><p> <code>--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?</code> </p></blockquote> </div><p> The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#gMonth" shape="rect">gMonth</a> is <a href="#vp-gMonthLexRep" shape="rect"><i><span class="arrow">&#183;</span>gMonthLexicalMap<span class="arrow">&#183;</span></i></a>. The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is <a href="#vp-gMonthCanRep" shape="rect"><i><span class="arrow">&#183;</span>gMonthCanonicalMap<span class="arrow">&#183;</span></i></a>. </p></div><div class="div4"> <h5><a name="gMonth-facets" id="gMonth-facets" shape="rect"></a>3.3.14.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#gMonth" shape="rect">gMonth</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="gMonth.whiteSpace" shape="rect" id="gMonth.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#gMonth" shape="rect">gMonth</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-explicitTimezone" name="gMonth.explicitTimezone" shape="rect" id="gMonth.explicitTimezone">explicitTimezone</a><span class="normal"><span class="normal"> = <b><i>optional</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#gMonth" shape="rect">gMonth</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#gMonth" shape="rect">gMonth</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="hexBinary" id="hexBinary" shape="rect"></a>3.3.15 hexBinary</h4><p><span class="termdef"><a name="dt-hexBinary" id="dt-hexBinary" title="" shape="rect">[Definition:]&#160;&#160;</a><b>hexBinary</b> represents arbitrary hex-encoded binary data.&#160; </span> </p><div class="div4"> <h5><a name="sec-vs-hexbin" id="sec-vs-hexbin" shape="rect"></a>3.3.15.1 Value Space</h5><p>The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#hexBinary" shape="rect">hexBinary</a> is the set of finite-length sequences of zero or more binary octets.&#160; The length of a value is the number of octets.</p></div><div class="div4"> <h5><a name="hexBinary-lexical-representation" id="hexBinary-lexical-representation" shape="rect"></a>3.3.15.2 Lexical Mapping</h5><p><a href="#hexBinary" shape="rect">hexBinary</a>'s <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> 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).&#160; For example, '<code>0FB7</code>' is a <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> of the two-octet value 00001111 10110111.</p><div class="block">More formally, the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#hexBinary" shape="rect">hexBinary</a> is the set of literals matching the <a href="#nt-hexBinary" shape="rect"><i>hexBinary</i></a> production. <div class="defset"> <div class="defset-head">Lexical space of hexBinary</div> <div class="prod"> <a name="nt-hexDigit" id="nt-hexDigit" shape="rect"></a><span class="lhs">[24] &#160; <i>hexDigit</i></span>&#160;::= [<code>0-9a-fA-F</code>]</div><div class="prod"> <a name="nt-hexOctet" id="nt-hexOctet" shape="rect"></a><span class="lhs">[25] &#160; <i>hexOctet</i></span>&#160;::= <a href="#nt-hexDigit" shape="rect"><i>hexDigit</i></a> <a href="#nt-hexDigit" shape="rect"><i>hexDigit</i></a></div><div class="prod"> <a name="nt-hexBinary" id="nt-hexBinary" shape="rect"></a><span class="lhs">[26] &#160; <i>hexBinary</i></span>&#160;::= <a href="#nt-hexOctet" shape="rect"><i>hexOctet</i></a>*</div></div> </div><p>The set recognized by <a href="#nt-hexBinary" shape="rect"><i>hexBinary</i></a> is the same as that recognized by the regular expression '<code>([0-9a-fA-F]{2})*</code>'.</p><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> of <a href="#hexBinary" shape="rect">hexBinary</a> is <a href="#f-hexBinaryMap" shape="rect"><i><span class="arrow">&#183;</span>hexBinaryMap<span class="arrow">&#183;</span></i></a>.</p><p>The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> of <a href="#hexBinary" shape="rect">hexBinary</a> is given formally in <a href="#f-hexBinaryCanonical" shape="rect"><i><span class="arrow">&#183;</span>hexBinaryCanonical<span class="arrow">&#183;</span></i></a>.</p></div><div class="div4"> <h5><a name="hexBinary-facets" id="hexBinary-facets" shape="rect"></a>3.3.15.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#hexBinary" shape="rect">hexBinary</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="hexBinary.whiteSpace" shape="rect" id="hexBinary.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#hexBinary" shape="rect">hexBinary</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#hexBinary" shape="rect">hexBinary</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="base64Binary" id="base64Binary" shape="rect"></a>3.3.16 base64Binary</h4><p><span class="termdef"><a name="dt-base64Binary" id="dt-base64Binary" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>base64Binary</b> represents arbitrary Base64-encoded binary data.&#160; For <b>base64Binary</b> data the entire binary stream is encoded using the Base64 Encoding defined in <a href="#RFC3548" shape="rect">[RFC 3548]</a>, which is derived from the encoding described in <a href="#RFC2045" shape="rect">[RFC 2045]</a>.</span></p><div class="div4"> <h5><a name="sec-vs-b46b" id="sec-vs-b46b" shape="rect"></a>3.3.16.1 Value Space</h5><p>The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#base64Binary" shape="rect">base64Binary</a> is the set of finite-length sequences of zero or more binary octets.&#160; The length of a value is the number of octets.</p></div><div class="div4"> <h5><a name="sec-lex-b64b" id="sec-lex-b64b" shape="rect"></a>3.3.16.2 Lexical Mapping</h5><p>The <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> of <a href="#base64Binary" shape="rect">base64Binary</a> values are limited to the 65 characters of the Base64 Alphabet defined in <a href="#RFC3548" shape="rect">[RFC 3548]</a>, 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 the space character (#x20). No other characters are allowed. </p><p> For compatibility with older mail gateways, <a href="#RFC2045" shape="rect">[RFC 2045]</a> suggests that Base64 data should have lines limited to at most 76 characters in length.&#160; This line-length limitation is not required by <a href="#RFC3548" shape="rect">[RFC 3548]</a> and is not mandated in the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> of <a href="#base64Binary" shape="rect">base64Binary</a> data.&#160; It <span class="rfc2119">must not</span> be enforced by XML Schema processors.</p><p>The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#base64Binary" shape="rect">base64Binary</a> is the set of literals which <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="#base64Binary" shape="rect">base64Binary</a>production.</p><div class="block"> <div class="defset"> <div class="defset-head">Lexical space of base64Binary</div> <div class="prod"> <a name="nt-Base64Binary" id="nt-Base64Binary" shape="rect"></a><span class="lhs">[27] &#160; <i>Base64Binary</i></span>&#160;::= (<a href="#nt-B64quad" shape="rect"><i>B64quad</i></a>* <a href="#nt-B64final" shape="rect"><i>B64final</i></a>)?</div><div class="prod"> <a name="nt-B64quad" id="nt-B64quad" shape="rect"></a><span class="lhs">[28] &#160; <i>B64quad</i></span>&#160;::= (<a href="#nt-B64" shape="rect"><i>B64</i></a> <a href="#nt-B64" shape="rect"><i>B64</i></a> <a href="#nt-B64" shape="rect"><i>B64</i></a> <a href="#nt-B64" shape="rect"><i>B64</i></a>) <div class="bnf_comment">/* <i class="com"><a href="#nt-B64quad" shape="rect"><i>B64quad</i></a> represents three octets of binary data.</i> */</div> </div><div class="prod"> <a name="nt-B64final" id="nt-B64final" shape="rect"></a><span class="lhs">[29] &#160; <i>B64final</i></span>&#160;::= <a href="#nt-B64finalquad" shape="rect"><i>B64finalquad</i></a> | <a href="#nt-Padded16" shape="rect"><i>Padded16</i></a> | <a href="#nt-Padded8" shape="rect"><i>Padded8</i></a></div><div class="prod"> <a name="nt-B64finalquad" id="nt-B64finalquad" shape="rect"></a><span class="lhs">[30] &#160; <i>B64finalquad</i></span>&#160;::= (<a href="#nt-B64" shape="rect"><i>B64</i></a> <a href="#nt-B64" shape="rect"><i>B64</i></a> <a href="#nt-B64" shape="rect"><i>B64</i></a> <a href="#nt-B64char" shape="rect"><i>B64char</i></a>) <div class="bnf_comment">/* <i class="com"><a href="#nt-B64finalquad" shape="rect"><i>B64finalquad</i></a> represents three octets of binary data without trailing space.</i> */</div> </div><div class="prod"> <a name="nt-Padded16" id="nt-Padded16" shape="rect"></a><span class="lhs">[31] &#160; <i>Padded16</i></span>&#160;::= <a href="#nt-B64" shape="rect"><i>B64</i></a> <a href="#nt-B64" shape="rect"><i>B64</i></a> <a href="#nt-B16" shape="rect"><i>B16</i></a> '<code>=</code>' <div class="bnf_comment">/* <i class="com"><a href="#nt-Padded16" shape="rect"><i>Padded16</i></a> represents a two-octet at the end of the data.</i> */</div> </div><div class="prod"> <a name="nt-Padded8" id="nt-Padded8" shape="rect"></a><span class="lhs">[32] &#160; <i>Padded8</i></span>&#160;::= <a href="#nt-B64" shape="rect"><i>B64</i></a> <a href="#nt-B04" shape="rect"><i>B04</i></a> '<code>=</code>' #x20? '<code>=</code>' <div class="bnf_comment">/* <i class="com"><a href="#nt-Padded8" shape="rect"><i>Padded8</i></a> represents a single octet at the end of the data.</i> */</div> </div><div class="prod"> <a name="nt-B64" id="nt-B64" shape="rect"></a><span class="lhs">[33] &#160; <i>B64</i></span>&#160;::= <a href="#nt-B64char" shape="rect"><i>B64char</i></a> #x20?</div><div class="prod"> <a name="nt-B64char" id="nt-B64char" shape="rect"></a><span class="lhs">[34] &#160; <i>B64char</i></span>&#160;::= [A-Za-z0-9+/]</div><div class="prod"> <a name="nt-B16" id="nt-B16" shape="rect"></a><span class="lhs">[35] &#160; <i>B16</i></span>&#160;::= <a href="#nt-B16char" shape="rect"><i>B16char</i></a> #x20?</div><div class="prod"> <a name="nt-B16char" id="nt-B16char" shape="rect"></a><span class="lhs">[36] &#160; <i>B16char</i></span>&#160;::= [AEIMQUYcgkosw048] <div class="bnf_comment">/* <i class="com">Base64 characters whose bit-string value ends in '00'</i> */</div></div><div class="prod"> <a name="nt-B04" id="nt-B04" shape="rect"></a><span class="lhs">[37] &#160; <i>B04</i></span>&#160;::= <a href="#nt-B04char" shape="rect"><i>B04char</i></a> #x20?</div><div class="prod"> <a name="nt-B04char" id="nt-B04char" shape="rect"></a><span class="lhs">[38] &#160; <i>B04char</i></span>&#160;::= [AQgw] <div class="bnf_comment">/* <i class="com">Base64 characters whose bit-string value ends in '0000'</i> */</div></div></div> </div><div class="block"> The <a href="#nt-Base64Binary" shape="rect"><i>Base64Binary</i></a> production is equivalent to the following regular expression. <blockquote class="shrink"><p> <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> </p></blockquote> Note that each '<code>?</code>' except the last is preceded by a single space character.</div><p>Note that this grammar requires the number of non-whitespace characters in the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> to be a multiple of four, and for equals signs to appear only at the end of the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>; literals which do not meet these constraints are not legal <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> of <a href="#base64Binary" shape="rect">base64Binary</a>.</p><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#base64Binary" shape="rect">base64Binary</a> is as given in <a href="#RFC2045" shape="rect">[RFC 2045]</a> and <a href="#RFC3548" shape="rect">[RFC 3548]</a>.</p><div class="note"><div class="p"><b>Note:</b> The above definition of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> is more restrictive than that given in <a href="#RFC2045" shape="rect">[RFC 2045]</a> as regards whitespace &#8212; and less restrictive than <a href="#RFC3548" shape="rect">[RFC 3548]</a>. This is not an issue in practice.&#160; Any string compatible with either RFC can occur in an element or attribute validated by this type, because the <a href="#dt-whiteSpace" class="termref" shape="rect"><span class="arrow">&#183;</span>whiteSpace<span class="arrow">&#183;</span></a> facet of this type is fixed to <b><i>collapse</i></b>, which means that all leading and trailing whitespace will be stripped, and all internal whitespace collapsed to single space characters, <em>before</em> the above grammar is enforced. The possibility of ignoring whitespace in Base64 data is foreseen in clause 2.3 of <a href="#RFC3548" shape="rect">[RFC 3548]</a>, but for the reasons given there this specification does not allow implementations to ignore non-whitespace characters which are not in the Base64 Alphabet.</div></div><p>The canonical <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> of a <a href="#base64Binary" shape="rect">base64Binary</a> data value is the Base64 encoding of the value which matches the Canonical-base64Binary production in the following grammar: </p><div class="block"> <div class="defset"> <div class="defset-head">Canonical representation of base64Binary</div> <div class="prod"> <a name="nt-Canonical-base64Binary" id="nt-Canonical-base64Binary" shape="rect"></a><span class="lhs">[39] &#160; <i>Canonical-base64Binary</i></span>&#160;::= <a href="#nt-CanonicalQuad" shape="rect"><i>CanonicalQuad</i></a>* <a href="#nt-CanonicalPadded" shape="rect"><i>CanonicalPadded</i></a>?</div><div class="prod"> <a name="nt-CanonicalQuad" id="nt-CanonicalQuad" shape="rect"></a><span class="lhs">[40] &#160; <i>CanonicalQuad</i></span>&#160;::= <a href="#nt-B64char" shape="rect"><i>B64char</i></a> <a href="#nt-B64char" shape="rect"><i>B64char</i></a> <a href="#nt-B64char" shape="rect"><i>B64char</i></a> <a href="#nt-B64char" shape="rect"><i>B64char</i></a></div><div class="prod"> <a name="nt-CanonicalPadded" id="nt-CanonicalPadded" shape="rect"></a><span class="lhs">[41] &#160; <i>CanonicalPadded</i></span>&#160;::= <a href="#nt-B64char" shape="rect"><i>B64char</i></a> <a href="#nt-B64char" shape="rect"><i>B64char</i></a> <a href="#nt-B16char" shape="rect"><i>B16char</i></a> '<code>=</code>' | <a href="#nt-B64char" shape="rect"><i>B64char</i></a> <a href="#nt-B04char" shape="rect"><i>B04char</i></a> '<code>==</code>'</div></div> </div><p>That is, the <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> of a <a href="#base64Binary" shape="rect">base64Binary</a> value is the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> which maps to that value and contains no whitespace. The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> for <a href="#base64Binary" shape="rect">base64Binary</a> is thus the encoding algorithm for Base64 data given in <a href="#RFC2045" shape="rect">[RFC 2045]</a> and <a href="#RFC3548" shape="rect">[RFC 3548]</a>, with the proviso that no characters except those in the Base64 Alphabet are to be written out.</p><div class="note"><div class="p"><b>Note:</b> For some values the <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> defined above does not conform to <a href="#RFC2045" shape="rect">[RFC 2045]</a>, which requires breaking with linefeeds at appropriate intervals. It does conform with <a href="#RFC3548" shape="rect">[RFC 3548]</a>.</div></div><p>The length of a <a href="#base64Binary" shape="rect">base64Binary</a> value may be calculated from the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> by removing whitespace and padding characters and performing the calculation shown in the pseudo-code below:</p><p> <code> lex2&#160;&#160;&#160;:=&#160;killwhitespace(lexform)&#160; &#160;&#160;--&#160;remove&#160;whitespace&#160;characters<br clear="none" /> lex3&#160;&#160;&#160;:=&#160;strip_equals(lex2)&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;--&#160;strip&#160;padding&#160;characters&#160;at&#160;end<br clear="none" /> length&#160;:=&#160;floor&#160;(length(lex3)&#160;*&#160;3&#160;/&#160;4)&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;--&#160;calculate&#160;length </code> </p><p> Note on encoding:&#160; <a href="#RFC2045" shape="rect">[RFC 2045]</a> and <a href="#RFC3548" shape="rect">[RFC 3548]</a> explicitly reference US-ASCII encoding.&#160; However, decoding of <b>base64Binary</b> data in an XML entity is to be performed on the Unicode characters obtained after character encoding processing as specified by <a href="#XML" shape="rect">[XML]</a>. </p></div><div class="div4"> <h5><a name="base64Binary-facets" id="base64Binary-facets" shape="rect"></a>3.3.16.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#base64Binary" shape="rect">base64Binary</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="base64Binary.whiteSpace" shape="rect" id="base64Binary.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#base64Binary" shape="rect">base64Binary</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#base64Binary" shape="rect">base64Binary</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="anyURI" id="anyURI" shape="rect"></a>3.3.17 anyURI</h4><p><span class="termdef"><a name="dt-anyURI" id="dt-anyURI" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>anyURI</b> represents an Internationalized Resource Identifier Reference (IRI).&#160; An <b>anyURI</b> value can be absolute or relative, and may have an optional fragment identifier (i.e., it may be an IRI Reference).&#160; This type should be used when the value fulfills the role of an IRI, as defined in <a href="#RFC3987" shape="rect">[RFC 3987]</a> or its successor(s) in the IETF Standards Track.</span></p><div class="note"><div class="p"><b>Note:</b> 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 mapping from <a href="#anyURI" shape="rect">anyURI</a> values to URIs given by the reference escaping procedure defined in <a href="#LEIRIs" shape="rect">[LEIRI]</a> and in Section 3.1 <a href="http://www.ietf.org/rfc/rfc3987.txt" shape="rect">Mapping of IRIs to URIs</a> of <a href="#RFC3987" shape="rect">[RFC 3987]</a> or its successor(s) in the IETF Standards Track.&#160; This means that a wide range of internationalized resource identifiers can be specified when an <a href="#anyURI" shape="rect">anyURI</a> is called for, and still be understood as URIs per <a href="#RFC3986" shape="rect">[RFC 3986]</a> and its successor(s).</div></div><div class="div4"> <h5><a name="anyURI-vs" id="anyURI-vs" shape="rect"></a>3.3.17.1 Value Space</h5><p>The value space of <a href="#anyURI" shape="rect">anyURI</a> is the set of finite-length sequences of zero or more <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect">character</a>s (as defined in <a href="#XML" shape="rect">[XML]</a>) that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a> production from <a href="#XML" shape="rect">[XML]</a>.</p></div><div class="div4"> <h5><a name="anyURI-lexical-representation" id="anyURI-lexical-representation" shape="rect"></a>3.3.17.2 Lexical Mapping</h5><p>The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#anyURI" shape="rect">anyURI</a> is the set of finite-length sequences of zero or more <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect">character</a>s (as defined in <a href="#XML" shape="rect">[XML]</a>) that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml11/#NT-Char" shape="rect">Char</a> production from <a href="#XML" shape="rect">[XML]</a>.</p><div class="note"><div class="p"><b>Note:</b> For an <a href="#anyURI" shape="rect">anyURI</a> value to be usable in practice as an IRI, the result of applying to it the algorithm defined in Section 3.1 of <a href="#RFC3987" shape="rect">[RFC 3987]</a> should be a string which is a legal URI according to <a href="#RFC3986" shape="rect">[RFC 3986]</a>. (This is true at the time this document is published; if in the future <a href="#RFC3987" shape="rect">[RFC 3987]</a> and <a href="#RFC3986" shape="rect">[RFC 3986]</a> are replaced by other specifications in the IETF Standards Track, the relevant constraints will be those imposed by those successor specifications.)</div><div class="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 <a href="#RFC3987" shape="rect">[RFC 3987]</a> and <a href="#RFC3986" shape="rect">[RFC 3986]</a> and their successors are part of this datatype as defined here. Applications which depend on <a href="#anyURI" shape="rect">anyURI</a> values being legal according to the rules of the relevant specifications should make arrangements to check values against the appropriate definitions of IRI, URI, and specific schemes.</div></div><div class="note"><div class="p"><b>Note:</b> Spaces are, in principle, allowed in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#anyURI" shape="rect">anyURI</a>, however, their use is highly discouraged (unless they are encoded by '<code>%20</code>').</div></div><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#anyURI" shape="rect">anyURI</a> is the identity mapping.</p><div class="note"><div class="p"><b>Note:</b> 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 "equivalent" URIs or IRIs are different character sequences, they map to different values in this datatype.</div></div></div><div class="div4"> <h5><a name="anyURI-facets" id="anyURI-facets" shape="rect"></a>3.3.17.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#anyURI" shape="rect">anyURI</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="anyURI.whiteSpace" shape="rect" id="anyURI.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#anyURI" shape="rect">anyURI</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#anyURI" shape="rect">anyURI</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="QName" id="QName" shape="rect"></a>3.3.18 QName</h4><p><span class="termdef"><a name="dt-QName" id="dt-QName" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>QName</b> represents <a href="https://www.w3.org/TR/xml-names11/#dt-qualname" shape="rect">XML qualified names</a>. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>QName</b> is the set of tuples {<a href="https://www.w3.org/TR/xml-names11/#dt-NSName" shape="rect">namespace name</a>, <a href="https://www.w3.org/TR/xml-names11/#dt-localname" shape="rect">local part</a>}, where <a href="https://www.w3.org/TR/xml-names11/#dt-NSName" shape="rect">namespace name</a> is an <a href="#anyURI" shape="rect">anyURI</a> and <a href="https://www.w3.org/TR/xml-names11/#dt-localname" shape="rect">local part</a> is an <a href="#NCName" shape="rect">NCName</a>. The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>QName</b> is the set of strings that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml-names11/#NT-QName" shape="rect"> QName</a> production of <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>.</span></p><p>It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml-names11/#NT-QName" shape="rect">QName</a> production from <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>, or that from <a href="#XMLNS1.0" shape="rect">[Namespaces in XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </p><p> The mapping from lexical space to value space for a particular <a href="#QName" shape="rect">QName</a> <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> depends on the namespace bindings in scope where the literal occurs. </p><p>When <a href="#QName" shape="rect">QName</a>s appear in an XML context, the bindings to be used in the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> are those in the <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[in-scope namespaces]</a> property of the relevant element. When this datatype is used in a non-XML host language, the host language <span class="rfc2119">must</span> specify what namespace bindings are to be used.</p><p> The host language, whether XML-based or otherwise, <span class="rfc2119">may</span> specify whether unqualified names are bound to the default namespace (if any) or not; the host language may also place this under user control. If the host language does not specify otherwise, unqualified names are bound to the default namespace. </p><div class="note"><div class="p"><b>Note:</b> The default treatment of unqualified names parallels that specified in <a href="#XMLNS" shape="rect">[Namespaces in XML]</a> for element names (as opposed to that specified for attribute names). </div></div><div class="note"><div class="p"><b>Note:</b> The mapping between <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> and values in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#QName" shape="rect">QName</a> depends on the set of namespace declarations in scope for the context in which <a href="#QName" shape="rect">QName</a> is used.&#160; </div><div class="p">Because the lexical representations available for any value of type <a href="#QName" shape="rect">QName</a> vary with context, no <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> is defined for <a href="#QName" shape="rect">QName</a> in this specification.</div></div><div class="div4"> <h5><a name="QName-facets" id="QName-facets" shape="rect"></a>3.3.18.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#QName" shape="rect">QName</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="QName.whiteSpace" shape="rect" id="QName.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#QName" shape="rect">QName</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#QName" shape="rect">QName</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="NOTATION" id="NOTATION" shape="rect"></a>3.3.19 NOTATION</h4><p><span class="termdef"><a name="dt-NOTATION" id="dt-NOTATION" title="" shape="rect">[Definition:]&#160;&#160;</a><b>NOTATION</b> represents the <a href="https://www.w3.org/TR/xml11/#NT-NotationType" class="nt" shape="rect">NOTATION</a> attribute type from <a href="#XML" shape="rect">[XML]</a>. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>NOTATION</b> is the set of <a href="#QName" shape="rect">QName</a>s of notations declared in the current schema. The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>NOTATION</b> is the set of all names of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-notation" shape="rect">notations</a> declared in the current schema (in the form of <a href="#QName" shape="rect">QName</a>s).</span></p><div class="note"><div class="p"><b>Note:</b> Because its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> depends on the notion of a "current schema", as instantiated for example by <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, the <a href="#NOTATION" shape="rect">NOTATION</a> datatype is unsuitable for use in other contexts which lack the notion of a current schema. </div></div><p> The lexical mapping rules for <a href="#NOTATION" shape="rect">NOTATION</a> are as given for <a href="#QName" shape="rect">QName</a> in <a href="#QName" shape="rect">QName (&#167;3.3.18)</a>. </p><div class="constraintnote"><a id="enumeration-required-notation" name="enumeration-required-notation" shape="rect"></a><b>Schema Component Constraint: enumeration facet value required for NOTATION</b><br clear="none" /><div class="constraint"><div class="p">It is (with one exception) an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> for <a href="#NOTATION" shape="rect">NOTATION</a> to be used directly to validate a literal as described in <a href="#cvc-datatype-valid" shape="rect">Datatype Valid (&#167;4.1.4)</a>: only datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#NOTATION" shape="rect">NOTATION</a> by specifying a value for <a href="#dt-enumeration" class="termref" shape="rect"><span class="arrow">&#183;</span>enumeration<span class="arrow">&#183;</span></a> can be used to validate literals.</div><div class="p"> The exception is that in the <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derivation<span class="arrow">&#183;</span></a> of a new type the <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> used to enumerate the allowed values <span class="rfc2119">may</span> be (and in the context of [XSD 1.1 Part 1: Structures] will be) validated directly against <a href="#NOTATION" shape="rect">NOTATION</a>; this amounts to verifying that the value is a <a href="#QName" shape="rect">QName</a> and that the <a href="#QName" shape="rect">QName</a> is the name of a <b>NOTATION</b> declared in the current schema. </div></div></div><p>For compatibility (see <a href="#terminology" shape="rect">Terminology (&#167;1.6)</a>) <a href="#NOTATION" shape="rect">NOTATION</a> should be used only on attributes and should only be used in schemas with no target namespace.</p><div class="block"> <div class="note"><div class="p"><b>Note:</b> Because the lexical representations available for any given value of <a href="#NOTATION" shape="rect">NOTATION</a> vary with context, this specification defines no <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#NOTATION" shape="rect">NOTATION</a> values.</div></div> </div><div class="div4"> <h5><a name="NOTATION-facets" id="NOTATION-facets" shape="rect"></a>3.3.19.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#NOTATION" shape="rect">NOTATION</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" name="NOTATION.whiteSpace" shape="rect" id="NOTATION.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#NOTATION" shape="rect">NOTATION</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#NOTATION" shape="rect">NOTATION</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div><p> The use of <a href="#dt-length" class="termref" shape="rect"><span class="arrow">&#183;</span>length<span class="arrow">&#183;</span></a>, <a href="#dt-minLength" class="termref" shape="rect"><span class="arrow">&#183;</span>minLength<span class="arrow">&#183;</span></a> and <a href="#dt-maxLength" class="termref" shape="rect"><span class="arrow">&#183;</span>maxLength<span class="arrow">&#183;</span></a> on <a href="#NOTATION" shape="rect">NOTATION</a> or datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#NOTATION" shape="rect">NOTATION</a> is deprecated.&#160; Future versions of this specification may remove these facets for this datatype. </p></div></div></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#built-in-primitive-datatypes" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="ordinary-built-ins" id="ordinary-built-ins" shape="rect"></a>3.4 Other Built-in Datatypes</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.1 <a href="#normalizedString" shape="rect">normalizedString</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.1.1 <a href="#normalizedString-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.1.2 <a href="#normalizedString-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.2 <a href="#token" shape="rect">token</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.2.1 <a href="#token-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.2.2 <a href="#token-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.3 <a href="#language" shape="rect">language</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.3.1 <a href="#language-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.4 <a href="#NMTOKEN" shape="rect">NMTOKEN</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.4.1 <a href="#NMTOKEN-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.4.2 <a href="#NMTOKEN-derived-types" shape="rect">Related datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.5 <a href="#NMTOKENS" shape="rect">NMTOKENS</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.5.1 <a href="#NMTOKENS-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.6 <a href="#Name" shape="rect">Name</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.6.1 <a href="#Name-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.6.2 <a href="#Name-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.7 <a href="#NCName" shape="rect">NCName</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.7.1 <a href="#NCName-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.7.2 <a href="#NCName-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.8 <a href="#ID" shape="rect">ID</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.8.1 <a href="#ID-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.9 <a href="#IDREF" shape="rect">IDREF</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.9.1 <a href="#IDREF-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.9.2 <a href="#IDREF-derived-types" shape="rect">Related datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.10 <a href="#IDREFS" shape="rect">IDREFS</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.10.1 <a href="#IDREFS-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.11 <a href="#ENTITY" shape="rect">ENTITY</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.11.1 <a href="#ENTITY-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.11.2 <a href="#ENTITY-derived-types" shape="rect">Related datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.12 <a href="#ENTITIES" shape="rect">ENTITIES</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.12.1 <a href="#ENTITIES-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.13 <a href="#integer" shape="rect">integer</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.13.1 <a href="#integer-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.13.2 <a href="#integer-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.13.3 <a href="#integer-facets" shape="rect">Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.13.4 <a href="#integer-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.14 <a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.14.1 <a href="#nonPositiveInteger-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.14.2 <a href="#nonPositiveInteger-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.14.3 <a href="#nonPositiveInteger-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.14.4 <a href="#nonPositiveInteger-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.15 <a href="#negativeInteger" shape="rect">negativeInteger</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.15.1 <a href="#negativeInteger-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.15.2 <a href="#negativeInteger-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.15.3 <a href="#negativeInteger-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.16 <a href="#long" shape="rect">long</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.16.1 <a href="#long-lexical-representation" shape="rect">Lexical Representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.16.2 <a href="#long-canonical-repr" shape="rect">Canonical Representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.16.3 <a href="#long-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.16.4 <a href="#long-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.17 <a href="#int" shape="rect">int</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.17.1 <a href="#int-lexical-representation" shape="rect">Lexical Representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.17.2 <a href="#int-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.17.3 <a href="#int-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.17.4 <a href="#int-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.18 <a href="#short" shape="rect">short</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.18.1 <a href="#short-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.18.2 <a href="#short-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.18.3 <a href="#short-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.18.4 <a href="#short-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.19 <a href="#byte" shape="rect">byte</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.19.1 <a href="#byte-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.19.2 <a href="#byte-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.19.3 <a href="#byte-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.20 <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.20.1 <a href="#nonNegativeInteger-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.20.2 <a href="#nonNegativeInteger-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.20.3 <a href="#nonNegativeInteger-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.20.4 <a href="#nonNegativeInteger-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.21 <a href="#unsignedLong" shape="rect">unsignedLong</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.21.1 <a href="#unsignedLong-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.21.2 <a href="#unsignedLong-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.21.3 <a href="#unsignedLong-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.21.4 <a href="#unsignedLong-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.22 <a href="#unsignedInt" shape="rect">unsignedInt</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.22.1 <a href="#unsignedInt-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.22.2 <a href="#unsignedInt-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.22.3 <a href="#unsignedInt-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.22.4 <a href="#unsignedInt-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.23 <a href="#unsignedShort" shape="rect">unsignedShort</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.23.1 <a href="#unsignedShort-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.23.2 <a href="#unsignedShort-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.23.3 <a href="#unsignedShort-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.23.4 <a href="#unsignedShort-derived-types" shape="rect">Derived datatypes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.24 <a href="#unsignedByte" shape="rect">unsignedByte</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.24.1 <a href="#unsignedByte-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.24.2 <a href="#unsignedByte-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.24.3 <a href="#unisngedByte-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.25 <a href="#positiveInteger" shape="rect">positiveInteger</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.25.1 <a href="#positiveInteger-lexical-representation" shape="rect">Lexical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.25.2 <a href="#positiveInteger-canonical-repr" shape="rect">Canonical representation</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.25.3 <a href="#positiveInteger-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.26 <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.26.1 <a href="#yearMonthDuration-lexical-mapping" shape="rect">The Lexical Mapping</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.26.2 <a href="#YearMonthDuration-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.27 <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.27.1 <a href="#dayTimeDuration-lexical-mapping" shape="rect">The Lexical Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.27.2 <a href="#dayTimeDuration-facets" shape="rect"> Facets</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.28 <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.28.1 <a href="#dateTimeStamp-lexical-mapping" shape="rect">The Lexical Space</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;3.4.28.2 <a href="#dateTimeStamp-facets" shape="rect"> Facets</a><br clear="none" /> </div><p> This section gives conceptual definitions for all <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes defined by this specification. The XML representation used to define <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes (whether <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> or <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a>) is given in <a href="#xr-defn" shape="rect">XML Representation of Simple Type Definition Schema Components (&#167;4.1.2)</a> and the complete definitions of the <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes are provided in the appendix <a href="#schema" shape="rect">Schema for Schema Documents (Datatypes) (normative) (&#167;A)</a>. </p><div class="div3"> <h4><a name="normalizedString" id="normalizedString" shape="rect"></a>3.4.1 normalizedString</h4><p> <span class="termdef"><a name="dt-normalizedString" id="dt-normalizedString" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>normalizedString</b> represents white space normalized strings.&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>normalizedString</b> is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters.&#160; The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>normalizedString</b> is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>normalizedString</b> is <a href="#string" shape="rect">string</a>. </span> </p><div class="div4"> <h5><a name="normalizedString-facets" id="normalizedString-facets" shape="rect"></a>3.4.1.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#normalizedString" shape="rect">normalizedString</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-whiteSpace" name="normalizedString.whiteSpace" shape="rect" id="normalizedString.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>replace</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#normalizedString" shape="rect">normalizedString</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#normalizedString" shape="rect">normalizedString</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="normalizedString-derived-types" id="normalizedString-derived-types" shape="rect"></a>3.4.1.2 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#normalizedString" shape="rect">normalizedString</a></p><ul><li><a href="#token" shape="rect">token</a></li></ul></div></div><div class="div3"> <h4><a name="token" id="token" shape="rect"></a>3.4.2 token</h4><p> <span class="termdef"><a name="dt-token" id="dt-token" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>token</b> represents tokenized strings. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>token</b> 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 <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>token</b> 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 <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>token</b> is <a href="#normalizedString" shape="rect">normalizedString</a>. </span> </p><div class="div4"> <h5><a name="token-facets" id="token-facets" shape="rect"></a>3.4.2.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#token" shape="rect">token</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-whiteSpace" name="token.whiteSpace" shape="rect" id="token.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#token" shape="rect">token</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#token" shape="rect">token</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="token-derived-types" id="token-derived-types" shape="rect"></a>3.4.2.2 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes are <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#token" shape="rect">token</a></p><ul><li><a href="#language" shape="rect">language</a></li><li><a href="#NMTOKEN" shape="rect">NMTOKEN</a></li><li><a href="#Name" shape="rect">Name</a></li></ul></div></div><div class="div3"> <h4><a name="language" id="language" shape="rect"></a>3.4.3 language</h4><div class="block"><span class="termdef"><a name="dt-language" id="dt-language" title="" shape="rect">[Definition:]&#160;&#160;</a><b>language</b> represents formal natural language identifiers, as defined by <a href="#BCP47" shape="rect">[BCP 47]</a> (currently represented by <a href="#RFC4646" shape="rect">[RFC 4646]</a> and <a href="#RFC4647" shape="rect">[RFC 4647]</a>) or its successor(s). </span> The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#language" shape="rect">language</a> are the set of all strings that conform to the pattern <blockquote><blockquote><p><code>[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*</code></p></blockquote></blockquote> This is the set of strings accepted by the grammar given in <a href="#RFC3066" shape="rect">[RFC 3066]</a>, which is now obsolete; the current specification of language codes is more restrictive.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <a href="#language" shape="rect">language</a> is <a href="#token" shape="rect">token</a>. </div><div class="note"><div class="p"><b>Note:</b> 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 <a href="#BCP47" shape="rect">[BCP 47]</a> 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.</div></div><div class="note"><div class="p"><b>Note:</b> <a href="#BCP47" shape="rect">[BCP 47]</a> specifies that language codes "are to be treated as case insensitive; there exist conventions for capitalization of some of the subtags, but these MUST NOT be taken to carry meaning." Since the <a href="#language" shape="rect">language</a> datatype is derived from <a href="#string" shape="rect">string</a>, it inherits from <a href="#string" shape="rect">string</a> a one-to-one mapping from lexical representations to values. The literals '<code>MN</code>' and '<code>mn</code>' (for Mongolian) 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 <a href="#BCP47" shape="rect">[BCP 47]</a> does not follow from the definition of this datatype given here; applications which require case-insensitivity should make appropriate adjustments.</div></div><div class="note"><a name="xml.lang.and.language" id="xml.lang.and.language" shape="rect"></a><div class="p"><b>Note:</b> The empty string is not a member of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#language" shape="rect">language</a>. Some constructs which normally take language codes as their values, however, also allow the empty string. The attribute <code>xml:lang</code> defined by <a href="#XML" shape="rect">[XML]</a> is one example; there, the empty string overrides a value which would otherwise be inherited, but without specifying a new value.</div><div class="p">One way to define the desired set of possible values is illustrated by the schema document for the XML namespace at <a href="https://www.w3.org/2001/xml.xsd" shape="rect">http://www.w3.org/2001/xml.xsd</a>, which defines the attribute <code>xml:lang</code> as having a type which is a union of <a href="#language" shape="rect">language</a> and an anonymous type whose only value is the empty string:<pre 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; </pre></div></div><div class="div4"> <h5><a name="language-facets" id="language-facets" shape="rect"></a>3.4.3.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#language" shape="rect">language</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" name="language.pattern" shape="rect" id="language.pattern">pattern</a><span class="normal"><span class="normal"> = <b><i>[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*</i></b></span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#language" shape="rect">language</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#language" shape="rect">language</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="NMTOKEN" id="NMTOKEN" shape="rect"></a>3.4.4 NMTOKEN</h4><p><span class="termdef"><a name="dt-NMTOKEN" id="dt-NMTOKEN" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>NMTOKEN</b> represents the <a href="https://www.w3.org/TR/xml11/#NT-TokenizedType" shape="rect">NMTOKEN attribute type</a> from <a href="#XML" shape="rect">[XML]</a>. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>NMTOKEN</b> is the set of tokens that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml11/#NT-Nmtoken" shape="rect">Nmtoken</a> production in <a href="#XML" shape="rect">[XML]</a>. The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>NMTOKEN</b> is the set of strings that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml11/#NT-Nmtoken" shape="rect">Nmtoken</a> production in <a href="#XML" shape="rect">[XML]</a>.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>NMTOKEN</b> is <a href="#token" shape="rect">token</a>. </span></p><p>It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml11/#NT-Nmtoken" shape="rect">NMTOKEN</a> production from <a href="#XML" shape="rect">[XML]</a>, or that from <a href="#XML1.0" shape="rect">[XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>.</p><p>For compatibility (see <a href="#terminology" shape="rect">Terminology (&#167;1.6)</a> <a href="#NMTOKEN" shape="rect">NMTOKEN</a> should be used only on attributes.</p><div class="div4"> <h5><a name="NMTOKEN-facets" id="NMTOKEN-facets" shape="rect"></a>3.4.4.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#NMTOKEN" shape="rect">NMTOKEN</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" name="NMTOKEN.pattern" shape="rect" id="NMTOKEN.pattern">pattern</a><span class="normal"><span class="normal"> = <b><i>\c+</i></b></span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#NMTOKEN" shape="rect">NMTOKEN</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#NMTOKEN" shape="rect">NMTOKEN</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="NMTOKEN-derived-types" id="NMTOKEN-derived-types" shape="rect"></a>3.4.4.2 Related datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from <a href="#NMTOKEN" shape="rect">NMTOKEN</a></p><ul><li><a href="#NMTOKENS" shape="rect">NMTOKENS</a></li></ul></div></div><div class="div3"> <h4><a name="NMTOKENS" id="NMTOKENS" shape="rect"></a>3.4.5 NMTOKENS</h4><p><span class="termdef"><a name="dt-NMTOKENS" id="dt-NMTOKENS" title="" shape="rect">[Definition:]&#160;&#160;</a><b>NMTOKENS</b> represents the <a href="https://www.w3.org/TR/xml11/#NT-TokenizedType" shape="rect">NMTOKENS attribute type</a> from <a href="#XML" shape="rect">[XML]</a>. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>NMTOKENS</b> is the set of finite, non-zero-length sequences of <a href="#dt-NMTOKEN" class="termref" shape="rect"><span class="arrow">&#183;</span>NMTOKEN<span class="arrow">&#183;</span></a>s.&#160; The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>NMTOKENS</b> is the set of space-separated lists of tokens, of which each token is in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#NMTOKEN" shape="rect">NMTOKEN</a>.&#160; The <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> of <b>NMTOKENS</b> is <a href="#NMTOKEN" shape="rect">NMTOKEN</a>. <a href="#NMTOKENS" shape="rect">NMTOKENS</a> is derived from <a href="#dt-anySimpleType" class="termref" shape="rect"><span class="arrow">&#183;</span><code>anySimpleType</code><span class="arrow">&#183;</span></a> in two steps: an anonymous list type is defined, whose <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> is <a href="#NMTOKEN" shape="rect">NMTOKEN</a>; this is the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <a href="#NMTOKENS" shape="rect">NMTOKENS</a>, which restricts its value space to lists with at least one item. </span></p><p> For compatibility (see <a href="#terminology" shape="rect">Terminology (&#167;1.6)</a>) <a href="#NMTOKENS" shape="rect">NMTOKENS</a> should be used only on attributes. </p><div class="div4"> <h5><a name="NMTOKENS-facets" id="NMTOKENS-facets" shape="rect"></a>3.4.5.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#NMTOKENS" shape="rect">NMTOKENS</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-minLength" name="NMTOKENS.minLength" shape="rect" id="NMTOKENS.minLength">minLength</a><span class="normal"><span class="normal"> = <b><i>1</i></b></span></span></li><li><a href="#rf-whiteSpace" name="NMTOKENS.whiteSpace" shape="rect" id="NMTOKENS.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#NMTOKENS" shape="rect">NMTOKENS</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#NMTOKENS" shape="rect">NMTOKENS</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="Name" id="Name" shape="rect"></a>3.4.6 Name</h4><p> <span class="termdef"><a name="dt-Name" id="dt-Name" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>Name</b> represents <a href="https://www.w3.org/TR/xml11/#dt-name" shape="rect">XML Names</a>. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>Name</b> is the set of all strings which <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml11/#NT-Name" shape="rect">Name</a> production of <a href="#XML" shape="rect">[XML]</a>.&#160; The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>Name</b> is the set of all strings which <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml11/#NT-Name" shape="rect">Name</a> production of <a href="#XML" shape="rect">[XML]</a>. The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>Name</b> is <a href="#token" shape="rect">token</a>. </span> </p><p>It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml11/#NT-Name" shape="rect">Name</a> production from <a href="#XML" shape="rect">[XML]</a>, or that from <a href="#XML1.0" shape="rect">[XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </p><div class="div4"> <h5><a name="Name-facets" id="Name-facets" shape="rect"></a>3.4.6.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#Name" shape="rect">Name</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" name="Name.pattern" shape="rect" id="Name.pattern">pattern</a><span class="normal"><span class="normal"> = <b><i>\i\c*</i></b></span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#Name" shape="rect">Name</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#Name" shape="rect">Name</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="Name-derived-types" id="Name-derived-types" shape="rect"></a>3.4.6.2 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#Name" shape="rect">Name</a></p><ul><li><a href="#NCName" shape="rect">NCName</a></li></ul></div></div><div class="div3"> <h4><a name="NCName" id="NCName" shape="rect"></a>3.4.7 NCName</h4><p> <span class="termdef"><a name="dt-NCName" id="dt-NCName" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>NCName</b> represents XML "non-colonized" Names.&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>NCName</b> is the set of all strings which <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production of <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>.&#160; The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>NCName</b> is the set of all strings which <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production of <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>NCName</b> is <a href="#Name" shape="rect">Name</a>. </span> </p><p>It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production from <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>, or that from <a href="#XMLNS1.0" shape="rect">[Namespaces in XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </p><div class="div4"> <h5><a name="NCName-facets" id="NCName-facets" shape="rect"></a>3.4.7.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#NCName" shape="rect">NCName</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" name="NCName.pattern" shape="rect" id="NCName.pattern">pattern</a><span class="normal"><span class="normal"> = <b><i>\i\c* &#8745; [\i-[:]][\c-[:]]*</i></b></span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#NCName" shape="rect">NCName</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#NCName" shape="rect">NCName</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="NCName-derived-types" id="NCName-derived-types" shape="rect"></a>3.4.7.2 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes are <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#NCName" shape="rect">NCName</a></p><ul><li><a href="#ID" shape="rect">ID</a></li><li><a href="#IDREF" shape="rect">IDREF</a></li><li><a href="#ENTITY" shape="rect">ENTITY</a></li></ul></div></div><div class="div3"> <h4><a name="ID" id="ID" shape="rect"></a>3.4.8 ID</h4><p><span class="termdef"><a name="dt-ID" id="dt-ID" title="" shape="rect">[Definition:]&#160;&#160;</a><b>ID</b> represents the <a href="https://www.w3.org/TR/xml11/#NT-TokenizedType" shape="rect">ID attribute type</a> from <a href="#XML" shape="rect">[XML]</a>.&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>ID</b> is the set of all strings that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production in <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>.&#160; The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>ID</b> is the set of all strings that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production in <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>. The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>ID</b> is <a href="#NCName" shape="rect">NCName</a>. </span></p><div class="note"><div class="p"><b>Note:</b> It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production from <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>, or that from <a href="#XMLNS1.0" shape="rect">[Namespaces in XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>.</div></div><p>For compatibility (see <a href="#terminology" shape="rect">Terminology (&#167;1.6)</a>), <a href="#ID" shape="rect">ID</a> should be used only on attributes.</p><div class="note"><div class="p"><b>Note:</b> Uniqueness of items validated as <a href="#ID" shape="rect">ID</a> is not part of this datatype as defined here. When this specification is used in conjunction with <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, uniqueness is enforced at a different level, not as part of datatype validity; see <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#cvc-id" shape="rect">Validation Rule: Validation Root Valid (ID/IDREF)</a> in <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>.</div></div><div class="div4"> <h5><a name="ID-facets" id="ID-facets" shape="rect"></a>3.4.8.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#ID" shape="rect">ID</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>\i\c* &#8745; [\i-[:]][\c-[:]]*</i></b></span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#ID" shape="rect">ID</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#ID" shape="rect">ID</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="IDREF" id="IDREF" shape="rect"></a>3.4.9 IDREF</h4><p> <span class="termdef"><a name="dt-IDREF" id="dt-IDREF" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>IDREF</b> represents the <a href="https://www.w3.org/TR/xml11/#NT-TokenizedType" shape="rect">IDREF attribute type</a> from <a href="#XML" shape="rect">[XML]</a>.&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>IDREF</b> is the set of all strings that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production in <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>.&#160; The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>IDREF</b> is the set of strings that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production in <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>. The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>IDREF</b> is <a href="#NCName" shape="rect">NCName</a>. </span> </p><div class="note"><div class="p"><b>Note:</b> It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production from <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>, or that from <a href="#XMLNS1.0" shape="rect">[Namespaces in XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </div></div><p> For compatibility (see <a href="#terminology" shape="rect">Terminology (&#167;1.6)</a>) this datatype should be used only on attributes. </p><div class="note"><div class="p"><b>Note:</b> Existence of referents for items validated as <a href="#IDREF" shape="rect">IDREF</a> is not part of this datatype as defined here. When this specification is used in conjunction with <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, referential integrity is enforced at a different level, not as part of datatype validity; see <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#cvc-id" shape="rect">Validation Rule: Validation Root Valid (ID/IDREF)</a> in <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>.</div></div><div class="div4"> <h5><a name="IDREF-facets" id="IDREF-facets" shape="rect"></a>3.4.9.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#IDREF" shape="rect">IDREF</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>\i\c* &#8745; [\i-[:]][\c-[:]]*</i></b></span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#IDREF" shape="rect">IDREF</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#IDREF" shape="rect">IDREF</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="IDREF-derived-types" id="IDREF-derived-types" shape="rect"></a>3.4.9.2 Related datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from <a href="#IDREF" shape="rect">IDREF</a></p><ul><li><a href="#IDREFS" shape="rect">IDREFS</a></li></ul></div></div><div class="div3"> <h4><a name="IDREFS" id="IDREFS" shape="rect"></a>3.4.10 IDREFS</h4><p><span class="termdef"><a name="dt-IDREFS" id="dt-IDREFS" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>IDREFS</b> represents the <a href="https://www.w3.org/TR/xml11/#NT-TokenizedType" shape="rect">IDREFS attribute type</a> from <a href="#XML" shape="rect">[XML]</a>.&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>IDREFS</b> is the set of finite, non-zero-length sequences of <a href="#IDREF" shape="rect">IDREF</a>s. The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>IDREFS</b> is the set of space-separated lists of tokens, of which each token is in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#IDREF" shape="rect">IDREF</a>.&#160; The <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> of <b>IDREFS</b> is <a href="#IDREF" shape="rect">IDREF</a>. <a href="#IDREFS" shape="rect">IDREFS</a> is derived from <a href="#dt-anySimpleType" class="termref" shape="rect"><span class="arrow">&#183;</span><code>anySimpleType</code><span class="arrow">&#183;</span></a> in two steps: an anonymous list type is defined, whose <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> is <a href="#IDREF" shape="rect">IDREF</a>; this is the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <a href="#IDREFS" shape="rect">IDREFS</a>, which restricts its value space to lists with at least one item. </span></p><p>For compatibility (see <a href="#terminology" shape="rect">Terminology (&#167;1.6)</a>) <a href="#IDREFS" shape="rect">IDREFS</a> should be used only on attributes.</p><div class="note"><div class="p"><b>Note:</b> Existence of referents for items validated as <a href="#IDREFS" shape="rect">IDREFS</a> is not part of this datatype as defined here. When this specification is used in conjunction with <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, referential integrity is enforced at a different level, not as part of datatype validity; see <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#cvc-id" shape="rect">Validation Rule: Validation Root Valid (ID/IDREF)</a> in <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>.</div></div><div class="div4"> <h5><a name="IDREFS-facets" id="IDREFS-facets" shape="rect"></a>3.4.10.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#IDREFS" shape="rect">IDREFS</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-minLength" name="IDREFS.minLength" shape="rect" id="IDREFS.minLength">minLength</a><span class="normal"><span class="normal"> = <b><i>1</i></b></span></span></li><li><a href="#rf-whiteSpace" name="IDREFS.whiteSpace" shape="rect" id="IDREFS.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#IDREFS" shape="rect">IDREFS</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#IDREFS" shape="rect">IDREFS</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="ENTITY" id="ENTITY" shape="rect"></a>3.4.11 ENTITY</h4><p> <span class="termdef"><a name="dt-ENTITY" id="dt-ENTITY" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>ENTITY</b> represents the <a href="https://www.w3.org/TR/xml11/#NT-TokenizedType" shape="rect">ENTITY</a> attribute type from <a href="#XML" shape="rect">[XML]</a>.&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>ENTITY</b> is the set of all strings that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production in <a href="#XMLNS" shape="rect">[Namespaces in XML]</a> and have been declared as an <a href="https://www.w3.org/TR/xml11/#dt-unparsed" shape="rect">unparsed entity</a> in a <a href="https://www.w3.org/TR/xml11/#dt-doctype" shape="rect">document type definition</a>. The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>ENTITY</b> is the set of all strings that <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>match<span class="arrow">&#183;</span></a> the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production in <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>. The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>ENTITY</b> is <a href="#NCName" shape="rect">NCName</a>. </span> </p><div class="note"><div class="p"><b>Note:</b> It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports the <a href="https://www.w3.org/TR/xml-names11/#NT-NCName" shape="rect">NCName</a> production from <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>, or that from <a href="#XMLNS1.0" shape="rect">[Namespaces in XML 1.0]</a>, or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </div></div><div class="note"><div class="p"><b>Note:</b> The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#ENTITY" shape="rect">ENTITY</a> is scoped to a specific instance document.</div></div><p>For compatibility (see <a href="#terminology" shape="rect">Terminology (&#167;1.6)</a>) <a href="#ENTITY" shape="rect">ENTITY</a> should be used only on attributes.</p><div class="div4"> <h5><a name="ENTITY-facets" id="ENTITY-facets" shape="rect"></a>3.4.11.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#ENTITY" shape="rect">ENTITY</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>\i\c* &#8745; [\i-[:]][\c-[:]]*</i></b></span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#ENTITY" shape="rect">ENTITY</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-minLength" shape="rect">minLength</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#ENTITY" shape="rect">ENTITY</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="ENTITY-derived-types" id="ENTITY-derived-types" shape="rect"></a>3.4.11.2 Related datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from <a href="#ENTITY" shape="rect">ENTITY</a></p><ul><li><a href="#ENTITIES" shape="rect">ENTITIES</a></li></ul></div></div><div class="div3"> <h4><a name="ENTITIES" id="ENTITIES" shape="rect"></a>3.4.12 ENTITIES</h4><p><span class="termdef"><a name="dt-ENTITIES" id="dt-ENTITIES" title="" shape="rect">[Definition:]&#160;&#160;</a><b>ENTITIES</b> represents the <a href="https://www.w3.org/TR/xml11/#NT-TokenizedType" shape="rect">ENTITIES attribute type</a> from <a href="#XML" shape="rect">[XML]</a>.&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>ENTITIES</b> is the set of finite, non-zero-length sequences of <a href="#dt-ENTITY" class="termref" shape="rect"><span class="arrow">&#183;</span>ENTITY<span class="arrow">&#183;</span></a> values that have been declared as <a href="https://www.w3.org/TR/xml11/#dt-unparsed" shape="rect">unparsed entities</a> in a <a href="https://www.w3.org/TR/xml11/#dt-doctype" shape="rect">document type definition</a>.&#160; The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>ENTITIES</b> is the set of space-separated lists of tokens, of which each token is in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#ENTITY" shape="rect">ENTITY</a>.&#160; The <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> of <b>ENTITIES</b> is <a href="#ENTITY" shape="rect">ENTITY</a>. <a href="#ENTITIES" shape="rect">ENTITIES</a> is derived from <a href="#dt-anySimpleType" class="termref" shape="rect"><span class="arrow">&#183;</span><code>anySimpleType</code><span class="arrow">&#183;</span></a> in two steps: an anonymous list type is defined, whose <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> is <a href="#ENTITY" shape="rect">ENTITY</a>; this is the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <a href="#ENTITIES" shape="rect">ENTITIES</a>, which restricts its value space to lists with at least one item. </span> </p><div class="note"><div class="p"><b>Note:</b> The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#ENTITIES" shape="rect">ENTITIES</a> is scoped to a specific instance document.</div></div><p>For compatibility (see <a href="#terminology" shape="rect">Terminology (&#167;1.6)</a>) <a href="#ENTITIES" shape="rect">ENTITIES</a> should be used only on attributes.</p><div class="div4"> <h5><a name="ENTITIES-facets" id="ENTITIES-facets" shape="rect"></a>3.4.12.1 Facets</h5><p><span class="normal"><span class="normal">The <a href="#ENTITIES" shape="rect">ENTITIES</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-minLength" name="ENTITIES.minLength" shape="rect" id="ENTITIES.minLength">minLength</a><span class="normal"><span class="normal"> = <b><i>1</i></b></span></span></li><li><a href="#rf-whiteSpace" name="ENTITIES.whiteSpace" shape="rect" id="ENTITIES.whiteSpace">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#ENTITIES" shape="rect">ENTITIES</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-length" shape="rect">length</a></li><li><a href="#rf-maxLength" shape="rect">maxLength</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#ENTITIES" shape="rect">ENTITIES</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>false</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="integer" id="integer" shape="rect"></a>3.4.13 integer</h4><p><span class="termdef"><a name="dt-integer-datatype" id="dt-integer-datatype" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>integer</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#decimal" shape="rect">decimal</a> by fixing the value of <a href="#dt-fractionDigits" class="termref" shape="rect"><span class="arrow">&#183;</span>fractionDigits<span class="arrow">&#183;</span></a> to be 0 and disallowing the trailing decimal point.&#160; This results in the standard mathematical concept of the integer numbers.&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>integer</b> is the infinite set {...,-2,-1,0,1,2,...}.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>integer</b> is <a href="#decimal" shape="rect">decimal</a>.</span></p><div class="div4"> <h5><a name="integer-lexical-representation" id="integer-lexical-representation" shape="rect"></a>3.4.13.1 Lexical representation</h5><p><a href="#integer" shape="rect">integer</a> has a lexical representation consisting of a finite-length sequence of one or more decimal digits (#x30-#x39) with an optional leading sign.&#160; If the sign is omitted, "+" is assumed.&#160; For example: -1, 0, 12678967543233, +100000. </p></div><div class="div4"> <h5><a name="integer-canonical-repr" id="integer-canonical-repr" shape="rect"></a>3.4.13.2 Canonical representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#integer" shape="rect">integer</a> is defined by prohibiting certain options from the <a href="#integer-lexical-representation" shape="rect">Lexical representation (&#167;3.4.13.1)</a>.&#160; Specifically, the preceding optional "+" sign is prohibited and leading zeroes are prohibited.</p></div><div class="div4"> <h5><a name="integer-facets" id="integer-facets" shape="rect"></a>3.4.13.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#integer" shape="rect">integer</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" name="integer.fractionDigits" shape="rect" id="integer.fractionDigits">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#integer" shape="rect">integer</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" name="integer.pattern" shape="rect" id="integer.pattern">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#integer" shape="rect">integer</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#integer" shape="rect">integer</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="integer-derived-types" id="integer-derived-types" shape="rect"></a>3.4.13.4 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes are <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#integer" shape="rect">integer</a></p><ul><li><a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a></li><li><a href="#long" shape="rect">long</a></li><li><a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a></li></ul></div></div><div class="div3"> <h4><a name="nonPositiveInteger" id="nonPositiveInteger" shape="rect"></a>3.4.14 nonPositiveInteger</h4><p><span class="termdef"><a name="dt-nonPositiveInteger" id="dt-nonPositiveInteger" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>nonPositiveInteger</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#integer" shape="rect">integer</a> by setting the value of <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> to be 0.&#160; This results in the standard mathematical concept of the non-positive integers. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>nonPositiveInteger</b> is the infinite set {...,-2,-1,0}.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>nonPositiveInteger</b> is <a href="#integer" shape="rect">integer</a>.</span></p><div class="div4"> <h5><a name="nonPositiveInteger-lexical-representation" id="nonPositiveInteger-lexical-representation" shape="rect"></a>3.4.14.1 Lexical representation</h5><p><a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a> has a lexical representation consisting of an optional preceding sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39).&#160; The sign may be "+" or may be omitted only for lexical forms denoting zero; in all other lexical forms, the negative sign ('<code>-</code>') <span class="rfc2119">must</span> be present.&#160; For example: -1, 0, -12678967543233, -100000.</p></div><div class="div4"> <h5><a name="nonPositiveInteger-canonical-repr" id="nonPositiveInteger-canonical-repr" shape="rect"></a>3.4.14.2 Canonical representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a> is defined by prohibiting certain options from the <a href="#nonPositiveInteger-lexical-representation" shape="rect">Lexical representation (&#167;3.4.14.1)</a>.&#160; In the canonical form for zero, the sign <span class="rfc2119">must</span> be omitted.&#160; Leading zeroes are prohibited.</p></div><div class="div4"> <h5><a name="nonPositiveInteger-facets" id="nonPositiveInteger-facets" shape="rect"></a>3.4.14.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-maxInclusive" name="nonPositiveInteger.maxInclusive" shape="rect" id="nonPositiveInteger.maxInclusive">maxInclusive</a><span class="normal"><span class="normal"> = <b><i>0</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="nonPositiveInteger-derived-types" id="nonPositiveInteger-derived-types" shape="rect"></a>3.4.14.4 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a></p><ul><li><a href="#negativeInteger" shape="rect">negativeInteger</a></li></ul></div></div><div class="div3"> <h4><a name="negativeInteger" id="negativeInteger" shape="rect"></a>3.4.15 negativeInteger</h4><p><span class="termdef"><a name="dt-negativeInteger" id="dt-negativeInteger" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>negativeInteger</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a> by setting the value of <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> to be -1.&#160; This results in the standard mathematical concept of the negative integers.&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>negativeInteger</b> is the infinite set {...,-2,-1}.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>negativeInteger</b> is <a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a>. </span></p><div class="div4"> <h5><a name="negativeInteger-lexical-representation" id="negativeInteger-lexical-representation" shape="rect"></a>3.4.15.1 Lexical representation</h5><p><a href="#negativeInteger" shape="rect">negativeInteger</a> has a lexical representation consisting of a negative sign ('<code>-</code>') followed by a non-empty finite-length sequence of decimal digits (#x30-#x39), at least one of which <span class="rfc2119">must</span> be a digit other than '<code>0</code>'.&#160; For example: -1, -12678967543233, -100000.</p></div><div class="div4"> <h5><a name="negativeInteger-canonical-repr" id="negativeInteger-canonical-repr" shape="rect"></a>3.4.15.2 Canonical representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#negativeInteger" shape="rect">negativeInteger</a> is defined by prohibiting certain options from the <a href="#negativeInteger-lexical-representation" shape="rect">Lexical representation (&#167;3.4.15.1)</a>.&#160; Specifically, leading zeroes are prohibited.</p></div><div class="div4"> <h5><a name="negativeInteger-facets" id="negativeInteger-facets" shape="rect"></a>3.4.15.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#negativeInteger" shape="rect">negativeInteger</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#negativeInteger" shape="rect">negativeInteger</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-maxInclusive" name="negativeInteger.maxInclusive" shape="rect" id="negativeInteger.maxInclusive">maxInclusive</a><span class="normal"><span class="normal"> = <b><i>-1</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#negativeInteger" shape="rect">negativeInteger</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#negativeInteger" shape="rect">negativeInteger</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="long" id="long" shape="rect"></a>3.4.16 long</h4><p><span class="termdef"><a name="dt-long" id="dt-long" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>long</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#integer" shape="rect">integer</a> by setting the value of <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> to be 9223372036854775807 and <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> to be -9223372036854775808. The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>long</b> is <a href="#integer" shape="rect">integer</a>. </span> </p><div class="div4"> <h5><a name="long-lexical-representation" id="long-lexical-representation" shape="rect"></a>3.4.16.1 Lexical Representation</h5><p><a href="#long" shape="rect">long</a> has a lexical representation consisting of an optional sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39).&#160; If the sign is omitted, "+" is assumed.&#160; For example: -1, 0, 12678967543233, +100000.</p></div><div class="div4"> <h5><a name="long-canonical-repr" id="long-canonical-repr" shape="rect"></a>3.4.16.2 Canonical Representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#long" shape="rect">long</a> is defined by prohibiting certain options from the <a href="#long-lexical-representation" shape="rect">Lexical Representation (&#167;3.4.16.1)</a>.&#160; Specifically, the the optional "+" sign is prohibited and leading zeroes are prohibited.</p></div><div class="div4"> <h5><a name="long-facets" id="long-facets" shape="rect"></a>3.4.16.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#long" shape="rect">long</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#long" shape="rect">long</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-maxInclusive" name="long.maxInclusive" shape="rect" id="long.maxInclusive">maxInclusive</a><span class="normal"><span class="normal"> = <b><i>9223372036854775807</i></b></span></span></li><li><a href="#rf-minInclusive" name="long.minInclusive" shape="rect" id="long.minInclusive">minInclusive</a><span class="normal"><span class="normal"> = <b><i>-9223372036854775808</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#long" shape="rect">long</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#long" shape="rect">long</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>true</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="long-derived-types" id="long-derived-types" shape="rect"></a>3.4.16.4 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#long" shape="rect">long</a></p><ul><li><a href="#int" shape="rect">int</a></li></ul></div></div><div class="div3"> <h4><a name="int" id="int" shape="rect"></a>3.4.17 int</h4><p><span class="termdef"><a name="dt-int" id="dt-int" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>int</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#long" shape="rect">long</a> by setting the value of <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> to be 2147483647 and <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> to be -2147483648.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>int</b> is <a href="#long" shape="rect">long</a>.</span></p><div class="div4"> <h5><a name="int-lexical-representation" id="int-lexical-representation" shape="rect"></a>3.4.17.1 Lexical Representation</h5><p><a href="#int" shape="rect">int</a> has a lexical representation consisting of an optional sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39).&#160; If the sign is omitted, "+" is assumed. For example: -1, 0, 126789675, +100000.</p></div><div class="div4"> <h5><a name="int-canonical-repr" id="int-canonical-repr" shape="rect"></a>3.4.17.2 Canonical representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#int" shape="rect">int</a> is defined by prohibiting certain options from the <a href="#int-lexical-representation" shape="rect">Lexical Representation (&#167;3.4.17.1)</a>.&#160; Specifically, the the optional "+" sign is prohibited and leading zeroes are prohibited. </p></div><div class="div4"> <h5><a name="int-facets" id="int-facets" shape="rect"></a>3.4.17.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#int" shape="rect">int</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#int" shape="rect">int</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-maxInclusive" name="int.maxInclusive" shape="rect" id="int.maxInclusive">maxInclusive</a><span class="normal"><span class="normal"> = <b><i>2147483647</i></b></span></span></li><li><a href="#rf-minInclusive" name="int.minInclusive" shape="rect" id="int.minInclusive">minInclusive</a><span class="normal"><span class="normal"> = <b><i>-2147483648</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#int" shape="rect">int</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#int" shape="rect">int</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>true</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="int-derived-types" id="int-derived-types" shape="rect"></a>3.4.17.4 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#int" shape="rect">int</a></p><ul><li><a href="#short" shape="rect">short</a></li></ul></div></div><div class="div3"> <h4><a name="short" id="short" shape="rect"></a>3.4.18 short</h4><p><span class="termdef"><a name="dt-short" id="dt-short" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>short</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#int" shape="rect">int</a> by setting the value of <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> to be 32767 and <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> to be -32768.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>short</b> is <a href="#int" shape="rect">int</a>.</span></p><div class="div4"> <h5><a name="short-lexical-representation" id="short-lexical-representation" shape="rect"></a>3.4.18.1 Lexical representation</h5><p><a href="#short" shape="rect">short</a> has a lexical representation consisting of an optional sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39).&#160; If the sign is omitted, "+" is assumed. For example: -1, 0, 12678, +10000.</p></div><div class="div4"> <h5><a name="short-canonical-repr" id="short-canonical-repr" shape="rect"></a>3.4.18.2 Canonical representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#short" shape="rect">short</a> is defined by prohibiting certain options from the <a href="#short-lexical-representation" shape="rect">Lexical representation (&#167;3.4.18.1)</a>.&#160; Specifically, the the optional "+" sign is prohibited and leading zeroes are prohibited.</p></div><div class="div4"> <h5><a name="short-facets" id="short-facets" shape="rect"></a>3.4.18.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#short" shape="rect">short</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#short" shape="rect">short</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-maxInclusive" name="short.maxInclusive" shape="rect" id="short.maxInclusive">maxInclusive</a><span class="normal"><span class="normal"> = <b><i>32767</i></b></span></span></li><li><a href="#rf-minInclusive" name="short.minInclusive" shape="rect" id="short.minInclusive">minInclusive</a><span class="normal"><span class="normal"> = <b><i>-32768</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#short" shape="rect">short</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#short" shape="rect">short</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>true</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="short-derived-types" id="short-derived-types" shape="rect"></a>3.4.18.4 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#short" shape="rect">short</a></p><ul><li><a href="#byte" shape="rect">byte</a></li></ul></div></div><div class="div3"> <h4><a name="byte" id="byte" shape="rect"></a>3.4.19 byte</h4><p><span class="termdef"><a name="dt-byte" id="dt-byte" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>byte</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#short" shape="rect">short</a> by setting the value of <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> to be 127 and <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> to be -128. The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>byte</b> is <a href="#short" shape="rect">short</a>.</span></p><div class="div4"> <h5><a name="byte-lexical-representation" id="byte-lexical-representation" shape="rect"></a>3.4.19.1 Lexical representation</h5><p><a href="#byte" shape="rect">byte</a> has a lexical representation consisting of an optional sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39).&#160; If the sign is omitted, "+" is assumed. For example: -1, 0, 126, +100.</p></div><div class="div4"> <h5><a name="byte-canonical-repr" id="byte-canonical-repr" shape="rect"></a>3.4.19.2 Canonical representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#byte" shape="rect">byte</a> is defined by prohibiting certain options from the <a href="#byte-lexical-representation" shape="rect">Lexical representation (&#167;3.4.19.1)</a>.&#160; Specifically, the the optional "+" sign is prohibited and leading zeroes are prohibited.</p></div><div class="div4"> <h5><a name="byte-facets" id="byte-facets" shape="rect"></a>3.4.19.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#byte" shape="rect">byte</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#byte" shape="rect">byte</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-maxInclusive" name="byte.maxInclusive" shape="rect" id="byte.maxInclusive">maxInclusive</a><span class="normal"><span class="normal"> = <b><i>127</i></b></span></span></li><li><a href="#rf-minInclusive" name="byte.minInclusive" shape="rect" id="byte.minInclusive">minInclusive</a><span class="normal"><span class="normal"> = <b><i>-128</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#byte" shape="rect">byte</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#byte" shape="rect">byte</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>true</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="nonNegativeInteger" id="nonNegativeInteger" shape="rect"></a>3.4.20 nonNegativeInteger</h4><p><span class="termdef"><a name="dt-nonNegativeInteger" id="dt-nonNegativeInteger" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>nonNegativeInteger</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#integer" shape="rect">integer</a> by setting the value of <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> to be 0.&#160; This results in the standard mathematical concept of the non-negative integers. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>nonNegativeInteger</b> is the infinite set {0,1,2,...}.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>nonNegativeInteger</b> is <a href="#integer" shape="rect">integer</a>.</span></p><div class="div4"> <h5><a name="nonNegativeInteger-lexical-representation" id="nonNegativeInteger-lexical-representation" shape="rect"></a>3.4.20.1 Lexical representation</h5><p><a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a> has a lexical representation consisting of an optional sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39).&#160; If the sign is omitted, the positive sign ('<code>+</code>') is assumed. If the sign is present, it <span class="rfc2119">must</span> be "+" except for lexical forms denoting zero, which may be preceded by a positive ('<code>+</code>') or a negative ('<code>-</code>') sign. For example: 1, 0, 12678967543233, +100000. </p></div><div class="div4"> <h5><a name="nonNegativeInteger-canonical-repr" id="nonNegativeInteger-canonical-repr" shape="rect"></a>3.4.20.2 Canonical representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a> is defined by prohibiting certain options from the <a href="#nonNegativeInteger-lexical-representation" shape="rect">Lexical representation (&#167;3.4.20.1)</a>.&#160; Specifically, the the optional "+" sign is prohibited and leading zeroes are prohibited.</p></div><div class="div4"> <h5><a name="nonNegativeInteger-facets" id="nonNegativeInteger-facets" shape="rect"></a>3.4.20.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-minInclusive" name="nonNegativeInteger.minInclusive" shape="rect" id="nonNegativeInteger.minInclusive">minInclusive</a><span class="normal"><span class="normal"> = <b><i>0</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="nonNegativeInteger-derived-types" id="nonNegativeInteger-derived-types" shape="rect"></a>3.4.20.4 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes are <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a></p><ul><li><a href="#unsignedLong" shape="rect">unsignedLong</a></li><li><a href="#positiveInteger" shape="rect">positiveInteger</a></li></ul></div></div><div class="div3"> <h4><a name="unsignedLong" id="unsignedLong" shape="rect"></a>3.4.21 unsignedLong</h4><p> <span class="termdef"><a name="dt-unsignedLong" id="dt-unsignedLong" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>unsignedLong</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a> by setting the value of <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> to be 18446744073709551615.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>unsignedLong</b> is <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a>. </span> </p><div class="div4"> <h5><a name="unsignedLong-lexical-representation" id="unsignedLong-lexical-representation" shape="rect"></a>3.4.21.1 Lexical representation</h5><p><a href="#unsignedLong" shape="rect">unsignedLong</a> has a lexical representation consisting of an optional sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39).&#160; If the sign is omitted, the positive sign ('<code>+</code>') is assumed.&#160; If the sign is present, it <span class="rfc2119">must</span> be '<code>+</code>' except for lexical forms denoting zero, which may be preceded by a positive ('<code>+</code>') or a negative ('<code>-</code>') sign. For example: 0, 12678967543233, 100000.</p></div><div class="div4"> <h5><a name="unsignedLong-canonical-repr" id="unsignedLong-canonical-repr" shape="rect"></a>3.4.21.2 Canonical representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#unsignedLong" shape="rect">unsignedLong</a> is defined by prohibiting certain options from the <a href="#unsignedLong-lexical-representation" shape="rect">Lexical representation (&#167;3.4.21.1)</a>.&#160; Specifically, leading zeroes are prohibited.</p></div><div class="div4"> <h5><a name="unsignedLong-facets" id="unsignedLong-facets" shape="rect"></a>3.4.21.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#unsignedLong" shape="rect">unsignedLong</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#unsignedLong" shape="rect">unsignedLong</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-maxInclusive" name="unsignedLong.maxInclusive" shape="rect" id="unsignedLong.maxInclusive">maxInclusive</a><span class="normal"><span class="normal"> = <b><i>18446744073709551615</i></b></span></span></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a><span class="normal"><span class="normal"> = <b><i>0</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#unsignedLong" shape="rect">unsignedLong</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#unsignedLong" shape="rect">unsignedLong</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>true</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="unsignedLong-derived-types" id="unsignedLong-derived-types" shape="rect"></a>3.4.21.4 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#unsignedLong" shape="rect">unsignedLong</a></p><ul><li><a href="#unsignedInt" shape="rect">unsignedInt</a></li></ul></div></div><div class="div3"> <h4><a name="unsignedInt" id="unsignedInt" shape="rect"></a>3.4.22 unsignedInt</h4><p><span class="termdef"><a name="dt-unsignedInt" id="dt-unsignedInt" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>unsignedInt</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#unsignedLong" shape="rect">unsignedLong</a> by setting the value of <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> to be 4294967295.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>unsignedInt</b> is <a href="#unsignedLong" shape="rect">unsignedLong</a>. </span> </p><div class="div4"> <h5><a name="unsignedInt-lexical-representation" id="unsignedInt-lexical-representation" shape="rect"></a>3.4.22.1 Lexical representation</h5><p><a href="#unsignedInt" shape="rect">unsignedInt</a> has a lexical representation consisting of an optional sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39).&#160; If the sign is omitted, the positive sign ('<code>+</code>') is assumed.&#160; If the sign is present, it <span class="rfc2119">must</span> be '<code>+</code>' except for lexical forms denoting zero, which may be preceded by a positive ('<code>+</code>') or a negative ('<code>-</code>') sign. For example: 0, 1267896754, 100000.</p></div><div class="div4"> <h5><a name="unsignedInt-canonical-repr" id="unsignedInt-canonical-repr" shape="rect"></a>3.4.22.2 Canonical representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#unsignedInt" shape="rect">unsignedInt</a> is defined by prohibiting certain options from the <a href="#unsignedInt-lexical-representation" shape="rect">Lexical representation (&#167;3.4.22.1)</a>.&#160; Specifically, leading zeroes are prohibited. </p></div><div class="div4"> <h5><a name="unsignedInt-facets" id="unsignedInt-facets" shape="rect"></a>3.4.22.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#unsignedInt" shape="rect">unsignedInt</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#unsignedInt" shape="rect">unsignedInt</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-maxInclusive" name="unsignedInt.maxInclusive" shape="rect" id="unsignedInt.maxInclusive">maxInclusive</a><span class="normal"><span class="normal"> = <b><i>4294967295</i></b></span></span></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a><span class="normal"><span class="normal"> = <b><i>0</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#unsignedInt" shape="rect">unsignedInt</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#unsignedInt" shape="rect">unsignedInt</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>true</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="unsignedInt-derived-types" id="unsignedInt-derived-types" shape="rect"></a>3.4.22.4 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#unsignedInt" shape="rect">unsignedInt</a></p><ul><li><a href="#unsignedShort" shape="rect">unsignedShort</a></li></ul></div></div><div class="div3"> <h4><a name="unsignedShort" id="unsignedShort" shape="rect"></a>3.4.23 unsignedShort</h4><p><span class="termdef"><a name="dt-unsignedShort" id="dt-unsignedShort" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>unsignedShort</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#unsignedInt" shape="rect">unsignedInt</a> by setting the value of <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> to be 65535.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>unsignedShort</b> is <a href="#unsignedInt" shape="rect">unsignedInt</a>.</span></p><div class="div4"> <h5><a name="unsignedShort-lexical-representation" id="unsignedShort-lexical-representation" shape="rect"></a>3.4.23.1 Lexical representation</h5><p><a href="#unsignedShort" shape="rect">unsignedShort</a> has a lexical representation consisting of an optional sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39). If the sign is omitted, the positive sign ('<code>+</code>') is assumed.&#160; If the sign is present, it <span class="rfc2119">must</span> be '<code>+</code>' except for lexical forms denoting zero, which may be preceded by a positive ('<code>+</code>') or a negative ('<code>-</code>') sign.&#160; For example: 0, 12678, 10000.</p></div><div class="div4"> <h5><a name="unsignedShort-canonical-repr" id="unsignedShort-canonical-repr" shape="rect"></a>3.4.23.2 Canonical representation</h5><p>The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#unsignedShort" shape="rect">unsignedShort</a> is defined by prohibiting certain options from the <a href="#unsignedShort-lexical-representation" shape="rect">Lexical representation (&#167;3.4.23.1)</a>.&#160; Specifically, the leading zeroes are prohibited.</p></div><div class="div4"> <h5><a name="unsignedShort-facets" id="unsignedShort-facets" shape="rect"></a>3.4.23.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#unsignedShort" shape="rect">unsignedShort</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#unsignedShort" shape="rect">unsignedShort</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-maxInclusive" name="unsignedShort.maxInclusive" shape="rect" id="unsignedShort.maxInclusive">maxInclusive</a><span class="normal"><span class="normal"> = <b><i>65535</i></b></span></span></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a><span class="normal"><span class="normal"> = <b><i>0</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#unsignedShort" shape="rect">unsignedShort</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#unsignedShort" shape="rect">unsignedShort</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>true</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div><div class="div4"> <h5><a name="unsignedShort-derived-types" id="unsignedShort-derived-types" shape="rect"></a>3.4.23.4 Derived datatypes</h5><p> The following <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#unsignedShort" shape="rect">unsignedShort</a></p><ul><li><a href="#unsignedByte" shape="rect">unsignedByte</a></li></ul></div></div><div class="div3"> <h4><a name="unsignedByte" id="unsignedByte" shape="rect"></a>3.4.24 unsignedByte</h4><p><span class="termdef"><a name="dt-unsignedByte" id="dt-unsignedByte" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>unsignedByte</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#unsignedShort" shape="rect">unsignedShort</a> by setting the value of <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> to be 255.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>unsignedByte</b> is <a href="#unsignedShort" shape="rect">unsignedShort</a>.</span></p><div class="div4"> <h5><a name="unsignedByte-lexical-representation" id="unsignedByte-lexical-representation" shape="rect"></a>3.4.24.1 Lexical representation</h5><p><a href="#unsignedByte" shape="rect">unsignedByte</a> has a lexical representation consisting of an optional sign followed by a non-empty finite-length sequence of decimal digits (#x30-#x39). If the sign is omitted, the positive sign ('<code>+</code>') is assumed.&#160; If the sign is present, it <span class="rfc2119">must</span> be '<code>+</code>' except for lexical forms denoting zero, which may be preceded by a positive ('<code>+</code>') or a negative ('<code>-</code>') sign.&#160; For example: 0, 126, 100.</p></div><div class="div4"> <h5><a name="unsignedByte-canonical-repr" id="unsignedByte-canonical-repr" shape="rect"></a>3.4.24.2 Canonical representation</h5><p> The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#unsignedByte" shape="rect">unsignedByte</a> is defined by prohibiting certain options from the <a href="#unsignedByte-lexical-representation" shape="rect">Lexical representation (&#167;3.4.24.1)</a>.&#160; Specifically, leading zeroes are prohibited.</p></div><div class="div4"> <h5><a name="unisngedByte-facets" id="unisngedByte-facets" shape="rect"></a>3.4.24.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#unsignedByte" shape="rect">unsignedByte</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#unsignedByte" shape="rect">unsignedByte</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-maxInclusive" name="unsignedByte.maxInclusive" shape="rect" id="unsignedByte.maxInclusive">maxInclusive</a><span class="normal"><span class="normal"> = <b><i>255</i></b></span></span></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a><span class="normal"><span class="normal"> = <b><i>0</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#unsignedByte" shape="rect">unsignedByte</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#unsignedByte" shape="rect">unsignedByte</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>true</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>finite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="positiveInteger" id="positiveInteger" shape="rect"></a>3.4.25 positiveInteger</h4><p><span class="termdef"><a name="dt-positiveInteger" id="dt-positiveInteger" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>positiveInteger</b> is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a> by setting the value of <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> to be 1.&#160; This results in the standard mathematical concept of the positive integer numbers.&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>positiveInteger</b> is the infinite set {1,2,...}.&#160; The <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <b>positiveInteger</b> is <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a>.</span></p><div class="div4"> <h5><a name="positiveInteger-lexical-representation" id="positiveInteger-lexical-representation" shape="rect"></a>3.4.25.1 Lexical representation</h5><p><a href="#positiveInteger" shape="rect">positiveInteger</a> has a lexical representation consisting of an optional positive sign ('<code>+</code>') followed by a non-empty finite-length sequence of decimal digits (#x30-#x39), at least one of which <span class="rfc2119">must</span> be a digit other than '<code>0</code>'.&#160; For example: 1, 12678967543233, +100000.</p></div><div class="div4"> <h5><a name="positiveInteger-canonical-repr" id="positiveInteger-canonical-repr" shape="rect"></a>3.4.25.2 Canonical representation</h5><p> The <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> for <a href="#positiveInteger" shape="rect">positiveInteger</a> is defined by prohibiting certain options from the <a href="#positiveInteger-lexical-representation" shape="rect">Lexical representation (&#167;3.4.25.1)</a>.&#160; Specifically, the optional "+" sign is prohibited and leading zeroes are prohibited. </p></div><div class="div4"> <h5><a name="positiveInteger-facets" id="positiveInteger-facets" shape="rect"></a>3.4.25.3 Facets</h5><p><span class="normal"><span class="normal">The <a href="#positiveInteger" shape="rect">positiveInteger</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-fractionDigits" shape="rect">fractionDigits</a><span class="normal"><span class="normal"> = <b><i>0</i></b> (fixed)</span></span></li><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#positiveInteger" shape="rect">positiveInteger</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" shape="rect">pattern</a><span class="normal"><span class="normal"> = <b><i>[\-+]?[0-9]+</i></b></span></span></li><li><a href="#rf-minInclusive" name="positiveInteger.minInclusive" shape="rect" id="positiveInteger.minInclusive">minInclusive</a><span class="normal"><span class="normal"> = <b><i>1</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#positiveInteger" shape="rect">positiveInteger</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-totalDigits" shape="rect">totalDigits</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#positiveInteger" shape="rect">positiveInteger</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>total</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>true</i></b></li></ul></div></div></div></div><div class="div3"> <h4><a name="yearMonthDuration" id="yearMonthDuration" shape="rect"></a>3.4.26 yearMonthDuration</h4><p><span class="termdef"><a name="dt-yearMonthDuration" id="dt-yearMonthDuration" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>yearMonthDuration</b> is a datatype <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#duration" shape="rect">duration</a> by restricting its <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> to instances of <a href="#nt-yearMonthDurationRep" shape="rect"><i>yearMonthDurationLexicalRep</i></a>.</span>&#160; The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>yearMonthDuration</b> is therefore that of <a href="#duration" shape="rect">duration</a> restricted to those whose <a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> property is 0.&#160; This results in a duration datatype which is totally ordered.</p><div class="note"><div class="p"><b>Note:</b> The always-zero <a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> is formally retained in order that <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a>'s (abstract) value space truly be a subset of that of <a href="#duration" shape="rect">duration</a>&#160; An obvious implementation optimization is to ignore the zero and implement <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> values simply as <a href="#integer" shape="rect">integer</a> values.</div></div><div class="div4"> <h5><a name="yearMonthDuration-lexical-mapping" id="yearMonthDuration-lexical-mapping" shape="rect"></a>3.4.26.1 The <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> Lexical Mapping</h5><div class="block">The lexical space is reduced from that of <a href="#duration" shape="rect">duration</a> by disallowing <a href="#nt-duDaFrag" shape="rect"><i>duDayFrag</i></a> and <a href="#nt-duTFrag" shape="rect"><i>duTimeFrag</i></a> fragments in the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a>. <div class="defset"> <div class="defset-head">The <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> Lexical Representation</div> <div class="prod"> <a name="nt-yearMonthDurationRep" id="nt-yearMonthDurationRep" shape="rect"></a><span class="lhs">[42] &#160; <i>yearMonthDurationLexicalRep</i></span>&#160;::= '<code>-</code>'?&#160;'<code>P</code>'&#160;<a href="#nt-duYMFrag" shape="rect"><i>duYearMonthFrag</i></a></div></div> </div><p>The lexical space of <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> consists of strings which match the regular expression '<code>-?P((([0-9]+Y)([0-9]+M)?)|([0-9]+M))</code>' or the expression '<code>-?P[0-9]+(Y([0-9]+M)?|M)</code>', but the formal definition of <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> uses a simpler regular expression in its <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> facet: '<code>[^DT]*</code>'. This pattern matches only strings of characters which contain no 'D' and no 'T', thus restricting the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#duration" shape="rect">duration</a> to strings with no day, hour, minute, or seconds fields. </p><p>The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is that of <a href="#duration" shape="rect">duration</a> restricted in its range to the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> (which reduces its domain to omit any values not in the <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> value space). </p><div class="note"><div class="p"><b>Note:</b> The <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> value whose <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> and <a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> are both zero has no <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> in this datatype since its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a> in <a href="#duration" shape="rect">duration</a> ('<code>PT0S</code>') is not in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a>.</div></div></div><div class="div4"> <h5><a name="YearMonthDuration-facets" id="YearMonthDuration-facets" shape="rect"></a>3.4.26.2 Facets</h5><p><span class="normal"><span class="normal">The <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" name="yearMonthDuration.pattern" shape="rect" id="yearMonthDuration.pattern">pattern</a><span class="normal"><span class="normal"> = <b><i>[^DT]*</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div><div class="note"><div class="p"><b>Note:</b> The <a href="#ff-o" class="compref" shape="rect">ordered</a> facet has the value <b><i>partial</i></b> even though the datatype is in fact totally ordered, because (as explained in <a href="#rf-ordered" shape="rect">ordered (&#167;4.2.1)</a>), the value of that facet is unchanged by derivation. </div></div></div></div><div class="div3"> <h4><a name="dayTimeDuration" id="dayTimeDuration" shape="rect"></a>3.4.27 dayTimeDuration</h4><p> <span class="termdef"><a name="dt-dayTimeDuration" id="dt-dayTimeDuration" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>dayTimeDuration</b> is a datatype <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#duration" shape="rect">duration</a> by restricting its <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> to instances of <a href="#nt-dayTimeDurationRep" shape="rect"><i>dayTimeDurationLexicalRep</i></a>.</span> The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <b>dayTimeDuration</b> is therefore that of <a href="#duration" shape="rect">duration</a> restricted to those whose <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> property is 0.&#160; This results in a duration datatype which is totally ordered.</p><div class="div4"> <h5><a name="dayTimeDuration-lexical-mapping" id="dayTimeDuration-lexical-mapping" shape="rect"></a>3.4.27.1 The <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> Lexical Space</h5><p> The lexical space is reduced from that of <a href="#duration" shape="rect">duration</a> by disallowing <a href="#nt-duYrFrag" shape="rect"><i>duYearFrag</i></a> and <a href="#nt-duMoFrag" shape="rect"><i>duMonthFrag</i></a> fragments in the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a>. </p><div class="block"><div class="defset"> <div class="defset-head">The <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> Lexical Representation</div> <div class="prod"> <a name="nt-dayTimeDurationRep" id="nt-dayTimeDurationRep" shape="rect"></a><span class="lhs">[43] &#160; <i>dayTimeDurationLexicalRep</i></span>&#160;::= '<code>-</code>'?&#160;'<code>P</code>'&#160;<a href="#nt-duDTFrag" shape="rect"><i>duDayTimeFrag</i></a></div></div> </div><p>The lexical space of <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> consists of strings in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#duration" shape="rect">duration</a> which match the regular expression '<code>[^YM]*[DT].*</code>'; this pattern eliminates all durations with year or month fields, leaving only those with day, hour, minutes, and/or seconds fields. </p><p> The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is that of <a href="#duration" shape="rect">duration</a> restricted in its range to the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> (which reduces its domain to omit any values not in the <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> value space). </p></div><div class="div4"> <h5><a name="dayTimeDuration-facets" id="dayTimeDuration-facets" shape="rect"></a>3.4.27.2 Facets</h5><p><span class="normal"><span class="normal">The <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">The <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> datatype has the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with the values shown; these facets <span class="rfc2119">may</span> be specified in the derivation of new types, if the value given is at least as restrictive as the one shown:</p><ul><li><a href="#rf-pattern" name="dayTimeDuration.pattern" shape="rect" id="dayTimeDuration.pattern">pattern</a><span class="normal"><span class="normal"> = <b><i>[^YM]*(T.*)?</i></b></span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div><div class="note"><div class="p"><b>Note:</b> The <a href="#ff-o" class="compref" shape="rect">ordered</a> facet has the value <b><i>partial</i></b> even though the datatype is in fact totally ordered, because (as explained in <a href="#rf-ordered" shape="rect">ordered (&#167;4.2.1)</a>), the value of that facet is unchanged by derivation. </div></div></div></div><div class="div3"> <h4><a name="dateTimeStamp" id="dateTimeStamp" shape="rect"></a>3.4.28 dateTimeStamp</h4><p> <span class="termdef"><a name="dt-dateTimeStamp" id="dt-dateTimeStamp" title="" shape="rect">[Definition:]&#160;&#160;</a> The <b>dateTimeStamp</b> datatype is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#dateTime" shape="rect">dateTime</a> by giving the value <b><i>required</i></b> to its <a href="#f-tz" class="compref" shape="rect">explicitTimezone</a> facet.</span> The result is that all values of <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> are required to have explicit time zone offsets and the datatype is totally ordered. </p><div class="div4"> <h5><a name="dateTimeStamp-lexical-mapping" id="dateTimeStamp-lexical-mapping" shape="rect"></a>3.4.28.1 The <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> Lexical Space</h5><p>As a consequence of requiring an explicit time zone offset, the lexical space of <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> is reduced from that of <a href="#dateTime" shape="rect">dateTime</a> by requiring a <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a> fragment in the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a>.</p><div class="block"><div class="defset"> <div class="defset-head">The <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> Lexical Representation</div> <div class="prod"> <a name="nt-dateTimeStampRep" id="nt-dateTimeStampRep" shape="rect"></a><span class="lhs">[44] &#160; <i>dateTimeStampLexicalRep</i></span>&#160;::= <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>&#160;'<code>-</code>'&#160;<a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>&#160;'<code>-</code>'&#160;<a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>&#160;'<code>T</code>'&#160;((<a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>&#160;'<code>:</code>'&#160;<a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>&#160;'<code>:</code>'&#160;<a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a>)&#160;| <a href="#nt-eodFrag" shape="rect"><i>endOfDayFrag</i></a>) <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>&#160;&#160; <b>Constraint:</b>&#160; Day-of-month Representations</div></div> </div><div class="note"><div class="p"><b>Note:</b> For details of the <a href="#con-dateTime-day" shape="rect">Day-of-month Representations (&#167;3.3.7.2)</a> constraint, see <a href="#dateTime" shape="rect">dateTime</a>, from which the constraint is inherited. </div></div><p>In other words, the lexical space of <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> consists of strings which are in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#dateTime" shape="rect">dateTime</a> and which also match the regular expression '<code>.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9])</code>'.</p><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> is that of <a href="#dateTime" shape="rect">dateTime</a> restricted to the <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> lexical space.</p><p>The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> is that of <a href="#dateTime" shape="rect">dateTime</a> restricted to the <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> value space.</p></div><div class="div4"> <h5><a name="dateTimeStamp-facets" id="dateTimeStamp-facets" shape="rect"></a>3.4.28.2 Facets</h5><p><span class="normal"><span class="normal">The <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> datatype and all datatypes derived from it by restriction have the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a></span></span> with <b><i>fixed</i></b> values; these facets <span class="rfc2119">must not</span> be changed from the values shown:</p><ul><li><a href="#rf-whiteSpace" shape="rect">whiteSpace</a><span class="normal"><span class="normal"> = <b><i>collapse</i></b> (fixed)</span></span></li><li><a href="#rf-explicitTimezone" name="dateTimeStamp.explicitTimezone" shape="rect" id="dateTimeStamp.explicitTimezone">explicitTimezone</a><span class="normal"><span class="normal"> = <b><i>required</i></b> (fixed)</span></span></li></ul><p><span class="normal"><span class="normal">Datatypes derived by restriction from <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> <span class="rfc2119">may</span> also specify values for the following <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a>:</span></span></p><ul><li><a href="#rf-pattern" shape="rect">pattern</a></li><li><a href="#rf-enumeration" shape="rect">enumeration</a></li><li><a href="#rf-maxInclusive" shape="rect">maxInclusive</a></li><li><a href="#rf-maxExclusive" shape="rect">maxExclusive</a></li><li><a href="#rf-minInclusive" shape="rect">minInclusive</a></li><li><a href="#rf-minExclusive" shape="rect">minExclusive</a></li><li><a href="#rf-assertions" shape="rect">assertions</a></li></ul><div class="normal"><div class="normal"><p>The <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> datatype has the following values for its <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>: </p><ul><li><a href="#rf-ordered" shape="rect">ordered</a> = <b><i>partial</i></b></li><li><a href="#rf-bounded" shape="rect">bounded</a> = <b><i>false</i></b></li><li><a href="#rf-cardinality" shape="rect">cardinality</a> = <b><i>countably infinite</i></b></li><li><a href="#rf-numeric" shape="rect">numeric</a> = <b><i>false</i></b></li></ul></div></div><div class="note"><div class="p"><b>Note:</b> The <a href="#ff-o" class="compref" shape="rect">ordered</a> facet has the value <b><i>partial</i></b> even though the datatype is in fact totally ordered, because (as explained in <a href="#rf-ordered" shape="rect">ordered (&#167;4.2.1)</a>), the value of that facet is unchanged by derivation. </div></div></div></div></div></div><div class="div1"> <h2><a name="datatype-components" id="datatype-components" shape="rect"></a>4 Datatype components</h2><p>The preceding sections of this specification have described datatypes in a way largely independent of their use in the particular context of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-va" shape="rect">schema-aware processing</a> as defined in <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>.</p><p> This section presents the mechanisms necessary to integrate datatypes into the context of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, mostly in terms of the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#c" shape="rect">schema component</a> 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 <a href="#std-target_namespace" class="propref" shape="rect">{target namespace}</a> and <a href="#std-final" class="propref" shape="rect">{final}</a> properties are required because of particular aspects of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a> 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.&#160; Any property not identified as optional is required to be present; optional properties which are not present have <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-null" shape="rect">absent</a> as their value. Any property identified as a having a set, subset or <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> value may have an empty value unless this is explicitly ruled out: this is not the same as <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-null" shape="rect">absent</a>. 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 schema components, see <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#components" shape="rect">Schema Component Details</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </p><p><span class="termdef"><a name="dt-owner" id="dt-owner" title="" shape="rect">[Definition:]&#160;&#160;</a>A component may be referred to as the <b>owner</b> of its properties, and of the values of those properties.</span></p><div class="div2"> <h3 class="withToc"><span class="nav"> <a href="#rf-fund-facets" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="rf-defn" id="rf-defn" shape="rect"></a>4.1 Simple Type Definition</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.1.1 <a href="#dc-defn" shape="rect">The Simple Type Definition Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.1.2 <a href="#xr-defn" shape="rect">XML Representation of Simple Type Definition Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.1.3 <a href="#defn-rep-constr" shape="rect">Constraints on XML Representation of Simple Type Definition</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.1.4 <a href="#defn-validation-rules" shape="rect">Simple Type Definition Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.1.5 <a href="#defn-coss" shape="rect">Constraints on Simple Type Definition Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.1.6 <a href="#builtin-stds" shape="rect">Built-in Simple Type Definitions</a><br clear="none" /> </div><p> Simple Type Definitions provide for: </p><ul><li><div class="p">In the case of <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes, identifying a datatype with its definition in this specification.</div></li><li><div class="p">In the case of <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> datatypes, defining the datatype in terms of other datatypes.</div></li><li><div class="p">Attaching a <a href="#QName" shape="rect">QName</a> to the datatype.</div></li></ul><div class="div3"> <h4><a name="dc-defn" id="dc-defn" shape="rect"></a>4.1.1 The Simple Type Definition Schema Component</h4><p>The Simple Type Definition schema component has the following properties:</p><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="std" id="std" shape="rect">Simple Type Definition</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="std-annotations" shape="rect" id="std-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="std-name" shape="rect" id="std-name"></a><div class="pdName"><span class="propdef">{name}</span></div> <div class="pdDef"> An xs:NCName value. Optional.</div> </div> <div class="propDefn"><a name="std-target_namespace" shape="rect" id="std-target_namespace"></a><div class="pdName"><span class="propdef">{target namespace}</span></div> <div class="pdDef"> An xs:anyURI value. Optional.</div> </div> <div class="propDefn"><a id="std-final" name="std-final" shape="rect"></a><div class="pdName"><span class="propdef">{final}</span></div> <div class="pdDef"> <div class="ownDesc"> <p>A subset of <code>{</code><b><i>restriction</i></b>, <b><i>extension</i></b>, <b><i>list</i></b>, <b><i>union</i></b><code>}</code></p></div> </div> </div> <div class="propDefn"><a name="std-context" shape="rect" id="std-context"></a><div class="pdName"><span class="propdef">{context}</span></div> <div class="pdDef"> Required if <a href="#std-name" class="propref" shape="rect">{name}</a> is <b><i>absent</i></b>, otherwise <span class="rfc2119">must</span> be <b><i>absent</i></b><div class="ownDesc"> <p>Either an <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#ad" class="compref" shape="rect">Attribute Declaration</a>, an <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#ed" class="compref" shape="rect">Element Declaration</a>, a <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#ctd" class="compref" shape="rect">Complex Type Definition</a> or a <a href="#std" class="compref" shape="rect">Simple Type Definition</a>.</p></div> </div> </div> <div class="propDefn"><a name="std-base_type_definition" shape="rect" id="std-base_type_definition"></a><div class="pdName"><span class="propdef">{base type definition}</span></div> <div class="pdDef"> A <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#td" class="compref" shape="rect">Type Definition</a> component. Required.<div class="ownDesc"> <p>With one exception, the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> of any <a href="#std" class="compref" shape="rect">Simple Type Definition</a> is a <a href="#std" class="compref" shape="rect">Simple Type Definition</a>. The exception is <a href="#anySimpleType-def" class="termref" shape="rect"><span class="arrow">&#183;</span>anySimpleType<span class="arrow">&#183;</span></a>, which has <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-anyType" shape="rect">anyType</a>, a <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#ctd" shape="rect">Complex Type Definition</a>, as its <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </p></div> </div> </div> <div class="propDefn"><a name="std-facets" shape="rect" id="std-facets"></a><div class="pdName"><span class="propdef">{facets}</span></div> <div class="pdDef"> A set of <a href="#f" class="compref" shape="rect">Constraining Facet</a> components. </div> </div> <div class="propDefn"><a name="std-fundamental_facets" shape="rect" id="std-fundamental_facets"></a><div class="pdName"><span class="propdef">{fundamental facets}</span></div> <div class="pdDef"> A set of <a href="#ff" class="compref" shape="rect">Fundamental Facet</a> components. </div> </div> <div class="propDefn"><a name="std-variety" shape="rect" id="std-variety"></a><div class="pdName"><span class="propdef">{variety}</span></div> <div class="pdDef"> One of {<span class="enumval">atomic</span>, <span class="enumval">list</span>, <span class="enumval">union</span>}. Required for all <a href="#std" class="compref" shape="rect">Simple Type Definition</a>s except <a href="#anySimpleType-def" class="termref" shape="rect"><span class="arrow">&#183;</span>anySimpleType<span class="arrow">&#183;</span></a>, in which it is <b><i>absent</i></b>.</div> </div> <div class="propDefn"><a name="std-primitive_type_definition" shape="rect" id="std-primitive_type_definition"></a><div class="pdName"><span class="propdef">{primitive type definition}</span></div> <div class="pdDef"> A <a href="#std" class="compref" shape="rect">Simple Type Definition</a> component. With one exception, required if <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>atomic</i></b>, otherwise <span class="rfc2119">must</span> be <b><i>absent</i></b>. The exception is <a href="#anyAtomicType-def" class="termref" shape="rect"><span class="arrow">&#183;</span>anyAtomicType<span class="arrow">&#183;</span></a>, whose <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is <b><i>absent</i></b>.<div class="ownDesc"> <p>If not <b><i>absent</i></b>, <span class="rfc2119">must</span> be a <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> built-in definition.</p></div> </div> </div> <div class="propDefn"><a name="std-item_type_definition" shape="rect" id="std-item_type_definition"></a><div class="pdName"><span class="propdef">{item type definition}</span></div> <div class="pdDef"> A <a href="#std" class="compref" shape="rect">Simple Type Definition</a> component. Required if <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>list</i></b>, otherwise <span class="rfc2119">must</span> be <b><i>absent</i></b>.<div class="ownDesc"> <p> The value of this property <span class="rfc2119">must</span> be a primitive or ordinary simple type definition with <a href="#std-variety" class="propref" shape="rect">{variety}</a> = <b><i>atomic</i></b>, or an ordinary simple type definition with <a href="#std-variety" class="propref" shape="rect">{variety}</a> = <b><i>union</i></b> whose basic members are all atomic; the value <span class="rfc2119">must not</span> itself be a list type (have <a href="#std-variety" class="propref" shape="rect">{variety}</a> = <b><i>list</i></b>) or have any basic members which are list types. </p></div> </div> </div> <div class="propDefn"><a name="std-member_type_definitions" shape="rect" id="std-member_type_definitions"></a><div class="pdName"><span class="propdef">{member type definitions}</span></div> <div class="pdDef"> A sequence of primitive or ordinary <a href="#std" class="compref" shape="rect">Simple Type Definition</a> components. <div class="ownDesc"> <p><span class="rfc2119">Must</span> be present (but <span class="rfc2119">may</span> be empty) if <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>union</i></b>, otherwise <span class="rfc2119">must</span> be <b><i>absent</i></b>.</p><p>The sequence may contain any primitive or ordinary simple type definition, but <span class="rfc2119">must not</span> contain any special type definitions.</p></div> </div> </div> </div></div> </div> </div> <p> Simple type definitions are identified by their <a href="#std-name" class="propref" shape="rect">{name}</a> and <a href="#std-target_namespace" class="propref" shape="rect">{target namespace}</a>.&#160; Except for anonymous <a href="#std" class="compref" shape="rect">Simple Type Definition</a>s (those with no <a href="#std-name" class="propref" shape="rect">{name}</a>), <a href="#std" class="compref" shape="rect">Simple Type Definition</a>s <span class="rfc2119">must</span> be uniquely identified within a schema. Within a valid schema, each <a href="#std" class="compref" shape="rect">Simple Type Definition</a> uniquely determines one datatype. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a>, etc., of a <a href="#std" class="compref" shape="rect">Simple Type Definition</a> are the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, etc., of the datatype uniquely determined (or "defined") by that <a href="#std" class="compref" shape="rect">Simple Type Definition</a>. </p><p> If <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> then the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the datatype defined will be a subset of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> (which is a subset of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a>). If <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> then the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the datatype defined will be the set of (possibly empty) finite-length sequences of values from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a>. If <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> then the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the datatype defined will be a subset (possibly an improper subset) of the union of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> of each <a href="#std" class="compref" shape="rect">Simple Type Definition</a> in <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a>. </p><p> If <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> then the <a href="#std-variety" class="propref" shape="rect">{variety}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> <span class="rfc2119">must</span> be <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a>, unless the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> is <a href="#anySimpleType" shape="rect">anySimpleType</a>. If <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> then the <a href="#std-variety" class="propref" shape="rect">{variety}</a> of <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a> <span class="rfc2119">must</span> be either <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> or <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, and if <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a> is <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> then all its <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic members<span class="arrow">&#183;</span></a> <span class="rfc2119">must</span> be <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a>. If <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> then <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a> <span class="rfc2119">must</span> be a list of <a href="#std" class="compref" shape="rect">Simple Type Definition</a>s.</p><p>The <a href="#std-facets" class="propref" shape="rect">{facets}</a> property determines the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of the datatype being defined by imposing constraints which are to be satisfied by all valid values and <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a>. </p><p> The <a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a> 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 <a href="#std-final" class="propref" shape="rect">{final}</a> is the empty set then the type can be used in deriving other types; the explicit values <b><i>restriction</i></b>, <b><i>list</i></b> and <b><i>union</i></b> prevent further derivations of <a href="#std" class="compref" shape="rect">Simple Type Definition</a>s by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a>, <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> and <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> respectively; the explicit value <b><i>extension</i></b> prevents any derivation of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#ctd" class="compref" shape="rect">Complex Type Definitions</a> by extension. </p><p>The <a href="#std-context" class="propref" shape="rect">{context}</a> 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. <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a> or <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</p></div><div class="div3"> <h4><a name="xr-defn" id="xr-defn" shape="rect"></a>4.1.2 XML Representation of Simple Type Definition Schema Components</h4><p> The XML representation for a <a href="#std" class="compref" shape="rect">Simple Type Definition</a> schema component is a <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>simpleType</code>&#160;Element Information Item et al.</div><div class="reprBody"><div class="element-syntax-1"><a id="element-simpleType" name="element-simpleType" shape="rect">&lt;simpleType</a><br clear="none" />&#160;&#160;final = (<var>#all</var> | List of (<var>list</var> | <var>union</var> | <var>restriction</var> | <var>extension</var>)) <br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;name = <a href="#NCName" shape="rect">NCName</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?, (<a href="#element-restriction" class="eltref" shape="rect">restriction</a> | <a href="#element-list" class="eltref" shape="rect">list</a> | <a href="#element-union" class="eltref" shape="rect">union</a>))<br clear="none" />&lt;/simpleType&gt;</div><div class="element-syntax"><a id="element-restriction" name="element-restriction" shape="rect">&lt;restriction</a><br clear="none" />&#160;&#160;base = <a href="#QName" shape="rect">QName</a><br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?, (<a href="#element-simpleType" class="eltref" shape="rect">simpleType</a>?, (<a href="#element-minExclusive" class="eltref" shape="rect">minExclusive</a> | <a href="#element-minInclusive" class="eltref" shape="rect">minInclusive</a> | <a href="#element-maxExclusive" class="eltref" shape="rect">maxExclusive</a> | <a href="#element-maxInclusive" class="eltref" shape="rect">maxInclusive</a> | <a href="#element-totalDigits" class="eltref" shape="rect">totalDigits</a> | <a href="#element-fractionDigits" class="eltref" shape="rect">fractionDigits</a> | <a href="#element-length" class="eltref" shape="rect">length</a> | <a href="#element-minLength" class="eltref" shape="rect">minLength</a> | <a href="#element-maxLength" class="eltref" shape="rect">maxLength</a> | <a href="#element-enumeration" class="eltref" shape="rect">enumeration</a> | <a href="#element-whiteSpace" class="eltref" shape="rect">whiteSpace</a> | <a href="#element-pattern" class="eltref" shape="rect">pattern</a> | <a href="#element-assertion" class="eltref" shape="rect">assertion</a> | <a href="#element-explicitTimezone" class="eltref" shape="rect">explicitTimezone</a> | <em>{any with namespace: ##other}</em>)*))<br clear="none" />&lt;/restriction&gt;</div><div class="element-syntax"><a id="element-list" name="element-list" shape="rect">&lt;list</a><br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;itemType = <a href="#QName" shape="rect">QName</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?, <a href="#element-simpleType" class="eltref" shape="rect">simpleType</a>?)<br clear="none" />&lt;/list&gt;</div><div class="element-syntax"><a id="element-union" name="element-union" shape="rect">&lt;union</a><br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;memberTypes = List of <a href="#QName" shape="rect">QName</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?, <a href="#element-simpleType" class="eltref" shape="rect">simpleType</a>*)<br clear="none" />&lt;/union&gt;</div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-defn" shape="rect">Simple Type Definition</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-name" class="propref" shape="rect">{name}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>name</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present on the <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a> element, otherwise <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-null" shape="rect">absent</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-target_namespace" class="propref" shape="rect">{target namespace}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>targetNamespace</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> of the parent <code>schema</code> element information item, if present, otherwise <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-null" shape="rect">absent</a>.</div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a></div><div class="mapRepr"> The appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">1 <b>If </b>the <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a> alternative is chosen, <b>then </b>the type definition <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#src-resolve" shape="rect">resolved</a> to by the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>base</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> of <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a>, if present, otherwise the type definition corresponding to the <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a> among the <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a> of <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a>.</div><div class="clnumber">2 <b>If </b>the <a href="#element-list" class="eltref" shape="rect">&lt;list&gt;</a> or <a href="#element-union" class="eltref" shape="rect">&lt;union&gt;</a> alternative is chosen, <b>then </b><a href="#anySimpleType-def" class="termref" shape="rect"><span class="arrow">&#183;</span>anySimpleType<span class="arrow">&#183;</span></a>.</div></div> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-final" class="propref" shape="rect">{final}</a></div><div class="mapRepr"> A subset of <code>{</code><b><i>restriction</i></b>, <b><i>extension</i></b>, <b><i>list</i></b>, <b><i>union</i></b><code>}</code>, determined as follows. <span class="termdef"><a name="lt-vs" id="lt-vs" title="" shape="rect">[Definition:]&#160;&#160;</a>Let <b>FS</b> be the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>final</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>finalDefault</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> of the ancestor <code>schema</code> element, if present, otherwise the empty string.</span> Then the property value is the appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">1 <b>If </b><a href="#lt-vs" class="termref" shape="rect"><span class="arrow">&#183;</span>FS<span class="arrow">&#183;</span></a> is the empty string, <b>then </b>the empty set;</div><div class="clnumber">2 <b>If </b><a href="#lt-vs" class="termref" shape="rect"><span class="arrow">&#183;</span>FS<span class="arrow">&#183;</span></a> is '<code>#all</code>', <b>then </b><code>{</code><b><i>restriction</i></b>, <b><i>extension</i></b>, <b><i>list</i></b>, <b><i>union</i></b><code>}</code>;</div><div class="clnumber">3 <b>otherwise </b>Consider <a href="#lt-vs" class="termref" shape="rect"><span class="arrow">&#183;</span>FS<span class="arrow">&#183;</span></a> as a space-separated list, and include <b><i>restriction</i></b> if '<code>restriction</code>' is in that list, and similarly for <b><i>extension</i></b>, <b><i>list</i></b> and <b><i>union</i></b>. </div></div> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-context" class="propref" shape="rect">{context}</a></div><div class="mapRepr"> The appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">1 <b>If </b>the <code>name</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> is present, <b>then </b><a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-null" shape="rect">absent</a></div><div class="clnumber">2 <b>otherwise </b> the appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">2.1 <b>If </b>the parent element information item is <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-attribute" class="eltref" shape="rect">&lt;attribute&gt;</a>, <b>then </b>the corresponding <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#ad" class="compref" shape="rect">Attribute Declaration</a></div><div class="clnumber">2.2 <b>If </b>the parent element information item is <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-element" class="eltref" shape="rect">&lt;element&gt;</a>, <b>then </b>the corresponding <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#ed" class="compref" shape="rect">Element Declaration</a></div><div class="clnumber">2.3 <b>If </b>the parent element information item is <a href="#element-list" class="eltref" shape="rect">&lt;list&gt;</a> or <a href="#element-union" class="eltref" shape="rect">&lt;union&gt;</a>, <b>then </b>the <a href="#std" class="compref" shape="rect">Simple Type Definition</a> corresponding to the grandparent <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a> element information item</div><div class="clnumber">2.4 <b>otherwise </b>(the parent element information item is <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a>), the appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">2.4.1 <b>If </b>the grandparent element information item is <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a>, <b>then </b>the <a href="#std" class="compref" shape="rect">Simple Type Definition</a> corresponding to the grandparent</div><div class="clnumber">2.4.2 <b>otherwise </b>(the grandparent element information item is <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-simpleContent" class="eltref" shape="rect">&lt;simpleContent&gt;</a>), the <a href="#std" class="compref" shape="rect">Simple Type Definition</a> which is the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#ctd-content_type" class="xpropref" shape="rect">{content type}</a> of the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#ctd" class="compref" shape="rect">Complex Type Definition</a> corresponding to the great-grandparent <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-complexType" class="eltref" shape="rect">&lt;complexType&gt;</a> element information item.</div></div> </div></div> </div></div> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-variety" class="propref" shape="rect">{variety}</a></div><div class="mapRepr">If the <a href="#element-list" class="eltref" shape="rect">&lt;list&gt;</a> alternative is chosen, then <b><i>list</i></b>, otherwise if the <a href="#element-union" class="eltref" shape="rect">&lt;union&gt;</a> alternative is chosen, then <b><i>union</i></b>, otherwise (the <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a> alternative is chosen) the <a href="#std-variety" class="propref" shape="rect">{variety}</a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-facets" class="propref" shape="rect">{facets}</a></div><div class="mapRepr"> The appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">1 <b>If </b>the <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a> alternative is chosen, <b>then </b>the set of <a href="#f" class="compref" shape="rect">Constraining Facet</a> components obtained by <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-facets-overlay" shape="rect">overlaying</a> the <a href="#std-facets" class="propref" shape="rect">{facets}</a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> with the set of <a href="#f" class="compref" shape="rect">Constraining Facet</a> components corresponding to those <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a> of <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a> which specify facets, as defined in <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#st-restrict-facets" shape="rect">Schema Component Constraint: Simple Type Restriction (Facets) </a>.</div><div class="clnumber">2 <b>If </b>the <a href="#element-list" class="eltref" shape="rect">&lt;list&gt;</a> alternative is chosen, <b>then </b>a set with one member, a <a href="#f-w" class="compref" shape="rect">whiteSpace</a> facet with <a href="#f-w-value" class="propref" shape="rect">{value}</a> = <b><i>collapse</i></b> and <a href="#f-w-fixed" class="propref" shape="rect">{fixed}</a> = <b><i>true</i></b>.</div><div class="clnumber">3 <b>otherwise </b>the empty set</div></div> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a></div><div class="mapRepr">Based on <a href="#std-variety" class="propref" shape="rect">{variety}</a>, <a href="#std-facets" class="propref" shape="rect">{facets}</a>, <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a>, a set of <a href="#ff" class="compref" shape="rect">Fundamental Facet</a> components, one each as specified in <a href="#dc-ordered" shape="rect">The ordered Schema Component (&#167;4.2.1.1)</a>, <a href="#dc-bounded" shape="rect">The bounded Schema Component (&#167;4.2.2.1)</a>, <a href="#dc-cardinality" shape="rect">The cardinality Schema Component (&#167;4.2.3.1)</a> and <a href="#dc-numeric" shape="rect">The numeric Schema Component (&#167;4.2.4.1)</a>.</div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-set" shape="rect">annotation mapping</a> of the set of elements containing the <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a>, and the <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a>, the <a href="#element-list" class="eltref" shape="rect">&lt;list&gt;</a>, or the <a href="#element-union" class="eltref" shape="rect">&lt;union&gt;</a> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[child]</a>, whichever is present, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div><div class="reprdep"> <span class="termdef"><a name="std-ancestor" id="std-ancestor" title="" shape="rect">[Definition:]&#160;&#160;</a>The <b>ancestors</b> of a <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#td" shape="rect">type definition</a> are its <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and the <a href="#std-ancestor" class="termref" shape="rect"><span class="arrow">&#183;</span>ancestors<span class="arrow">&#183;</span></a> of its <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</span> (The ancestors of a <a href="#std" class="compref" shape="rect">Simple Type Definition</a> <var>T</var> in the type hierarchy are themselves <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#td" shape="rect">type definitions</a>; they are distinct from the XML elements which may be ancestors, in the XML document hierarchy, of the <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a> element which declares <var>T</var>.) </div><div class="reprdep">If the <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>atomic</i></b>, the following additional property mapping also applies:</div><div class="reprcompmulti"><div class="reprHead"><a href="#xr-defn" shape="rect">Atomic Simple Type Definition</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a></div><div class="mapRepr">From among the <a href="#std-ancestor" class="termref" shape="rect"><span class="arrow">&#183;</span>ancestors<span class="arrow">&#183;</span></a> of this <a href="#std" class="compref" shape="rect">Simple Type Definition</a>, that <a href="#std" class="compref" shape="rect">Simple Type Definition</a> which corresponds to a <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype.<!--* Force break / clear, to avoid border cutting off property name * --> <br clear="all" /> </div><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> An electronic commerce schema might define a datatype called '<code>SKU</code>' (the barcode number that appears on products) from the <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype <a href="#string" shape="rect">string</a> by supplying a value for the <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> facet. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='SKU'&gt; &lt;restriction base='string'&gt; &lt;pattern value='\d{3}-[A-Z]{2}'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div><div class="exampleWrapper"> <div class="p"> In this case, '<code>SKU</code>' is the name of the new <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype, <a href="#string" shape="rect">string</a> is its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> and <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> is the facet. </div></div></div><div class="reprdep">If the <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>list</i></b>, the following additional property mappings also apply:</div><div class="reprcompmulti"><div class="reprHead"><a href="#xr-defn" shape="rect">List Simple Type Definition</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a></div><div class="mapRepr"> The appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">1 <b>If </b>the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> is <a href="#anySimpleType-def" class="termref" shape="rect"><span class="arrow">&#183;</span>anySimpleType<span class="arrow">&#183;</span></a>, <b>then </b>the <a href="#std" class="compref" shape="rect">Simple Type Definition</a> (a) <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#src-resolve" shape="rect">resolved</a> to by the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>itemType</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> of <a href="#element-list" class="eltref" shape="rect">&lt;list&gt;</a>, or (b) corresponding to the <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a> among the <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a> of <a href="#element-list" class="eltref" shape="rect">&lt;list&gt;</a>, whichever is present. <div class="note"><div class="p"><b>Note:</b> In this case, a <a href="#element-list" class="eltref" shape="rect">&lt;list&gt;</a> element will invariably be present; it will invariably have either an <code>itemType</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> or a <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[child]</a>, but not both.</div></div> </div><div class="clnumber">2 <b>otherwise </b>(that is, the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> is not <a href="#anySimpleType-def" class="termref" shape="rect"><span class="arrow">&#183;</span>anySimpleType<span class="arrow">&#183;</span></a>), the <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. <div class="note"><div class="p"><b>Note:</b> In this case, a <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a> element will invariably be present.</div></div></div></div> </div><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> A system might want to store lists of floating point values. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='listOfFloat'&gt; &lt;list itemType='float'/&gt; &lt;/simpleType&gt; </pre></div><div class="exampleWrapper"> <div class="p"> In this case, <em>listOfFloat</em> is the name of the new <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype, <a href="#float" shape="rect">float</a> is its <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> and <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> is the derivation method. </div></div></div><div class="reprdep">If the <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>union</i></b>, the following additional property mappings also apply:</div><div class="reprcompmulti"><div class="reprHead"><a href="#xr-defn" shape="rect">Union Simple Type Definition</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a></div><div class="mapRepr"> The appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">1 <b>If </b>the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> is <a href="#anySimpleType-def" class="termref" shape="rect"><span class="arrow">&#183;</span>anySimpleType<span class="arrow">&#183;</span></a>, <b>then </b>the sequence of (a) the <a href="#std" class="compref" shape="rect">Simple Type Definition</a>s (a) <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#src-resolve" shape="rect">resolved</a> to by the items in the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>memberTypes</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> of <a href="#element-union" class="eltref" shape="rect">&lt;union&gt;</a>, if any, and (b) those corresponding to the <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a>s among the <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a> of <a href="#element-union" class="eltref" shape="rect">&lt;union&gt;</a>, if any, in order. <div class="note"><div class="p"><b>Note:</b> In this case, a <a href="#element-union" class="eltref" shape="rect">&lt;union&gt;</a> element will invariably be present; it will invariably have either a <code>memberTypes</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> or one or more <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a>, or both.</div></div> </div><div class="clnumber">2 <b>otherwise </b>(that is, the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> is not <a href="#anySimpleType-def" class="termref" shape="rect"><span class="arrow">&#183;</span>anySimpleType<span class="arrow">&#183;</span></a>), the <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. <div class="note"><div class="p"><b>Note:</b> In this case, a <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a> element will invariably be present.</div></div></div></div> </div><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="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".&#160; The <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> <a href="#std" class="compref" shape="rect">Simple Type Definition</a> below would accomplish that.</div></div><div class="exampleInner"> <pre xml:space="preserve"> &lt;xs:attribute name="size"&gt; &lt;xs:simpleType&gt; &lt;xs:union&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base="xs:positiveInteger"&gt; &lt;xs:minInclusive value="8"/&gt; &lt;xs:maxInclusive value="72"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base="xs:NMTOKEN"&gt; &lt;xs:enumeration value="small"/&gt; &lt;xs:enumeration value="medium"/&gt; &lt;xs:enumeration value="large"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;/xs:union&gt; &lt;/xs:simpleType&gt; &lt;/xs:attribute&gt; </pre></div><div class="exampleInner"> <pre 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; </pre></div></div></div></div><p> A datatype can be <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from a <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype or an <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatype by one of three means: by <em><a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a></em>, by <em><a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a></em> or by <em><a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a></em>.</p></div><div class="div3"> <h4><a name="defn-rep-constr" id="defn-rep-constr" shape="rect"></a>4.1.3 Constraints on XML Representation of Simple Type Definition</h4><div class="constraintnote"><a id="src-list-itemType-or-simpleType" name="src-list-itemType-or-simpleType" shape="rect"></a><b>Schema Representation Constraint: itemType attribute or simpleType child</b><br clear="none" /><div class="constraint"><div class="p"> Either the <code>itemType</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> or the <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[child]</a> of the <a href="#element-list" class="eltref" shape="rect">&lt;list&gt;</a> element <span class="rfc2119">must</span> be present, but not both. </div></div></div><div class="constraintnote"><a id="src-restriction-base-or-simpleType" name="src-restriction-base-or-simpleType" shape="rect"></a><b>Schema Representation Constraint: base attribute or simpleType child</b><br clear="none" /><div class="constraint"><div class="p"> Either the <code>base</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> or the <code>simpleType</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[child]</a> of the <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a> element <span class="rfc2119">must</span> be present, but not both. </div></div></div><div class="constraintnote"><a id="src-union-memberTypes-or-simpleTypes" name="src-union-memberTypes-or-simpleTypes" shape="rect"></a><b>Schema Representation Constraint: memberTypes attribute or simpleType children</b><br clear="none" /><div class="constraint"><div class="p"> Either the <code>memberTypes</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> of the <a href="#element-union" class="eltref" shape="rect">&lt;union&gt;</a> element <span class="rfc2119">must</span> be non-empty or there <span class="rfc2119">must</span> be at least one <code>simpleType</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[child]</a>. </div></div></div></div><div class="div3"> <h4><a name="defn-validation-rules" id="defn-validation-rules" shape="rect"></a>4.1.4 Simple Type Definition Validation Rules</h4><div class="constraintnote"><a id="cvc-facet-valid" name="cvc-facet-valid" shape="rect"></a><b>Validation Rule: Facet Valid</b><br clear="none" /><div class="constraint"><div class="p"> A value in a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is facet-valid with respect to a <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facet<span class="arrow">&#183;</span></a> component if and only if: </div><div class="constraintlist"><div class="clnumber">1 <span class="p"> the value is facet-valid with respect to the particular <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facet<span class="arrow">&#183;</span></a> as specified below. </span></div> </div></div></div><div class="constraintnote"><a id="cvc-datatype-valid" name="cvc-datatype-valid" shape="rect"></a><b>Validation Rule: Datatype Valid</b><br clear="none" /><div class="constraint"><div class="p"> A <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> is datatype-valid with respect to a <a href="#std" class="compref" shape="rect">Simple Type Definition</a> if and only if it is a member of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of the corresponding datatype.</div></div></div><div class="note"><div class="p"><b>Note:</b> Since every value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is denoted by some <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a>, and every <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> maps to some value, the requirement that the <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> be in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> entails the requirement that the value it maps to should fulfill all of the constraints imposed by the <a href="#std-facets" class="propref" shape="rect">{facets}</a> of the datatype. If the datatype is a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, the Datatype Valid constraint also entails that each whitespace-delimited token in the list be datatype-valid against the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> of the list. If the datatype is a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, the Datatype Valid constraint entails that the <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> be datatype-valid against at least one of the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a>.</div><div class="p">That is, the constraints on <a href="#std" class="compref" shape="rect">Simple Type Definition</a>s and on datatype <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derivation<span class="arrow">&#183;</span></a> defined in this specification have as a consequence that a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> <var>L</var> is datatype-valid with respect to a <a href="#std" class="compref" shape="rect">Simple Type Definition</a> <var>T</var> if and only if either <var>T</var> corresponds to a <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> datatype or <b>all</b> of the following are true:<div class="constraintlist"><div class="clnumber">1<a id="dv_pattern" name="dv_pattern" shape="rect"> </a><span class="p">If there is a <a href="#f-p" class="compref" shape="rect">pattern</a> in <a href="#std-facets" class="propref" shape="rect">{facets}</a>, then <var>L</var> is <a href="#cvc-pattern-valid" shape="rect">pattern valid (&#167;4.3.4.4)</a> with respect to the <a href="#f-p" class="compref" shape="rect">pattern</a>. If there are other <a href="#dt-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical<span class="arrow">&#183;</span></a> facets in <a href="#std-facets" class="propref" shape="rect">{facets}</a>, then <var>L</var> is facet-valid with respect to them.</span></div> <div class="clnumber">2<a id="dv_lv" name="dv_lv" shape="rect"> </a><!--* no span class='p' possible here *-->The appropriate case among the following is true: <div class="constraintlist"><div class="clnumber">2.1<a id="dv_atomic" name="dv_atomic" shape="rect"> </a><span class="p">If the <a href="#std-variety" class="propref" shape="rect">{variety}</a> of <var>T</var> is <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a>, then <var>L</var> is in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of the <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> of <var>T</var>, as defined in the appropriate documentation. Let <var>V</var> be the member of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> of <var>T</var> mapped to by <var>L</var>, as defined in the appropriate documentation.</span><div class="note"><div class="p"><b>Note:</b> For <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitives<span class="arrow">&#183;</span></a>, the "appropriate documentation" is the relevant section of this specification. For <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitives<span class="arrow">&#183;</span></a>, it is the normative specification of the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, which will typically be included in, or referred to from, the implementation's documentation.</div></div></div> <div class="clnumber">2.2<a id="dv_list" name="dv_list" shape="rect"> </a><span class="p">If the <a href="#std-variety" class="propref" shape="rect">{variety}</a> of <var>T</var> is <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, then each space-delimited substring of <var>L</var> is Datatype Valid with respect to the <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a> of <var>T</var>. Let <var>V</var> be the sequence consisting of the values identified by Datatype Valid for each of those substrings, in order.</span></div> <div class="clnumber">2.3<a id="dv_union" name="dv_union" shape="rect"> </a><span class="p">If the <a href="#std-variety" class="propref" shape="rect">{variety}</a> of <var>T</var> is <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, then <var>L</var> is Datatype Valid with respect to at least one member of the <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a> of <var>T</var>. Let <var>B</var> be the <a href="#dt-active-basic-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active basic member<span class="arrow">&#183;</span></a> of <var>T</var> for <var>L</var>. Let <var>V</var> be the value identified by Datatype Valid for <var>L</var> with respect to <var>B</var>.</span></div> </div> </div> <div class="clnumber">3<a id="dv_vfacets" name="dv_vfacets" shape="rect"> </a><span class="p"><var>V</var>, as determined by the appropriate sub-clause of clause <a href="#dv_lv" shape="rect">2</a> above, is <a href="#cvc-facet-valid" shape="rect">Facet Valid (&#167;4.1.4)</a> with respect to each member of the <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <var>T</var> which is a <a href="#dt-value-based" class="termref" shape="rect"><span class="arrow">&#183;</span>value-based<span class="arrow">&#183;</span></a> (and not a <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> or <a href="#dt-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical<span class="arrow">&#183;</span></a>) facet.</span></div> </div> </div><div class="p">Note that <a href="#f-w" class="compref" shape="rect">whiteSpace</a> facets and other <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facets do not take part in checking Datatype Valid. In cases where this specification is used in conjunction with schema-validation of XML documents, such facets are used to normalize infoset values <em>before</em> the normalized results are checked for datatype validity. In the case of unions the <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facets to use are those associated with <var>B</var> in clause <a href="#dv_union" shape="rect">2.3</a> above. When more than one <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facet applies, the <a href="#f-w" class="compref" shape="rect">whiteSpace</a> facet is applied first; the order in which <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> facets are applied is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a>.</div></div></div><div class="div3"> <h4><a name="defn-coss" id="defn-coss" shape="rect"></a>4.1.5 Constraints on Simple Type Definition Schema Components</h4><div class="constraintnote"><a id="cos-applicable-facets" name="cos-applicable-facets" shape="rect"></a><b>Schema Component Constraint: Applicable Facets</b><br clear="none" /><div class="constraint"><div class="p"> The <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> which are allowed to be members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> depend on the <a href="#std-variety" class="propref" shape="rect">{variety}</a> and <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> of the type, as follows: </div><p> If <a href="#std-variety" shape="rect">{variety}</a> is <b><i>absent</i></b>, then no facets are applicable. (This is true for <a href="#anySimpleType-def" shape="rect">anySimpleType</a>.) </p> <p> If <a href="#std-variety" shape="rect">{variety}</a> is <a href="#dt-list" shape="rect">list</a>, then the applicable facets are <a href="#dc-assertions" shape="rect">assertions</a>, <a href="#dt-length" shape="rect">length</a>, <a href="#dt-minLength" shape="rect">minLength</a>, <a href="#dt-maxLength" shape="rect">maxLength</a>, <a href="#dt-pattern" shape="rect">pattern</a>, <a href="#dt-enumeration" shape="rect">enumeration</a>, and <a href="#dt-whiteSpace" shape="rect">whiteSpace</a>. </p> <p> If <a href="#std-variety" shape="rect">{variety}</a> is <a href="#dt-union" shape="rect">union</a>, then the applicable facets are <a href="#dt-pattern" shape="rect">pattern</a>, <a href="#dt-enumeration" shape="rect">enumeration</a>, and <a href="#dc-assertions" shape="rect">assertions</a>. </p> <p> If <a href="#std-variety" shape="rect">{variety}</a> is <a href="#dt-atomic" shape="rect">atomic</a>, and <a href="#std-primitive_type_definition" shape="rect">{primitive type definition}</a> is <b><i>absent</i></b> then no facets are applicable. (This is true for <a href="#anyAtomicType-def" shape="rect">anyAtomicType</a>.) </p><p> In all other cases (<a href="#std-variety" shape="rect">{variety}</a> is <a href="#dt-atomic" shape="rect">atomic</a> and <a href="#std-primitive_type_definition" shape="rect">{primitive type definition}</a> is not <b><i>absent</i></b>), then the applicable facets are shown in the table below. </p><table border="1" bgcolor="#bedce6"> <tr><th rowspan="1" colspan="1"><a href="#std-primitive_type_definition" shape="rect">{primitive type definition}</a></th><th rowspan="1" colspan="1">applicable <a href="#std-facets" shape="rect">{facets}</a></th></tr> <tr><td rowspan="1" colspan="1"><a href="#string" shape="rect">string</a></td><td rowspan="1" colspan="1"><a href="#dc-length" shape="rect">length</a>, <a href="#dc-minLength" shape="rect">minLength</a>, <a href="#dc-maxLength" shape="rect">maxLength</a>, <a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#boolean" shape="rect">boolean</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#float" shape="rect">float</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#double" shape="rect">double</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#decimal" shape="rect">decimal</a></td><td rowspan="1" colspan="1"><a href="#dc-totalDigits" shape="rect">totalDigits</a>, <a href="#dc-fractionDigits" shape="rect">fractionDigits</a>, <a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#duration" shape="rect">duration</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#dateTime" shape="rect">dateTime</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a>, <a href="#dc-explicitTimezone" shape="rect">explicitTimezone</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#time" shape="rect">time</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a>, <a href="#dc-explicitTimezone" shape="rect">explicitTimezone</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#date" shape="rect">date</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a>, <a href="#dc-explicitTimezone" shape="rect">explicitTimezone</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#gYearMonth" shape="rect">gYearMonth</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a>, <a href="#dc-explicitTimezone" shape="rect">explicitTimezone</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#gYear" shape="rect">gYear</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a>, <a href="#dc-explicitTimezone" shape="rect">explicitTimezone</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#gMonthDay" shape="rect">gMonthDay</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a>, <a href="#dc-explicitTimezone" shape="rect">explicitTimezone</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#gDay" shape="rect">gDay</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a>, <a href="#dc-explicitTimezone" shape="rect">explicitTimezone</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#gMonth" shape="rect">gMonth</a></td><td rowspan="1" colspan="1"><a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-maxInclusive" shape="rect">maxInclusive</a>, <a href="#dc-maxExclusive" shape="rect">maxExclusive</a>, <a href="#dc-minInclusive" shape="rect">minInclusive</a>, <a href="#dc-minExclusive" shape="rect">minExclusive</a>, <a href="#dc-assertions" shape="rect">assertions</a>, <a href="#dc-explicitTimezone" shape="rect">explicitTimezone</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#hexBinary" shape="rect">hexBinary</a></td><td rowspan="1" colspan="1"><a href="#dc-length" shape="rect">length</a>, <a href="#dc-minLength" shape="rect">minLength</a>, <a href="#dc-maxLength" shape="rect">maxLength</a>, <a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#base64Binary" shape="rect">base64Binary</a></td><td rowspan="1" colspan="1"><a href="#dc-length" shape="rect">length</a>, <a href="#dc-minLength" shape="rect">minLength</a>, <a href="#dc-maxLength" shape="rect">maxLength</a>, <a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#anyURI" shape="rect">anyURI</a></td><td rowspan="1" colspan="1"><a href="#dc-length" shape="rect">length</a>, <a href="#dc-minLength" shape="rect">minLength</a>, <a href="#dc-maxLength" shape="rect">maxLength</a>, <a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#QName" shape="rect">QName</a></td><td rowspan="1" colspan="1"><a href="#dc-length" shape="rect">length</a>, <a href="#dc-minLength" shape="rect">minLength</a>, <a href="#dc-maxLength" shape="rect">maxLength</a>, <a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> <tr><td rowspan="1" colspan="1"><a href="#NOTATION" shape="rect">NOTATION</a></td><td rowspan="1" colspan="1"><a href="#dc-length" shape="rect">length</a>, <a href="#dc-minLength" shape="rect">minLength</a>, <a href="#dc-maxLength" shape="rect">maxLength</a>, <a href="#dc-pattern" shape="rect">pattern</a>, <a href="#dc-enumeration" shape="rect">enumeration</a>, <a href="#dc-whiteSpace" shape="rect">whiteSpace</a>, <a href="#dc-assertions" shape="rect">assertions</a></td></tr> </table><div class="note"><div class="p"><b>Note:</b> For any <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> primitive types, it is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> which constraining facets are applicable to them. </div><div class="p">Similarly, for any <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> constraining facets, it is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> which <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitives<span class="arrow">&#183;</span></a> they apply to. </div></div></div></div></div><div class="div3"> <h4><a name="builtin-stds" id="builtin-stds" shape="rect"></a>4.1.6 Built-in Simple Type Definitions</h4><p>The <a href="#std" class="compref" shape="rect">Simple Type Definition</a> of <a href="#anySimpleType" shape="rect">anySimpleType</a> is present in every schema.&#160; It has the following properties:</p><div class="scInstance"><div class="scHead"><a id="anySimpleType-def" name="anySimpleType-def" shape="rect">Simple type definition of <code>anySimpleType</code></a></div><div class="pvlist"><div class="pvpair"><div class="pvProp"><b>Property</b></div><div class="pvVal"><b>Value</b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-name" class="propref" shape="rect">{name}</a></div><div class="pvVal">'<code>anySimpleType</code>'</div></div><div class="pvpair"><div class="pvProp"><a href="#std-target_namespace" class="propref" shape="rect">{target namespace}</a></div><div class="pvVal">'<code>http://www.w3.org/2001/XMLSchema</code>'</div></div><div class="pvpair"><div class="pvProp"><a href="#std-final" class="propref" shape="rect">{final}</a></div><div class="pvVal">The empty set</div></div><div class="pvpair"><div class="pvProp"><a href="#std-context" class="propref" shape="rect">{context}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a></div><div class="pvVal"><a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#any-type-itself" shape="rect">anyType</a></div></div><div class="pvpair"><div class="pvProp"><a href="#std-facets" class="propref" shape="rect">{facets}</a></div><div class="pvVal">The empty set</div></div><div class="pvpair"><div class="pvProp"><a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a></div><div class="pvVal">The empty set</div></div><div class="pvpair"><div class="pvProp"><a href="#std-variety" class="propref" shape="rect">{variety}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-annotations" class="propref" shape="rect">{annotations}</a></div><div class="pvVal">The empty sequence</div></div></div></div><p id="ast_radix_omnium">The definition of <a href="#anySimpleType" shape="rect">anySimpleType</a> is the root of the Simple Type Definition hierarchy; as such it mediates between the other simple type definitions, which all eventually trace back to it via their <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> properties, and the definition of <b><i>anyType</i></b>, which is <em>its</em> <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</p><p>The <a href="#std" class="compref" shape="rect">Simple Type Definition</a> of <a href="#anyAtomicType" shape="rect">anyAtomicType</a> is present in every schema.&#160; It has the following properties:</p><div class="scInstance"><div class="scHead"><a id="anyAtomicType-def" name="anyAtomicType-def" shape="rect">Simple type definition of <code>anyAtomicType</code></a></div><div class="pvlist"><div class="pvpair"><div class="pvProp"><b>Property</b></div><div class="pvVal"><b>Value</b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-name" class="propref" shape="rect">{name}</a></div><div class="pvVal">'<code>anyAtomicType</code>'</div></div><div class="pvpair"><div class="pvProp"><a href="#std-target_namespace" class="propref" shape="rect">{target namespace}</a></div><div class="pvVal">'<code>http://www.w3.org/2001/XMLSchema</code>'</div></div><div class="pvpair"><div class="pvProp"><a href="#std-final" class="propref" shape="rect">{final}</a></div><div class="pvVal">The empty set</div></div><div class="pvpair"><div class="pvProp"><a href="#std-context" class="propref" shape="rect">{context}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a></div><div class="pvVal"><a href="#anySimpleType" shape="rect">anySimpleType</a></div></div><div class="pvpair"><div class="pvProp"><a href="#std-facets" class="propref" shape="rect">{facets}</a></div><div class="pvVal">The empty set</div></div><div class="pvpair"><div class="pvProp"><a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a></div><div class="pvVal">The empty set</div></div><div class="pvpair"><div class="pvProp"><a href="#std-variety" class="propref" shape="rect">{variety}</a></div><div class="pvVal"><b><i>atomic</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-annotations" class="propref" shape="rect">{annotations}</a></div><div class="pvVal">The empty sequence</div></div></div></div><p>Simple type definitions for all the built-in primitive datatypes, namely <a href="#string" shape="rect">string</a>, <a href="#boolean" shape="rect">boolean</a>, <a href="#float" shape="rect">float</a>, <a href="#double" shape="rect">double</a>, <a href="#decimal" shape="rect">decimal</a>, <a href="#dateTime" shape="rect">dateTime</a>, <a href="#duration" shape="rect">duration</a>, <a href="#time" shape="rect">time</a>, <a href="#date" shape="rect">date</a>, <a href="#gMonth" shape="rect">gMonth</a>, <a href="#gMonthDay" shape="rect">gMonthDay</a>, <a href="#gDay" shape="rect">gDay</a>, <a href="#gYear" shape="rect">gYear</a>, <a href="#gYearMonth" shape="rect">gYearMonth</a>, <a href="#hexBinary" shape="rect">hexBinary</a>, <a href="#base64Binary" shape="rect">base64Binary</a>, <a href="#anyURI" shape="rect">anyURI</a> are present by definition in every schema.&#160; All have a very similar structure, with only the <a href="#std-name" class="propref" shape="rect">{name}</a>, the <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> (which is self-referential), the <a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a>, and in one case the <a href="#std-facets" class="propref" shape="rect">{facets}</a> varying from one to the next:</p><div class="scInstance"><div class="scHead"><a id="dummy-def" name="dummy-def" shape="rect">Simple Type Definition corresponding to the built-in primitive datatypes</a></div><div class="pvlist"><div class="pvpair"><div class="pvProp"><b>Property</b></div><div class="pvVal"><b>Value</b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-name" class="propref" shape="rect">{name}</a></div><div class="pvVal">[as appropriate]</div></div><div class="pvpair"><div class="pvProp"><a href="#std-target_namespace" class="propref" shape="rect">{target namespace}</a></div><div class="pvVal">'<code>http://www.w3.org/2001/XMLSchema</code>'</div></div><div class="pvpair"><div class="pvProp"><a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a></div><div class="pvVal"> <a href="#anyAtomicType-def" shape="rect">anyAtomicType Definition</a></div></div><div class="pvpair"><div class="pvProp"><a href="#std-final" class="propref" shape="rect">{final}</a></div><div class="pvVal">The empty set</div></div><div class="pvpair"><div class="pvProp"><a href="#std-variety" class="propref" shape="rect">{variety}</a></div><div class="pvVal"><b><i>atomic</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a></div><div class="pvVal">[this <a href="#std" class="compref" shape="rect">Simple Type Definition</a> itself]</div></div><div class="pvpair"><div class="pvProp"><a href="#std-facets" class="propref" shape="rect">{facets}</a></div><div class="pvVal">{a <a href="#f-w" class="compref" shape="rect">whiteSpace</a> facet with <a href="#f-w-value" class="propref" shape="rect">{value}</a> = <b><i>collapse</i></b> and <a href="#f-w-fixed" class="propref" shape="rect">{fixed}</a> = <b><i>true</i></b> in all cases except <a href="#string" shape="rect">string</a>, which has <a href="#f-w-value" class="propref" shape="rect">{value}</a> = <b><i>preserve</i></b> and <a href="#f-w-fixed" class="propref" shape="rect">{fixed}</a> = <b><i>false</i></b>}</div></div><div class="pvpair"><div class="pvProp"><a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a></div><div class="pvVal">[as appropriate] </div></div><div class="pvpair"><div class="pvProp"><a href="#std-context" class="propref" shape="rect">{context}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-annotations" class="propref" shape="rect">{annotations}</a></div><div class="pvVal">The empty sequence</div></div></div></div><div class="block"> <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>Implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitives<span class="arrow">&#183;</span></a> <span class="rfc2119">must</span> have a <a href="#std" class="compref" shape="rect">Simple Type Definition</a> with the values shown above, with the following exceptions. <ol class="enumar"><li><div class="p">The <a href="#std-facets" class="propref" shape="rect">{facets}</a> property <span class="rfc2119">must</span> contain a <a href="#f-w" class="compref" shape="rect">whiteSpace</a> facet, the value of which is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a>. It <span class="rfc2119">may</span> contain other facets, whether defined in this specification or <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a>.</div></li><li><div class="p">The value of <a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a> is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a>.</div></li><li><div class="p">The value of <a href="#std-annotations" class="propref" shape="rect">{annotations}</a> <span class="rfc2119">may</span> be empty, but need not be.</div></li></ol> </div><div class="note"><div class="p"><b>Note:</b> It is a consequence of the rule just given that each <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> will have an <a href="https://www.w3.org/TR/2004/REC-xml-names11-20040204/#dt-expname" shape="rect">expanded name</a> by which it can be referred to.</div></div><div class="note"><div class="p"><b>Note:</b> <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>Implementation-defined<span class="arrow">&#183;</span></a> datatypes will normally have a value other than '<code>http://www.w3.org/2001/XMLSchema</code>' for the <a href="#std-target_namespace" class="propref" shape="rect">{target namespace}</a> property. That namespace is controlled by the W3C and datatypes will be added to it only by W3C or its designees. </div></div><p>Similarly, <a href="#std" class="compref" shape="rect">Simple Type Definition</a>s for all the built-in <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes are present by definition in every schema, with properties as specified in <a href="#ordinary-built-ins" shape="rect">Other Built-in Datatypes (&#167;3.4)</a> and as represented in XML in <a href="#drvd.nxsd" shape="rect">Illustrative XML representations for the built-in ordinary type definitions (&#167;C.2)</a>.</p><div class="scInstance"><div class="scHead"><a id="dummy-ddef" name="dummy-ddef" shape="rect">Simple Type Definition corresponding to the built-in ordinary datatypes</a></div><div class="pvlist"><div class="pvpair"><div class="pvProp"><b>Property</b></div><div class="pvVal"><b>Value</b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-name" class="propref" shape="rect">{name}</a></div><div class="pvVal">[as appropriate]</div></div><div class="pvpair"><div class="pvProp"><a href="#std-target_namespace" class="propref" shape="rect">{target namespace}</a></div><div class="pvVal">'<code>http://www.w3.org/2001/XMLSchema</code>'</div></div><div class="pvpair"><div class="pvProp"><a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a></div><div class="pvVal">[as specified in the appropriate sub-section of <a href="#ordinary-built-ins" shape="rect">Other Built-in Datatypes (&#167;3.4)</a>]</div></div><div class="pvpair"><div class="pvProp"><a href="#std-final" class="propref" shape="rect">{final}</a></div><div class="pvVal">The empty set</div></div><div class="pvpair"><div class="pvProp"><a href="#std-variety" class="propref" shape="rect">{variety}</a></div><div class="pvVal">[<b><i>atomic</i></b> or <b><i>list</i></b>, as specified in the appropriate sub-section of <a href="#ordinary-built-ins" shape="rect">Other Built-in Datatypes (&#167;3.4)</a>]</div></div><div class="pvpair"><div class="pvProp"><a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a></div><div class="pvVal">[if <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>atomic</i></b>, then the <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>, otherwise <b><i>absent</i></b>]</div></div><div class="pvpair"><div class="pvProp"><a href="#std-facets" class="propref" shape="rect">{facets}</a></div><div class="pvVal">[as specified in the appropriate sub-section of <a href="#ordinary-built-ins" shape="rect">Other Built-in Datatypes (&#167;3.4)</a>]</div></div><div class="pvpair"><div class="pvProp"><a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a></div><div class="pvVal">[as specified in the appropriate sub-section of <a href="#ordinary-built-ins" shape="rect">Other Built-in Datatypes (&#167;3.4)</a>]</div></div><div class="pvpair"><div class="pvProp"><a href="#std-context" class="propref" shape="rect">{context}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a></div><div class="pvVal">if <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>atomic</i></b>, then <b><i>absent</i></b>, otherwise as specified in the appropriate sub-section of <a href="#ordinary-built-ins" shape="rect">Other Built-in Datatypes (&#167;3.4)</a>]</div></div><div class="pvpair"><div class="pvProp"><a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a></div><div class="pvVal"><b><i>absent</i></b></div></div><div class="pvpair"><div class="pvProp"><a href="#std-annotations" class="propref" shape="rect">{annotations}</a></div><div class="pvVal">As shown in the XML representations of the ordinary built-in datatypes in <a href="#drvd.nxsd" shape="rect">Illustrative XML representations for the built-in ordinary type definitions (&#167;C.2)</a></div></div></div></div></div></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#rf-defn" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#rf-facets" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="rf-fund-facets" id="rf-fund-facets" shape="rect"></a>4.2 Fundamental Facets</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.2.1 <a href="#rf-ordered" shape="rect">ordered</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.2.1.1 <a href="#dc-ordered" shape="rect">The ordered Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.2.2 <a href="#rf-bounded" shape="rect">bounded</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.2.2.1 <a href="#dc-bounded" shape="rect">The bounded Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.2.3 <a href="#rf-cardinality" shape="rect">cardinality</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.2.3.1 <a href="#dc-cardinality" shape="rect">The cardinality Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.2.4 <a href="#rf-numeric" shape="rect">numeric</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.2.4.1 <a href="#dc-numeric" shape="rect">The numeric Schema Component</a><br clear="none" /> </div><p> <a name="ff" id="ff" shape="rect"></a> <span class="termdef"><a name="dt-fundamental-facet" id="dt-fundamental-facet" title="" shape="rect">[Definition:]&#160;&#160;</a> Each <b>fundamental facet</b> is a schema component that provides a limited piece of information about some aspect of each datatype.</span>&#160; All <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facet<span class="arrow">&#183;</span></a> components are defined in this section.&#160; For example, <a href="#ff-c" class="compref" shape="rect">cardinality</a> is a <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facet<span class="arrow">&#183;</span></a>.&#160; Most <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a> are given a value fixed with each primitive datatype's definition, and this value is not changed by subsequent <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derivations<span class="arrow">&#183;</span></a> (even when it would perhaps be reasonable to expect an application to give a more accurate value based on the constraining facets used to define the <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derivation<span class="arrow">&#183;</span></a>).&#160; The <a href="#ff-c" class="compref" shape="rect">cardinality</a> and <a href="#ff-b" class="compref" shape="rect">bounded</a> facets are exceptions to this rule; their values may change as a result of certain <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derivations<span class="arrow">&#183;</span></a>.</p><div class="note"><div class="p"><b>Note:</b> Schema components are identified by kind.&#160; "Fundamental" is not a kind of component.&#160; Each kind of <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facet<span class="arrow">&#183;</span></a> ("ordered", "bounded", etc.) is a separate kind of schema component.</div></div><p></p><p>A <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facet<span class="arrow">&#183;</span></a> can occur only in the <a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a> of a <a href="#std" class="compref" shape="rect">Simple Type Definition</a>, and this is the only place where <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facet<span class="arrow">&#183;</span></a> components occur.&#160; &#160; Each kind of <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facet<span class="arrow">&#183;</span></a> component occurs (once) in each <a href="#std" class="compref" shape="rect">Simple Type Definition</a>'s <a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a> set.</p><div class="note"><div class="p"><b>Note:</b> The value of any <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facet<span class="arrow">&#183;</span></a> component can always be calculated from other properties of its <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner<span class="arrow">&#183;</span></a>.&#160; Fundamental facets are not required for schema processing, but some applications use them.</div></div><div class="div3"> <h4><a name="rf-ordered" id="rf-ordered" shape="rect"></a>4.2.1 ordered</h4><p>For some datatypes, this document specifies an order relation for their value spaces (see <a href="#order" shape="rect">Order (&#167;2.2.3)</a>); the <em>ordered</em> facet reflects this. It takes the values <b><i>total</i></b>, <b><i>partial</i></b>, and <b><i>false</i></b>, with the meanings described below. For the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes, the value of the <em>ordered</em> facet is specified in <a href="#app-fundamental-facets" shape="rect">Fundamental Facets (&#167;F.1)</a>. For <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes, the value is inherited without change from the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. For a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, the value is always <b><i>false</i></b>; for a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, the value is computed as described below. </p><p>A <b><i>false</i></b> value means no order is prescribed; a <b><i>total</i></b> value assures that the prescribed order is a total order; a <b><i>partial</i></b> value means that the prescribed order is a partial order, but not (for the primitive type in question) a total order. </p><div class="note"><div class="p"><b>Note:</b> The value <b><i>false</i></b> in the <em>ordered</em> facet does not mean no partial or total ordering <em>exists</em> for the value space, only that none is specified by this document for use in checking upper and lower bounds. Mathematically, any set of values possesses at least one trivial partial ordering, in which every value pair that is not equal is incomparable.</div></div><div class="note"><div class="p"><b>Note:</b> When new datatypes are derived from datatypes with partial orders, the constraints imposed can sometimes result in a value space for which the ordering is total, or trivial. The value of the <a href="#ff-o" class="compref" shape="rect">ordered</a> facet is not, however, changed to reflect this. The value <b><i>partial</i></b> should therefore be interpreted with appropriate caution.</div></div><p> <span class="termdef"><a name="dt-ordered" id="dt-ordered" title="" shape="rect">[Definition:]&#160;&#160;</a>A <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, and hence a datatype, is said to be <b>ordered</b> if some members of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> are drawn from a <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype for which the table in <a href="#app-fundamental-facets" shape="rect">Fundamental Facets (&#167;F.1)</a> specifies the value <b><i>total</i></b> or <b><i>partial</i></b> for the <em>ordered</em> facet.</span></p><div class="note"><div class="p"><b>Note:</b> Some of the "real-world" datatypes which are the basis for those defined herein are ordered in some applications, even though no order is prescribed for schema-processing purposes.&#160; For example, <a href="#boolean" shape="rect">boolean</a> is sometimes ordered, and <a href="#string" shape="rect">string</a> and <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatypes <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> from ordered <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatypes are sometimes given "lexical" orderings.&#160; They are <em>not</em> ordered for schema-processing purposes.</div></div><div class="div4"> <h5><a name="dc-ordered" id="dc-ordered" shape="rect"></a>4.2.1.1 The ordered Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="ff-o" id="ff-o" shape="rect">ordered</a>, a kind of <a href="#ff" class="compref" shape="rect">Fundamental Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="ff-o-value" shape="rect" id="ff-o-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> One of {<span class="enumval">false</span>, <span class="enumval">partial</span>, <span class="enumval">total</span>}. Required.</div> </div> </div></div> </div> </div> <div class="block"><a href="#ff-o-value" class="propref" shape="rect">{value}</a> depends on the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a>, <a href="#std-facets" class="propref" shape="rect">{facets}</a>, and <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a>. The appropriate <b>case</b> among the following <span class="rfc2119">must</span> be true:<div class="constraintlist"><div class="clnumber">1<a id="x04042a" name="x04042a" shape="rect"> </a><b>If </b>the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>atomic</i></b>, <b>then </b> the appropriate <b>case</b> among the following <span class="rfc2119">must</span> be true:<div class="constraintlist"><div class="clnumber">1.1<a id="x040428b" name="x040428b" shape="rect"> </a><b>If </b>the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner<span class="arrow">&#183;</span></a> is <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, <b>then </b><a href="#ff-o-value" class="propref" shape="rect">{value}</a> is as specified in the table in <a href="#app-fundamental-facets" shape="rect">Fundamental Facets (&#167;F.1)</a>.</div><div class="clnumber">1.2 <b>otherwise </b><a href="#ff-o-value" class="propref" shape="rect">{value}</a> is the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>'s <a href="#ff-o" class="compref" shape="rect">ordered</a> <a href="#ff-o-value" class="propref" shape="rect">{value}</a>.</div></div> </div><div class="clnumber">2 <b>If </b>the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>list</i></b>, <b>then </b><a href="#ff-o-value" class="propref" shape="rect">{value}</a> is <b><i>false</i></b>.</div><div class="clnumber">3 <b>otherwise </b>the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>union</i></b>; the appropriate <b>case</b> among the following <span class="rfc2119">must</span> be true:<div class="constraintlist"><div class="clnumber">3.1<a id="x040428" name="x040428" shape="rect"> </a><b>If </b>every <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic member<span class="arrow">&#183;</span></a> of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner<span class="arrow">&#183;</span></a> has <a href="#std-variety" class="propref" shape="rect">{variety}</a> atomic and has the same <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a>, <b>then </b><a href="#ff-o-value" class="propref" shape="rect">{value}</a> is the same as the <a href="#ff-o" class="compref" shape="rect">ordered</a> component's <a href="#ff-o-value" class="propref" shape="rect">{value}</a> in that primitive type definition's <a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a>.</div><div class="clnumber">3.2 <b>If </b>each member of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a> has an <a href="#ff-o" class="compref" shape="rect">ordered</a> component in its <a href="#std-fundamental_facets" class="propref" shape="rect">{fundamental facets}</a> whose <a href="#ff-o-value" class="propref" shape="rect">{value}</a> is <b><i>false</i></b>, <b>then </b><a href="#ff-o-value" class="propref" shape="rect">{value}</a> is <b><i>false</i></b>.</div><div class="clnumber">3.3 <b>otherwise </b><a href="#ff-o-value" class="propref" shape="rect">{value}</a> is <b><i>partial</i></b>.</div></div> </div></div> </div></div></div><div class="div3"> <h4><a name="rf-bounded" id="rf-bounded" shape="rect"></a>4.2.2 bounded</h4><p>Some ordered datatypes have the property that there is one value greater than or equal to every other value, and another that is less than or equal to every other value.&#160; (In the case of <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes, these two values are not necessarily in the value space of the derived datatype, but they will always be in the value space of the primitive datatype from which they have been derived.) The <em>bounded</em> facet value is <a href="#boolean" shape="rect">boolean</a> and is generally <b><i>true</i></b> for such <em>bounded</em> datatypes.&#160; However, it will remain <b><i>false</i></b> when the mechanism for imposing such a bound is difficult to detect, as, for example, when the boundedness occurs because of derivation using a <a href="#f-p" class="compref" shape="rect">pattern</a> component.</p><div class="div4"> <h5><a name="dc-bounded" id="dc-bounded" shape="rect"></a>4.2.2.1 The bounded Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="ff-b" id="ff-b" shape="rect">bounded</a>, a kind of <a href="#ff" class="compref" shape="rect">Fundamental Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="ff-b-value" shape="rect" id="ff-b-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p><a href="#ff-b-value" class="propref" shape="rect">{value}</a> depends on the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a>, <a href="#std-facets" class="propref" shape="rect">{facets}</a> and <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a>.</p><p>When the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner<span class="arrow">&#183;</span></a> is <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, <a href="#ff-b-value" class="propref" shape="rect">{value}</a> is as specified in the table in <a href="#app-fundamental-facets" shape="rect">Fundamental Facets (&#167;F.1)</a>.&#160; Otherwise, when the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>atomic</i></b>, if one of <a href="#f-mii" class="compref" shape="rect">minInclusive</a> or <a href="#f-mie" class="compref" shape="rect">minExclusive</a> and one of <a href="#f-mai" class="compref" shape="rect">maxInclusive</a> or <a href="#f-mae" class="compref" shape="rect">maxExclusive</a> are members of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-facets" class="propref" shape="rect">{facets}</a> set, then <a href="#ff-b-value" class="propref" shape="rect">{value}</a> is <b><i>true</i></b>; otherwise <a href="#ff-b-value" class="propref" shape="rect">{value}</a> is <b><i>false</i></b>.</p><p>When the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>list</i></b>, <a href="#ff-b-value" class="propref" shape="rect">{value}</a> is <b><i>false</i></b>.</p><p> When the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>union</i></b>, if <a href="#ff-b-value" class="propref" shape="rect">{value}</a> is <b><i>true</i></b> for every member of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a> set and all of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic members<span class="arrow">&#183;</span></a> have the same <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a>, then <a href="#ff-b-value" class="propref" shape="rect">{value}</a> is <b><i>true</i></b>; otherwise <a href="#ff-b-value" class="propref" shape="rect">{value}</a> is <b><i>false</i></b>. </p></div></div><div class="div3"> <h4><a name="rf-cardinality" id="rf-cardinality" shape="rect"></a>4.2.3 cardinality</h4><p>Every value space has a specific number of members.&#160; This number can be characterized as <em>finite</em> or <em>infinite</em>.&#160; (Currently there are no datatypes with infinite value spaces larger than <em>countable</em>.)&#160; The <em>cardinality</em> facet value is either <b><i>finite</i></b> or <b><i>countably infinite</i></b> and is generally <b><i>finite</i></b> for datatypes with finite value spaces.&#160; However, it will remain <b><i>countably infinite</i></b> when the mechanism for causing finiteness is difficult to detect, as, for example, when finiteness occurs because of a derivation using a <a href="#f-p" class="compref" shape="rect">pattern</a> component.</p><div class="div4"> <h5><a name="dc-cardinality" id="dc-cardinality" shape="rect"></a>4.2.3.1 The cardinality Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="ff-c" id="ff-c" shape="rect">cardinality</a>, a kind of <a href="#ff" class="compref" shape="rect">Fundamental Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="ff-c-value" shape="rect" id="ff-c-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> One of {<span class="enumval">finite</span>, <span class="enumval">countably infinite</span>}. Required.</div> </div> </div></div> </div> </div> <p> <a href="#ff-c-value" class="propref" shape="rect">{value}</a> depends on the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a>, <a href="#std-facets" class="propref" shape="rect">{facets}</a>, and <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a>.</p><div class="block">When the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner<span class="arrow">&#183;</span></a> is <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, <a href="#ff-c-value" class="propref" shape="rect">{value}</a> is as specified in the table in <a href="#app-fundamental-facets" shape="rect">Fundamental Facets (&#167;F.1)</a>.&#160; Otherwise, when the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>atomic</i></b>, <a href="#ff-c-value" class="propref" shape="rect">{value}</a> is <b><i>countably infinite</i></b> unless <b>any</b> of the following conditions are true, in which case <a href="#ff-c-value" class="propref" shape="rect">{value}</a> is <b><i>finite</i></b>: <ol class="enumar"><li><div class="p">the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>'s <a href="#ff-c" class="compref" shape="rect">cardinality</a> <a href="#ff-c-value" class="propref" shape="rect">{value}</a> is <b><i>finite</i></b>,</div></li><li><div class="p">at least one of <a href="#f-l" class="compref" shape="rect">length</a>, <a href="#f-mal" class="compref" shape="rect">maxLength</a>, or <a href="#f-td" class="compref" shape="rect">totalDigits</a> is a member of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-facets" class="propref" shape="rect">{facets}</a> set,</div></li><li><div class="p"><b>all</b> of the following are true:</div><ol class="enumla"><li><div class="p">one of <a href="#f-mii" class="compref" shape="rect">minInclusive</a> or <a href="#f-mie" class="compref" shape="rect">minExclusive</a> is a member of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-facets" class="propref" shape="rect">{facets}</a> set</div></li><li><div class="p">one of <a href="#f-mai" class="compref" shape="rect">maxInclusive</a> or <a href="#f-mae" class="compref" shape="rect">maxExclusive</a> is a member of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-facets" class="propref" shape="rect">{facets}</a> set</div></li><li><div class="p"><b>either</b> of the following are true:</div><ol class="enumlr"><li><div class="p"><a href="#f-fd" class="compref" shape="rect">fractionDigits</a> is a member of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-facets" class="propref" shape="rect">{facets}</a> set</div></li><li><div class="p"><a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is one of <a href="#date" shape="rect">date</a>, <a href="#gYearMonth" shape="rect">gYearMonth</a>, <a href="#gYear" shape="rect">gYear</a>, <a href="#gMonthDay" shape="rect">gMonthDay</a>, <a href="#gDay" shape="rect">gDay</a> or <a href="#gMonth" shape="rect">gMonth</a></div></li></ol></li></ol></li></ol> </div><p> When the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>list</i></b>, if <a href="#f-l" class="compref" shape="rect">length</a> or both <a href="#f-mil" class="compref" shape="rect">minLength</a> and <a href="#f-mal" class="compref" shape="rect">maxLength</a> are members of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-facets" class="propref" shape="rect">{facets}</a> set and the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a>'s <a href="#ff-c" class="compref" shape="rect">cardinality</a> <a href="#ff-c-value" class="propref" shape="rect">{value}</a> is <b><i>finite</i></b> then <a href="#ff-c-value" class="propref" shape="rect">{value}</a> is <b><i>finite</i></b>; otherwise <a href="#ff-c-value" class="propref" shape="rect">{value}</a> is <b><i>countably infinite</i></b>. </p><p> When the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>union</i></b>, if <a href="#ff-c" class="compref" shape="rect">cardinality</a>'s <a href="#ff-c-value" class="propref" shape="rect">{value}</a> is <em>finite</em> for every member of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a> set then <a href="#ff-c-value" class="propref" shape="rect">{value}</a> is <b><i>finite</i></b>, otherwise <a href="#ff-c-value" class="propref" shape="rect">{value}</a> is <b><i>countably infinite</i></b>. </p></div></div><div class="div3"> <h4><a name="rf-numeric" id="rf-numeric" shape="rect"></a>4.2.4 numeric</h4><p>Some value spaces are made up of things that are conceptually <em>numeric</em>, others are not.&#160;The <em>numeric</em> facet value indicates which are considered numeric. </p><div class="div4"> <h5><a name="dc-numeric" id="dc-numeric" shape="rect"></a>4.2.4.1 The numeric Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="ff-n" id="ff-n" shape="rect">numeric</a>, a kind of <a href="#ff" class="compref" shape="rect">Fundamental Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="ff-n-value" shape="rect" id="ff-n-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> <a href="#ff-n-value" class="propref" shape="rect">{value}</a> depends on the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a>, <a href="#std-facets" class="propref" shape="rect">{facets}</a>, <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a>. </p><p> When the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner<span class="arrow">&#183;</span></a> is <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, <a href="#ff-n-value" class="propref" shape="rect">{value}</a> is as specified in the table in <a href="#app-fundamental-facets" shape="rect">Fundamental Facets (&#167;F.1)</a>.&#160; Otherwise, when the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>atomic</i></b>, <a href="#ff-n-value" class="propref" shape="rect">{value}</a> is inherited from the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>'s <a href="#ff-n" class="compref" shape="rect">numeric</a><a href="#ff-n-value" class="propref" shape="rect">{value}</a>. </p><p> When the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>list</i></b>, <a href="#ff-n-value" class="propref" shape="rect">{value}</a> is <b><i>false</i></b>. </p><p> When the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <b><i>union</i></b>, if <a href="#ff-n" class="compref" shape="rect">numeric</a>'s <a href="#ff-n-value" class="propref" shape="rect">{value}</a> is <b><i>true</i></b> for every member of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner's<span class="arrow">&#183;</span></a> <a href="#std-member_type_definitions" class="propref" shape="rect">{member type definitions}</a> set then <a href="#ff-n-value" class="propref" shape="rect">{value}</a> is <b><i>true</i></b>, otherwise <a href="#ff-n-value" class="propref" shape="rect">{value}</a> is <b><i>false</i></b>. </p></div></div></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#rf-fund-facets" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="rf-facets" id="rf-facets" shape="rect"></a>4.3 Constraining Facets</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.1 <a href="#rf-length" shape="rect">length</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.1.1 <a href="#dc-length" shape="rect">The length Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.1.2 <a href="#xr-length" shape="rect">XML Representation of length Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.1.3 <a href="#length-validation-rules" shape="rect">length Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.1.4 <a href="#length-coss" shape="rect">Constraints on length Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.2 <a href="#rf-minLength" shape="rect">minLength</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.2.1 <a href="#dc-minLength" shape="rect">The minLength Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.2.2 <a href="#xr-minLength" shape="rect">XML Representation of minLength Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.2.3 <a href="#minLength-validation-rules" shape="rect">minLength Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.2.4 <a href="#minLength-coss" shape="rect">Constraints on minLength Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.3 <a href="#rf-maxLength" shape="rect">maxLength</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.3.1 <a href="#dc-maxLength" shape="rect">The maxLength Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.3.2 <a href="#xr-maxLength" shape="rect">XML Representation of maxLength Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.3.3 <a href="#maxLength-validation-rules" shape="rect">maxLength Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.3.4 <a href="#maxLength-coss" shape="rect">Constraints on maxLength Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.4 <a href="#rf-pattern" shape="rect">pattern</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.4.1 <a href="#dc-pattern" shape="rect">The pattern Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.4.2 <a href="#xr-pattern" shape="rect">XML Representation of pattern Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.4.3 <a href="#pattern-rep-constr" shape="rect">Constraints on XML Representation of pattern</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.4.4 <a href="#pattern-validation-rules" shape="rect">pattern Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.4.5 <a href="#pattern-constraints" shape="rect">Constraints on pattern Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.5 <a href="#rf-enumeration" shape="rect">enumeration</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.5.1 <a href="#dc-enumeration" shape="rect">The enumeration Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.5.2 <a href="#xr-enumeration" shape="rect">XML Representation of enumeration Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.5.3 <a href="#enumeration-rep-constr" shape="rect">Constraints on XML Representation of enumeration</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.5.4 <a href="#enumeration-validation-rules" shape="rect">enumeration Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.5.5 <a href="#enumeration-coss" shape="rect">Constraints on enumeration Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.6 <a href="#rf-whiteSpace" shape="rect">whiteSpace</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.6.1 <a href="#dc-whiteSpace" shape="rect">The whiteSpace Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.6.2 <a href="#xr-whiteSpace" shape="rect">XML Representation of whiteSpace Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.6.3 <a href="#whiteSpace-validation-rules" shape="rect">whiteSpace Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.6.4 <a href="#whiteSpace-coss" shape="rect">Constraints on whiteSpace Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.7 <a href="#rf-maxInclusive" shape="rect">maxInclusive</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.7.1 <a href="#dc-maxInclusive" shape="rect">The maxInclusive Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.7.2 <a href="#xr-maxInclusive" shape="rect">XML Representation of maxInclusive Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.7.3 <a href="#maxInclusive-validation-rules" shape="rect">maxInclusive Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.7.4 <a href="#maxInclusive-coss" shape="rect">Constraints on maxInclusive Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.8 <a href="#rf-maxExclusive" shape="rect">maxExclusive</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.8.1 <a href="#dc-maxExclusive" shape="rect">The maxExclusive Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.8.2 <a href="#xr-maxExclusive" shape="rect">XML Representation of maxExclusive Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.8.3 <a href="#maxExclusive-validation-rules" shape="rect">maxExclusive Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.8.4 <a href="#maxExclusive-coss" shape="rect">Constraints on maxExclusive Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.9 <a href="#rf-minExclusive" shape="rect">minExclusive</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.9.1 <a href="#dc-minExclusive" shape="rect">The minExclusive Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.9.2 <a href="#xr-minExclusive" shape="rect">XML Representation of minExclusive Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.9.3 <a href="#minExclusive-validation-rules" shape="rect">minExclusive Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.9.4 <a href="#minExclusive-coss" shape="rect">Constraints on minExclusive Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.10 <a href="#rf-minInclusive" shape="rect">minInclusive</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.10.1 <a href="#dc-minInclusive" shape="rect">The minInclusive Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.10.2 <a href="#xr-minInclusive" shape="rect">XML Representation of minInclusive Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.10.3 <a href="#minInclusive-validation-rules" shape="rect">minInclusive Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.10.4 <a href="#minInclusive-coss" shape="rect">Constraints on minInclusive Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.11 <a href="#rf-totalDigits" shape="rect">totalDigits</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.11.1 <a href="#dc-totalDigits" shape="rect">The totalDigits Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.11.2 <a href="#xr-totalDigits" shape="rect">XML Representation of totalDigits Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.11.3 <a href="#totalDigits-validation-rules" shape="rect">totalDigits Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.11.4 <a href="#totalDigits-coss" shape="rect">Constraints on totalDigits Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.12 <a href="#rf-fractionDigits" shape="rect">fractionDigits</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.12.1 <a href="#dc-fractionDigits" shape="rect">The fractionDigits Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.12.2 <a href="#xr-fractionDigits" shape="rect">XML Representation of fractionDigits Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.12.3 <a href="#fractionDigits-validation-rules" shape="rect">fractionDigits Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.12.4 <a href="#fractionDigits-coss" shape="rect">Constraints on fractionDigits Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.13 <a href="#rf-assertions" shape="rect">Assertions</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.13.1 <a href="#dc-assertions" shape="rect">The assertions Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.13.2 <a href="#xr-assertions" shape="rect">XML Representation of assertions Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.13.3 <a href="#assertions-validation-rules" shape="rect">Assertions Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.13.4 <a href="#assertions-coss" shape="rect">Constraints on assertions Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.14 <a href="#rf-explicitTimezone" shape="rect">explicitTimezone</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.14.1 <a href="#dc-explicitTimezone" shape="rect">The explicitTimezone Schema Component</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.14.2 <a href="#xr-timezone" shape="rect">XML Representation of explicitTimezone Schema Components</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.14.3 <a href="#timezone-vr" shape="rect">explicitTimezone Validation Rules</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;4.3.14.4 <a href="#timezone-coss" shape="rect">Constraints on explicitTimezone Schema Components</a><br clear="none" /> </div><p> <a name="f" id="f" shape="rect"></a> <span class="termdef"><a name="dt-constraining-facet" id="dt-constraining-facet" title="" shape="rect">[Definition:]&#160;&#160;</a><b>Constraining facets</b> are schema components whose values may be set or changed during <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derivation<span class="arrow">&#183;</span></a> (subject to facet-specific controls) to control various aspects of the derived datatype.</span>&#160; All <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facet<span class="arrow">&#183;</span></a> components defined by this specification are defined in this section.&#160; For example, <a href="#f-w" class="compref" shape="rect">whiteSpace</a> is a <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facet<span class="arrow">&#183;</span></a>.&#160; <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>Constraining Facets<span class="arrow">&#183;</span></a> are given a value as part of the <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derivation<span class="arrow">&#183;</span></a> when an <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatype is defined by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restricting<span class="arrow">&#183;</span></a> a <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> or <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatype; a few <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> have default values that are also provided for <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes.</p><div class="note"><div class="p"><b>Note:</b> Schema components are identified by kind.&#160; "Constraining" is not a kind of component.&#160; Each kind of <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facet<span class="arrow">&#183;</span></a> ("whiteSpace", "length", etc.) is a separate kind of schema component. </div></div><div class="block"> This specification distinguishes three kinds of constraining facets:<ul><li><div class="p"><span class="termdef"><a name="dt-pre-lexical" id="dt-pre-lexical" title="" shape="rect">[Definition:]&#160;&#160;</a>A constraining facet which is used to normalize an initial <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> before checking to see whether the resulting character sequence is a member of a datatype's <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> is a <b>pre-lexical</b> facet.</span></div><div class="p">This specification defines just one <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facet: <a href="#f-w" class="compref" shape="rect">whiteSpace</a>.</div></li><li><div class="p"><span class="termdef"><a name="dt-lexical" id="dt-lexical" title="" shape="rect">[Definition:]&#160;&#160;</a>A constraining facet which directly restricts the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of a datatype is a <b>lexical</b> facet.</span></div><div class="p">This specification defines just one <a href="#dt-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical<span class="arrow">&#183;</span></a> facet: <a href="#f-p" class="compref" shape="rect">pattern</a>.</div><div class="note"><div class="p"><b>Note:</b> As specified normatively elsewhere, <a href="#dt-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical<span class="arrow">&#183;</span></a> facets can have an indirect effect on the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>: if every lexical representation of a value is removed from the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, the value itself is removed from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.</div></div></li><li><div class="p"><span class="termdef"><a name="dt-value-based" id="dt-value-based" title="" shape="rect">[Definition:]&#160;&#160;</a>A constraining facet which directly restricts the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of a datatype is a <b>value-based</b> facet.</span></div><div class="p">Most of the constraining facets defined by this specification are <a href="#dt-value-based" class="termref" shape="rect"><span class="arrow">&#183;</span>value-based<span class="arrow">&#183;</span></a> facets.</div><div class="note"><div class="p"><b>Note:</b> As specified normatively elsewhere, <a href="#dt-value-based" class="termref" shape="rect"><span class="arrow">&#183;</span>value-based<span class="arrow">&#183;</span></a> facets can have an indirect effect on the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>: if a value is removed from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, its lexical representations are removed from the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>.</div></div></li></ul> </div><p> Conforming processors <span class="rfc2119">must</span> support all the facets defined in this section. It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether a processor supports other constraining facets. <span class="termdef"><a name="dt-unknown-f" id="dt-unknown-f" title="" shape="rect">[Definition:]&#160;&#160;</a>An <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facet<span class="arrow">&#183;</span></a> which is not supported by the processor in use is <b>unknown</b>.</span> </p><div class="note"><div class="p"><b>Note:</b> A reference to an <a href="#dt-unknown-f" class="termref" shape="rect"><span class="arrow">&#183;</span>unknown<span class="arrow">&#183;</span></a> facet might be a reference to an <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> facet supported by some other processor, or might be the result of a typographic error, or might have some other explanation. </div></div><p></p><p>The descriptions of individual facets given below include both constraints on <a href="#std" class="compref" shape="rect">Simple Type Definition</a> components and rules for checking the datatype validity of a given literal against a given datatype. The validation rules typically depend upon having a full knowledge of the datatype; full knowledge of the datatype, in turn, depends on having a fully instantiated <a href="#std" class="compref" shape="rect">Simple Type Definition</a>. A full instantiation of the <a href="#std" class="compref" shape="rect">Simple Type Definition</a>, and the checking of the component constraints, require knowledge of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. It follows that if a datatype's <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> is <a href="#dt-unknown-dt" class="termref" shape="rect"><span class="arrow">&#183;</span>unknown<span class="arrow">&#183;</span></a>, the <a href="#std" class="compref" shape="rect">Simple Type Definition</a> defining the datatype will be incompletely instantiated, and the datatype itself will be <a href="#dt-unknown-dt" class="termref" shape="rect"><span class="arrow">&#183;</span>unknown<span class="arrow">&#183;</span></a>. Similarly, any datatype defined using an <a href="#dt-unknown-f" class="termref" shape="rect"><span class="arrow">&#183;</span>unknown<span class="arrow">&#183;</span></a> <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facet<span class="arrow">&#183;</span></a> will be <a href="#dt-unknown-dt" class="termref" shape="rect"><span class="arrow">&#183;</span>unknown<span class="arrow">&#183;</span></a>. It is not possible to perform datatype validation as defined here using <a href="#dt-unknown-dt" class="termref" shape="rect"><span class="arrow">&#183;</span>unknown<span class="arrow">&#183;</span></a> datatypes.</p><div class="note"><div class="p"><b>Note:</b> The preceding paragraph does not forbid implementations from attempting to make use of such partial information as they have about <a href="#dt-unknown-dt" class="termref" shape="rect"><span class="arrow">&#183;</span>unknown<span class="arrow">&#183;</span></a> datatypes. But the exploitation of such partial knowledge is not datatype validity checking as defined here and is to be distinguished from it in the implementation's documentation and interface.</div></div><div class="div3"> <h4><a name="rf-length" id="rf-length" shape="rect"></a>4.3.1 length</h4><p> <span class="termdef"><a name="dt-length" id="dt-length" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>length</b> is the number of <em>units of length</em>, where <em>units of length</em> varies depending on the type that is being <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from. The value of <b>length</b> <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be a <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a>. </span> </p><p> For <a href="#string" shape="rect">string</a> and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#string" shape="rect">string</a>, <b>length</b> is measured in units of <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect"> character</a>s as defined in <a href="#XML" shape="rect">[XML]</a>. For <a href="#anyURI" shape="rect">anyURI</a>, <b>length</b> is measured in units of characters (as for <a href="#string" shape="rect">string</a>). For <a href="#hexBinary" shape="rect">hexBinary</a> and <a href="#base64Binary" shape="rect">base64Binary</a> and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from them, <b>length</b> is measured in octets (8 bits) of binary data. For datatypes <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> by <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, <b>length</b> is measured in number of list items. </p><div class="note"><div class="p"><b>Note:</b> For <a href="#string" shape="rect">string</a> and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#string" shape="rect">string</a>, <b>length</b> will not always coincide with "string length" as perceived by some users or with the number of storage units in some digital representation.&#160; Therefore, care should be taken when specifying a value for <b>length</b> and in attempting to infer storage requirements from a given value for <b>length</b>. </div></div><p> <a href="#dt-length" class="termref" shape="rect"><span class="arrow">&#183;</span>length<span class="arrow">&#183;</span></a> provides for: </p><ul><li><div class="p"> Constraining a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to values with a specific number of <em>units of length</em>, where <em>units of length</em> varies depending on <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </div></li></ul><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following is the definition of a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype to represent product codes which must be exactly 8 characters in length.&#160; By fixing the value of the <b>length</b> facet we ensure that types derived from productCode can change or set the values of other facets, such as <b>pattern</b>, but cannot change the length. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='productCode'&gt; &lt;restriction base='string'&gt; &lt;length value='8' fixed='true'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div></div><div class="div4"> <h5><a name="dc-length" id="dc-length" shape="rect"></a>4.3.1.1 The length Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-l" id="f-l" shape="rect">length</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-l-annotations" shape="rect" id="f-l-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-l-value" shape="rect" id="f-l-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> An xs:nonNegativeInteger value. Required.</div> </div> <div class="propDefn"><a name="f-l-fixed" shape="rect" id="f-l-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> If <a href="#f-l-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then types for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> cannot specify a value for <a href="#f-l" class="compref" shape="rect">length</a> other than <a href="#f-l-value" class="propref" shape="rect">{value}</a>. </p><div class="note"><div class="p"><b>Note:</b> The <a href="#f-l-fixed" class="propref" shape="rect">{fixed}</a> property is defined for parallelism with other facets and for compatibility with version 1.0 of this specification. But it is a consequence of <a href="#length-valid-restriction" shape="rect">length valid restriction (&#167;4.3.1.4)</a> that the value of the <a href="#f-l" class="compref" shape="rect">length</a> facet cannot be changed, regardless of whether <a href="#f-l-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em> or <em>false</em>. </div></div></div><div class="div4"> <h5><a name="xr-length" id="xr-length" shape="rect"></a>4.3.1.2 XML Representation of length Schema Components</h5><p> The XML representation for a <a href="#f-l" class="compref" shape="rect">length</a> schema component is a <a href="#element-length" class="eltref" shape="rect">&lt;length&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>length</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-length" name="element-length" shape="rect">&lt;length</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/length&gt;</div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-fractionDigits" shape="rect">length</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-l-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-l-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-l-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-length" class="eltref" shape="rect">&lt;length&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="length-validation-rules" id="length-validation-rules" shape="rect"></a>4.3.1.3 length Validation Rules</h5><div class="constraintnote"><a id="cvc-length-valid" name="cvc-length-valid" shape="rect"></a><b>Validation Rule: Length Valid</b><br clear="none" /><div class="constraint"><div class="p"> A value in a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is facet-valid with respect to <a href="#dt-length" class="termref" shape="rect"><span class="arrow">&#183;</span>length<span class="arrow">&#183;</span></a> if and only if: </div><div class="constraintlist"><div class="clnumber">1 <!--* no span class='p' possible here *--> if the <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> then <div class="constraintlist"><div class="clnumber">1.1 <span class="p"> if <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is <a href="#string" shape="rect">string</a> or <a href="#anyURI" shape="rect">anyURI</a>, then the length of the value, as measured in <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect"> character</a>s <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to <a href="#f-l-value" class="propref" shape="rect">{value}</a>; </span></div> <div class="clnumber">1.2 <span class="p"> if <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is <a href="#hexBinary" shape="rect">hexBinary</a> or <a href="#base64Binary" shape="rect">base64Binary</a>, then the length of the value, as measured in octets of the binary data, <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to <a href="#f-l-value" class="propref" shape="rect">{value}</a>; </span></div> <div class="clnumber">1.3 <span class="p"> if <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is <a href="#QName" shape="rect">QName</a> or <a href="#NOTATION" shape="rect">NOTATION</a>, then any <a href="#f-l-value" class="propref" shape="rect">{value}</a> is facet-valid. </span></div> </div> </div> <div class="clnumber">2 <span class="p"> if the <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, then the length of the value, as measured in list items, <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to <a href="#f-l-value" class="propref" shape="rect">{value}</a> </span></div> </div></div></div><p> The use of <a href="#dt-length" class="termref" shape="rect"><span class="arrow">&#183;</span>length<span class="arrow">&#183;</span></a> on <a href="#QName" shape="rect">QName</a>, <a href="#NOTATION" shape="rect">NOTATION</a>, and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from them is deprecated.&#160; Future versions of this specification may remove this facet for these datatypes. </p></div><div class="div4"> <h5><a name="length-coss" id="length-coss" shape="rect"></a>4.3.1.4 Constraints on length Schema Components</h5><div class="constraintnote"><a id="length-minLength-maxLength" name="length-minLength-maxLength" shape="rect"></a><b>Schema Component Constraint: length and minLength or maxLength</b><br clear="none" /><div class="constraint"><div class="p">If <a href="#f-l" class="compref" shape="rect">length</a> is a member of <a href="#std-facets" class="propref" shape="rect">{facets}</a> then <div class="constraintlist"><div class="clnumber">1 <!--* no span class='p' possible here *-->It is an error for <a href="#f-mil" class="compref" shape="rect">minLength</a> to be a member of <a href="#std-facets" class="propref" shape="rect">{facets}</a> unless <div class="constraintlist"><div class="clnumber">1.1 <span class="p">the <a href="#f-mil-value" class="propref" shape="rect">{value}</a> of <a href="#f-mil" class="compref" shape="rect">minLength</a> &lt;= the <a href="#f-l-value" class="propref" shape="rect">{value}</a> of <a href="#f-l" class="compref" shape="rect">length</a> and</span></div> <div class="clnumber">1.2 <span class="p">there is some type definition from which this one is derived by one or more <a href="#dt-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restriction<span class="arrow">&#183;</span></a> steps in which <a href="#f-mil" class="compref" shape="rect">minLength</a> has the same <a href="#f-mil-value" class="propref" shape="rect">{value}</a> and <a href="#f-l" class="compref" shape="rect">length</a> is not specified.</span></div> </div> </div> <div class="clnumber">2 <!--* no span class='p' possible here *-->It is an error for <a href="#f-mal" class="compref" shape="rect">maxLength</a> to be a member of <a href="#std-facets" class="propref" shape="rect">{facets}</a> unless <div class="constraintlist"><div class="clnumber">2.1 <span class="p">the <a href="#f-l-value" class="propref" shape="rect">{value}</a> of <a href="#f-l" class="compref" shape="rect">length</a> &lt;= the <a href="#f-mal-value" class="propref" shape="rect">{value}</a> of <a href="#f-mal" class="compref" shape="rect">maxLength</a> and</span></div> <div class="clnumber">2.2 <span class="p">there is some type definition from which this one is derived by one or more restriction steps in which <a href="#f-mal" class="compref" shape="rect">maxLength</a> has the same <a href="#f-mal-value" class="propref" shape="rect">{value}</a> and <a href="#f-l" class="compref" shape="rect">length</a> is not specified.</span></div> </div> </div> </div> </div></div></div><div class="constraintnote"><a id="length-valid-restriction" name="length-valid-restriction" shape="rect"></a><b>Schema Component Constraint: length valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if <a href="#f-l" class="compref" shape="rect">length</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-l-value" class="propref" shape="rect">{value}</a> is not equal to the <a href="#f-l-value" class="propref" shape="rect">{value}</a> of the parent <a href="#f-l" class="compref" shape="rect">length</a>. </div></div></div></div></div><div class="div3"> <h4><a name="rf-minLength" id="rf-minLength" shape="rect"></a>4.3.2 minLength</h4><p> <span class="termdef"><a name="dt-minLength" id="dt-minLength" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>minLength</b> is the minimum number of <em>units of length</em>, where <em>units of length</em> varies depending on the type that is being <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from. The value of <b>minLength</b> &#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be a <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a>. </span> </p><p> For <a href="#string" shape="rect">string</a> and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#string" shape="rect">string</a>, <b>minLength</b> is measured in units of <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect"> character</a>s as defined in <a href="#XML" shape="rect">[XML]</a>. For <a href="#hexBinary" shape="rect">hexBinary</a> and <a href="#base64Binary" shape="rect">base64Binary</a> and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from them, <b>minLength</b> is measured in octets (8 bits) of binary data. For datatypes <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> by <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, <b>minLength</b> is measured in number of list items. </p><div class="note"><div class="p"><b>Note:</b> For <a href="#string" shape="rect">string</a> and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#string" shape="rect">string</a>, <b>minLength</b> will not always coincide with "string length" as perceived by some users or with the number of storage units in some digital representation. Therefore, care should be taken when specifying a value for <b>minLength</b> and in attempting to infer storage requirements from a given value for <b>minLength</b>. </div></div><p> <a href="#dt-minLength" class="termref" shape="rect"><span class="arrow">&#183;</span>minLength<span class="arrow">&#183;</span></a> provides for: </p><ul><li><div class="p"> Constraining a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to values with at least a specific number of <em>units of length</em>, where <em>units of length</em> varies depending on <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </div></li></ul><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following is the definition of a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype which requires strings to have at least one character (i.e., the empty string is not in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of this datatype). </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='non-empty-string'&gt; &lt;restriction base='string'&gt; &lt;minLength value='1'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div></div><div class="div4"> <h5><a name="dc-minLength" id="dc-minLength" shape="rect"></a>4.3.2.1 The minLength Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-mil" id="f-mil" shape="rect">minLength</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-mil-annotations" shape="rect" id="f-mil-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-mil-value" shape="rect" id="f-mil-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> An xs:nonNegativeInteger value. Required.</div> </div> <div class="propDefn"><a name="f-mil-fixed" shape="rect" id="f-mil-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> If <a href="#f-mil-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then types for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> cannot specify a value for <a href="#f-mil" class="compref" shape="rect">minLength</a> other than <a href="#f-mil-value" class="propref" shape="rect">{value}</a>. </p></div><div class="div4"> <h5><a name="xr-minLength" id="xr-minLength" shape="rect"></a>4.3.2.2 XML Representation of minLength Schema Component</h5><p> The XML representation for a <a href="#f-mil" class="compref" shape="rect">minLength</a> schema component is a <a href="#element-minLength" class="eltref" shape="rect">&lt;minLength&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>minLength</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-minLength" name="element-minLength" shape="rect">&lt;minLength</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/minLength&gt;</div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-fractionDigits" shape="rect">minLength</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mil-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mil-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mil-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-minLength" class="eltref" shape="rect">&lt;minLength&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="minLength-validation-rules" id="minLength-validation-rules" shape="rect"></a>4.3.2.3 minLength Validation Rules</h5><div class="constraintnote"><a id="cvc-minLength-valid" name="cvc-minLength-valid" shape="rect"></a><b>Validation Rule: minLength Valid</b><br clear="none" /><div class="constraint"><div class="p"> A value in a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is facet-valid with respect to <a href="#dt-minLength" class="termref" shape="rect"><span class="arrow">&#183;</span>minLength<span class="arrow">&#183;</span></a>, determined as follows: </div><div class="constraintlist"><div class="clnumber">1 <!--* no span class='p' possible here *--> if the <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> then <div class="constraintlist"><div class="clnumber">1.1 <span class="p"> if <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is <a href="#string" shape="rect">string</a> or <a href="#anyURI" shape="rect">anyURI</a>, then the length of the value, as measured in<a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect"> character</a>s <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be greater than or equal to <a href="#f-mil-value" class="propref" shape="rect">{value}</a>; </span></div> <div class="clnumber">1.2 <span class="p"> if <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is <a href="#hexBinary" shape="rect">hexBinary</a> or <a href="#base64Binary" shape="rect">base64Binary</a>, then the length of the value, as measured in octets of the binary data, <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be greater than or equal to <a href="#f-mil-value" class="propref" shape="rect">{value}</a>; </span></div> <div class="clnumber">1.3 <span class="p"> if <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is <a href="#QName" shape="rect">QName</a> or <a href="#NOTATION" shape="rect">NOTATION</a>, then any <a href="#f-mil-value" class="propref" shape="rect">{value}</a> is facet-valid. </span></div> </div> </div> <div class="clnumber">2 <span class="p"> if the <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, then the length of the value, as measured in list items, <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be greater than or equal to <a href="#f-mil-value" class="propref" shape="rect">{value}</a> </span></div> </div></div></div><p> The use of <a href="#dt-minLength" class="termref" shape="rect"><span class="arrow">&#183;</span>minLength<span class="arrow">&#183;</span></a> on <a href="#QName" shape="rect">QName</a>, <a href="#NOTATION" shape="rect">NOTATION</a>, and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from them is deprecated.&#160; Future versions of this specification may remove this facet for these datatypes. </p></div><div class="div4"> <h5><a name="minLength-coss" id="minLength-coss" shape="rect"></a>4.3.2.4 Constraints on minLength Schema Components</h5><div class="constraintnote"><a id="minLength-less-than-equal-to-maxLength" name="minLength-less-than-equal-to-maxLength" shape="rect"></a><b>Schema Component Constraint: minLength &lt;= maxLength</b><br clear="none" /><div class="constraint"><div class="p"> If both <a href="#f-mil" class="compref" shape="rect">minLength</a> and <a href="#f-mal" class="compref" shape="rect">maxLength</a> are members of <a href="#std-facets" class="propref" shape="rect">{facets}</a>, then the <a href="#f-mil-value" class="propref" shape="rect">{value}</a> of <a href="#f-mil" class="compref" shape="rect">minLength</a> &#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be less than or equal to the <a href="#f-mal-value" class="propref" shape="rect">{value}</a> of <a href="#f-mal" class="compref" shape="rect">maxLength</a>. </div></div></div><div class="constraintnote"><a id="minLength-valid-restriction" name="minLength-valid-restriction" shape="rect"></a><b>Schema Component Constraint: minLength valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if <a href="#f-mil" class="compref" shape="rect">minLength</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mil-value" class="propref" shape="rect">{value}</a> is less than the <a href="#f-mil-value" class="propref" shape="rect">{value}</a> of the parent <a href="#f-mil" class="compref" shape="rect">minLength</a>. </div></div></div></div></div><div class="div3"> <h4><a name="rf-maxLength" id="rf-maxLength" shape="rect"></a>4.3.3 maxLength</h4><p> <span class="termdef"><a name="dt-maxLength" id="dt-maxLength" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>maxLength</b> is the maximum number of <em>units of length</em>, where <em>units of length</em> varies depending on the type that is being <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from. The value of <b>maxLength</b> &#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be a <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a>. </span> </p><p> For <a href="#string" shape="rect">string</a> and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#string" shape="rect">string</a>, <b>maxLength</b> is measured in units of <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect"> character</a>s as defined in <a href="#XML" shape="rect">[XML]</a>. For <a href="#hexBinary" shape="rect">hexBinary</a> and <a href="#base64Binary" shape="rect">base64Binary</a> and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from them, <b>maxLength</b> is measured in octets (8 bits) of binary data. For datatypes <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> by <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, <b>maxLength</b> is measured in number of list items. </p><div class="note"><div class="p"><b>Note:</b> For <a href="#string" shape="rect">string</a> and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#string" shape="rect">string</a>, <b>maxLength</b> will not always coincide with "string length" as perceived by some users or with the number of storage units in some digital representation. Therefore, care should be taken when specifying a value for <b>maxLength</b> and in attempting to infer storage requirements from a given value for <b>maxLength</b>. </div></div><p> <a href="#dt-maxLength" class="termref" shape="rect"><span class="arrow">&#183;</span>maxLength<span class="arrow">&#183;</span></a> provides for: </p><ul><li><div class="p"> Constraining a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to values with at most a specific number of <em>units of length</em>, where <em>units of length</em> varies depending on <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </div></li></ul><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following is the definition of a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype which might be used to accept form input with an upper limit to the number of characters that are acceptable. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='form-input'&gt; &lt;restriction base='string'&gt; &lt;maxLength value='50'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div></div><div class="div4"> <h5><a name="dc-maxLength" id="dc-maxLength" shape="rect"></a>4.3.3.1 The maxLength Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-mal" id="f-mal" shape="rect">maxLength</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-mal-annotations" shape="rect" id="f-mal-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-mal-value" shape="rect" id="f-mal-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> An xs:nonNegativeInteger value. Required.</div> </div> <div class="propDefn"><a name="f-mal-fixed" shape="rect" id="f-mal-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> If <a href="#f-mal-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then types for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> cannot specify a value for <a href="#f-mal" class="compref" shape="rect">maxLength</a> other than <a href="#f-mal-value" class="propref" shape="rect">{value}</a>. </p></div><div class="div4"> <h5><a name="xr-maxLength" id="xr-maxLength" shape="rect"></a>4.3.3.2 XML Representation of maxLength Schema Components</h5><p> The XML representation for a <a href="#f-mal" class="compref" shape="rect">maxLength</a> schema component is a <a href="#element-maxLength" class="eltref" shape="rect">&lt;maxLength&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>maxLength</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-maxLength" name="element-maxLength" shape="rect">&lt;maxLength</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/maxLength&gt;</div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-fractionDigits" shape="rect">maxLength</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mal-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mal-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mal-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-maxLength" class="eltref" shape="rect">&lt;maxLength&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="maxLength-validation-rules" id="maxLength-validation-rules" shape="rect"></a>4.3.3.3 maxLength Validation Rules</h5><div class="constraintnote"><a id="cvc-maxLength-valid" name="cvc-maxLength-valid" shape="rect"></a><b>Validation Rule: maxLength Valid</b><br clear="none" /><div class="constraint"><div class="p"> A value in a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is facet-valid with respect to <a href="#dt-maxLength" class="termref" shape="rect"><span class="arrow">&#183;</span>maxLength<span class="arrow">&#183;</span></a>, determined as follows: </div><div class="constraintlist"><div class="clnumber">1 <!--* no span class='p' possible here *--> if the <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> then <div class="constraintlist"><div class="clnumber">1.1 <span class="p"> if <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is <a href="#string" shape="rect">string</a> or <a href="#anyURI" shape="rect">anyURI</a>, then the length of the value, as measured in <a href="https://www.w3.org/TR/xml11/#dt-character" shape="rect"> character</a>s <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be less than or equal to <a href="#f-mal-value" class="propref" shape="rect">{value}</a>; </span></div> <div class="clnumber">1.2 <span class="p"> if <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is <a href="#hexBinary" shape="rect">hexBinary</a> or <a href="#base64Binary" shape="rect">base64Binary</a>, then the length of the value, as measured in octets of the binary data, <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be less than or equal to <a href="#f-mal-value" class="propref" shape="rect">{value}</a>; </span></div> <div class="clnumber">1.3 <span class="p"> if <a href="#std-primitive_type_definition" class="propref" shape="rect">{primitive type definition}</a> is <a href="#QName" shape="rect">QName</a> or <a href="#NOTATION" shape="rect">NOTATION</a>, then any <a href="#f-mal-value" class="propref" shape="rect">{value}</a> is facet-valid. </span></div> </div> </div> <div class="clnumber">2 <span class="p"> if the <a href="#std-variety" class="propref" shape="rect">{variety}</a> is <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, then the length of the value, as measured in list items, <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be less than or equal to <a href="#f-mal-value" class="propref" shape="rect">{value}</a> </span></div> </div></div></div><p> The use of <a href="#dt-maxLength" class="termref" shape="rect"><span class="arrow">&#183;</span>maxLength<span class="arrow">&#183;</span></a> on <a href="#QName" shape="rect">QName</a>, <a href="#NOTATION" shape="rect">NOTATION</a>, and datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from them is deprecated.&#160; Future versions of this specification may remove this facet for these datatypes. </p></div><div class="div4"> <h5><a name="maxLength-coss" id="maxLength-coss" shape="rect"></a>4.3.3.4 Constraints on maxLength Schema Components</h5><div class="constraintnote"><a id="maxLength-valid-restriction" name="maxLength-valid-restriction" shape="rect"></a><b>Schema Component Constraint: maxLength valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if <a href="#f-mal" class="compref" shape="rect">maxLength</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mal-value" class="propref" shape="rect">{value}</a> is greater than the <a href="#f-mal-value" class="propref" shape="rect">{value}</a> of the parent <a href="#f-mal" class="compref" shape="rect">maxLength</a>. </div></div></div></div></div><div class="div3"> <h4><a name="rf-pattern" id="rf-pattern" shape="rect"></a>4.3.4 pattern</h4><p><span class="termdef"><a name="dt-pattern" id="dt-pattern" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>pattern</b> is a constraint on the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of a datatype which is achieved by constraining the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> to <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> which match each member of a set of <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expressions<span class="arrow">&#183;</span></a>.&#160; The value of <b>pattern</b> &#160;<span class="rfc2119">must</span> be a set of <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expressions<span class="arrow">&#183;</span></a>. </span> </p><div class="note"><div class="p"><b>Note:</b> An XML <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a> containing more than one <a href="#element-pattern" class="eltref" shape="rect">&lt;pattern&gt;</a> element gives rise to a single <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expression<span class="arrow">&#183;</span></a> in the set; this <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expression<span class="arrow">&#183;</span></a> is an "or" of the <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expressions<span class="arrow">&#183;</span></a> that are the content of the <a href="#element-pattern" class="eltref" shape="rect">&lt;pattern&gt;</a> elements.</div></div><p> <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> provides for: </p><ul><li><div class="p">Constraining a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to values that are denoted by <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> which match each of a set of <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expressions<span class="arrow">&#183;</span></a>. </div></li></ul><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following is the definition of a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype which is a better representation of postal codes in the United States, by limiting strings to those which are matched by a specific <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expression<span class="arrow">&#183;</span></a>. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='better-us-zipcode'&gt; &lt;restriction base='string'&gt; &lt;pattern value='[0-9]{5}(-[0-9]{4})?'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div></div><div class="div4"> <h5><a name="dc-pattern" id="dc-pattern" shape="rect"></a>4.3.4.1 The pattern Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-p" id="f-p" shape="rect">pattern</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-p-annotations" shape="rect" id="f-p-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-p-value" shape="rect" id="f-p-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> <div class="ownDesc"> <p>A non-empty set of <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expressions<span class="arrow">&#183;</span></a>.</p></div> </div> </div> </div></div> </div> </div> </div><div class="div4"> <h5><a name="xr-pattern" id="xr-pattern" shape="rect"></a>4.3.4.2 XML Representation of pattern Schema Components</h5><p> The XML representation for a <a href="#f-p" class="compref" shape="rect">pattern</a> schema component is one or more <a href="#element-pattern" class="eltref" shape="rect">&lt;pattern&gt;</a> element information items. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>pattern</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-pattern" name="element-pattern" shape="rect">&lt;pattern</a><br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#string" shape="rect">string</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/pattern&gt;</div><div class="reprdep"> </div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-pattern" shape="rect">pattern</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-p-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> <span class="termdef"><a name="l-R" id="l-R" title="" shape="rect">[Definition:]&#160;&#160;</a>Let <b>R</b> be a regular expression given by </span> the appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">1 <b>If </b>there is only one <a href="#element-pattern" class="eltref" shape="rect">&lt;pattern&gt;</a> among the <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a> of a <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a>, <b>then </b>the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of its <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a></div><div class="clnumber">2 <b>otherwise </b>the concatenation of the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual values</a> of all the <a href="#element-pattern" class="eltref" shape="rect">&lt;pattern&gt;</a> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a>'s <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attributes]</a>, in order, separated by '<code>|</code>', so forming a single regular expression with multiple <a href="#dt-branch" class="termref" shape="rect"><span class="arrow">&#183;</span>branches<span class="arrow">&#183;</span></a>.</div></div> The value is then given by the appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">1 <b>If </b>the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner<span class="arrow">&#183;</span></a> has a <a href="#f-p" class="compref" shape="rect">pattern</a> facet among its <a href="#std-facets" class="propref" shape="rect">{facets}</a>, <b>then </b>the union of that <a href="#f-p" class="compref" shape="rect">pattern</a> facet's <a href="#f-p-value" class="propref" shape="rect">{value}</a> and {<a href="#l-R" class="termref" shape="rect"><span class="arrow">&#183;</span>R<span class="arrow">&#183;</span></a>}</div><div class="clnumber">2 <b>otherwise </b>just {<a href="#l-R" class="termref" shape="rect"><span class="arrow">&#183;</span>R<span class="arrow">&#183;</span></a>}</div></div> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-p-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-set" shape="rect">annotation mapping</a> of the set containing all of the <a href="#element-pattern" class="eltref" shape="rect">&lt;pattern&gt;</a> elements among the <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a> of the <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a> element information item, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div><div class="note"><div class="p"><b>Note:</b> The <a href="#f-p-value" class="propref" shape="rect">{value}</a> property will only have more than one member when <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> involves a <a href="#f-p" class="compref" shape="rect">pattern</a> facet at more than one step in a type derivation. During validation, lexical forms will be checked against every member of the resulting <a href="#f-p-value" class="propref" shape="rect">{value}</a>, effectively creating a conjunction of patterns.</div><div class="p"> In summary, <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> facets specified on the <em>same</em> step in a type derivation are <b>OR</b>ed together, while <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> facets specified on <em>different</em> steps of a type derivation are <b>AND</b>ed together. </div><div class="p"> Thus, to impose two <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> constraints simultaneously, schema authors may either write a single <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> which expresses the intersection of the two <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a>s they wish to impose, or define each <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> on a separate type derivation step. </div></div></div><div class="div4"> <h5><a name="pattern-rep-constr" id="pattern-rep-constr" shape="rect"></a>4.3.4.3 Constraints on XML Representation of pattern</h5><div class="constraintnote"><a id="src-pattern-value" name="src-pattern-value" shape="rect"></a><b>Schema Representation Constraint: Pattern value</b><br clear="none" /><div class="constraint"><div class="p">The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> must be a <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expression<span class="arrow">&#183;</span></a> as defined in <a href="#regexs" shape="rect">Regular Expressions (&#167;G)</a>.</div></div></div></div><div class="div4"> <h5><a name="pattern-validation-rules" id="pattern-validation-rules" shape="rect"></a>4.3.4.4 pattern Validation Rules</h5><div class="constraintnote"><a id="cvc-pattern-valid" name="cvc-pattern-valid" shape="rect"></a><b>Validation Rule: pattern valid</b><br clear="none" /><div class="constraint"><div class="p">A <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> in a <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> is pattern-valid (or: facet-valid with respect to <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a>) if and only if for each <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expression<span class="arrow">&#183;</span></a> in its <a href="#f-p-value" class="propref" shape="rect">{value}</a>, the <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> is among the set of character sequences denoted by the <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expression<span class="arrow">&#183;</span></a>. </div></div></div><div class="note"><div class="p"><b>Note:</b> As noted in <a href="#datatype" shape="rect">Datatype (&#167;2.1)</a>, certain uses of the <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> facet may eliminate from the lexical space the canonical forms of some values in the value space; this can be inconvenient for applications which write out the canonical form of a value and rely on being able to read it in again as a legal lexical form. This specification provides no recourse in such situations; applications are free to deal with it as they see fit. Caution is advised. </div></div></div><div class="div4"> <h5><a name="pattern-constraints" id="pattern-constraints" shape="rect"></a>4.3.4.5 Constraints on pattern Schema Components</h5><div class="constraintnote"><a id="cos-pattern-restriction" name="cos-pattern-restriction" shape="rect"></a><b>Schema Component Constraint: Valid restriction of pattern</b><br clear="none" /><div class="constraint"><div class="p">It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if there is any member of the <a href="#f-p-value" class="propref" shape="rect">{value}</a> of the <a href="#f-p" class="compref" shape="rect">pattern</a> facet on the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> which is not also a member of the <a href="#f-p-value" class="propref" shape="rect">{value}</a>.</div><div class="note"><div class="p"><b>Note:</b> For components constructed from XML representations in schema documents, the satisfaction of this constraint is a consequence of the XML mapping rules: any pattern imposed by a simple type definition <var>S</var> will always also be imposed by any type derived from <var>S</var> by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a>. This constraint ensures that components constructed by other means (so-called "born-binary" components) similarly preserve <a href="#f-p" class="compref" shape="rect">pattern</a> facets across <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a>. </div></div></div></div></div></div><div class="div3"> <h4><a name="rf-enumeration" id="rf-enumeration" shape="rect"></a>4.3.5 enumeration</h4><p> <span class="termdef"><a name="dt-enumeration" id="dt-enumeration" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>enumeration</b> constrains the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to a specified set of values. </span> </p><p> <b>enumeration</b> does not impose an order relation on the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> it creates; the value of the <a href="#dt-ordered" class="termref" shape="rect"><span class="arrow">&#183;</span>ordered<span class="arrow">&#183;</span></a> property of the <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> datatype remains that of the datatype from which it is <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a>. </p><p> <a href="#dt-enumeration" class="termref" shape="rect"><span class="arrow">&#183;</span>enumeration<span class="arrow">&#183;</span></a> provides for: </p><ul><li><div class="p"> Constraining a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to a specified set of values. </div></li></ul><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following example is a <a href="#std" class="compref" shape="rect">Simple Type Definition</a> for a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype which limits the values of dates to the three US holidays enumerated. This <a href="#std" class="compref" shape="rect">Simple Type Definition</a> would appear in a schema authored by an "end-user" and shows how to define a datatype by enumerating the values in its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.&#160; The enumerated values must be type-valid <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> for the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='holidays'&gt; &lt;annotation&gt; &lt;documentation&gt;some US holidays&lt;/documentation&gt; &lt;/annotation&gt; &lt;restriction base='gMonthDay'&gt; &lt;enumeration value='--01-01'&gt; &lt;annotation&gt; &lt;documentation&gt;New Year's day&lt;/documentation&gt; &lt;/annotation&gt; &lt;/enumeration&gt; &lt;enumeration value='--07-04'&gt; &lt;annotation&gt; &lt;documentation&gt;4th of July&lt;/documentation&gt; &lt;/annotation&gt; &lt;/enumeration&gt; &lt;enumeration value='--12-25'&gt; &lt;annotation&gt; &lt;documentation&gt;Christmas&lt;/documentation&gt; &lt;/annotation&gt; &lt;/enumeration&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div></div><div class="div4"> <h5><a name="dc-enumeration" id="dc-enumeration" shape="rect"></a>4.3.5.1 The enumeration Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-e" id="f-e" shape="rect">enumeration</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-e-annotations" shape="rect" id="f-e-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-e-value" shape="rect" id="f-e-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> <div class="ownDesc"> <p> A set of values from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</p></div> </div> </div> </div></div> </div> </div> </div><div class="div4"> <h5><a name="xr-enumeration" id="xr-enumeration" shape="rect"></a>4.3.5.2 XML Representation of enumeration Schema Components</h5><p> The XML representation for an <a href="#f-e" class="compref" shape="rect">enumeration</a> schema component is one or more <a href="#element-enumeration" class="eltref" shape="rect">&lt;enumeration&gt;</a> element information items. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>enumeration</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-enumeration" name="element-enumeration" shape="rect">&lt;enumeration</a><br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#dt-anySimpleType" shape="rect">anySimpleType</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/enumeration&gt;</div><div class="reprdep"> </div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-enumeration" shape="rect">enumeration</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-e-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The appropriate <b>case</b> among the following:<div class="constraintlist"><div class="clnumber">1 <b>If </b>there is only one <a href="#element-enumeration" class="eltref" shape="rect">&lt;enumeration&gt;</a> among the <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a> of a <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a>, <b>then </b>a set with one member, the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of its <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, interpreted as an instance of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</div><div class="clnumber">2 <b>otherwise </b>a set of the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual values</a> of all the <a href="#element-enumeration" class="eltref" shape="rect">&lt;enumeration&gt;</a> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a>'s <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attributes]</a>, interpreted as instances of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</div></div> <div class="note"><div class="p"><b>Note:</b> The <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> is declared as having type <a href="#dt-anySimpleType" class="termref" shape="rect"><span class="arrow">&#183;</span><code>anySimpleType</code><span class="arrow">&#183;</span></a>, but the <a href="#f-e-value" class="propref" shape="rect">{value}</a> property of the <a href="#f-e" class="compref" shape="rect">enumeration</a> facet <span class="rfc2119">must</span> be a member of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. So in mapping from the XML representation to the <a href="#f-e" class="compref" shape="rect">enumeration</a> component, the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> is identified by using the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </div></div> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-e-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> A (possibly empty) sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components, one for each <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">&lt;annotation&gt;</a> among the <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a> of the <a href="#element-enumeration" class="eltref" shape="rect">&lt;enumeration&gt;</a>s among the <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a> of a <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a>, in order.</div></div></div></div><div class="div4"> <h5><a name="enumeration-rep-constr" id="enumeration-rep-constr" shape="rect"></a>4.3.5.3 Constraints on XML Representation of enumeration</h5><div class="constraintnote"><a id="src-enumeration-value" name="src-enumeration-value" shape="rect"></a><b>Schema Representation Constraint: Enumeration value</b><br clear="none" /><div class="constraint"><div class="p">The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-nv" shape="rect">normalized value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> must be <a href="#cvc-datatype-valid" shape="rect">Datatype Valid (&#167;4.1.4)</a> with respect to the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> of the <a href="#std" class="compref" shape="rect">Simple Type Definition</a> corresponding to the nearest <a href="#element-simpleType" class="eltref" shape="rect">&lt;simpleType&gt;</a> ancestor element.</div></div></div></div><div class="div4"> <h5><a name="enumeration-validation-rules" id="enumeration-validation-rules" shape="rect"></a>4.3.5.4 enumeration Validation Rules</h5><div class="constraintnote"><a id="cvc-enumeration-valid" name="cvc-enumeration-valid" shape="rect"></a><b>Validation Rule: enumeration valid</b><br clear="none" /><div class="constraint"><div class="p"> A value in a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is facet-valid with respect to <a href="#dt-enumeration" class="termref" shape="rect"><span class="arrow">&#183;</span>enumeration<span class="arrow">&#183;</span></a> if and only if the value is equal or identical to one of the values specified in <a href="#f-e-value" class="propref" shape="rect">{value}</a>. </div></div></div><div class="note"><div class="p"><b>Note:</b> As specified normatively elsewhere, for purposes of checking enumerations, no distinction is made between an atomic value <var>V</var> and a list of length one containing <var>V</var> as its only item.</div><div class="p">In this question, the behavior of this specification is thus the same as the behavior specified by <a href="#F_O" shape="rect">[XQuery 1.0 and XPath 2.0 Functions and Operators]</a> and related specifications.</div></div></div><div class="div4"> <h5><a name="enumeration-coss" id="enumeration-coss" shape="rect"></a>4.3.5.5 Constraints on enumeration Schema Components</h5><div class="constraintnote"><a id="enumeration-valid-restriction" name="enumeration-valid-restriction" shape="rect"></a><b>Schema Component Constraint: enumeration valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if any member of <a href="#f-e-value" class="propref" shape="rect">{value}</a> is not in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </div></div></div></div></div><div class="div3"> <h4><a name="rf-whiteSpace" id="rf-whiteSpace" shape="rect"></a>4.3.6 whiteSpace</h4><p> <span class="termdef"><a name="dt-whiteSpace" id="dt-whiteSpace" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>whiteSpace</b> constrains the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of types <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#string" shape="rect">string</a> such that the various behaviors specified in <a href="https://www.w3.org/TR/xml11/#AVNormalize" shape="rect">Attribute Value Normalization</a> in <a href="#XML" shape="rect">[XML]</a> are realized.&#160; The value of <b>whiteSpace</b> must be one of {preserve, replace, collapse}. </span> </p><div class="glist"><div class="gitem"><div class="giLabel">preserve</div><div class="giDef"><div class="p"> No normalization is done, the value is not changed (this is the behavior required by <a href="#XML" shape="rect">[XML]</a> for element content) </div></div></div><div class="gitem"><div class="giLabel">replace</div><div class="giDef"><div class="p"> All occurrences of #x9 (tab), #xA (line feed) and #xD (carriage return) are replaced with #x20 (space) </div></div></div><div class="gitem"><div class="giLabel">collapse</div><div class="giDef"><div class="p"> After the processing implied by <b>replace</b>, contiguous sequences of #x20's are collapsed to a single #x20, and any #x20 at the start or end of the string is then removed. </div></div></div></div><div class="note"><div class="p"><b>Note:</b> The notation #xA used here (and elsewhere in this specification) represents the Universal Character Set (UCS) code point <code>hexadecimal A</code> (line feed), which is denoted by U+000A.&#160; This notation is to be distinguished from <code>&amp;#xA;</code>, which is the XML <a href="https://www.w3.org/TR/xml11/#NT-CharRef" shape="rect">character reference</a> to that same UCS code point. </div></div><p> <b>whiteSpace</b> is applicable to all <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> and <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatypes.&#160; For all <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatypes other than <a href="#string" shape="rect">string</a> (and types <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> from it) the value of <b>whiteSpace</b> is <code>collapse</code> and cannot be changed by a schema author; for <a href="#string" shape="rect">string</a> the value of <b>whiteSpace</b> is <code>preserve</code>; for any type <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> from <a href="#string" shape="rect">string</a> the value of <b>whiteSpace</b> can be any of the three legal values (as long as the value is at least as restrictive as the value of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>; see <a href="#whiteSpace-coss" shape="rect">Constraints on whiteSpace Schema Components (&#167;4.3.6.4)</a>).&#160; For all datatypes <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> by <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> the value of <b>whiteSpace</b> is <code>collapse</code> and cannot be changed by a schema author.&#160; For all datatypes <a href="#dt-constructed" class="termref" shape="rect"><span class="arrow">&#183;</span>constructed<span class="arrow">&#183;</span></a> by <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> &#160;<b>whiteSpace</b> does not apply directly; however, the normalization behavior of <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> types is controlled by the value of <b>whiteSpace</b> on that one of the <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic members<span class="arrow">&#183;</span></a> against which the <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> is successfully validated. </p><div class="note"><div class="p"><b>Note:</b> For more information on <b>whiteSpace</b>, see the discussion on white space normalization in <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#components" shape="rect">Schema Component Details</a> in <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div><p> <a href="#dt-whiteSpace" class="termref" shape="rect"><span class="arrow">&#183;</span>whiteSpace<span class="arrow">&#183;</span></a> provides for: </p><ul><li><div class="p"> Constraining a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> according to the white space normalization rules. </div></li></ul><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following example is the <a href="#std" class="compref" shape="rect">Simple Type Definition</a> for the <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> <a href="#token" shape="rect">token</a> datatype. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='token'&gt; &lt;restriction base='normalizedString'&gt; &lt;whiteSpace value='collapse'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div></div><div class="note"><div class="p"><b>Note:</b> The values "<code>replace</code>" and "<code>collapse</code>" may appear to provide a convenient way to "unwrap" text (i.e. undo the effects of pretty-printing and word-wrapping). In some cases, especially highly constrained data consisting of lists of artificial tokens such as part numbers or other identifiers, this appearance is correct. For natural-language data, however, the whitespace processing prescribed for these values is not only unreliable but will systematically remove the information needed to perform unwrapping correctly. For Asian scripts, for example, a correct unwrapping process will replace line boundaries not with blanks but with zero-width separators or nothing. In consequence, it is normally unwise to use these values for natural-language data, or for any data other than lists of highly constrained tokens.</div></div><div class="div4"> <h5><a name="dc-whiteSpace" id="dc-whiteSpace" shape="rect"></a>4.3.6.1 The whiteSpace Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-w" id="f-w" shape="rect">whiteSpace</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-w-annotations" shape="rect" id="f-w-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-w-value" shape="rect" id="f-w-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> One of {<span class="enumval">preserve</span>, <span class="enumval">replace</span>, <span class="enumval">collapse</span>}. Required.</div> </div> <div class="propDefn"><a name="f-w-fixed" shape="rect" id="f-w-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> If <a href="#f-w-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then types for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> cannot specify a value for <a href="#f-w" class="compref" shape="rect">whiteSpace</a> other than <a href="#f-w-value" class="propref" shape="rect">{value}</a>. </p></div><div class="div4"> <h5><a name="xr-whiteSpace" id="xr-whiteSpace" shape="rect"></a>4.3.6.2 XML Representation of whiteSpace Schema Components</h5><p> The XML representation for a <a href="#f-w" class="compref" shape="rect">whiteSpace</a> schema component is a <a href="#element-whiteSpace" class="eltref" shape="rect">&lt;whiteSpace&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>whiteSpace</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-whiteSpace" name="element-whiteSpace" shape="rect">&lt;whiteSpace</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = (<var>collapse</var> | <var>preserve</var> | <var>replace</var>)<br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/whiteSpace&gt;</div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-whiteSpace" shape="rect">whiteSpace</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-w-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-w-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-w-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-whiteSpace" class="eltref" shape="rect">&lt;whiteSpace&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="whiteSpace-validation-rules" id="whiteSpace-validation-rules" shape="rect"></a>4.3.6.3 whiteSpace Validation Rules</h5><div class="note"><div class="p"><b>Note:</b> There are no <a href="#dt-cvc" class="termref" shape="rect"><span class="arrow">&#183;</span>Validation Rule<span class="arrow">&#183;</span></a>s associated with <a href="#dt-whiteSpace" class="termref" shape="rect"><span class="arrow">&#183;</span>whiteSpace<span class="arrow">&#183;</span></a>. For more information, see the discussion on white space normalization in <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#components" shape="rect">Schema Component Details</a> in <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, in particular the section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#sec-wsnormalization" shape="rect">3.1.4 White Space Normalization during Validation</a>. </div></div></div><div class="div4"> <h5><a name="whiteSpace-coss" id="whiteSpace-coss" shape="rect"></a>4.3.6.4 Constraints on whiteSpace Schema Components</h5><div class="constraintnote"><a id="whiteSpace-valid-restriction" name="whiteSpace-valid-restriction" shape="rect"></a><b>Schema Component Constraint: whiteSpace valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if <a href="#f-w" class="compref" shape="rect">whiteSpace</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and any of the following conditions is true: </div><div class="constraintlist"><div class="clnumber">1 <span class="p"> <a href="#f-w-value" class="propref" shape="rect">{value}</a> is <em>replace</em> or <em>preserve</em> and the <a href="#f-w-value" class="propref" shape="rect">{value}</a> of the parent <a href="#f-w" class="compref" shape="rect">whiteSpace</a> is <em>collapse</em> </span></div> <div class="clnumber">2 <span class="p"> <a href="#f-w-value" class="propref" shape="rect">{value}</a> is <em>preserve</em> and the <a href="#f-w-value" class="propref" shape="rect">{value}</a> of the parent <a href="#f-w" class="compref" shape="rect">whiteSpace</a> is <em>replace</em> </span></div> </div></div></div><div class="note"><div class="p"><b>Note:</b> In order of increasing restrictiveness, the legal values for the <a href="#f-w" class="compref" shape="rect">whiteSpace</a> facet are <b><i>preserve</i></b>, <b><i>collapse</i></b>, and <b><i>replace</i></b>. The more restrictive keywords are more restrictive not in the sense of accepting progressively fewer instance documents but in the sense that each corresponds to a progressively smaller, more tightly restricted value space.</div></div></div></div><div class="div3"> <h4><a name="rf-maxInclusive" id="rf-maxInclusive" shape="rect"></a>4.3.7 maxInclusive</h4><p> <span class="termdef"><a name="dt-maxInclusive" id="dt-maxInclusive" title="" shape="rect">[Definition:]&#160;&#160;</a> maxInclusive is the inclusive upper bound of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> for a datatype with the <a href="#dt-ordered" class="termref" shape="rect"><span class="arrow">&#183;</span>ordered<span class="arrow">&#183;</span></a> property.&#160; The value of <b>maxInclusive</b>&#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to some value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. </span> </p><p> <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> provides for: </p><ul><li><div class="p"> Constraining a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to values with a specific inclusive upper bound. </div></li></ul><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following is the definition of a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype which limits values to integers less than or equal to 100, using <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a>. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='one-hundred-or-less'&gt; &lt;restriction base='integer'&gt; &lt;maxInclusive value='100'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div></div><div class="div4"> <h5><a name="dc-maxInclusive" id="dc-maxInclusive" shape="rect"></a>4.3.7.1 The maxInclusive Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-mai" id="f-mai" shape="rect">maxInclusive</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-mai-annotations" shape="rect" id="f-mai-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-mai-value" shape="rect" id="f-mai-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> Required.<div class="ownDesc"> <p>A value from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</p></div> </div> </div> <div class="propDefn"><a name="f-mai-fixed" shape="rect" id="f-mai-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> If <a href="#f-mai-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then types for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> cannot specify a value for <a href="#f-mai" class="compref" shape="rect">maxInclusive</a> other than <a href="#f-mai-value" class="propref" shape="rect">{value}</a>. </p></div><div class="div4"> <h5><a name="xr-maxInclusive" id="xr-maxInclusive" shape="rect"></a>4.3.7.2 XML Representation of maxInclusive Schema Components</h5><p> The XML representation for a <a href="#f-mai" class="compref" shape="rect">maxInclusive</a> schema component is a <a href="#element-maxInclusive" class="eltref" shape="rect">&lt;maxInclusive&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>maxInclusive</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-maxInclusive" name="element-maxInclusive" shape="rect">&lt;maxInclusive</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#dt-anySimpleType" shape="rect">anySimpleType</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/maxInclusive&gt;</div><div class="reprdep"> <a href="#f-mai-value" class="propref" shape="rect">{value}</a>&#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to some value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </div><div class="reprcompmulti"><div class="reprHead"><a href="#dt-maxInclusive" shape="rect">maxInclusive</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mai-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mai-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mai-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-maxInclusive" class="eltref" shape="rect">&lt;maxInclusive&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="maxInclusive-validation-rules" id="maxInclusive-validation-rules" shape="rect"></a>4.3.7.3 maxInclusive Validation Rules</h5><div class="constraintnote"><a id="cvc-maxInclusive-valid" name="cvc-maxInclusive-valid" shape="rect"></a><b>Validation Rule: maxInclusive Valid</b><br clear="none" /><div class="constraint"><div class="p"> A value in an <a href="#dt-ordered" class="termref" shape="rect"><span class="arrow">&#183;</span>ordered<span class="arrow">&#183;</span></a>&#160;<a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is facet-valid with respect to <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> if and only if the value is less than or equal to <a href="#f-mie-value" class="propref" shape="rect">{value}</a>, according to the datatype's order relation. </div></div></div></div><div class="div4"> <h5><a name="maxInclusive-coss" id="maxInclusive-coss" shape="rect"></a>4.3.7.4 Constraints on maxInclusive Schema Components</h5><div class="constraintnote"><a id="minInclusive-less-than-equal-to-maxInclusive" name="minInclusive-less-than-equal-to-maxInclusive" shape="rect"></a><b>Schema Component Constraint: minInclusive &lt;= maxInclusive</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> for the value specified for <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> to be greater than the value specified for <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> for the same datatype. </div></div></div><div class="constraintnote"><a id="maxInclusive-valid-restriction" name="maxInclusive-valid-restriction" shape="rect"></a><b>Schema Component Constraint: maxInclusive valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if any of the following conditions is true: </div><div class="constraintlist"><div class="clnumber">1 <span class="p"> <a href="#f-mai" class="compref" shape="rect">maxInclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mai-value" class="propref" shape="rect">{value}</a> is greater than the <a href="#f-mai-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mai" class="compref" shape="rect">maxInclusive</a>. </span></div> <div class="clnumber">2 <span class="p"> <a href="#f-mae" class="compref" shape="rect">maxExclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mai-value" class="propref" shape="rect">{value}</a> is greater than or equal to the <a href="#f-mae-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mae" class="compref" shape="rect">maxExclusive</a>. </span></div> <div class="clnumber">3 <span class="p"> <a href="#f-mii" class="compref" shape="rect">minInclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mai-value" class="propref" shape="rect">{value}</a> is less than the <a href="#f-mii-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mii" class="compref" shape="rect">minInclusive</a>. </span></div> <div class="clnumber">4 <span class="p"> <a href="#f-mie" class="compref" shape="rect">minExclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mai-value" class="propref" shape="rect">{value}</a> is less than or equal to the <a href="#f-mie-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mie" class="compref" shape="rect">minExclusive</a>. </span></div> </div></div></div></div></div><div class="div3"> <h4><a name="rf-maxExclusive" id="rf-maxExclusive" shape="rect"></a>4.3.8 maxExclusive</h4><p> <span class="termdef"><a name="dt-maxExclusive" id="dt-maxExclusive" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>maxExclusive</b> is the exclusive upper bound of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> for a datatype with the <a href="#dt-ordered" class="termref" shape="rect"><span class="arrow">&#183;</span>ordered<span class="arrow">&#183;</span></a> property.&#160; The value of <b>maxExclusive</b> &#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to some value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> or be equal to <a href="#f-mae-value" class="propref" shape="rect">{value}</a> in <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </span> </p><p> <a href="#dt-maxExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxExclusive<span class="arrow">&#183;</span></a> provides for: </p><ul><li><div class="p"> Constraining a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to values with a specific exclusive upper bound. </div></li></ul><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following is the definition of a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype which limits values to integers less than or equal to 100, using <a href="#dt-maxExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxExclusive<span class="arrow">&#183;</span></a>. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='less-than-one-hundred-and-one'&gt; &lt;restriction base='integer'&gt; &lt;maxExclusive value='101'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div><div class="exampleWrapper"> <div class="p"> Note that the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of this datatype is identical to the previous one (named 'one-hundred-or-less'). </div></div></div><div class="div4"> <h5><a name="dc-maxExclusive" id="dc-maxExclusive" shape="rect"></a>4.3.8.1 The maxExclusive Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-mae" id="f-mae" shape="rect">maxExclusive</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-mae-annotations" shape="rect" id="f-mae-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-mae-value" shape="rect" id="f-mae-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> Required.<div class="ownDesc"> <p>A value from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</p></div> </div> </div> <div class="propDefn"><a name="f-mae-fixed" shape="rect" id="f-mae-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> If <a href="#f-mae-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then types for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> cannot specify a value for <a href="#f-mae" class="compref" shape="rect">maxExclusive</a> other than <a href="#f-mae-value" class="propref" shape="rect">{value}</a>. </p></div><div class="div4"> <h5><a name="xr-maxExclusive" id="xr-maxExclusive" shape="rect"></a>4.3.8.2 XML Representation of maxExclusive Schema Components</h5><p> The XML representation for a <a href="#f-mae" class="compref" shape="rect">maxExclusive</a> schema component is a <a href="#element-maxExclusive" class="eltref" shape="rect">&lt;maxExclusive&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>maxExclusive</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-maxExclusive" name="element-maxExclusive" shape="rect">&lt;maxExclusive</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#dt-anySimpleType" shape="rect">anySimpleType</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/maxExclusive&gt;</div><div class="reprdep"> <a href="#f-mae-value" class="propref" shape="rect">{value}</a>&#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to some value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </div><div class="reprcompmulti"><div class="reprHead"><a href="#dt-maxExclusive" shape="rect">maxExclusive</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mae-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mae-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mae-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-maxExclusive" class="eltref" shape="rect">&lt;maxExclusive&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="maxExclusive-validation-rules" id="maxExclusive-validation-rules" shape="rect"></a>4.3.8.3 maxExclusive Validation Rules</h5><div class="constraintnote"><a id="cvc-maxExclusive-valid" name="cvc-maxExclusive-valid" shape="rect"></a><b>Validation Rule: maxExclusive Valid</b><br clear="none" /><div class="constraint"><div class="p"> A value in an <a href="#dt-ordered" class="termref" shape="rect"><span class="arrow">&#183;</span>ordered<span class="arrow">&#183;</span></a> <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is facet-valid with respect to <a href="#dt-maxExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxExclusive<span class="arrow">&#183;</span></a> if and only if the value is less than <a href="#f-mie-value" class="propref" shape="rect">{value}</a>, according to the datatype's order relation. </div></div></div></div><div class="div4"> <h5><a name="maxExclusive-coss" id="maxExclusive-coss" shape="rect"></a>4.3.8.4 Constraints on maxExclusive Schema Components</h5><div class="constraintnote"><a id="maxInclusive-maxExclusive" name="maxInclusive-maxExclusive" shape="rect"></a><b>Schema Component Constraint: maxInclusive and maxExclusive</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> for both <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> and <a href="#dt-maxExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxExclusive<span class="arrow">&#183;</span></a> to be specified in the same derivation step of a <a href="#std" class="compref" shape="rect">Simple Type Definition</a>. </div></div></div><div class="constraintnote"><a id="minExclusive-less-than-equal-to-maxExclusive" name="minExclusive-less-than-equal-to-maxExclusive" shape="rect"></a><b>Schema Component Constraint: minExclusive &lt;= maxExclusive</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> for the value specified for <a href="#dt-minExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minExclusive<span class="arrow">&#183;</span></a> to be greater than the value specified for <a href="#dt-maxExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxExclusive<span class="arrow">&#183;</span></a> for the same datatype. </div></div></div><div class="constraintnote"><a id="maxExclusive-valid-restriction" name="maxExclusive-valid-restriction" shape="rect"></a><b>Schema Component Constraint: maxExclusive valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if any of the following conditions is true: </div><div class="constraintlist"><div class="clnumber">1 <span class="p"> <a href="#f-mae" class="compref" shape="rect">maxExclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mae-value" class="propref" shape="rect">{value}</a> is greater than the <a href="#f-mae-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mae" class="compref" shape="rect">maxExclusive</a>. </span></div> <div class="clnumber">2 <span class="p"> <a href="#f-mai" class="compref" shape="rect">maxInclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mae-value" class="propref" shape="rect">{value}</a> is greater than the <a href="#f-mai-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mai" class="compref" shape="rect">maxInclusive</a>. </span></div> <div class="clnumber">3 <span class="p"> <a href="#f-mii" class="compref" shape="rect">minInclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mae-value" class="propref" shape="rect">{value}</a> is less than or equal to the <a href="#f-mii-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mii" class="compref" shape="rect">minInclusive</a>. </span></div> <div class="clnumber">4 <span class="p"> <a href="#f-mie" class="compref" shape="rect">minExclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mae-value" class="propref" shape="rect">{value}</a> is less than or equal to the <a href="#f-mie-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mie" class="compref" shape="rect">minExclusive</a>. </span></div> </div></div></div></div></div><div class="div3"> <h4><a name="rf-minExclusive" id="rf-minExclusive" shape="rect"></a>4.3.9 minExclusive</h4><p> <span class="termdef"><a name="dt-minExclusive" id="dt-minExclusive" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>minExclusive</b> is the exclusive lower bound of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> for a datatype with the <a href="#dt-ordered" class="termref" shape="rect"><span class="arrow">&#183;</span>ordered<span class="arrow">&#183;</span></a> property. The value of <b>minExclusive</b>&#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to some value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> or be equal to <a href="#f-mie-value" class="propref" shape="rect">{value}</a> in <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </span> </p><p> <a href="#dt-minExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minExclusive<span class="arrow">&#183;</span></a> provides for: </p><ul><li><div class="p"> Constraining a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to values with a specific exclusive lower bound. </div></li></ul><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following is the definition of a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype which limits values to integers greater than or equal to 100, using <a href="#dt-minExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minExclusive<span class="arrow">&#183;</span></a>. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='more-than-ninety-nine'&gt; &lt;restriction base='integer'&gt; &lt;minExclusive value='99'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div><div class="exampleWrapper"> <div class="p"> Note that the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of this datatype is identical to the following one (named 'one-hundred-or-more'). </div></div></div><div class="div4"> <h5><a name="dc-minExclusive" id="dc-minExclusive" shape="rect"></a>4.3.9.1 The minExclusive Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-mie" id="f-mie" shape="rect">minExclusive</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-mie-annotations" shape="rect" id="f-mie-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-mie-value" shape="rect" id="f-mie-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> Required.<div class="ownDesc"> <p>A value from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</p></div> </div> </div> <div class="propDefn"><a name="f-mie-fixed" shape="rect" id="f-mie-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> If <a href="#f-mie-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then types for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> cannot specify a value for <a href="#f-mie" class="compref" shape="rect">minExclusive</a> other than <a href="#f-mie-value" class="propref" shape="rect">{value}</a>. </p></div><div class="div4"> <h5><a name="xr-minExclusive" id="xr-minExclusive" shape="rect"></a>4.3.9.2 XML Representation of minExclusive Schema Components</h5><p> The XML representation for a <a href="#f-mie" class="compref" shape="rect">minExclusive</a> schema component is a <a href="#element-minExclusive" class="eltref" shape="rect">&lt;minExclusive&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>minExclusive</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-minExclusive" name="element-minExclusive" shape="rect">&lt;minExclusive</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#dt-anySimpleType" shape="rect">anySimpleType</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/minExclusive&gt;</div><div class="reprdep"> <a href="#f-mie-value" class="propref" shape="rect">{value}</a>&#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to some value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </div><div class="reprcompmulti"><div class="reprHead"><a href="#dt-minExclusive" shape="rect">minExclusive</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mie-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mie-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mie-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-minExclusive" class="eltref" shape="rect">&lt;minExclusive&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="minExclusive-validation-rules" id="minExclusive-validation-rules" shape="rect"></a>4.3.9.3 minExclusive Validation Rules</h5><div class="constraintnote"><a id="cvc-minExclusive-valid" name="cvc-minExclusive-valid" shape="rect"></a><b>Validation Rule: minExclusive Valid</b><br clear="none" /><div class="constraint"><div class="p"> A value in an <a href="#dt-ordered" class="termref" shape="rect"><span class="arrow">&#183;</span>ordered<span class="arrow">&#183;</span></a>&#160;<a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is facet-valid with respect to <a href="#dt-minExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minExclusive<span class="arrow">&#183;</span></a> if and only if the value is greater than <a href="#f-mie-value" class="propref" shape="rect">{value}</a>, according to the datatype's order relation. </div></div></div></div><div class="div4"> <h5><a name="minExclusive-coss" id="minExclusive-coss" shape="rect"></a>4.3.9.4 Constraints on minExclusive Schema Components</h5><div class="constraintnote"><a id="minInclusive-minExclusive" name="minInclusive-minExclusive" shape="rect"></a><b>Schema Component Constraint: minInclusive and minExclusive</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> for both <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> and <a href="#dt-minExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minExclusive<span class="arrow">&#183;</span></a> to be specified in the same derivation step of a <a href="#std" class="compref" shape="rect">Simple Type Definition</a>. </div></div></div><div class="constraintnote"><a id="minExclusive-less-than-maxInclusive" name="minExclusive-less-than-maxInclusive" shape="rect"></a><b>Schema Component Constraint: minExclusive &lt; maxInclusive</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> for the value specified for <a href="#dt-minExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minExclusive<span class="arrow">&#183;</span></a> to be greater than or equal to the value specified for <a href="#dt-maxInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxInclusive<span class="arrow">&#183;</span></a> for the same datatype. </div></div></div><div class="constraintnote"><a id="minExclusive-valid-restriction" name="minExclusive-valid-restriction" shape="rect"></a><b>Schema Component Constraint: minExclusive valid restriction</b><br clear="none" /><div class="constraint"><div class="p">It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if any of the following conditions is true:</div><div class="constraintlist"><div class="clnumber">1 <span class="p"> <a href="#f-mie" class="compref" shape="rect">minExclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mie-value" class="propref" shape="rect">{value}</a> is less than the <a href="#f-mie-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mie" class="compref" shape="rect">minExclusive</a>. </span></div> <div class="clnumber">2 <span class="p"> <a href="#f-mii" class="compref" shape="rect">minInclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mie-value" class="propref" shape="rect">{value}</a> is less than the <a href="#f-mii-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mii" class="compref" shape="rect">minInclusive</a>. </span></div> <div class="clnumber">3 <span class="p"> <a href="#f-mai" class="compref" shape="rect">maxInclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mie-value" class="propref" shape="rect">{value}</a> is greater than or equal to the <a href="#f-mai-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mai" class="compref" shape="rect">maxInclusive</a>. </span></div> <div class="clnumber">4 <span class="p"> <a href="#f-mae" class="compref" shape="rect">maxExclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mae-value" class="propref" shape="rect">{value}</a> is greater than or equal to the <a href="#f-mae-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mae" class="compref" shape="rect">maxExclusive</a>. </span></div> </div></div></div></div></div><div class="div3"> <h4><a name="rf-minInclusive" id="rf-minInclusive" shape="rect"></a>4.3.10 minInclusive</h4><p> <span class="termdef"><a name="dt-minInclusive" id="dt-minInclusive" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>minInclusive</b> is the inclusive lower bound of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> for a datatype with the <a href="#dt-ordered" class="termref" shape="rect"><span class="arrow">&#183;</span>ordered<span class="arrow">&#183;</span></a> property.&#160; The value of <b>minInclusive</b> &#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to some value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. </span> </p><p> <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> provides for: </p><ul><li><div class="p"> Constraining a <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to values with a specific inclusive lower bound. </div></li></ul><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following is the definition of a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype which limits values to integers greater than or equal to 100, using <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a>. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='one-hundred-or-more'&gt; &lt;restriction base='integer'&gt; &lt;minInclusive value='100'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div></div><div class="div4"> <h5><a name="dc-minInclusive" id="dc-minInclusive" shape="rect"></a>4.3.10.1 The minInclusive Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-mii" id="f-mii" shape="rect">minInclusive</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-mii-annotations" shape="rect" id="f-mii-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-mii-value" shape="rect" id="f-mii-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> Required.<div class="ownDesc"> <p>A value from the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</p></div> </div> </div> <div class="propDefn"><a name="f-mii-fixed" shape="rect" id="f-mii-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> If <a href="#f-mii-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then types for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> cannot specify a value for <a href="#f-mii" class="compref" shape="rect">minInclusive</a> other than <a href="#f-mii-value" class="propref" shape="rect">{value}</a>. </p></div><div class="div4"> <h5><a name="xr-minInclusive" id="xr-minInclusive" shape="rect"></a>4.3.10.2 XML Representation of minInclusive Schema Components</h5><p> The XML representation for a <a href="#f-mii" class="compref" shape="rect">minInclusive</a> schema component is a <a href="#element-minInclusive" class="eltref" shape="rect">&lt;minInclusive&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>minInclusive</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-minInclusive" name="element-minInclusive" shape="rect">&lt;minInclusive</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#dt-anySimpleType" shape="rect">anySimpleType</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/minInclusive&gt;</div><div class="reprdep"> <a href="#f-mii-value" class="propref" shape="rect">{value}</a>&#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be equal to some value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </div><div class="reprcompmulti"><div class="reprHead"><a href="#dt-minInclusive" shape="rect">minInclusive</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mii-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mii-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-mii-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-minInclusive" class="eltref" shape="rect">&lt;minInclusive&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="minInclusive-validation-rules" id="minInclusive-validation-rules" shape="rect"></a>4.3.10.3 minInclusive Validation Rules</h5><div class="constraintnote"><a id="cvc-minInclusive-valid" name="cvc-minInclusive-valid" shape="rect"></a><b>Validation Rule: minInclusive Valid</b><br clear="none" /><div class="constraint"><div class="p"> A value in an <a href="#dt-ordered" class="termref" shape="rect"><span class="arrow">&#183;</span>ordered<span class="arrow">&#183;</span></a>&#160;<a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is facet-valid with respect to <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> if and only if the value is greater than or equal to <a href="#f-mie-value" class="propref" shape="rect">{value}</a>, according to the datatype's order relation.</div></div></div></div><div class="div4"> <h5><a name="minInclusive-coss" id="minInclusive-coss" shape="rect"></a>4.3.10.4 Constraints on minInclusive Schema Components</h5><div class="constraintnote"><a id="minInclusive-less-than-maxExclusive" name="minInclusive-less-than-maxExclusive" shape="rect"></a><b>Schema Component Constraint: minInclusive &lt; maxExclusive</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> for the value specified for <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> to be greater than or equal to the value specified for <a href="#dt-maxExclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>maxExclusive<span class="arrow">&#183;</span></a> for the same datatype. </div></div></div><div class="constraintnote"><a id="minInclusive-valid-restriction" name="minInclusive-valid-restriction" shape="rect"></a><b>Schema Component Constraint: minInclusive valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if any of the following conditions is true: </div><div class="constraintlist"><div class="clnumber">1 <span class="p"> <a href="#f-mii" class="compref" shape="rect">minInclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mii-value" class="propref" shape="rect">{value}</a> is less than the <a href="#f-mii-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mii" class="compref" shape="rect">minInclusive</a>. </span></div> <div class="clnumber">2 <span class="p"> <a href="#f-mai" class="compref" shape="rect">maxInclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mii-value" class="propref" shape="rect">{value}</a> is greater the <a href="#f-mai-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mai" class="compref" shape="rect">maxInclusive</a>. </span></div> <div class="clnumber">3 <span class="p"> <a href="#f-mie" class="compref" shape="rect">minExclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mii-value" class="propref" shape="rect">{value}</a> is less than or equal to the <a href="#f-mie-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mie" class="compref" shape="rect">minExclusive</a>. </span></div> <div class="clnumber">4 <span class="p"> <a href="#f-mae" class="compref" shape="rect">maxExclusive</a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-mii-value" class="propref" shape="rect">{value}</a> is greater than or equal to the <a href="#f-mae-value" class="propref" shape="rect">{value}</a> of that <a href="#f-mae" class="compref" shape="rect">maxExclusive</a>. </span></div> </div></div></div></div></div><div class="div3"> <h4><a name="rf-totalDigits" id="rf-totalDigits" shape="rect"></a>4.3.11 totalDigits</h4><p> <span class="termdef"><a name="dt-totalDigits" id="dt-totalDigits" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>totalDigits</b> restricts the magnitude and arithmetic precision of values in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> of <a href="#decimal" shape="rect">decimal</a> and datatypes derived from it. </span> </p><p> For <a href="#decimal" shape="rect">decimal</a>, if the <a href="#f-td-value" class="propref" shape="rect">{value}</a> of <a href="#f-td" class="compref" shape="rect">totalDigits</a> is <var>t</var>, the effect is to require that values be equal to <var>i</var>&#160;/&#160;10<sup><var>n</var></sup>, for some integers <var>i</var> and <var>n</var>, with |&#160;<var>i</var>&#160;| &lt; 10<sup><var>t</var></sup> and 0&#160;&#8804;&#160;<var>n</var>&#160;&#8804;&#160;<var>t</var>. This has as a consequence that the values are expressible using at most <var>t</var> digits in decimal notation. </p><p> The <a href="#f-td-value" class="propref" shape="rect">{value}</a> of <a href="#f-td" class="compref" shape="rect">totalDigits</a> <span class="rfc2119">must</span> be a <a href="#positiveInteger" shape="rect">positiveInteger</a>. </p><p> The term 'totalDigits' is chosen to reflect the fact that it restricts the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to those values that can be represented lexically using at most <em>totalDigits</em> digits in decimal notation, or at most <em>totalDigits</em> digits for the coefficient, in scientific notation.&#160; Note that it does not restrict the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> directly; a lexical representation that adds non-significant leading or trailing zero digits is still permitted. It also has no effect on the values NaN, INF, and -INF. </p><div class="div4"> <h5><a name="dc-totalDigits" id="dc-totalDigits" shape="rect"></a>4.3.11.1 The totalDigits Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-td" id="f-td" shape="rect">totalDigits</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-td-annotations" shape="rect" id="f-td-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-td-value" shape="rect" id="f-td-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> An xs:positiveInteger value. Required.</div> </div> <div class="propDefn"><a name="f-td-fixed" shape="rect" id="f-td-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> If <a href="#f-td-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then types for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> <span class="rfc2119">must</span> not specify a value for <a href="#f-td" class="compref" shape="rect">totalDigits</a> other than <a href="#f-td-value" class="propref" shape="rect">{value}</a>. </p></div><div class="div4"> <h5><a name="xr-totalDigits" id="xr-totalDigits" shape="rect"></a>4.3.11.2 XML Representation of totalDigits Schema Components</h5><p> The XML representation for a <a href="#f-td" class="compref" shape="rect">totalDigits</a> schema component is a <a href="#element-totalDigits" class="eltref" shape="rect">&lt;totalDigits&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>totalDigits</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-totalDigits" name="element-totalDigits" shape="rect">&lt;totalDigits</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#positiveInteger" shape="rect">positiveInteger</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/totalDigits&gt;</div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-totalDigits" shape="rect">totalDigits</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-td-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-td-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-td-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-totalDigits" class="eltref" shape="rect">&lt;totalDigits&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="totalDigits-validation-rules" id="totalDigits-validation-rules" shape="rect"></a>4.3.11.3 totalDigits Validation Rules</h5><div class="constraintnote"><a id="cvc-totalDigits-valid" name="cvc-totalDigits-valid" shape="rect"></a><b>Validation Rule: totalDigits Valid</b><br clear="none" /><div class="constraint"><div class="p">A value <var>v</var> is facet-valid with respect to a <a href="#f-td" class="compref" shape="rect">totalDigits</a> facet with a <a href="#f-td-value" class="propref" shape="rect">{value}</a> of <var>t</var> if and only if <var>v</var> is a <a href="#decimal" shape="rect">decimal</a> value equal to <var>i</var>&#160;/&#160;10<sup><var>n</var></sup>, for some integers <var>i</var> and <var>n</var>, with |&#160;<var>i</var>&#160;| &lt; 10<sup><var>t</var></sup> and 0&#160;&#8804;&#160;<var>n</var>&#160;&#8804;&#160;<var>t</var>. </div></div></div></div><div class="div4"> <h5><a name="totalDigits-coss" id="totalDigits-coss" shape="rect"></a>4.3.11.4 Constraints on totalDigits Schema Components</h5><div class="constraintnote"><a id="totalDigits-valid-restriction" name="totalDigits-valid-restriction" shape="rect"></a><b>Schema Component Constraint: totalDigits valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner<span class="arrow">&#183;</span></a>'s <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> has a <a href="#f-td" class="compref" shape="rect">totalDigits</a> facet among its <a href="#std-facets" class="propref" shape="rect">{facets}</a> and <a href="#f-td-value" class="propref" shape="rect">{value}</a> is greater than the <a href="#f-td-value" class="propref" shape="rect">{value}</a> of that <a href="#f-td" class="compref" shape="rect">totalDigits</a> facet. </div></div></div></div></div><div class="div3"> <h4><a name="rf-fractionDigits" id="rf-fractionDigits" shape="rect"></a>4.3.12 fractionDigits</h4><p> <span class="termdef"><a name="dt-fractionDigits" id="dt-fractionDigits" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>fractionDigits</b> places an upper limit on the arithmetic precision of <a href="#decimal" shape="rect">decimal</a> values: if the <a href="#f-fd-value" class="propref" shape="rect">{value}</a> of <b>fractionDigits</b> = <var>f</var>, then the value space is restricted to values equal to <var>i</var>&#160;/&#160;10<sup><var>n</var></sup> for some integers <var>i</var> and <var>n</var> and 0 &#8804; <var>n</var> &#8804; <var>f</var>.</span> The value of <b>fractionDigits</b>&#160;<a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> be a <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a> </p><p> The term <b>fractionDigits</b> is chosen to reflect the fact that it restricts the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> to those values that can be represented lexically in decimal notation using at most <em>fractionDigits</em> to the right of the decimal point. Note that it does not restrict the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> directly; a lexical representation that adds non-significant leading or trailing zero digits is still permitted. </p><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following is the definition of a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype which could be used to represent the magnitude of a person's body temperature on the Celsius scale. This definition would appear in a schema authored by an "end-user" and shows how to define a datatype by specifying facet values which constrain the range of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='celsiusBodyTemp'&gt; &lt;restriction base='decimal'&gt; &lt;fractionDigits value='1'/&gt; &lt;minInclusive value='32'/&gt; &lt;maxInclusive value='41.7'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt; </pre></div></div><div class="div4"> <h5><a name="dc-fractionDigits" id="dc-fractionDigits" shape="rect"></a>4.3.12.1 The fractionDigits Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-fd" id="f-fd" shape="rect">fractionDigits</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-fd-annotations" shape="rect" id="f-fd-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-fd-value" shape="rect" id="f-fd-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> An xs:nonNegativeInteger value. Required.</div> </div> <div class="propDefn"><a name="f-fd-fixed" shape="rect" id="f-fd-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p> If <a href="#f-fd-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then types for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> <span class="rfc2119">must</span> not specify a value for <a href="#f-fd" class="compref" shape="rect">fractionDigits</a> other than <a href="#f-fd-value" class="propref" shape="rect">{value}</a>. </p></div><div class="div4"> <h5><a name="xr-fractionDigits" id="xr-fractionDigits" shape="rect"></a>4.3.12.2 XML Representation of fractionDigits Schema Components</h5><p> The XML representation for a <a href="#f-fd" class="compref" shape="rect">fractionDigits</a> schema component is a <a href="#element-fractionDigits" class="eltref" shape="rect">&lt;fractionDigits&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>fractionDigits</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-fractionDigits" name="element-fractionDigits" shape="rect">&lt;fractionDigits</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/fractionDigits&gt;</div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-fractionDigits" shape="rect">fractionDigits</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-fd-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-fd-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-fd-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-fractionDigits" class="eltref" shape="rect">&lt;fractionDigits&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="fractionDigits-validation-rules" id="fractionDigits-validation-rules" shape="rect"></a>4.3.12.3 fractionDigits Validation Rules</h5><div class="constraintnote"><a id="cvc-fractionDigits-valid" name="cvc-fractionDigits-valid" shape="rect"></a><b>Validation Rule: fractionDigits Valid</b><br clear="none" /><div class="constraint"><div class="p"> A value is facet-valid with respect to <a href="#dt-fractionDigits" class="termref" shape="rect"><span class="arrow">&#183;</span>fractionDigits<span class="arrow">&#183;</span></a> if and only if that value is equal to <var>i</var>&#160;/&#160;10<sup><var>n</var></sup> for integer <var>i</var> and <var>n</var>, with 0 &#8804; <var>n</var> &#8804; <a href="#f-fd-value" class="propref" shape="rect">{value}</a>. </div></div></div></div><div class="div4"> <h5><a name="fractionDigits-coss" id="fractionDigits-coss" shape="rect"></a>4.3.12.4 Constraints on fractionDigits Schema Components</h5><div class="constraintnote"><a id="fractionDigits-totalDigits" name="fractionDigits-totalDigits" shape="rect"></a><b>Schema Component Constraint: fractionDigits less than or equal to totalDigits</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> for the <a href="#f-fd-value" class="propref" shape="rect">{value}</a> of <a href="#f-fd" class="compref" shape="rect">fractionDigits</a> to be greater than that of <a href="#f-td" class="compref" shape="rect">totalDigits</a>. </div></div></div><div class="constraintnote"><a id="fractionDigits-valid-restriction" name="fractionDigits-valid-restriction" shape="rect"></a><b>Schema Component Constraint: fractionDigits valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> It is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> if <a href="#dt-fractionDigits" class="termref" shape="rect"><span class="arrow">&#183;</span>fractionDigits<span class="arrow">&#183;</span></a> is among the members of <a href="#std-facets" class="propref" shape="rect">{facets}</a> of <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and <a href="#f-fd-value" class="propref" shape="rect">{value}</a> is greater than the <a href="#f-fd-value" class="propref" shape="rect">{value}</a> of that <a href="#dt-fractionDigits" class="termref" shape="rect"><span class="arrow">&#183;</span>fractionDigits<span class="arrow">&#183;</span></a>. </div></div></div></div></div><div class="div3"> <h4><a name="rf-assertions" id="rf-assertions" shape="rect"></a>4.3.13 Assertions</h4><p><span class="termdef"><a name="dt-assertions" id="dt-assertions" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>Assertions</b> constrain the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> by requiring the values to satisfy specified XPath (<a href="#XPATH2" shape="rect">[XPath 2.0]</a>) expressions. The value of the <a href="#f-a" class="compref" shape="rect">assertions</a> facet is a sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#as" shape="rect">Assertion</a> components as defined in <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>.</span></p><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <p>The following is the definition of a <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype which allows all integers but 0 by using an assertion to disallow the value 0.</p></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='nonZeroInteger'&gt; &lt;restriction base='integer'&gt; &lt;assertion test='$value ne 0'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt; </pre></div></div><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <p>The following example defines the datatype "triple", whose <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> is the set of integers evenly divisible by three.</p></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='triple'&gt; &lt;restriction base='integer'&gt; &lt;assertion test='$value mod 3 eq 0'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div><div class="exampleWrapper"> <p>The same datatype can be defined without the use of assertions, but the pattern necessary to represent the set of triples is long and error-prone:</p></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='triple'&gt; &lt;restriction base='integer'&gt; &lt;pattern value= "([0369]|[147][0369]*[258]|(([258]|[147][0369]*[147])([0369]|[258][0369]*[147])*([147]|[258][0369]*[258]))*"/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div><div class="exampleWrapper"> <p>The assertion used in the first version of "triple" is likely to be clearer for many readers of the schema document.</p></div></div><div class="div4"> <h5><a name="dc-assertions" id="dc-assertions" shape="rect"></a>4.3.13.1 The assertions Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-a" id="f-a" shape="rect">assertions</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-a-annotations" shape="rect" id="f-a-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-a-value" shape="rect" id="f-a-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> <div class="ownDesc"> <p>A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#as" shape="rect">Assertion</a> components.</p></div> </div> </div> </div></div> </div> </div> </div><div class="div4"> <h5><a name="xr-assertions" id="xr-assertions" shape="rect"></a>4.3.13.2 XML Representation of assertions Schema Components</h5><p>The XML representation for an <a href="#f-a" class="compref" shape="rect">assertions</a> schema component is one or more <a href="#element-assertion" class="eltref" shape="rect">&lt;assertion&gt;</a> element information items. The correspondences between the properties of the information item and properties of the component are as follows:</p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>assertion</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-assertion" name="element-assertion" shape="rect">&lt;assertion</a><br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>test</b> = <i>an XPath expression</i><br clear="none" />&#160;&#160;xpathDefaultNamespace = (<a href="#anyURI" shape="rect">anyURI</a> | (<var>##defaultNamespace</var> | <var>##targetNamespace</var> | <var>##local</var>)) <br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/assertion&gt;</div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-assertions" shape="rect">assertions</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-a-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> A sequence whose members are <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#as" shape="rect">Assertion</a>s drawn from the following sources, in order: <div class="constraintlist"><div class="clnumber">1 <span class="p">If the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> of the <a href="#dt-owner" class="termref" shape="rect"><span class="arrow">&#183;</span>owner<span class="arrow">&#183;</span></a> has an <a href="#f-a" class="compref" shape="rect">assertions</a> facet among its <a href="#std-facets" class="propref" shape="rect">{facets}</a>, then the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#as" shape="rect">Assertion</a>s which appear in the <a href="#f-p-value" class="propref" shape="rect">{value}</a> of that <a href="#f-a" class="compref" shape="rect">assertions</a> facet.</span></div> <div class="clnumber">2 <span class="p"><a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#as" shape="rect">Assertion</a>s corresponding to the <a href="#element-assertion" class="eltref" shape="rect">&lt;assertion&gt;</a> element information items among the <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[children]</a> of <a href="#element-restriction" class="eltref" shape="rect">&lt;restriction&gt;</a>, if any, in document order. For details of the construction of the <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#as" shape="rect">Assertion</a> components, see <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-assertion" shape="rect">section 3.13.2</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </span></div> </div> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-a-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The empty sequence. <div class="note"><div class="p"><b>Note:</b> Annotations specified within an <a href="#element-assertion" class="eltref" shape="rect">&lt;assertion&gt;</a> element are captured by the individual <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#as" shape="rect">Assertion</a> component to which it maps. </div></div> </div></div></div></div><div class="div4"> <h5><a name="assertions-validation-rules" id="assertions-validation-rules" shape="rect"></a>4.3.13.3 Assertions Validation Rules</h5><p>The following rule refers to "the nearest built-in" datatype and to the "XDM representation" of a value under a datatype. <span class="termdef"><a name="dt-optype" id="dt-optype" title="" shape="rect">[Definition:]&#160;&#160;</a>For any datatype <var>T</var>, the <b>nearest built-in datatype</b> to <var>T</var> is the first <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype encountered in following the chain of links connecting each datatype to its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. If <var>T</var> is a <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype, then the nearest built-in datatype of <var>T</var> is <var>T</var> itself; otherwise, it is the nearest built-in datatype of <var>T</var>'s <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>.</span> </p><div class="p"> <div class="termdef"><a name="dt-xdmrep" id="dt-xdmrep" title="" shape="rect">[Definition:]&#160;&#160;</a>For any value <var>V</var> and any datatype <var>T</var>, the <b>XDM representation of <var>V</var> under <var>T</var></b> is defined recursively as follows. Call the XDM representation <var>X</var>. Then<div class="constraintlist"><div class="clnumber">1 <span class="p">If <var>T</var> = <a href="#dt-anySimpleType" class="termref" shape="rect"><span class="arrow">&#183;</span><code>xs:anySimpleType</code><span class="arrow">&#183;</span></a> or <a href="#dt-anyAtomicType" class="termref" shape="rect"><span class="arrow">&#183;</span><code>xs:anyAtomicType</code><span class="arrow">&#183;</span></a> then <var>X</var> is <var>V</var>, and the <a href="https://www.w3.org/TR/xpath20/#dt-dynamic-type" shape="rect">dynamic type</a> of <var>X</var> is <code>xs:untypedAtomic</code>. </span></div> <div class="clnumber">2 <span class="p">If <var>T</var> . <a href="#std-variety" class="propref" shape="rect">{variety}</a> = <b><i>atomic</i></b>, then let <var>T2</var> be the <a href="#dt-optype" class="termref" shape="rect"><span class="arrow">&#183;</span>nearest built-in datatype<span class="arrow">&#183;</span></a> to <var>T</var>. If <var>V</var> is a member of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <var>T2</var>, then <var>X</var> is <var>V</var> and the <a href="https://www.w3.org/TR/xpath20/#dt-dynamic-type" shape="rect">dynamic type</a> of <var>X</var> is <var>T2</var>. Otherwise (i.e. if <var>V</var> is not a member of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <var>T2</var>), <var>X</var> is the <a href="#dt-xdmrep" class="termref" shape="rect"><span class="arrow">&#183;</span>XDM representation<span class="arrow">&#183;</span></a> of <var>V</var> under <var>T2</var> . <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </span></div> <div class="clnumber">3 <span class="p">If <var>T</var> . <a href="#std-variety" class="propref" shape="rect">{variety}</a> = <b><i>list</i></b>, then <var>X</var> is a sequence of atomic values, each atomic value being the <a href="#dt-xdmrep" class="termref" shape="rect"><span class="arrow">&#183;</span>XDM representation<span class="arrow">&#183;</span></a> of the corresponding item in the list <var>V</var> under <var>T</var> . <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a>. </span></div> <div class="clnumber">4 <span class="p">If <var>T</var> . <a href="#std-variety" class="propref" shape="rect">{variety}</a> = <b><i>union</i></b>, then <var>X</var> is the <a href="#dt-xdmrep" class="termref" shape="rect"><span class="arrow">&#183;</span>XDM representation<span class="arrow">&#183;</span></a> of <var>V</var> under the <a href="#dt-active-basic-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active basic member<span class="arrow">&#183;</span></a> of <var>V</var> when validated against <var>T</var>. If there is no <a href="#dt-active-basic-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active basic member<span class="arrow">&#183;</span></a>, then <var>V</var> has no <a href="#dt-xdmrep" class="termref" shape="rect"><span class="arrow">&#183;</span>XDM representation<span class="arrow">&#183;</span></a> under <var>T</var>.</span></div> </div> </div> <div class="note"><div class="p"><b>Note:</b> If the <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a> of a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> is a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, or the <a href="#dt-active-basic-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active basic member<span class="arrow">&#183;</span></a> is a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a>, then several steps may be necessary before the <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype which serves as the <a href="https://www.w3.org/TR/xpath20/#dt-dynamic-type" shape="rect">dynamic type</a> of <var>X</var> is found. </div><div class="p">Because the <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a> of a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> is required to be an <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> or <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype, and the <a href="#dt-active-basic-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active basic member<span class="arrow">&#183;</span></a> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> which accepts the value <var>V</var> is by definition not a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, the recursive rule given above is guaranteed to terminate in a sequence of one or more <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> values, each belonging to an <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype.</div></div> </div><div class="constraintnote"><a id="cvc-assertions-valid" name="cvc-assertions-valid" shape="rect"></a><b>Validation Rule: Assertions Valid</b><br clear="none" /><div class="constraint"><div class="p">A value <var>V</var> is facet-valid with respect to an <a href="#f-a" class="compref" shape="rect">assertions</a> facet belonging to a simple type <var>T</var> if and only if the {test} property of each <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#as" shape="rect">Assertion</a> in its <a href="#f-a-value" class="propref" shape="rect">{value}</a> evaluates to <code>true</code> under the conditions laid out below, without raising any <a href="https://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-dynamic-error" shape="rect">dynamic error</a> or <a href="https://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-type-error" shape="rect">type error</a>.</div><div class="p">Evaluation of {test} is performed as defined in <a href="#XPATH2" shape="rect">[XPath 2.0]</a>, with the following conditions:</div><div class="constraintlist"><div class="clnumber">1 <!--* no span class='p' possible here *-->The XPath expression {test} is evaluated, following the rules given in <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#cvc-xpath" shape="rect">XPath Evaluation</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, with the following modifications. <div class="constraintlist"><div class="clnumber">1.1 <span class="p"> The <a href="https://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-in-scope-variables" shape="rect">in-scope variables</a> in the <a href="https://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-static-context" shape="rect">static context</a> is a set with a single member. The <code>expanded QName</code> of that member has no namespace URI and has '<code>value</code>' as the local name. The (static) <code>type</code> of the member is <code>anyAtomicType*</code>. </span><div class="note"><div class="p"><b>Note:</b> The XDM type label <code>anyAtomicType*</code> simply says that for static typing purposes the variable <code>$value</code> will have a value consisting of a sequence of zero or more atomic values. </div></div></div> <div class="clnumber">1.2 <span class="p">There is no <a href="https://www.w3.org/TR/xpath20/#dt-context-item" shape="rect">context item</a> for the evaluation of the XPath expression. </span><div class="note"><div class="p"><b>Note:</b> In the terminology of <a href="#XPATH2" shape="rect">[XPath 2.0]</a>, the <a href="https://www.w3.org/TR/xpath20/#dt-context-item" shape="rect">context item</a> is "undefined". </div></div><div class="note"><div class="p"><b>Note:</b> As a consequence the expression '<code>.</code>', or any implicit or explicit reference to the context item, will raise a dynamic error, which will cause the assertion to be treated as false. If an error is detected statically, then the assertion violates the schema component constraint <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#xpath-valid" shape="rect">XPath Valid</a> and causes an error to be flagged in the schema. </div><div class="p">The variable "<code>$value</code>" can be used to refer to the value being checked. </div></div></div> <div class="clnumber">1.3 <span class="p">There is likewise no value for the <a href="https://www.w3.org/TR/xpath20/#dt-context-size" shape="rect">context size</a> and the <a href="https://www.w3.org/TR/xpath20/#dt-context-position" shape="rect">context position</a> in the <a href="https://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-dynamic-context" shape="rect">dynamic context</a> used for evaluation of the assertion. </span></div> <div class="clnumber">1.4 <span class="p"> The <a href="https://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-variable-values" shape="rect">variable values</a> in the <a href="https://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-dynamic-context" shape="rect">dynamic context</a> is a set with a single member. The <code>expanded QName</code> of that member has no namespace URI and '<code>value</code>' as the local name. The <code>value</code> of the member is the <a href="#dt-xdmrep" class="termref" shape="rect"><span class="arrow">&#183;</span>XDM representation<span class="arrow">&#183;</span></a> of <var>V</var> under <var>T</var>. </span></div> <div class="clnumber">1.5 <span class="p">If <var>V</var> has no <a href="#dt-xdmrep" class="termref" shape="rect"><span class="arrow">&#183;</span>XDM representation<span class="arrow">&#183;</span></a> under <var>T</var>, then the XPath expression cannot usefully be evaluated, and <var>V</var> is not facet-valid against the <a href="#f-a" class="compref" shape="rect">assertions</a> facet of <var>T</var>. </span></div> </div> </div> <div class="clnumber">2 <span class="p">The evaluation result is converted to either <code>true</code> or <code>false</code> as if by a call to the XPath <a href="https://www.w3.org/TR/2007/REC-xpath-functions-20070123/#func-boolean" shape="rect">fn:boolean</a> function.</span></div> </div></div></div></div><div class="div4"> <h5><a name="assertions-coss" id="assertions-coss" shape="rect"></a>4.3.13.4 Constraints on assertions Schema Components</h5><div class="constraintnote"><a id="cos-assertions-restriction" name="cos-assertions-restriction" shape="rect"></a><b>Schema Component Constraint: Valid restriction of assertions</b><br clear="none" /><div class="constraint"><div class="p">The <a href="#f-a-value" class="propref" shape="rect">{value}</a> of the <a href="#f-a" class="compref" shape="rect">assertions</a> facet on the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> <span class="rfc2119">must</span> be a prefix of the <a href="#f-a-value" class="propref" shape="rect">{value}</a>.</div><div class="note"><div class="p"><b>Note:</b> For components constructed from XML representations in schema documents, the satisfaction of this constraint is a consequence of the XML mapping rules: any assertion imposed by a simple type definition <var>S</var> will always also be imposed by any type derived from <var>S</var> by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a>. This constraint ensures that components constructed by other means (so-called "born-binary" components) similarly preserve <a href="#f-a" class="compref" shape="rect">assertions</a> facets across <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a>.</div></div></div></div></div></div><div class="div3"> <h4><a name="rf-explicitTimezone" id="rf-explicitTimezone" shape="rect"></a>4.3.14 explicitTimezone</h4><p><span class="termdef"><a name="dt-timezone" id="dt-timezone" title="" shape="rect">[Definition:]&#160;&#160;</a> <b>explicitTimezone</b> is a three-valued facet which can can be used to require or prohibit the time zone offset in date/time datatypes.</span></p><div class="exampleOuter"> <div class="exampleHeader">Example</div> <div class="exampleWrapper"> <div class="p"> The following <a href="#dt-user-defined" class="termref" shape="rect"><span class="arrow">&#183;</span>user-defined<span class="arrow">&#183;</span></a> datatype accepts only <a href="#date" shape="rect">date</a> values without a time zone offset, using the <a href="#f-tz" class="compref" shape="rect">explicitTimezone</a> facet. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='bare-date'&gt; &lt;restriction base='date'&gt; &lt;explicitTimezone value='prohibited'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div><div class="exampleWrapper"> <div class="p"> The same effect could also be achieved using the <a href="#f-p" class="compref" shape="rect">pattern</a> facet, as shown below, but it is somewhat less clear what is going on in this derivation, and it is better practice to use the more straightforward <a href="#f-tz" class="compref" shape="rect">explicitTimezone</a> for this purpose. </div></div><div class="exampleInner"> <pre xml:space="preserve">&lt;simpleType name='bare-date'&gt; &lt;restriction base='date'&gt; &lt;pattern value='[^:Z]*'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div></div><div class="div4"> <h5><a name="dc-explicitTimezone" id="dc-explicitTimezone" shape="rect"></a>4.3.14.1 The explicitTimezone Schema Component</h5><div class="schemaComp"> <div class="component"> <div class="compHeader"> <span class="schemaComp">Schema&#160;Component: </span><a name="f-tz" id="f-tz" shape="rect">explicitTimezone</a>, a kind of <a href="#f" class="compref" shape="rect">Constraining Facet</a></div> <div class="compBody"> <div class="propList"> <div class="propDefn"><a name="f-tz-annotations" shape="rect" id="f-tz-annotations"></a><div class="pdName"><span class="propdef">{annotations}</span></div> <div class="pdDef"> A sequence of <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#a" class="compref" shape="rect">Annotation</a> components. </div> </div> <div class="propDefn"><a name="f-tz-value" shape="rect" id="f-tz-value"></a><div class="pdName"><span class="propdef">{value}</span></div> <div class="pdDef"> One of {<span class="enumval">required</span>, <span class="enumval">prohibited</span>, <span class="enumval">optional</span>}. Required.</div> </div> <div class="propDefn"><a name="f-tz-fixed" shape="rect" id="f-tz-fixed"></a><div class="pdName"><span class="propdef">{fixed}</span></div> <div class="pdDef"> An xs:boolean value. Required.</div> </div> </div></div> </div> </div> <p>If <a href="#f-tz-fixed" class="propref" shape="rect">{fixed}</a> is <em>true</em>, then datatypes for which the current type is the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> cannot specify a value for <a href="#f-tz" class="compref" shape="rect">explicitTimezone</a> other than <a href="#f-tz-value" class="propref" shape="rect">{value}</a>.</p><div class="note"><div class="p"><b>Note:</b> It is a consequence of <a href="#timezone-valid-restriction" shape="rect">timezone valid restriction (&#167;4.3.14.4)</a> that the value of the <a href="#f-tz" class="compref" shape="rect">explicitTimezone</a> facet cannot be changed unless that value is <b><i>optional</i></b>, regardless of whether <a href="#f-tz-fixed" class="propref" shape="rect">{fixed}</a> is <b><i>true</i></b> or <b><i>false</i></b>.&#160; Accordingly, <a href="#f-tz-fixed" class="propref" shape="rect">{fixed}</a> is relevant only when <a href="#f-tz-value" class="propref" shape="rect">{value}</a> is <b><i>optional</i></b>.</div></div></div><div class="div4"> <h5><a name="xr-timezone" id="xr-timezone" shape="rect"></a>4.3.14.2 XML Representation of explicitTimezone Schema Components</h5><p> The XML representation for an <a href="#f-tz" class="compref" shape="rect">explicitTimezone</a> schema component is an <a href="#element-explicitTimezone" class="eltref" shape="rect">&lt;explicitTimezone&gt;</a> element information item. The correspondences between the properties of the information item and properties of the component are as follows: </p><div class="reprdef"><div class="reprHeader"><span class="reprdef">XML Representation Summary</span>: <code>explicitTimezone</code>&#160;Element Information Item</div><div class="reprBody"><div class="element-syntax-1"><a id="element-explicitTimezone" name="element-explicitTimezone" shape="rect">&lt;explicitTimezone</a><br clear="none" />&#160;&#160;fixed = <a href="#boolean" shape="rect">boolean</a>&#160;:&#160;false<br clear="none" />&#160;&#160;id = <a href="#ID" shape="rect">ID</a><br clear="none" />&#160;&#160;<b>value</b> = <a href="#NCName" shape="rect">NCName</a><br clear="none" />&#160;&#160;<em>{any attributes with non-schema namespace . . .}</em>&gt;<br clear="none" /><em>&#160;&#160;Content: </em>(<a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#element-annotation" class="eltref" shape="rect">annotation</a>?)<br clear="none" />&lt;/explicitTimezone&gt;</div><div class="reprcompmulti"><div class="reprHead"><a href="#dc-explicitTimezone" shape="rect">explicitTimezone</a> <strong>Schema Component</strong></div></div><div class="mapProp"><strong>Property</strong></div><div class="mapRepr"><strong>Representation</strong></div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-tz-value" class="propref" shape="rect">{value}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>value</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-tz-fixed" class="propref" shape="rect">{fixed}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-vv" shape="rect">actual value</a> of the <code>fixed</code> <a href="https://www.w3.org/TR/xml-infoset/#infoitem.element" class="xpropref" shape="rect">[attribute]</a>, if present, otherwise <b><i>false</i></b> </div><div class="mapSep">&#160;</div><div class="mapProp"><a href="#f-tz-annotations" class="propref" shape="rect">{annotations}</a></div><div class="mapRepr"> The <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#key-am-one" shape="rect">annotation mapping</a> of the <a href="#element-explicitTimezone" class="eltref" shape="rect">&lt;explicitTimezone&gt;</a> element, as defined in section <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#declare-annotation" shape="rect">XML Representation of Annotation Schema Components</a> of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. </div></div></div></div><div class="div4"> <h5><a name="timezone-vr" id="timezone-vr" shape="rect"></a>4.3.14.3 explicitTimezone Validation Rules</h5><div class="constraintnote"><a id="cvc-explicitTimezone-valid" name="cvc-explicitTimezone-valid" shape="rect"></a><b>Validation Rule: explicitOffset Valid</b><br clear="none" /><div class="constraint"><div class="p"> A <a href="#dateTime" shape="rect">dateTime</a> value <var>V</var> is facet-valid with respect to <a href="#dt-timezone" class="termref" shape="rect"><span class="arrow">&#183;</span>explicitTimezone<span class="arrow">&#183;</span></a> if and only if <b>one</b> of the following is true<div class="constraintlist"><div class="clnumber">1 <span class="p">The <a href="#f-tz-value" class="propref" shape="rect">{value}</a> of the facet is <b><i>required</i></b> and <var>V</var> has a (non-<b><i>absent</i></b>) value for the <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> property.</span></div> <div class="clnumber">2 <span class="p">The <a href="#f-tz-value" class="propref" shape="rect">{value}</a> of the facet is <b><i>prohibited</i></b> and the value for the <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> property in <var>V</var> is <b><i>absent</i></b>.</span></div> <div class="clnumber">3 <span class="p">The <a href="#f-tz-value" class="propref" shape="rect">{value}</a> of the facet is <b><i>optional</i></b>.</span></div> </div> </div></div></div></div><div class="div4"> <h5><a name="timezone-coss" id="timezone-coss" shape="rect"></a>4.3.14.4 Constraints on explicitTimezone Schema Components</h5><div class="constraintnote"><a id="timezone-valid-restriction" name="timezone-valid-restriction" shape="rect"></a><b>Schema Component Constraint: timezone valid restriction</b><br clear="none" /><div class="constraint"><div class="p"> If the <a href="#f-tz" class="compref" shape="rect">explicitTimezone</a> facet on the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> has a <a href="#f-tz-value" class="propref" shape="rect">{value}</a> other than <b><i>optional</i></b>, then the <a href="#f-tz-value" class="propref" shape="rect">{value}</a> of the facet on the <a href="#dt-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restriction<span class="arrow">&#183;</span></a> <span class="rfc2119">must</span> be equal to the <a href="#f-tz-value" class="propref" shape="rect">{value}</a> on the <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>; otherwise it is an <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a>.</div><div class="note"><div class="p"><b>Note:</b> The effect of this rule is to allow datatypes with a <a href="#f-tz" class="compref" shape="rect">explicitTimezone</a> value of <b><i>optional</i></b> to be restricted by specifying a value of <b><i>required</i></b> or <b><i>prohibited</i></b>, and to forbid any other derivations using this facet. </div></div></div></div></div></div></div></div><div class="div1"> <h2><a name="conformance" id="conformance" shape="rect"></a>5 Conformance</h2><p><em>XSD 1.1: Datatypes</em> is intended to be usable in a variety of contexts.</p><p>In the usual case, it will embedded in a <b>host language</b> such as <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, which refers to this specification normatively to define some part of the host language. In some cases, <em>XSD 1.1: Datatypes</em> may be implemented independently of any host language. </p><div class="block">Certain aspects of the behavior of conforming processors are described in this specification as <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> or <a href="#key-impl-dep" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-dependent<span class="arrow">&#183;</span></a>. <ul><li><div class="p"><span class="termdef"><a name="key-impl-def" id="key-impl-def" title="" shape="rect">[Definition:]&#160;&#160;</a>Something which <span class="rfc2119">may</span> vary among conforming implementations, but which <span class="rfc2119">must</span> be specified by the implementor for each particular implementation, is <b>implementation-defined</b>.</span></div></li><li><div class="p"><span class="termdef"><a name="key-impl-dep" id="key-impl-dep" title="" shape="rect">[Definition:]&#160;&#160;</a>Something which <span class="rfc2119">may</span> vary among conforming implementations, is not specified by this or any W3C specification, and is not required to be specified by the implementor for any particular implementation, is <b>implementation-dependent</b>.</span> </div></li></ul> Anything described in this specification as <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> or <a href="#key-impl-dep" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-dependent<span class="arrow">&#183;</span></a> <span class="rfc2119">may</span> be further constrained by the specifications of a host language in which the datatypes and other material specified here are used. A list of implementation-defined and implementation-dependent features can be found in <a href="#idef-idep" shape="rect">Implementation-defined and implementation-dependent features (normative) (&#167;H)</a> </div><div class="div2"> <h3><span class="nav"> <a href="#independent-impl" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="hostlangs" id="hostlangs" shape="rect"></a>5.1 Host Languages</h3><p>When <em>XSD 1.1: Datatypes</em> is embedded in a host language, the definition of conformance is specified by the host language, not by this specification. That is, when this specification is implemented in the context of an implementation of a host language, the question of conformance to this specification (separate from the host language) does not arise.</p><p>This specification imposes certain constraints on the embedding of <em>XSD 1.1: Datatypes</em> by a host language; these are indicated in the normative text by the use of the verbs '<span class="rfc2119">must</span>', etc., with the phrase "host language" as the subject of the verb.</p><div class="note"><div class="p"><b>Note:</b> For convenience, the most important of these constraints are noted here:<ul><li><div class="p">Host languages <span class="rfc2119">should</span> specify that all of the datatypes described here as built-ins are automatically available.</div></li><li><div class="p">Host languages <span class="rfc2119">may</span> specify that additional datatypes are also made available automatically.</div></li><li><div class="p">If user-defined datatypes are to be supported in the host language, then the host language <span class="rfc2119">must</span> specify how user-defined datatypes are defined and made available for use.</div></li></ul> </div></div><p> In addition, host languages <span class="rfc2119">must</span> require conforming implementations of the host language to obey all of the constraints and rules specified here.</p></div><div class="div2"> <h3><span class="nav"><a href="#hostlangs" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#data-conformance" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="independent-impl" id="independent-impl" shape="rect"></a>5.2 Independent implementations</h3><div class="p"><div class="termdef"><a name="dt-minimally-conforming" id="dt-minimally-conforming" title="" shape="rect">[Definition:]&#160;&#160;</a>Implementations claiming <b>minimal conformance</b> to this specification independent of any host language <span class="rfc2119">must</span> do <b>all</b> of the following:<div class="constraintlist"><div class="clnumber">1<a id="support-all-primitives" name="support-all-primitives" shape="rect"> </a><span class="p">Support all the <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes defined in this specification.</span></div> <div class="clnumber">2<a id="implement-all-cos" name="implement-all-cos" shape="rect"> </a><span class="p">Completely and correctly implement all of the <a href="#dt-cos" class="termref" shape="rect"><span class="arrow">&#183;</span>constraints on schemas<span class="arrow">&#183;</span></a> defined in this specification.</span></div> <div class="clnumber">3<a id="implement-all-vr" name="implement-all-vr" shape="rect"> </a><span class="p">Completely and correctly implement all of the <a href="#dt-cvc" class="termref" shape="rect"><span class="arrow">&#183;</span>Validation Rules<span class="arrow">&#183;</span></a> defined in this specification, when checking the datatype validity of literals against datatypes.</span></div> </div> </div> </div><div class="block">Implementations claiming <b>schema-document-aware conformance</b> to this specification, independent of any host language <span class="rfc2119">must</span> be minimally conforming. In addition, they must do <b>all</b> of the following:<div class="constraintlist"><div class="clnumber">1<a id="accept-std" name="accept-std" shape="rect"> </a><span class="p">Accept simple type definitions in the form specified in <a href="#datatype-components" shape="rect">Datatype components (&#167;4)</a>.</span></div> <div class="clnumber">2<a id="implement-all-xrc" name="implement-all-xrc" shape="rect"> </a><span class="p">Completely and correctly implement all of rules governing the XML representation of simple type definitions specified in <a href="#datatype-components" shape="rect">Datatype components (&#167;4)</a>.</span></div> <div class="clnumber">3<a id="map-xml-component" name="map-xml-component" shape="rect"> </a><span class="p">Map the XML representations of simple type definitions to simple type definition components as specified in the mapping rules given in <a href="#datatype-components" shape="rect">Datatype components (&#167;4)</a>.</span></div> </div> </div><div class="note"><div class="p"><b>Note:</b> The term <b>schema-document aware</b> is used here for parallelism with the corresponding term in <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>. The reference to schema documents may be taken as referring to the fact that schema-document-aware implementations accept the XML representation of simple type definitions found in XSD schema documents. It does <em>not</em> mean that the simple type definitions must themselves be free-standing XML documents, nor that they typically will be. </div></div></div><div class="div2"> <h3><span class="nav"><a href="#independent-impl" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#partial-implementation" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="data-conformance" id="data-conformance" shape="rect"></a>5.3 Conformance of data</h3><p>Abstract representations of simple type definitions conform to this specification if and only if they obey all of the <a href="#dt-cos" class="termref" shape="rect"><span class="arrow">&#183;</span>constraints on schemas<span class="arrow">&#183;</span></a> defined in this specification.</p><p>XML representations of simple type definitions conform to this specification if they obey all of the applicable rules defined in this specification.</p><div class="note"><div class="p"><b>Note:</b> Because the conformance of the resulting simple type definition component depends not only on the XML representation of a given simple type definition, but on the properties of its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>, the conformance of an XML representation of a simple type definition does not guarantee that, in the context of other schema components, it will map to a conforming component.</div></div></div><div class="div2"> <h3><span class="nav"><a href="#data-conformance" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="partial-implementation" id="partial-implementation" shape="rect"></a>5.4 Partial Implementation of Infinite Datatypes</h3><p>Some <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes defined in this specification have infinite <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a>; no finite implementation can completely handle all their possible values. For some such datatypes, minimum implementation limits are specified below. For other infinite types such as <a href="#string" shape="rect">string</a>, <a href="#hexBinary" shape="rect">hexBinary</a>, and <a href="#base64Binary" shape="rect">base64Binary</a>, no minimum implementation limits are specified. </p><p>When this specification is used in the context of other languages (as it is, for example, by <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>), the host language may specify other minimum implementation limits.</p><p> When presented with a literal or value exceeding the capacity of its partial implementation of a datatype, a minimally conforming implementation of this specification will sometimes be unable to determine with certainty whether the value is datatype-valid or not. Sometimes it will be unable to represent the value correctly through its interface to any downstream application. </p><p> When either of these is so, a conforming processor <span class="rfc2119">must</span> indicate to the user and/or downstream application that it cannot process the input data with assured correctness (much as it would indicate if it ran out of memory). When the datatype validity of a value or literal is uncertain because it exceeds the capacity of a partial implementation, the literal or value <span class="rfc2119">must not</span> be treated as invalid, and the unsupported value <span class="rfc2119">must not</span> be quietly changed to a supported value. </p><p> This specification does not constrain the method used to indicate that a literal or value in the input data has exceeded the capacity of the implementation, or the form such indications take. </p><p><a href="#dt-minimally-conforming" class="termref" shape="rect"><span class="arrow">&#183;</span>Minimally conforming<span class="arrow">&#183;</span></a> processors which set an application- or <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> limit on the size of the values supported <span class="rfc2119">must</span> clearly document that limit.</p><div class="block">These are the partial-implementation <a href="#dt-minimally-conforming" class="termref" shape="rect"><span class="arrow">&#183;</span>minimal conformance<span class="arrow">&#183;</span></a> requirements:<ul><li><div class="p">All <a href="#dt-minimally-conforming" class="termref" shape="rect"><span class="arrow">&#183;</span>minimally conforming<span class="arrow">&#183;</span></a> processors <span class="rfc2119">must</span> support <a href="#decimal" shape="rect">decimal</a> values whose absolute value can be expressed as <var>i</var>&#160;/&#160;10<sup><var>k</var></sup>, where <var>i</var> and <var>k</var> are nonnegative integers such that <var>i</var> &lt; 10<sup>16</sup> and <var>k</var> &#8804; 16 (i.e., those expressible with sixteen total digits).</div></li><li id="loc6048"><div class="p">All <a href="#dt-minimally-conforming" class="termref" shape="rect"><span class="arrow">&#183;</span>minimally conforming<span class="arrow">&#183;</span></a> processors <span class="rfc2119">must</span> support nonnegative <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> values less than 10000 (i.e., those expressible with four digits) in all datatypes which use the seven-property model defined in <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model (&#167;D.2.1)</a> and have a non-<a href="#key-null" class="termref" shape="rect"><span class="arrow">&#183;</span>absent<span class="arrow">&#183;</span></a> value for <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> (i.e. <a href="#dateTime" shape="rect">dateTime</a>, <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a>, <a href="#date" shape="rect">date</a>, <a href="#gYearMonth" shape="rect">gYearMonth</a>, and <a href="#gYear" shape="rect">gYear</a>). .</div></li><li><div class="p">All <a href="#dt-minimally-conforming" class="termref" shape="rect"><span class="arrow">&#183;</span>minimally conforming<span class="arrow">&#183;</span></a> processors <span class="rfc2119">must</span> support <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> values to milliseconds (i.e. those expressible with three fraction digits) in all datatypes which use the seven-property model defined in <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model (&#167;D.2.1)</a> and have a non-<a href="#key-null" class="termref" shape="rect"><span class="arrow">&#183;</span>absent<span class="arrow">&#183;</span></a> value for <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> (i.e. <a href="#dateTime" shape="rect">dateTime</a>, <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a>, and <a href="#time" shape="rect">time</a>). .</div></li><li><div class="p">All <a href="#dt-minimally-conforming" class="termref" shape="rect"><span class="arrow">&#183;</span>minimally conforming<span class="arrow">&#183;</span></a> processors <span class="rfc2119">must</span> support fractional-second <a href="#duration" shape="rect">duration</a> values to milliseconds (i.e. those expressible with three fraction digits). </div></li><li><div class="p">All <a href="#dt-minimally-conforming" class="termref" shape="rect"><span class="arrow">&#183;</span>minimally conforming<span class="arrow">&#183;</span></a> processors <span class="rfc2119">must</span> support <a href="#duration" shape="rect">duration</a> values with <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> values in the range &#8722;119999 to 119999 months (9999 years and 11 months) and <a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> values in the range &#8722;31622400 to 31622400 seconds (one leap-year).</div></li></ul> </div></div></div></div><div class="back"><div class="div1"> <h2><a name="schema" id="schema" shape="rect"></a>A Schema for Schema Documents (Datatypes) (normative)</h2><p>The XML representation of the datatypes-relevant part of the schema for schema documents is presented here as a normative part of the specification. Independent copies of this material are available in an undated (mutable) version at <a href="https://www.w3.org/2009/XMLSchema/datatypes.xsd" shape="rect">http://www.w3.org/2009/XMLSchema/datatypes.xsd</a> and in a dated (immutable) version at <a href="https://www.w3.org/2012/04/datatypes.xsd" shape="rect">http://www.w3.org/2012/04/datatypes.xsd</a> &#8212; the mutable version will be updated with future revisions of this specification, and the immutable one will not. </p><p>Like any other XML document, schema documents may carry XML and document type declarations. An XML declaration and a document type declaration are provided here for convenience. Since this schema document describes the XML Schema language, the <code>targetNamespace</code> attribute on the <code>schema</code> element refers to the XML Schema namespace itself.</p><p> Schema documents conforming to this specification may be in XML 1.0 or XML 1.1. Conforming implementations may accept input in XML 1.0 or XML 1.1 or both. See <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </p><div class="sfsScrap" id="div_schema-for-datatypes"> <a id="schema-for-datatypes" name="schema-for-datatypes" shape="rect"></a> <div class="sfsHead">Schema for Schema Documents (Datatypes)</div> <div class="sfsBody"> <pre xml:space="preserve">&lt;?xml version='1.0'?&gt; &lt;!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XSD 1.1//EN" "XMLSchema.dtd" [ &lt;!-- Make sure that processors that do not read the external subset will know about the various IDs we declare --&gt; &lt;!ATTLIST xs:simpleType id ID #IMPLIED&gt; &lt;!ATTLIST xs:maxExclusive id ID #IMPLIED&gt; &lt;!ATTLIST xs:minExclusive id ID #IMPLIED&gt; &lt;!ATTLIST xs:maxInclusive id ID #IMPLIED&gt; &lt;!ATTLIST xs:minInclusive id ID #IMPLIED&gt; &lt;!ATTLIST xs:totalDigits id ID #IMPLIED&gt; &lt;!ATTLIST xs:fractionDigits id ID #IMPLIED&gt; &lt;!ATTLIST xs:length id ID #IMPLIED&gt; &lt;!ATTLIST xs:minLength id ID #IMPLIED&gt; &lt;!ATTLIST xs:maxLength id ID #IMPLIED&gt; &lt;!ATTLIST xs:enumeration id ID #IMPLIED&gt; &lt;!ATTLIST xs:pattern id ID #IMPLIED&gt; &lt;!ATTLIST xs:assertion id ID #IMPLIED&gt; &lt;!ATTLIST xs:explicitTimezone id ID #IMPLIED&gt; &lt;!ATTLIST xs:appinfo id ID #IMPLIED&gt; &lt;!ATTLIST xs:documentation id ID #IMPLIED&gt; &lt;!ATTLIST xs:list id ID #IMPLIED&gt; &lt;!ATTLIST xs:union id ID #IMPLIED&gt; ]&gt; &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xml:lang="en" targetNamespace="http://www.w3.org/2001/XMLSchema" version="datatypes.xsd (rec-20120405)"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="../datatypes/datatypes.html"&gt; The schema corresponding to this document is normative, with respect to the syntactic constraints it expresses in the XML Schema language. The documentation (within 'documentation' elements) below, is not normative, but rather highlights important aspects of the W3C Recommendation of which this is a part. See below (at the bottom of this document) for information about the revision and namespace-versioning policy governing this schema document. &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:simpleType name="derivationControl"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt; A utility type, not for public use&lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:NMTOKEN"&gt; &lt;xs:enumeration value="substitution"/&gt; &lt;xs:enumeration value="extension"/&gt; &lt;xs:enumeration value="restriction"/&gt; &lt;xs:enumeration value="list"/&gt; &lt;xs:enumeration value="union"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:group name="simpleDerivation"&gt; &lt;xs:choice&gt; &lt;xs:element ref="xs:restriction"/&gt; &lt;xs:element ref="xs:list"/&gt; &lt;xs:element ref="xs:union"/&gt; &lt;/xs:choice&gt; &lt;/xs:group&gt; &lt;xs:simpleType name="simpleDerivationSet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt; #all or (possibly empty) subset of {restriction, extension, union, list} &lt;/xs:documentation&gt; &lt;xs:documentation&gt; A utility type, not for public use&lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:union&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base="xs:token"&gt; &lt;xs:enumeration value="#all"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType&gt; &lt;xs:list&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base="xs:derivationControl"&gt; &lt;xs:enumeration value="list"/&gt; &lt;xs:enumeration value="union"/&gt; &lt;xs:enumeration value="restriction"/&gt; &lt;xs:enumeration value="extension"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;/xs:list&gt; &lt;/xs:simpleType&gt; &lt;/xs:union&gt; &lt;/xs:simpleType&gt; &lt;xs:complexType name="simpleType" abstract="true"&gt; &lt;xs:complexContent&gt; &lt;xs:extension base="xs:annotated"&gt; &lt;xs:group ref="xs:simpleDerivation"/&gt; &lt;xs:attribute name="final" type="xs:simpleDerivationSet"/&gt; &lt;xs:attribute name="name" type="xs:NCName"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt; Can be restricted to required or forbidden &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;/xs:attribute&gt; &lt;/xs:extension&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;xs:complexType name="topLevelSimpleType"&gt; &lt;xs:complexContent&gt; &lt;xs:restriction base="xs:simpleType"&gt; &lt;xs:sequence&gt; &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt; &lt;xs:group ref="xs:simpleDerivation"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="name" type="xs:NCName" use="required"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt; Required at the top level &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;/xs:attribute&gt; &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt; &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;xs:complexType name="localSimpleType"&gt; &lt;xs:complexContent&gt; &lt;xs:restriction base="xs:simpleType"&gt; &lt;xs:sequence&gt; &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt; &lt;xs:group ref="xs:simpleDerivation"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="name" use="prohibited"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt; Forbidden when nested &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;/xs:attribute&gt; &lt;xs:attribute name="final" use="prohibited"/&gt; &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt; &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;xs:element name="simpleType" type="xs:topLevelSimpleType" id="simpleType"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-simpleType"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:element name="facet" abstract="true"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt; An abstract element, representing facets in general. The facets defined by this spec are substitutable for this element, and implementation-defined facets should also name this as a substitution-group head. &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:group name="simpleRestrictionModel"&gt; &lt;xs:sequence&gt; &lt;xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/&gt; &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt; &lt;xs:element ref="xs:facet"/&gt; &lt;xs:any processContents="lax" namespace="##other"/&gt; &lt;/xs:choice&gt; &lt;/xs:sequence&gt; &lt;/xs:group&gt; &lt;xs:element name="restriction" id="restriction"&gt; &lt;xs:complexType&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-restriction"&gt; base attribute and simpleType child are mutually exclusive, but one or other is required &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:complexContent&gt; &lt;xs:extension base="xs:annotated"&gt; &lt;xs:group ref="xs:simpleRestrictionModel"/&gt; &lt;xs:attribute name="base" type="xs:QName" use="optional"/&gt; &lt;/xs:extension&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="list" id="list"&gt; &lt;xs:complexType&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-list"&gt; itemType attribute and simpleType child are mutually exclusive, but one or other is required &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:complexContent&gt; &lt;xs:extension base="xs:annotated"&gt; &lt;xs:sequence&gt; &lt;xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="itemType" type="xs:QName" use="optional"/&gt; &lt;/xs:extension&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="union" id="union"&gt; &lt;xs:complexType&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-union"&gt; memberTypes attribute must be non-empty or there must be at least one simpleType child &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:complexContent&gt; &lt;xs:extension base="xs:annotated"&gt; &lt;xs:sequence&gt; &lt;xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0" maxOccurs="unbounded"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="memberTypes" use="optional"&gt; &lt;xs:simpleType&gt; &lt;xs:list itemType="xs:QName"/&gt; &lt;/xs:simpleType&gt; &lt;/xs:attribute&gt; &lt;/xs:extension&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:complexType name="facet"&gt; &lt;xs:complexContent&gt; &lt;xs:extension base="xs:annotated"&gt; &lt;xs:attribute name="value" use="required"/&gt; &lt;xs:attribute name="fixed" type="xs:boolean" default="false" use="optional"/&gt; &lt;/xs:extension&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;xs:complexType name="noFixedFacet"&gt; &lt;xs:complexContent&gt; &lt;xs:restriction base="xs:facet"&gt; &lt;xs:sequence&gt; &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="fixed" use="prohibited"/&gt; &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt; &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;xs:element name="minExclusive" type="xs:facet" id="minExclusive" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-minExclusive"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:element name="minInclusive" type="xs:facet" id="minInclusive" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-minInclusive"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:element name="maxExclusive" type="xs:facet" id="maxExclusive" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-maxExclusive"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:element name="maxInclusive" type="xs:facet" id="maxInclusive" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-maxInclusive"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:complexType name="numFacet"&gt; &lt;xs:complexContent&gt; &lt;xs:restriction base="xs:facet"&gt; &lt;xs:sequence&gt; &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="value" type="xs:nonNegativeInteger" use="required"/&gt; &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt; &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;xs:complexType name="intFacet"&gt; &lt;xs:complexContent&gt; &lt;xs:restriction base="xs:facet"&gt; &lt;xs:sequence&gt; &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="value" type="xs:integer" use="required"/&gt; &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt; &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;xs:element name="totalDigits" id="totalDigits" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-totalDigits"/&gt; &lt;/xs:annotation&gt; &lt;xs:complexType&gt; &lt;xs:complexContent&gt; &lt;xs:restriction base="xs:numFacet"&gt; &lt;xs:sequence&gt; &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="value" type="xs:positiveInteger" use="required"/&gt; &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt; &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="fractionDigits" type="xs:numFacet" id="fractionDigits" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-fractionDigits"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:element name="length" type="xs:numFacet" id="length" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-length"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:element name="minLength" type="xs:numFacet" id="minLength" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-minLength"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:element name="maxLength" type="xs:numFacet" id="maxLength" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-maxLength"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:element name="enumeration" type="xs:noFixedFacet" id="enumeration" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-enumeration"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:element name="whiteSpace" id="whiteSpace" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-whiteSpace"/&gt; &lt;/xs:annotation&gt; &lt;xs:complexType&gt; &lt;xs:complexContent&gt; &lt;xs:restriction base="xs:facet"&gt; &lt;xs:sequence&gt; &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="value" use="required"&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base="xs:NMTOKEN"&gt; &lt;xs:enumeration value="preserve"/&gt; &lt;xs:enumeration value="replace"/&gt; &lt;xs:enumeration value="collapse"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;/xs:attribute&gt; &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt; &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="pattern" id="pattern" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-pattern"/&gt; &lt;/xs:annotation&gt; &lt;xs:complexType&gt; &lt;xs:complexContent&gt; &lt;xs:restriction base="xs:noFixedFacet"&gt; &lt;xs:sequence&gt; &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="value" type="xs:string" use="required"/&gt; &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt; &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="assertion" type="xs:assertion" id="assertion" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-assertion"/&gt; &lt;/xs:annotation&gt; &lt;/xs:element&gt; &lt;xs:element name="explicitTimezone" id="explicitTimezone" substitutionGroup="xs:facet"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#element-explicitTimezone"/&gt; &lt;/xs:annotation&gt; &lt;xs:complexType&gt; &lt;xs:complexContent&gt; &lt;xs:restriction base="xs:facet"&gt; &lt;xs:sequence&gt; &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="value" use="required"&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base="xs:NMTOKEN"&gt; &lt;xs:enumeration value="optional"/&gt; &lt;xs:enumeration value="required"/&gt; &lt;xs:enumeration value="prohibited"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;/xs:attribute&gt; &lt;xs:anyAttribute namespace="##other" processContents="lax"/&gt; &lt;/xs:restriction&gt; &lt;/xs:complexContent&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt; In keeping with the XML Schema WG's standard versioning policy, this schema document will persist at the URI http://www.w3.org/2012/04/datatypes.xsd. At the date of issue it can also be found at the URI http://www.w3.org/2009/XMLSchema/datatypes.xsd. The schema document at that URI may however change in the future, in order to remain compatible with the latest version of XSD and its namespace. In other words, if XSD or the XML Schema namespace change, the version of this document at http://www.w3.org/2009/XMLSchema/datatypes.xsd will change accordingly; the version at http://www.w3.org/2012/04/datatypes.xsd will not change. Previous dated (and unchanging) versions of this schema document include: http://www.w3.org/2012/01/datatypes.xsd (XSD 1.1 Proposed Recommendation) http://www.w3.org/2011/07/datatypes.xsd (XSD 1.1 Candidate Recommendation) http://www.w3.org/2009/04/datatypes.xsd (XSD 1.1 Candidate Recommendation) http://www.w3.org/2004/10/datatypes.xsd (XSD 1.0 Recommendation, Second Edition) http://www.w3.org/2001/05/datatypes.xsd (XSD 1.0 Recommendation, First Edition) &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;/xs:schema&gt; </pre></div></div></div><div class="div1"> <h2><a name="dtd-for-datatypeDefs" id="dtd-for-datatypeDefs" shape="rect"></a>B DTD for Datatype Definitions (non-normative)</h2><p>The DTD for the datatypes-specific aspects of schema documents is given below. Note there is <em>no</em> implication here that <code>schema</code> <span class="rfc2119">must</span> be the root element of a document.</p><div class="sfsScrap" id="div_dtd-for-datatypes"> <a id="dtd-for-datatypes" name="dtd-for-datatypes" shape="rect"></a> <div class="sfsHead">DTD for datatype definitions</div> <div class="sfsBody"> <pre xml:space="preserve">&lt;!-- DTD for XML Schemas: Part 2: Datatypes Id: datatypes.dtd,v 1.1.2.4 2005/01/31 18:40:42 cmsmcq Exp Note this DTD is NOT normative, or even definitive. --&gt; &lt;!-- This DTD cannot be used on its own, it is intended only for incorporation in XMLSchema.dtd, q.v. --&gt; &lt;!-- Define all the element names, with optional prefix --&gt; &lt;!ENTITY % simpleType "%p;simpleType"&gt; &lt;!ENTITY % restriction "%p;restriction"&gt; &lt;!ENTITY % list "%p;list"&gt; &lt;!ENTITY % union "%p;union"&gt; &lt;!ENTITY % maxExclusive "%p;maxExclusive"&gt; &lt;!ENTITY % minExclusive "%p;minExclusive"&gt; &lt;!ENTITY % maxInclusive "%p;maxInclusive"&gt; &lt;!ENTITY % minInclusive "%p;minInclusive"&gt; &lt;!ENTITY % totalDigits "%p;totalDigits"&gt; &lt;!ENTITY % fractionDigits "%p;fractionDigits"&gt; &lt;!ENTITY % length "%p;length"&gt; &lt;!ENTITY % minLength "%p;minLength"&gt; &lt;!ENTITY % maxLength "%p;maxLength"&gt; &lt;!ENTITY % enumeration "%p;enumeration"&gt; &lt;!ENTITY % whiteSpace "%p;whiteSpace"&gt; &lt;!ENTITY % pattern "%p;pattern"&gt; &lt;!ENTITY % assertion "%p;assertion"&gt; &lt;!ENTITY % explicitTimezone "%p;explicitTimezone"&gt; &lt;!-- Customization entities for the ATTLIST of each element type. Define one of these if your schema takes advantage of the anyAttribute='##other' in the schema for schemas --&gt; &lt;!ENTITY % simpleTypeAttrs ""&gt; &lt;!ENTITY % restrictionAttrs ""&gt; &lt;!ENTITY % listAttrs ""&gt; &lt;!ENTITY % unionAttrs ""&gt; &lt;!ENTITY % maxExclusiveAttrs ""&gt; &lt;!ENTITY % minExclusiveAttrs ""&gt; &lt;!ENTITY % maxInclusiveAttrs ""&gt; &lt;!ENTITY % minInclusiveAttrs ""&gt; &lt;!ENTITY % totalDigitsAttrs ""&gt; &lt;!ENTITY % fractionDigitsAttrs ""&gt; &lt;!ENTITY % lengthAttrs ""&gt; &lt;!ENTITY % minLengthAttrs ""&gt; &lt;!ENTITY % maxLengthAttrs ""&gt; &lt;!ENTITY % enumerationAttrs ""&gt; &lt;!ENTITY % whiteSpaceAttrs ""&gt; &lt;!ENTITY % patternAttrs ""&gt; &lt;!ENTITY % assertionAttrs ""&gt; &lt;!ENTITY % explicitTimezoneAttrs ""&gt; &lt;!-- Define some entities for informative use as attribute types --&gt; &lt;!ENTITY % URIref "CDATA"&gt; &lt;!ENTITY % XPathExpr "CDATA"&gt; &lt;!ENTITY % QName "NMTOKEN"&gt; &lt;!ENTITY % QNames "NMTOKENS"&gt; &lt;!ENTITY % NCName "NMTOKEN"&gt; &lt;!ENTITY % nonNegativeInteger "NMTOKEN"&gt; &lt;!ENTITY % boolean "(true|false)"&gt; &lt;!ENTITY % simpleDerivationSet "CDATA"&gt; &lt;!-- #all or space-separated list drawn from derivationChoice --&gt; &lt;!-- Note that the use of 'facet' below is less restrictive than is really intended: There should in fact be no more than one of each of minInclusive, minExclusive, maxInclusive, maxExclusive, totalDigits, fractionDigits, length, maxLength, minLength within datatype, and the min- and max- variants of Inclusive and Exclusive are mutually exclusive. On the other hand, pattern and enumeration and assertion may repeat. --&gt; &lt;!ENTITY % minBound "(%minInclusive; | %minExclusive;)"&gt; &lt;!ENTITY % maxBound "(%maxInclusive; | %maxExclusive;)"&gt; &lt;!ENTITY % bounds "%minBound; | %maxBound;"&gt; &lt;!ENTITY % numeric "%totalDigits; | %fractionDigits;"&gt; &lt;!ENTITY % ordered "%bounds; | %numeric;"&gt; &lt;!ENTITY % unordered "%pattern; | %enumeration; | %whiteSpace; | %length; | %maxLength; | %minLength; | %assertion; | %explicitTimezone;"&gt; &lt;!ENTITY % implementation-defined-facets ""&gt; &lt;!ENTITY % facet "%ordered; | %unordered; %implementation-defined-facets;"&gt; &lt;!ENTITY % facetAttr "value CDATA #REQUIRED id ID #IMPLIED"&gt; &lt;!ENTITY % fixedAttr "fixed %boolean; #IMPLIED"&gt; &lt;!ENTITY % facetModel "(%annotation;)?"&gt; &lt;!ELEMENT %simpleType; ((%annotation;)?, (%restriction; | %list; | %union;))&gt; &lt;!ATTLIST %simpleType; name %NCName; #IMPLIED final %simpleDerivationSet; #IMPLIED id ID #IMPLIED %simpleTypeAttrs;&gt; &lt;!-- name is required at top level --&gt; &lt;!ELEMENT %restriction; ((%annotation;)?, (%restriction1; | ((%simpleType;)?,(%facet;)*)), (%attrDecls;))&gt; &lt;!ATTLIST %restriction; base %QName; #IMPLIED id ID #IMPLIED %restrictionAttrs;&gt; &lt;!-- base and simpleType child are mutually exclusive, one is required. restriction is shared between simpleType and simpleContent and complexContent (in XMLSchema.xsd). restriction1 is for the latter cases, when this is restricting a complex type, as is attrDecls. --&gt; &lt;!ELEMENT %list; ((%annotation;)?,(%simpleType;)?)&gt; &lt;!ATTLIST %list; itemType %QName; #IMPLIED id ID #IMPLIED %listAttrs;&gt; &lt;!-- itemType and simpleType child are mutually exclusive, one is required --&gt; &lt;!ELEMENT %union; ((%annotation;)?,(%simpleType;)*)&gt; &lt;!ATTLIST %union; id ID #IMPLIED memberTypes %QNames; #IMPLIED %unionAttrs;&gt; &lt;!-- At least one item in memberTypes or one simpleType child is required --&gt; &lt;!ELEMENT %maxExclusive; %facetModel;&gt; &lt;!ATTLIST %maxExclusive; %facetAttr; %fixedAttr; %maxExclusiveAttrs;&gt; &lt;!ELEMENT %minExclusive; %facetModel;&gt; &lt;!ATTLIST %minExclusive; %facetAttr; %fixedAttr; %minExclusiveAttrs;&gt; &lt;!ELEMENT %maxInclusive; %facetModel;&gt; &lt;!ATTLIST %maxInclusive; %facetAttr; %fixedAttr; %maxInclusiveAttrs;&gt; &lt;!ELEMENT %minInclusive; %facetModel;&gt; &lt;!ATTLIST %minInclusive; %facetAttr; %fixedAttr; %minInclusiveAttrs;&gt; &lt;!ELEMENT %totalDigits; %facetModel;&gt; &lt;!ATTLIST %totalDigits; %facetAttr; %fixedAttr; %totalDigitsAttrs;&gt; &lt;!ELEMENT %fractionDigits; %facetModel;&gt; &lt;!ATTLIST %fractionDigits; %facetAttr; %fixedAttr; %fractionDigitsAttrs;&gt; &lt;!ELEMENT %length; %facetModel;&gt; &lt;!ATTLIST %length; %facetAttr; %fixedAttr; %lengthAttrs;&gt; &lt;!ELEMENT %minLength; %facetModel;&gt; &lt;!ATTLIST %minLength; %facetAttr; %fixedAttr; %minLengthAttrs;&gt; &lt;!ELEMENT %maxLength; %facetModel;&gt; &lt;!ATTLIST %maxLength; %facetAttr; %fixedAttr; %maxLengthAttrs;&gt; &lt;!-- This one can be repeated --&gt; &lt;!ELEMENT %enumeration; %facetModel;&gt; &lt;!ATTLIST %enumeration; %facetAttr; %enumerationAttrs;&gt; &lt;!ELEMENT %whiteSpace; %facetModel;&gt; &lt;!ATTLIST %whiteSpace; %facetAttr; %fixedAttr; %whiteSpaceAttrs;&gt; &lt;!-- This one can be repeated --&gt; &lt;!ELEMENT %pattern; %facetModel;&gt; &lt;!ATTLIST %pattern; %facetAttr; %patternAttrs;&gt; &lt;!ELEMENT %assertion; %facetModel;&gt; &lt;!ATTLIST %assertion; %facetAttr; %assertionAttrs;&gt; &lt;!ELEMENT %explicitTimezone; %facetModel;&gt; &lt;!ATTLIST %explicitTimezone; %facetAttr; %explicitTimezoneAttrs;&gt; </pre></div></div></div><div class="div1"> <h2><a name="prim.nxsd" id="prim.nxsd" shape="rect"></a>C Illustrative XML representations for the built-in simple type definitions</h2><div class="div2"> <h3><span class="nav"> <a href="#drvd.nxsd" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="sec-prim-nxsd" id="sec-prim-nxsd" shape="rect"></a>C.1 Illustrative XML representations for the built-in primitive type definitions</h3><p>The following, although in the form of a schema document, does not conform to the rules for schema documents defined in this specification. It contains explicit XML representations of the primitive datatypes which need not be declared in a schema document, since they are automatically included in every schema, and indeed must not be declared in a schema document, since it is forbidden to try to derive types with <a href="#anyAtomicType" shape="rect">anyAtomicType</a> as the base type definition. It is included here as a form of documentation. </p><div class="sfsScrap" id="div_not-schema-for-primitives"> <a id="not-schema-for-primitives" name="not-schema-for-primitives" shape="rect"></a> <div class="sfsHead">The (not a) schema document for primitive built-in type definitions</div> <div class="sfsBody"> <pre xml:space="preserve">&lt;?xml version='1.0'?&gt; &lt;!DOCTYPE xs:schema SYSTEM "../namespace/XMLSchema.dtd" [ &lt;!-- keep this schema XML1.0 DTD valid --&gt; &lt;!ENTITY % schemaAttrs 'xmlns:hfp CDATA #IMPLIED'&gt; &lt;!ELEMENT hfp:hasFacet EMPTY&gt; &lt;!ATTLIST hfp:hasFacet name NMTOKEN #REQUIRED&gt; &lt;!ELEMENT hfp:hasProperty EMPTY&gt; &lt;!ATTLIST hfp:hasProperty name NMTOKEN #REQUIRED value CDATA #REQUIRED&gt; ]&gt; &lt;xs:schema xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xml:lang="en" targetNamespace="http://www.w3.org/2001/XMLSchema"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt; This document contains XML elements which look like definitions for the primitive datatypes. These definitions are for information only; the real built-in definitions are magic. &lt;/xs:documentation&gt; &lt;xs:documentation&gt; For each built-in datatype in this schema (both primitive and derived) can be uniquely addressed via a URI constructed as follows: 1) the base URI is the URI of the XML Schema namespace 2) the fragment identifier is the name of the datatype For example, to address the int datatype, the URI is: http://www.w3.org/2001/XMLSchema#int Additionally, each facet definition element can be uniquely addressed via a URI constructed as follows: 1) the base URI is the URI of the XML Schema namespace 2) the fragment identifier is the name of the facet For example, to address the maxInclusive facet, the URI is: http://www.w3.org/2001/XMLSchema#maxInclusive Additionally, each facet usage in a built-in datatype definition can be uniquely addressed via a URI constructed as follows: 1) the base URI is the URI of the XML Schema namespace 2) the fragment identifier is the name of the datatype, followed by a period (".") followed by the name of the facet For example, to address the usage of the maxInclusive facet in the definition of int, the URI is: http://www.w3.org/2001/XMLSchema#int.maxInclusive &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:simpleType name="string" id="string"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="length"/&gt; &lt;hfp:hasFacet name="minLength"/&gt; &lt;hfp:hasFacet name="maxLength"/&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="false"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#string"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace value="preserve" id="string.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="boolean" id="boolean"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="false"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="finite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#boolean"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="boolean.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="float" id="float"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="true"/&gt; &lt;hfp:hasProperty name="cardinality" value="finite"/&gt; &lt;hfp:hasProperty name="numeric" value="true"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#float"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="float.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="double" id="double"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="true"/&gt; &lt;hfp:hasProperty name="cardinality" value="finite"/&gt; &lt;hfp:hasProperty name="numeric" value="true"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#double"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="double.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="decimal" id="decimal"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="totalDigits"/&gt; &lt;hfp:hasFacet name="fractionDigits"/&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="total"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="true"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#decimal"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="decimal.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="duration" id="duration"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#duration"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="duration.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="dateTime" id="dateTime"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasFacet name="explicitTimezone"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#dateTime"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="dateTime.whiteSpace"/&gt; &lt;xs:explicitTimezone value="optional" id="dateTime.explicitTimezone"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="time" id="time"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasFacet name="explicitTimezone"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#time"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="time.whiteSpace"/&gt; &lt;xs:explicitTimezone value="optional" id="time.explicitTimezone"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="date" id="date"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasFacet name="explicitTimezone"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#date"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="date.whiteSpace"/&gt; &lt;xs:explicitTimezone value="optional" id="date.explicitTimezone"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="gYearMonth" id="gYearMonth"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasFacet name="explicitTimezone"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#gYearMonth"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="gYearMonth.whiteSpace"/&gt; &lt;xs:explicitTimezone value="optional" id="gYearMonth.explicitTimezone"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="gYear" id="gYear"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasFacet name="explicitTimezone"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#gYear"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="gYear.whiteSpace"/&gt; &lt;xs:explicitTimezone value="optional" id="gYear.explicitTimezone"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="gMonthDay" id="gMonthDay"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasFacet name="explicitTimezone"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#gMonthDay"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="gMonthDay.whiteSpace"/&gt; &lt;xs:explicitTimezone value="optional" id="gMonthDay.explicitTimezone"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="gDay" id="gDay"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasFacet name="explicitTimezone"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#gDay"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="gDay.whiteSpace"/&gt; &lt;xs:explicitTimezone value="optional" id="gDay.explicitTimezone"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="gMonth" id="gMonth"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="maxInclusive"/&gt; &lt;hfp:hasFacet name="maxExclusive"/&gt; &lt;hfp:hasFacet name="minInclusive"/&gt; &lt;hfp:hasFacet name="minExclusive"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasFacet name="explicitTimezone"/&gt; &lt;hfp:hasProperty name="ordered" value="partial"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#gMonth"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="gMonth.whiteSpace"/&gt; &lt;xs:explicitTimezone value="optional" id="gMonth.explicitTimezone"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="hexBinary" id="hexBinary"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="length"/&gt; &lt;hfp:hasFacet name="minLength"/&gt; &lt;hfp:hasFacet name="maxLength"/&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="false"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#hexBinary"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="hexBinary.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="base64Binary" id="base64Binary"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="length"/&gt; &lt;hfp:hasFacet name="minLength"/&gt; &lt;hfp:hasFacet name="maxLength"/&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="false"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#base64Binary"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="base64Binary.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="anyURI" id="anyURI"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="length"/&gt; &lt;hfp:hasFacet name="minLength"/&gt; &lt;hfp:hasFacet name="maxLength"/&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="false"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#anyURI"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="anyURI.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="QName" id="QName"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="length"/&gt; &lt;hfp:hasFacet name="minLength"/&gt; &lt;hfp:hasFacet name="maxLength"/&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="false"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#QName"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="QName.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="NOTATION" id="NOTATION"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="length"/&gt; &lt;hfp:hasFacet name="minLength"/&gt; &lt;hfp:hasFacet name="maxLength"/&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="false"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#NOTATION"/&gt; &lt;xs:documentation&gt; NOTATION cannot be used directly in a schema; rather a type must be derived from it by specifying at least one enumeration facet whose value is the name of a NOTATION declared in the schema. &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:anyAtomicType"&gt; &lt;xs:whiteSpace fixed="true" value="collapse" id="NOTATION.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;/xs:schema&gt; </pre></div></div></div><div class="div2"> <h3><span class="nav"><a href="#sec-prim-nxsd" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="drvd.nxsd" id="drvd.nxsd" shape="rect"></a>C.2 Illustrative XML representations for the built-in ordinary type definitions</h3><p>The following, although in the form of a schema document, contains XML representations of components already present in all schemas by definition. It is included here as a form of documentation.</p><div class="note"><div class="p"><b>Note:</b> These datatypes do not need to be declared in a schema document, since they are automatically included in every schema.</div></div><div class="issue"><a name="B-1933" id="B-1933" shape="rect"></a><blockquote><b>Issue (B-1933):</b><div class="p">It is an open question whether this and similar XML documents should be accepted or rejected by software conforming to this specification. The XML Schema Working Group expects to resolve this question in connection with its work on issues relating to schema composition.</div><div class="p">In the meantime, some existing schema processors will accept declarations for them; other existing processors will reject such declarations as duplicates.</div></blockquote></div><div class="sfsScrap" id="div_schema-for-derived"> <a id="schema-for-derived" name="schema-for-derived" shape="rect"></a> <div class="sfsHead">Illustrative schema document for derived built-in type definitions</div> <div class="sfsBody"> <pre xml:space="preserve">&lt;?xml version='1.0'?&gt; &lt;!DOCTYPE xs:schema SYSTEM "../namespace/XMLSchema.dtd" [ &lt;!-- keep this schema XML1.0 DTD valid --&gt; &lt;!ENTITY % schemaAttrs 'xmlns:hfp CDATA #IMPLIED'&gt; &lt;!ELEMENT hfp:hasFacet EMPTY&gt; &lt;!ATTLIST hfp:hasFacet name NMTOKEN #REQUIRED&gt; &lt;!ELEMENT hfp:hasProperty EMPTY&gt; &lt;!ATTLIST hfp:hasProperty name NMTOKEN #REQUIRED value CDATA #REQUIRED&gt; ]&gt; &lt;xs:schema xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xml:lang="en" targetNamespace="http://www.w3.org/2001/XMLSchema"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt; This document contains XML representations for the ordinary non-primitive built-in datatypes &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:simpleType name="normalizedString" id="normalizedString"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#normalizedString"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:string"&gt; &lt;xs:whiteSpace value="replace" id="normalizedString.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="token" id="token"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#token"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:normalizedString"&gt; &lt;xs:whiteSpace value="collapse" id="token.whiteSpace"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="language" id="language"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#language"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:token"&gt; &lt;xs:pattern value="[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*" id="language.pattern"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.ietf.org/rfc/bcp/bcp47.txt"&gt; pattern specifies the content of section 2.12 of XML 1.0e2 and RFC 3066 (Revised version of RFC 1766). N.B. RFC 3066 is now obsolete; the grammar of RFC4646 is more restrictive. So strict conformance to the rules for language codes requires extra checking beyond validation against this type. &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;/xs:pattern&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="IDREFS" id="IDREFS"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="length"/&gt; &lt;hfp:hasFacet name="minLength"/&gt; &lt;hfp:hasFacet name="maxLength"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="false"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#IDREFS"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction&gt; &lt;xs:simpleType&gt; &lt;xs:list itemType="xs:IDREF"/&gt; &lt;/xs:simpleType&gt; &lt;xs:minLength value="1" id="IDREFS.minLength"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="ENTITIES" id="ENTITIES"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="length"/&gt; &lt;hfp:hasFacet name="minLength"/&gt; &lt;hfp:hasFacet name="maxLength"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="false"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#ENTITIES"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction&gt; &lt;xs:simpleType&gt; &lt;xs:list itemType="xs:ENTITY"/&gt; &lt;/xs:simpleType&gt; &lt;xs:minLength value="1" id="ENTITIES.minLength"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="NMTOKEN" id="NMTOKEN"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#NMTOKEN"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:token"&gt; &lt;xs:pattern value="\c+" id="NMTOKEN.pattern"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/REC-xml#NT-Nmtoken"&gt; pattern matches production 7 from the XML spec &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;/xs:pattern&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="NMTOKENS" id="NMTOKENS"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasFacet name="length"/&gt; &lt;hfp:hasFacet name="minLength"/&gt; &lt;hfp:hasFacet name="maxLength"/&gt; &lt;hfp:hasFacet name="enumeration"/&gt; &lt;hfp:hasFacet name="whiteSpace"/&gt; &lt;hfp:hasFacet name="pattern"/&gt; &lt;hfp:hasFacet name="assertions"/&gt; &lt;hfp:hasProperty name="ordered" value="false"/&gt; &lt;hfp:hasProperty name="bounded" value="false"/&gt; &lt;hfp:hasProperty name="cardinality" value="countably infinite"/&gt; &lt;hfp:hasProperty name="numeric" value="false"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#NMTOKENS"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction&gt; &lt;xs:simpleType&gt; &lt;xs:list itemType="xs:NMTOKEN"/&gt; &lt;/xs:simpleType&gt; &lt;xs:minLength value="1" id="NMTOKENS.minLength"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="Name" id="Name"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#Name"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:token"&gt; &lt;xs:pattern value="\i\c*" id="Name.pattern"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/REC-xml#NT-Name"&gt; pattern matches production 5 from the XML spec &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;/xs:pattern&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="NCName" id="NCName"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#NCName"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:Name"&gt; &lt;xs:pattern value="[\i-[:]][\c-[:]]*" id="NCName.pattern"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/REC-xml-names/#NT-NCName"&gt; pattern matches production 4 from the Namespaces in XML spec &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;/xs:pattern&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="ID" id="ID"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#ID"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:NCName"/&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="IDREF" id="IDREF"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#IDREF"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:NCName"/&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="ENTITY" id="ENTITY"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#ENTITY"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:NCName"/&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="integer" id="integer"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#integer"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:decimal"&gt; &lt;xs:fractionDigits fixed="true" value="0" id="integer.fractionDigits"/&gt; &lt;xs:pattern value="[\-+]?[0-9]+" id="integer.pattern"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="nonPositiveInteger" id="nonPositiveInteger"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#nonPositiveInteger"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:integer"&gt; &lt;xs:maxInclusive value="0" id="nonPositiveInteger.maxInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="negativeInteger" id="negativeInteger"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#negativeInteger"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:nonPositiveInteger"&gt; &lt;xs:maxInclusive value="-1" id="negativeInteger.maxInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="long" id="long"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasProperty name="bounded" value="true"/&gt; &lt;hfp:hasProperty name="cardinality" value="finite"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#long"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:integer"&gt; &lt;xs:minInclusive value="-9223372036854775808" id="long.minInclusive"/&gt; &lt;xs:maxInclusive value="9223372036854775807" id="long.maxInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="int" id="int"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#int"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:long"&gt; &lt;xs:minInclusive value="-2147483648" id="int.minInclusive"/&gt; &lt;xs:maxInclusive value="2147483647" id="int.maxInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="short" id="short"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#short"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:int"&gt; &lt;xs:minInclusive value="-32768" id="short.minInclusive"/&gt; &lt;xs:maxInclusive value="32767" id="short.maxInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="byte" id="byte"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#byte"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:short"&gt; &lt;xs:minInclusive value="-128" id="byte.minInclusive"/&gt; &lt;xs:maxInclusive value="127" id="byte.maxInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="nonNegativeInteger" id="nonNegativeInteger"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#nonNegativeInteger"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:integer"&gt; &lt;xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="unsignedLong" id="unsignedLong"&gt; &lt;xs:annotation&gt; &lt;xs:appinfo&gt; &lt;hfp:hasProperty name="bounded" value="true"/&gt; &lt;hfp:hasProperty name="cardinality" value="finite"/&gt; &lt;/xs:appinfo&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#unsignedLong"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:nonNegativeInteger"&gt; &lt;xs:maxInclusive value="18446744073709551615" id="unsignedLong.maxInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="unsignedInt" id="unsignedInt"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#unsignedInt"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:unsignedLong"&gt; &lt;xs:maxInclusive value="4294967295" id="unsignedInt.maxInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="unsignedShort" id="unsignedShort"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#unsignedShort"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:unsignedInt"&gt; &lt;xs:maxInclusive value="65535" id="unsignedShort.maxInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="unsignedByte" id="unsignedByte"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#unsignedByte"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:unsignedShort"&gt; &lt;xs:maxInclusive value="255" id="unsignedByte.maxInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="positiveInteger" id="positiveInteger"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#positiveInteger"/&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:nonNegativeInteger"&gt; &lt;xs:minInclusive value="1" id="positiveInteger.minInclusive"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="yearMonthDuration"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#yearMonthDuration"&gt; This type includes just those durations expressed in years and months. Since the pattern given excludes days, hours, minutes, and seconds, the values of this type have a seconds property of zero. They are totally ordered. &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:duration"&gt; &lt;xs:pattern id="yearMonthDuration.pattern" value="[^DT]*"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="dayTimeDuration"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#dayTimeDuration"&gt; This type includes just those durations expressed in days, hours, minutes, and seconds. The pattern given excludes years and months, so the values of this type have a months property of zero. They are totally ordered. &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:duration"&gt; &lt;xs:pattern id="dayTimeDuration.pattern" value="[^YM]*(T.*)?"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="dateTimeStamp" id="dateTimeStamp"&gt; &lt;xs:annotation&gt; &lt;xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#dateTimeStamp"&gt; This datatype includes just those dateTime values Whose explicitTimezone is present. They are totally ordered. &lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:restriction base="xs:dateTime"&gt; &lt;xs:explicitTimezone fixed="true" id="dateTimeStamp.explicitTimezone" value="required"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;/xs:schema&gt;</pre></div></div></div></div><div class="div1"> <h2><a name="constructedValueSpaces" id="constructedValueSpaces" shape="rect"></a>D Built-up Value Spaces</h2><p>Some datatypes, such as <a href="#integer" shape="rect">integer</a>, describe well-known mathematically abstract systems.&#160; Others, such as the date/time datatypes, describe "real-life", "applied" systems.&#160; Certain of the systems described by datatypes, both abstract and applied, have values in their value spaces most easily described as things having several <em>properties</em>, which in turn have values which are in some sense "primitive" or are from the value spaces of simpler datatypes.</p><p>In this document, the arguments to functions are assumed to be "call by value" unless explicitly noted to the contrary, meaning that if the argument is modified during the processing of the algorithm, that modification is <em>not</em> reflected in the "outside world".&#160; On the other hand, the arguments to procedures are assumed to be "call by location", meaning that modifications <em>are</em> so reflected, since that is the only way the processing of the algorithm can have any effect.</p><p>Properties always have values.&#160; <span class="termdef"><a name="dt-optional" id="dt-optional" title="" shape="rect">[Definition:]&#160;&#160;</a>An <b>optional</b> property is <em>permitted</em> but not <em>required</em> to have the distinguished value <b><i>absent</i></b>.</span></p><p><span class="termdef"><a name="key-null" id="key-null" title="" shape="rect">[Definition:]&#160;&#160;</a>Throughout this specification, the value <b><b><i>absent</i></b></b> is used as a distinguished value to indicate that a given instance of a property "has no value" or "is absent".</span>&#160; This should not be interpreted as constraining implementations, as for instance between using a <b><i>null</i></b> value for such properties or not representing them at all.</p><div class="block">Those values that are more primitive, and are used (among other things) herein to construct object value spaces but which we do not explicitly define are described here: <ul><li><div class="p">A <b>number (without precision)</b> is an ordinary mathematical number; 1, 1.0, and 1.000000000000 are the same number.&#160; The decimal numbers and integers generally used in the algorithms of appendix <a href="#ap-funcDefs" shape="rect">Function Definitions (&#167;E)</a> are such ordinary numbers, not carrying precision.</div></li><li><div class="p"><span class="termdef"><a name="dt-specialvalue" id="dt-specialvalue" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>special value</b> is an object whose only relevant properties for purposes of this specification are that it is distinct from, and unequal to, any other values (special or otherwise).</span>&#160; A few special values in different value spaces (e.g. <b><i>positiveInfinity</i></b>, <b><i>negativeInfinity</i></b>, and <b><i>notANumber</i></b> in <a href="#float" shape="rect">float</a> and <a href="#double" shape="rect">double</a>) share names.&#160; Thus, special values can be distinguished from each other in the general case by considering both the name and the primitive datatype of the value; in some cases, of course, the name alone suffices to identify the value uniquely.</div><div class="note"><a name="b3226move.n1" id="b3226move.n1" shape="rect"></a><div class="p"><b>Note:</b> In the case of <a href="#float" shape="rect">float</a> and <a href="#double" shape="rect">double</a>, the <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a> are members of the datatype's <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.&#160; </div></div></li></ul> </div><div class="div2"> <h3 class="withToc"><span class="nav"> <a href="#d-t-values" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="sec-numericalValues" id="sec-numericalValues" shape="rect"></a>D.1 Numerical Values</h3><div class="block">The following standard operators are defined here in case the reader is unsure of their definition: <ul><li><div class="p"><span class="termdef"><a name="dt-div" id="dt-div" title="" shape="rect">[Definition:]&#160;&#160;</a>If <var>m</var> and <var>n</var> are numbers, then <var>m</var>&#160;<b>div</b> <var>n</var> is the greatest integer less than or equal to <var>m</var>&#160;/&#160;<var>n</var>&#160;.</span></div></li><li><div class="p"><span class="termdef"><a name="dt-mod" id="dt-mod" title="" shape="rect">[Definition:]&#160;&#160;</a>If <var>m</var> and <var>n</var> are numbers, then <var>m</var> <b>mod</b> <var>n</var> is&#160; <var>m</var>&#160;&#8722;&#160;<var>n</var>&#160;&#215;&#160;(&#160;<var>m</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;<var>n</var>)&#160;.</span> </div></li></ul> </div><div class="note"><div class="p"><b>Note:</b> <var>n</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;1&#160; is a convenient and short way of expressing "the greatest integer less than or equal to <var>n</var>".</div></div><div class="div3"> <h4><a name="sec-exactmaps" id="sec-exactmaps" shape="rect"></a>D.1.1 Exact Lexical Mappings</h4><div class="defset"> <div class="defset-head">Numerals and Fragments Thereof</div> <div class="prod"> <a name="nt-digit" id="nt-digit" shape="rect"></a><span class="lhs">[45] &#160; <i>digit</i></span>&#160;::= [<code>0-9</code>]</div><div class="prod"> <a name="nt-unsNoDecNuml" id="nt-unsNoDecNuml" shape="rect"></a><span class="lhs">[46] &#160; <i>unsignedNoDecimalPtNumeral</i></span>&#160;::= <a href="#nt-digit" shape="rect"><i>digit</i></a>+</div><div class="prod"> <a name="nt-noDecNuml" id="nt-noDecNuml" shape="rect"></a><span class="lhs">[47] &#160; <i>noDecimalPtNumeral</i></span>&#160;::= ('<code>+</code>'&#160;|&#160;'<code>-</code>')?&#160;<a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a></div><div class="prod"> <a name="nt-fracFrag" id="nt-fracFrag" shape="rect"></a><span class="lhs">[48] &#160; <i>fracFrag</i></span>&#160;::= <a href="#nt-digit" shape="rect"><i>digit</i></a>+</div><div class="prod"> <a name="nt-unsDecNuml" id="nt-unsDecNuml" shape="rect"></a><span class="lhs">[49] &#160; <i>unsignedDecimalPtNumeral</i></span>&#160;::= (<a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>&#160;'<code>.</code>'&#160;<a href="#nt-fracFrag" shape="rect"><i>fracFrag</i></a>?)&#160;|&#160;('<code>.</code>'&#160;<a href="#nt-fracFrag" shape="rect"><i>fracFrag</i></a>)</div><div class="prod"> <a name="nt-unsFullDecNuml" id="nt-unsFullDecNuml" shape="rect"></a><span class="lhs">[50] &#160; <i>unsignedFullDecimalPtNumeral</i></span>&#160;::= <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>&#160;'<code>.</code>'&#160;<a href="#nt-fracFrag" shape="rect"><i>fracFrag</i></a></div><div class="prod"> <a name="nt-decNuml" id="nt-decNuml" shape="rect"></a><span class="lhs">[51] &#160; <i>decimalPtNumeral</i></span>&#160;::= ('<code>+</code>'&#160;|&#160;'<code>-</code>')?&#160;<a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a></div><div class="prod"> <a name="nt-unsSciNuml" id="nt-unsSciNuml" shape="rect"></a><span class="lhs">[52] &#160; <i>unsignedScientificNotationNumeral</i></span>&#160;::= (<a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>&#160;|&#160;<a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a>) ('<code>e</code>'&#160;|&#160;'<code>E</code>') <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a></div><div class="prod"> <a name="nt-sciNuml" id="nt-sciNuml" shape="rect"></a><span class="lhs">[53] &#160; <i>scientificNotationNumeral</i></span>&#160;::= ('<code>+</code>'&#160;|&#160;'<code>-</code>')?&#160;<a href="#nt-unsSciNuml" shape="rect"><i>unsignedScientificNotationNumeral</i></a></div></div> <div class="block"> <div class="defset"> <div class="not_aux"> <div class="defset-head">Generic Numeral-to-Number Lexical Mappings</div> <div class="deftop"><b><a name="summary-f-unsNoDecVal" id="summary-f-unsNoDecVal" href="#f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a></b> (<var>N</var>) &#8594; integer</div> <div class="defindent">Maps an <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a> to its numerical value.</div> <div class="deftop"><b><a name="summary-f-noDecVal" id="summary-f-noDecVal" href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a></b> (<var>N</var>) &#8594; integer</div> <div class="defindent">Maps an <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a> to its numerical value.</div> <div class="deftop"><b><a name="summary-f-unsDecVal" id="summary-f-unsDecVal" href="#f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a></b> (<var>D</var>) &#8594; decimal number</div> <div class="defindent">Maps an <a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a> to its numerical value.</div> <div class="deftop"><b><a name="summary-f-decVal" id="summary-f-decVal" href="#f-decVal" shape="rect"><i><span class="arrow">&#183;</span>decimalPtMap<span class="arrow">&#183;</span></i></a></b> (<var>N</var>) &#8594; decimal number</div> <div class="defindent">Maps a <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a> to its numerical value.</div> <div class="deftop"><b><a name="summary-f-sciVal" id="summary-f-sciVal" href="#f-sciVal" shape="rect"><i><span class="arrow">&#183;</span>scientificMap<span class="arrow">&#183;</span></i></a></b> (<var>N</var>) &#8594; decimal number</div> <div class="defindent">Maps a <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a> to its numerical value.</div> </div></div> <div class="defset"> <div class="not_aux"> <div class="defset-head">Generic Number to Numeral Canonical Mappings</div> <div class="deftop"><b><a name="summary-f-unsNoDecCanFragMap" id="summary-f-unsNoDecCanFragMap" href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>i</var>) &#8594; <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a></div> <div class="defindent">Maps a nonnegative integer to a <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-noDecCanMap" id="summary-f-noDecCanMap" href="#f-noDecCanMap" shape="rect"><i><span class="arrow">&#183;</span>noDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>i</var>) &#8594; <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a></div> <div class="defindent">Maps an integer to a <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-unsDecCanFragMap" id="summary-f-unsDecCanFragMap" href="#f-unsDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>n</var>) &#8594; <a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a></div> <div class="defindent">Maps a nonnegative decimal number to a <a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-decCanFragMap" id="summary-f-decCanFragMap" href="#f-decCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>decimalPtCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>n</var>) &#8594; <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a></div> <div class="defindent">Maps a decimal number to a <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-unsSciCanFragMap" id="summary-f-unsSciCanFragMap" href="#f-unsSciCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedScientificCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>n</var>) &#8594; <a href="#nt-unsSciNuml" shape="rect"><i>unsignedScientificNotationNumeral</i></a></div> <div class="defindent">Maps a nonnegative decimal number to a <a href="#nt-unsSciNuml" shape="rect"><i>unsignedScientificNotationNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-sciCanFragMap" id="summary-f-sciCanFragMap" href="#f-sciCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>scientificCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>n</var>) &#8594; <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a></div> <div class="defindent">Maps a decimal number to a <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> </div></div> Some numerical datatypes include some or all of three non-numerical <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a>: <b><i>positiveInfinity</i></b>, <b><i>negativeInfinity</i></b>, and <b><i>notANumber</i></b>.&#160; Their lexical spaces include non-numeral lexical representations for these non-numeric values: <div class="defset"> <div class="defset-head">Special Non-numerical Lexical Representations Used With Numerical Datatypes</div> <div class="prod"> <a name="nt-minNumSpecReps" id="nt-minNumSpecReps" shape="rect"></a><span class="lhs">[54] &#160; <i>minimalNumericalSpecialRep</i></span>&#160;::= '<code>INF</code>'&#160;|&#160;'<code>-INF</code>'&#160;|&#160;'<code>NaN</code>'</div><div class="prod"> <a name="nt-numSpecReps" id="nt-numSpecReps" shape="rect"></a><span class="lhs">[55] &#160; <i>numericalSpecialRep</i></span>&#160;::= '<code>+INF</code>'&#160;|&#160;<a href="#nt-minNumSpecReps" shape="rect"><i>minimalNumericalSpecialRep</i></a></div></div> <div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping for Non-numerical <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>Special Values<span class="arrow">&#183;</span></a> Used With Numerical Datatypes</div> <div class="deftop"><b><a name="summary-f-specRepVal" id="summary-f-specRepVal" href="#f-specRepVal" shape="rect"><i><span class="arrow">&#183;</span>specialRepValue<span class="arrow">&#183;</span></i></a></b> (<var>S</var>) &#8594; a <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special value<span class="arrow">&#183;</span></a></div> <div class="defindent">Maps the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> of <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a> used with some numerical datatypes to those <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a>.</div> </div></div> <div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping for Non-numerical <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>Special Values<span class="arrow">&#183;</span></a> Used with Numerical Datatypes</div> <div class="deftop"><b><a name="summary-f-specValCanMap" id="summary-f-specValCanMap" href="#f-specValCanMap" shape="rect"><i><span class="arrow">&#183;</span>specialRepCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>c</var>) &#8594; <a href="#nt-numSpecReps" shape="rect"><i>numericalSpecialRep</i></a></div> <div class="defindent">Maps the <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a> used with some numerical datatypes to their <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representations<span class="arrow">&#183;</span></a>.</div> </div></div> </div></div></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#sec-numericalValues" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="d-t-values" id="d-t-values" shape="rect"></a>D.2 Date/time Values</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;D.2.1 <a href="#theSevenPropertyModel" shape="rect">The Seven-property Model</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;D.2.2 <a href="#rf-lexicalMappings-datetime" shape="rect">Lexical Mappings</a><br clear="none" /> </div><p>There are several different primitive but related datatypes defined in the specification which pertain to various combinations of dates and times, and parts thereof.&#160; They all use related value-space models, which are described in detail in this section.&#160; It is not difficult for a casual reader of the descriptions of the individual datatypes elsewhere in this specification to misunderstand some of the details of just what the datatypes are intended to represent, so more detail is presented here in this section.</p><p>All of the value spaces for dates and times described here represent moments or periods of time in Universal Coordinated Time (UTC).&#160; <span class="termdef"><a name="dt-utc" id="dt-utc" title="" shape="rect">[Definition:]&#160;&#160;</a><b>Universal Coordinated Time</b> (<b>UTC</b>) is an adaptation of TAI which closely approximates UT1 by adding <a href="#dt-leapsec" class="termref" shape="rect"><span class="arrow">&#183;</span>leap-seconds<span class="arrow">&#183;</span></a> to selected <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a> days.</span></p><p><span class="termdef"><a name="dt-leapsec" id="dt-leapsec" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>leap-second</b> is an additional second added to the last day of December, June, October, or March, when such an adjustment is deemed necessary by the International Earth Rotation and Reference Systems Service in order to keep <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a> within 0.9 seconds of observed astronomical time.&#160; When leap seconds are introduced, the last minute in the day has more than sixty seconds.&#160; In theory leap seconds can also be removed from a day, but this has not yet occurred. (See <a href="#IERS" shape="rect">[International Earth Rotation Service (IERS)]</a>, <a href="#itu-r-460-6" shape="rect">[ITU-R TF.460-6]</a>.) Leap seconds are <em>not</em> supported by the types defined here.</span></p><p>Because the <a href="#dateTime" shape="rect">dateTime</a> type and other date- and time-related types defined in this specification do not support leap seconds, there are portions of the <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a> timeline which cannot be represented by values of these types. Users whose applications require that leap seconds be represented and that date/time arithmetic take historically occurring leap seconds into account will wish to make appropriate adjustments at the application level, or to use other types.</p><div class="div3"> <h4><a name="theSevenPropertyModel" id="theSevenPropertyModel" shape="rect"></a>D.2.1 The Seven-property Model</h4><p>There are two distinct ways to model moments in time:&#160; either by tracking their year, month, day, hour, minute and second (with fractional seconds as needed), or by tracking their time (measured generally in seconds or days) from some starting moment.&#160; Each has its advantages.&#160; The two are isomorphic.&#160; For definiteness, we choose to model the first using five integer and one decimal number properties.&#160; We superimpose the second by providing one decimal number-valued function which gives the corresponding count of seconds from zero (the "time on the time line").</p><div class="block">There is also a seventh <a href="#integer" shape="rect">integer</a> property which specifies the time zone offset as the number of minutes of offset from UTC.&#160; Values for the six primary properties are always stored in their "local" values (the values shown in the lexical representations), rather than converted to <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a>. <div class="defset"> <div class="defset-head">Properties of <a name="dt-dt-7PropMod" id="dt-dt-7PropMod" shape="rect">Date/time Seven-property Models</a></div> <div class="deftop"> <b><a name="vp-dt-year" id="vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a></b></div> <div class="defindent">an integer</div> <div class="deftop"> <b><a name="vp-dt-month" id="vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a></b></div> <div class="defindent">an integer between 1 and 12 inclusive</div> <div class="deftop"> <b><a name="vp-dt-day" id="vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a></b></div> <div class="defindent">an integer between 1 and 31 inclusive, possibly restricted further depending on <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> and <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a></div> <div class="deftop"> <b><a name="vp-dt-hour" id="vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a></b></div> <div class="defindent">an integer between 0 and 23 inclusive</div> <div class="deftop"> <b><a name="vp-dt-minute" id="vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a></b></div> <div class="defindent">an integer between 0 and 59 inclusive</div> <div class="deftop"> <b><a name="vp-dt-second" id="vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a></b></div> <div class="defindent">a decimal number greater than or equal to 0 and less than 60.</div> <div class="deftop"> <b><a name="vp-dt-timezone" id="vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a></b></div> <div class="defindent">an <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a> integer between &#8722;840 and 840 inclusive</div> </div> </div><p>Non-negative values of the properties map to the years, months, days of month, etc. of the Gregorian calendar in the obvious way. Values less than 1582 in the <a href="#vp-dt-year" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> property represent years in the "proleptic Gregorian calendar". A value of zero in the <a href="#vp-dt-year" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> property represents the year 1 BCE; a value of &#8722;1 represents the year 2 BCE, &#8722;2 is 3 BCE, etc.</p><div class="note"><div class="p"><b>Note:</b> In version 1.0 of this specification, the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> property was not permitted to have the value zero. The year before the year 1 in the proleptic Gregorian calendar, traditionally referred to as 1 BC or as 1 BCE, was represented by a <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> value of &#8722;1, 2 BCE by &#8722;2, and so forth. 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 "old style" calendar; the two correspond approximately but not exactly to each other. </div><div class="p">In this version of this specification, two changes are made in order to agree with existing usage. First, <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> is permitted to have the value zero. Second, the interpretation of <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> values is changed accordingly: a <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> value of zero represents 1 BCE, &#8722;1 represents 2 BCE, etc. This representation simplifies interval arithmetic and leap-year calculation for dates before the common era (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 <a href="#ISO8601" shape="rect">[ISO 8601]</a>. </div><div class="p"> Note that 1 BCE, 5 BCE, and so on (years 0000, &#8722;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. If existing schemas or data specify dates of 29 February for any years before the common era, 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. With that possible exception, schemas and data valid under the old interpretation remain valid under the new. </div></div><p>The model just described is called herein the "seven-property" model for date/time datatypes.&#160; It is used "as is" for <a href="#dateTime" shape="rect">dateTime</a>; all other date/time datatypes except <a href="#duration" shape="rect">duration</a> use the same model except that some of the six primary properties are <em>required</em> to have the value <b><i>absent</i></b>, instead of being required to have a numerical value.&#160; (An <em><a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a></em> property, like <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>, is always <em>permitted</em> to have the value <b><i>absent</i></b>.)</p><p><a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> values are limited to 14 hours, which is 840 (=&#160;60&#160;&#215;&#160;14) minutes.</p><div class="note"><div class="p"><b>Note:</b> Leap-seconds are not permitted</div></div><p>Readers interested in when leap-seconds have been introduced should consult <a href="#USNavy_leaps" shape="rect">[USNO Historical List]</a>, which includes a list of times when the difference between TAI and <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a> has changed.&#160; Because the simple types defined here do not support leap seconds, they cannot be used to represent the final second, in <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a>, of any of the days containing one.&#160; If it is important, at the application level, to track the occurrence of leap seconds, then users will need to make special arrangements for special handling of them and of time intervals crossing them. </p><p>While calculating, property values from the <a href="#dateTime" shape="rect">dateTime</a> 1972-12-31T00:00:00 are used to fill in for those that are <b><i>absent</i></b>, except that if <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b> but <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> is not, the largest permitted day for that month is used.</p><div class="block"> <div class="defset"> <div class="not_aux"> <div class="defset-head">Time on Timeline for Date/time Seven-property Model Datatypes</div> <div class="deftop"><b><a name="summary-vp-dt-timeOnTimeline" id="summary-vp-dt-timeOnTimeline" href="#vp-dt-timeOnTimeline" shape="rect"><i><span class="arrow">&#183;</span>timeOnTimeline<span class="arrow">&#183;</span></i></a></b> (<var>dt</var>) &#8594; decimal number</div> <div class="defindent">Maps a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value to the decimal number representing its position on the "time line".</div> </div></div> Values from any one date/time datatype using the seven-component model (all except <a href="#duration" shape="rect">duration</a>) are ordered the same as their <a href="#vp-dt-timeOnTimeline" shape="rect"><i><span class="arrow">&#183;</span>timeOnTimeline<span class="arrow">&#183;</span></i></a> values, except that if one value's <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b> and the other's is not, and using maximum and minimum <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> values for the one whose <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is actually <b><i>absent</i></b> changes the resulting (strict) inequality, the original two values are incomparable.</div></div><div class="div3"> <h4><a name="rf-lexicalMappings-datetime" id="rf-lexicalMappings-datetime" shape="rect"></a>D.2.2 Lexical Mappings</h4><div class="block"><span class="termdef"><a name="dt-dt-frag" id="dt-dt-frag" title="" shape="rect">[Definition:]&#160;&#160;</a>Each lexical representation is made up of certain <b>date/time fragments</b>, each of which corresponds to a particular property of the datatype value.</span>&#160; They are defined by the following productions. <div class="defset"> <div class="defset-head">Date/time Lexical Representation Fragments</div> <div class="prod"> <a name="nt-yrFrag" id="nt-yrFrag" shape="rect"></a><span class="lhs">[56] &#160; <i>yearFrag</i></span>&#160;::= '<code>-</code>'? (([<code>1-9</code>]&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>+))&#160;| ('<code>0</code>'&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>))</div><div class="prod"> <a name="nt-moFrag" id="nt-moFrag" shape="rect"></a><span class="lhs">[57] &#160; <i>monthFrag</i></span>&#160;::= ('<code>0</code>'&#160;[<code>1-9</code>])&#160;| ('<code>1</code>'&#160;[<code>0-2</code>])</div><div class="prod"> <a name="nt-daFrag" id="nt-daFrag" shape="rect"></a><span class="lhs">[58] &#160; <i>dayFrag</i></span>&#160;::= ('<code>0</code>'&#160;[<code>1-9</code>])&#160;|&#160;([<code>12</code>]&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>)&#160;| ('<code>3</code>'&#160;[<code>01</code>])</div><div class="prod"> <a name="nt-hrFrag" id="nt-hrFrag" shape="rect"></a><span class="lhs">[59] &#160; <i>hourFrag</i></span>&#160;::= ([<code>01</code>]&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>)&#160;| ('<code>2</code>'&#160;[<code>0-3</code>])</div><div class="prod"> <a name="nt-miFrag" id="nt-miFrag" shape="rect"></a><span class="lhs">[60] &#160; <i>minuteFrag</i></span>&#160;::= [<code>0-5</code>]&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a></div><div class="prod"> <a name="nt-seFrag" id="nt-seFrag" shape="rect"></a><span class="lhs">[61] &#160; <i>secondFrag</i></span>&#160;::= ([<code>0-5</code>]&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>) ('<code>.</code>'&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>+)?</div><div class="prod"> <a name="nt-eodFrag" id="nt-eodFrag" shape="rect"></a><span class="lhs">[62] &#160; <i>endOfDayFrag</i></span>&#160;::= '<code>24:00:00</code>'&#160;('<code>.</code>'&#160;'<code>0</code>'+)?</div><div class="prod"> <a name="nt-tzFrag" id="nt-tzFrag" shape="rect"></a><span class="lhs">[63] &#160; <i>timezoneFrag</i></span>&#160;::= '<code>Z</code>' |&#160;('<code>+</code>'&#160;|&#160;'<code>-</code>')&#160;(('<code>0</code>'&#160;<a href="#nt-digit" shape="rect"><i>digit</i></a>&#160;|&#160;'<code>1</code>'&#160;[<code>0-3</code>])&#160;'<code>:</code>'&#160;<a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a> | '<code>14:00</code>')</div></div> </div><div class="block">Each fragment other than <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a> defines a subset of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <a href="#decimal" shape="rect">decimal</a>; the corresponding <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> is the <a href="#decimal" shape="rect">decimal</a> <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> restricted to that subset.&#160; These fragment <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> are combined separately for each date/time datatype (other than <a href="#duration" shape="rect">duration</a>) to make up <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>the complete lexical mapping<span class="arrow">&#183;</span></a> for that datatype.&#160; The <a href="#f-dt-yrMap" shape="rect"><i><span class="arrow">&#183;</span>yearFragValue<span class="arrow">&#183;</span></i></a> mapping is used to obtain the value of the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> property, the <a href="#f-dt-moMap" shape="rect"><i><span class="arrow">&#183;</span>monthFragValue<span class="arrow">&#183;</span></i></a> mapping is used to obtain the value of the <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> property, etc.&#160; Each datatype which specifies some properties to be mandatorily <b><i>absent</i></b> also does not permit the corresponding lexical fragments in its lexical representations. <div class="defset"> <div class="not_aux"> <div class="defset-head">Partial Date/time Lexical Mappings</div> <div class="deftop"><b><a name="summary-f-dt-yrMap" id="summary-f-dt-yrMap" href="#f-dt-yrMap" shape="rect"><i><span class="arrow">&#183;</span>yearFragValue<span class="arrow">&#183;</span></i></a></b> (<var>YR</var>) &#8594; integer</div> <div class="defindent">Maps a <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> <div class="deftop"><b><a name="summary-f-dt-moMap" id="summary-f-dt-moMap" href="#f-dt-moMap" shape="rect"><i><span class="arrow">&#183;</span>monthFragValue<span class="arrow">&#183;</span></i></a></b> (<var>MO</var>) &#8594; integer</div> <div class="defindent">Maps a <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> <div class="deftop"><b><a name="summary-f-dt-daMap" id="summary-f-dt-daMap" href="#f-dt-daMap" shape="rect"><i><span class="arrow">&#183;</span>dayFragValue<span class="arrow">&#183;</span></i></a></b> (<var>DA</var>) &#8594; integer</div> <div class="defindent">Maps a <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> <div class="deftop"><b><a name="summary-f-dt-hrMap" id="summary-f-dt-hrMap" href="#f-dt-hrMap" shape="rect"><i><span class="arrow">&#183;</span>hourFragValue<span class="arrow">&#183;</span></i></a></b> (<var>HR</var>) &#8594; integer</div> <div class="defindent">Maps a <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> <div class="deftop"><b><a name="summary-f-dt-miMap" id="summary-f-dt-miMap" href="#f-dt-miMap" shape="rect"><i><span class="arrow">&#183;</span>minuteFragValue<span class="arrow">&#183;</span></i></a></b> (<var>MI</var>) &#8594; integer</div> <div class="defindent">Maps a <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> <div class="deftop"><b><a name="summary-f-dt-seMap" id="summary-f-dt-seMap" href="#f-dt-seMap" shape="rect"><i><span class="arrow">&#183;</span>secondFragValue<span class="arrow">&#183;</span></i></a></b> (<var>SE</var>) &#8594; decimal number</div> <div class="defindent">Maps a <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto a decimal number, presumably the <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> <div class="deftop"><b><a name="summary-f-dt-tzMap" id="summary-f-dt-tzMap" href="#f-dt-tzMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneFragValue<span class="arrow">&#183;</span></i></a></b> (<var>TZ</var>) &#8594; integer</div> <div class="defindent">Maps a <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> </div></div> </div><div class="note"><div class="p"><b>Note:</b> The redundancy between '<code>Z</code>', '<code>+00:00</code>', and '<code>-00:00</code>', and the possibility of trailing fractional '<code>0</code>' digits for <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a>, are the only redundancies preventing these mappings from being one-to-one. There is no <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#nt-eodFrag" shape="rect"><i>endOfDayFrag</i></a>; it is handled specially by the relevant <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a>.&#160; See, e.g., <a href="#vp-dateTimeLexRep" shape="rect"><i><span class="arrow">&#183;</span>dateTimeLexicalMap<span class="arrow">&#183;</span></i></a>. </div></div><div class="block">The following fragment <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mappings<span class="arrow">&#183;</span></a> for each value-object property are combined as appropriate to make the <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> for each date/time datatype (other than <a href="#duration" shape="rect">duration</a>): <div class="defset"> <div class="not_aux"> <div class="defset-head">Partial Date/time Canonical Mappings</div> <div class="deftop"><b><a name="summary-f-yrCanFragMap" id="summary-f-yrCanFragMap" href="#f-yrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>yearCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>y</var>) &#8594; <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a></div> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-moCanFragMap" id="summary-f-moCanFragMap" href="#f-moCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>monthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>m</var>) &#8594; <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a></div> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-daCanFragMap" id="summary-f-daCanFragMap" href="#f-daCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>dayCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>d</var>) &#8594; <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a></div> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-hrCanFragMap" id="summary-f-hrCanFragMap" href="#f-hrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>hourCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>h</var>) &#8594; <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a></div> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-miCanFragMap" id="summary-f-miCanFragMap" href="#f-miCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>minuteCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>m</var>) &#8594; <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a></div> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-seCanFragMap" id="summary-f-seCanFragMap" href="#f-seCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>secondCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>s</var>) &#8594; <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a></div> <div class="defindent">Maps a decimal number, presumably the <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> <div class="deftop"><b><a name="summary-f-tzCanFragMap" id="summary-f-tzCanFragMap" href="#f-tzCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>t</var>) &#8594; <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a></div> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div></div> </div></div></div></div><div class="div1"> <h2><a name="ap-funcDefs" id="ap-funcDefs" shape="rect"></a>E Function Definitions</h2><p>The more important functions and procedures defined here are summarized in the text&#160; When there is a text summary, the name of the function in each is a "hot-link" to the same name in the other.&#160; All other links to these functions link to the complete definition in this section.</p><div class="div2"> <h3><span class="nav"> <a href="#sec-duration-functions" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="sec-generic-number-functions" id="sec-generic-number-functions" shape="rect"></a>E.1 Generic Number-related Functions</h3><p>The following functions are used with various numeric and date/time datatypes. </p><div class="defset"> <div class="aux"> <div class="defset-head">Auxiliary Functions for Operating on Numeral Fragments</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-digitVal" id="f-digitVal" shape="rect"><i><span class="arrow">&#183;</span>digitValue<span class="arrow">&#183;</span></i></a></b> (<var>d</var>) &#8594; integer <div class="defindent">Maps each digit to its numerical value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>d</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-digit" shape="rect"><i>digit</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer less than ten</div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">0&#160;&#160; when&#160; <var>d</var>&#160;=&#160;'<code>0</code>'&#160;,</div></li><li><div class="p">1&#160;&#160; when&#160; <var>d</var>&#160;=&#160;'<code>1</code>'&#160;,</div></li><li><div class="p">2&#160;&#160; when&#160; <var>d</var>&#160;=&#160;'<code>2</code>'&#160;,</div></li><li><div class="p"><em>etc.</em></div></li></ul> </div> <div class="deftop"><b><a name="f-digitSeqVal" id="f-digitSeqVal" shape="rect"><i><span class="arrow">&#183;</span>digitSequenceValue<span class="arrow">&#183;</span></i></a></b> (<var>S</var>) &#8594; integer <div class="defindent">Maps a sequence of digits to the position-weighted sum of the terms numerical values.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>S</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a finite sequence of <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a>, each term matching <a href="#nt-digit" shape="rect"><i>digit</i></a>.</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer</div> <b>Algorithm:</b> <div class="defindent">Return the sum of <a href="#f-digitVal" shape="rect"><i><span class="arrow">&#183;</span>digitValue<span class="arrow">&#183;</span></i></a>(<var>S</var><sub><var>i</var></sub>)&#160;&#215;&#160;10<sup>length(<var>S</var>)&#8722;<var>i</var></sup>&#160; where <var>i</var> runs over the domain of <var>S</var>. </div> <div class="deftop"><b><a name="f-fracDigitSeqVal" id="f-fracDigitSeqVal" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitSequenceValue<span class="arrow">&#183;</span></i></a></b> (<var>S</var>) &#8594; integer <div class="defindent">Maps a sequence of digits to the position-weighted sum of the terms numerical values, weighted appropriately for fractional digits.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>S</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a finite sequence of <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a>, each term matching <a href="#nt-digit" shape="rect"><i>digit</i></a>.</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer</div> <b>Algorithm:</b> <div class="defindent">Return the sum of <a href="#f-digitVal" shape="rect"><i><span class="arrow">&#183;</span>digitValue<span class="arrow">&#183;</span></i></a>(<var>S</var><sub><var>i</var></sub>)&#160;&#8722;&#160;10<sup>&#8722;<var>i</var></sup>&#160; where <var>i</var> runs over the domain of <var>S</var>. </div> <div class="deftop"><b><a name="f-fracFragVal" id="f-fracFragVal" shape="rect"><i><span class="arrow">&#183;</span>fractionFragValue<span class="arrow">&#183;</span></i></a></b> (<var>N</var>) &#8594; decimal number <div class="defindent">Maps a <a href="#nt-fracFrag" shape="rect"><i>fracFrag</i></a> to the appropriate fractional decimal number.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>N</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-fracFrag" shape="rect"><i>fracFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative decimal number</div> <b>Algorithm:</b> <div class="defindent"><var>N</var> is necessarily the left-to-right concatenation of a finite sequence <var>S</var> of <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a>, each term matching <a href="#nt-digit" shape="rect"><i>digit</i></a>.</div> <div class="defindent">Return <a href="#f-fracDigitSeqVal" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitSequenceValue<span class="arrow">&#183;</span></i></a>(<var>S</var>).</div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Generic Numeral-to-Number Lexical Mappings</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-unsNoDecVal" id="f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a></b> (<var>N</var>) &#8594; integer <div class="defindent">Maps an <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a> to its numerical value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>N</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer</div> <b>Algorithm:</b> <div class="defindent"><var>N</var> is the left-to-right concatenation of a finite sequence <var>S</var> of <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a>, each term matching <a href="#nt-digit" shape="rect"><i>digit</i></a>.</div> <div class="defindent">Return <a href="#f-digitSeqVal" shape="rect"><i><span class="arrow">&#183;</span>digitSequenceValue<span class="arrow">&#183;</span></i></a>(<var>S</var>).</div> <div class="deftop"><b><a name="f-noDecVal" id="f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a></b> (<var>N</var>) &#8594; integer <div class="defindent">Maps an <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a> to its numerical value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>N</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">an integer</div> <b>Algorithm:</b> <div class="defindent"><var>N</var> necessarily consists of an optional sign('<code>+</code>' or '<code>-</code>') and then a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> <var>U</var> that matches <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>.</div> <div class="defindent">Return <ul><li><div class="p">&#8722;1&#160;&#215;&#160;<a href="#f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a>(<var>U</var>)&#160;&#160; when '<code>-</code>' is present, and</div></li><li><div class="p"><a href="#f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a>(<var>U</var>)&#160;&#160; otherwise.</div></li></ul></div> <div class="deftop"><b><a name="f-unsDecVal" id="f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a></b> (<var>D</var>) &#8594; decimal number <div class="defindent">Maps an <a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a> to its numerical value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>D</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative decimal number</div> <b>Algorithm:</b> <div class="defindent"><var>D</var> necessarily consists of an optional <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> <var>N</var> matching <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>, a decimal point, and then an optional <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> <var>F</var> matching <a href="#nt-fracFrag" shape="rect"><i>fracFrag</i></a>.</div> <div class="defindent">Return <ul><li><div class="p"><a href="#f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a>(<var>N</var>)&#160;&#160; when <var>F</var> is not present,</div></li><li><div class="p"><a href="#f-fracFragVal" shape="rect"><i><span class="arrow">&#183;</span>fractionFragValue<span class="arrow">&#183;</span></i></a>(<var>F</var>)&#160;&#160; when <var>N</var> is not present, and</div></li><li><div class="p"><a href="#f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a>(<var>N</var>)&#160;+&#160;<a href="#f-fracFragVal" shape="rect"><i><span class="arrow">&#183;</span>fractionFragValue<span class="arrow">&#183;</span></i></a>(<var>F</var>)&#160;&#160; otherwise.</div></li></ul></div> <div class="deftop"><b><a name="f-decVal" id="f-decVal" shape="rect"><i><span class="arrow">&#183;</span>decimalPtMap<span class="arrow">&#183;</span></i></a></b> (<var>N</var>) &#8594; decimal number <div class="defindent">Maps a <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a> to its numerical value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>N</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a decimal number</div> <b>Algorithm:</b> <div class="defindent"><var>N</var> necessarily consists of an optional sign('<code>+</code>' or '<code>-</code>') and then an instance <var>U</var> of <a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a>.</div> <div class="defindent"> Return <ul><li><div class="p">&#8722;<a href="#f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a>(<var>U</var>)&#160;&#160; when '<code>-</code>' is present, and</div></li><li><div class="p"><a href="#f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a>(<var>U</var>)&#160;&#160; otherwise.</div></li></ul></div> <div class="deftop"><b><a name="f-sciVal" id="f-sciVal" shape="rect"><i><span class="arrow">&#183;</span>scientificMap<span class="arrow">&#183;</span></i></a></b> (<var>N</var>) &#8594; decimal number <div class="defindent">Maps a <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a> to its numerical value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>N</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a decimal number</div> <b>Algorithm:</b> <div class="defindent"><var>N</var> necessarily consists of an instance <var>C</var> of either <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a> or <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a>, either an '<code>e</code>' or an '<code>E</code>', and then an instance <var>E</var> of <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a>.</div> <div class="defindent">Return <ul><li><div class="p"> <a href="#f-decVal" shape="rect"><i><span class="arrow">&#183;</span>decimalPtMap<span class="arrow">&#183;</span></i></a>(<var>C</var>)&#160;&#215;&#160;10&#160;^&#160;<a href="#f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a>(<var>E</var>)&#160;&#160; when a '<code>.</code>' is present in <var>N</var>, and</div></li><li><div class="p"> <a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>C</var>)&#160;&#215;&#160;10&#160;^&#160;<a href="#f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a>(<var>E</var>)&#160;&#160; otherwise.</div></li></ul></div> </div></div><div class="defset"> <div class="aux"> <div class="defset-head">Auxiliary Functions for Producing Numeral Fragments</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-digit" id="f-digit" shape="rect"><i><span class="arrow">&#183;</span>digit<span class="arrow">&#183;</span></i></a></b> (<var>i</var>) &#8594; <a href="#nt-digit" shape="rect"><i>digit</i></a> <div class="defindent">Maps each integer between 0 and 9 to the corresponding <a href="#nt-digit" shape="rect"><i>digit</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>i</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">between 0 and 9 inclusive</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-digit" shape="rect"><i>digit</i></a></div> <b>Algorithm:</b> <div class="defindent">Return<ul><li><div class="p">'<code>0</code>'&#160;&#160; when&#160; <var>i</var>&#160;=&#160;0&#160;,</div></li><li><div class="p">'<code>1</code>'&#160;&#160; when&#160; <var>i</var>&#160;=&#160;1&#160;,</div></li><li><div class="p">'<code>2</code>'&#160;&#160; when&#160; <var>i</var>&#160;=&#160;2&#160;,</div></li><li><div class="p">etc.</div></li></ul></div> <div class="deftop"><b><a name="f-digitRemSeq" id="f-digitRemSeq" shape="rect"><i><span class="arrow">&#183;</span>digitRemainderSeq<span class="arrow">&#183;</span></i></a></b> (<var>i</var>) &#8594; sequence of integers <div class="defindent">Maps each nonnegative integer to a sequence of integers used by <a href="#f-digitSeq" shape="rect"><i><span class="arrow">&#183;</span>digitSeq<span class="arrow">&#183;</span></i></a> to ultimately create an <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>i</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">sequence of nonnegative integers</div> <b>Algorithm:</b> <div class="defindent">Return that sequence <var>s</var> for which <ul><li><div class="p"><var>s</var><sub>0</sub>&#160;=&#160;<var>i</var>&#160; and</div></li><li><div class="p"><var>s</var><sub><var>j</var>+1</sub>&#160;=&#160;<var>s</var><sub><var>j</var></sub>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;10&#160;.</div></li></ul> </div> <div class="deftop"><b><a name="f-digitSeq" id="f-digitSeq" shape="rect"><i><span class="arrow">&#183;</span>digitSeq<span class="arrow">&#183;</span></i></a></b> (<var>i</var>) &#8594; sequence of integers <div class="defindent">Maps each nonnegative integer to a sequence of integers used by <a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a> to create an <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>i</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">sequence of integers where each term is between 0 and 9 inclusive</div> <b>Algorithm:</b> <div class="defindent">Return that sequence <var>s</var> for which&#160; <var>s</var><sub><var>j</var></sub>&#160;=<a href="#f-digitRemSeq" shape="rect"><i><span class="arrow">&#183;</span>digitRemainderSeq<span class="arrow">&#183;</span></i></a>(<var>i</var>)<sub><var>j</var></sub>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;10&#160;. </div> <div class="deftop"><b><a name="f-lastSigDigit" id="f-lastSigDigit" shape="rect"><i><span class="arrow">&#183;</span>lastSignificantDigit<span class="arrow">&#183;</span></i></a></b> (<var>s</var>) &#8594; integer <div class="defindent">Maps a sequence of nonnegative integers to the index of the first zero term.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>s</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a sequence of nonnegative integers</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer</div> <b>Algorithm:</b> <div class="defindent">Return the smallest nonnegative integer <var>j</var> such that <var>s</var>(<var>i</var>)<sub><var>j</var>+1</sub> is 0. </div> <div class="deftop"><b><a name="f-fracDigitRemSeq" id="f-fracDigitRemSeq" shape="rect"><i><span class="arrow">&#183;</span>FractionDigitRemainderSeq<span class="arrow">&#183;</span></i></a></b> (<var>f</var>) &#8594; sequence of decimal numbers <div class="defindent">Maps each nonnegative decimal number less than 1 to a sequence of decimal numbers used by <a href="#f-fracDigitSeq" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitSeq<span class="arrow">&#183;</span></i></a> to ultimately create an <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>f</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">nonnegative and less than 1</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a sequence of nonnegative decimal numbers</div> <b>Algorithm:</b> <div class="defindent">Return that sequence <var>s</var> for which <ul><li><div class="p"><var>s</var><sub>0</sub>&#160;=&#160;<var>f</var>&#160;&#8722;&#160;10&#160;, and</div></li><li><div class="p"><var>s</var><sub><var>j</var>+1</sub>&#160;=&#160;(<var>s</var><sub><var>j</var></sub>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;1)&#160;&#8722;&#160;10&#160;.</div></li></ul> </div> <div class="deftop"><b><a name="f-fracDigitSeq" id="f-fracDigitSeq" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitSeq<span class="arrow">&#183;</span></i></a></b> (<var>f</var>) &#8594; sequence of integers <div class="defindent">Maps each nonnegative decimal number less than 1 to a sequence of integers used by <a href="#f-fracDigitsMap" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitsCanonicalFragmentMap<span class="arrow">&#183;</span></i></a> to ultimately create an <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>f</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">nonnegative and less than 1</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a sequence of integer;s where each term is between 0 and 9 inclusive</div> <b>Algorithm:</b> <div class="defindent">Return that sequence <var>s</var> for which&#160; <var>s</var><sub><var>j</var></sub>&#160;=&#160;<a href="#f-fracDigitRemSeq" shape="rect"><i><span class="arrow">&#183;</span>FractionDigitRemainderSeq<span class="arrow">&#183;</span></i></a>(<var>f</var>)<sub><var>j</var></sub>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;1&#160;. </div> <div class="deftop"><b><a name="f-fracDigitsMap" id="f-fracDigitsMap" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitsCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>f</var>) &#8594; <a href="#nt-fracFrag" shape="rect"><i>fracFrag</i></a> <div class="defindent">Maps each nonnegative decimal number less than 1 to a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> used by <a href="#f-unsDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a> to create an <a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>f</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">nonnegative and less than 1</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-fracFrag" shape="rect"><i>fracFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return&#160; <a href="#f-digit" shape="rect"><i><span class="arrow">&#183;</span>digit<span class="arrow">&#183;</span></i></a>(<a href="#f-fracDigitSeq" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitSeq<span class="arrow">&#183;</span></i></a>(<var>f</var>)<sub>0</sub>)&#160;&amp; .&#160;.&#160;. &amp; <a href="#f-digit" shape="rect"><i><span class="arrow">&#183;</span>digit<span class="arrow">&#183;</span></i></a>(<a href="#f-fracDigitSeq" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitSeq<span class="arrow">&#183;</span></i></a>(<var>f</var>)<sub><a href="#f-lastSigDigit" shape="rect"><i><span class="arrow">&#183;</span>lastSignificantDigit<span class="arrow">&#183;</span></i></a>(<a href="#f-fracDigitRemSeq" shape="rect"><i><span class="arrow">&#183;</span>FractionDigitRemainderSeq<span class="arrow">&#183;</span></i></a>(<var>f</var>))</sub>)&#160;.</div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Generic Number to Numeral Canonical Mappings</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-unsNoDecCanFragMap" id="f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>i</var>) &#8594; <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a> <div class="defindent">Maps a nonnegative integer to a <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>i</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-digit" shape="rect"><i><span class="arrow">&#183;</span>digit<span class="arrow">&#183;</span></i></a>(<a href="#f-digitSeq" shape="rect"><i><span class="arrow">&#183;</span>digitSeq<span class="arrow">&#183;</span></i></a>(<var>i</var>)<sub><a href="#f-lastSigDigit" shape="rect"><i><span class="arrow">&#183;</span>lastSignificantDigit<span class="arrow">&#183;</span></i></a>(<a href="#f-digitRemSeq" shape="rect"><i><span class="arrow">&#183;</span>digitRemainderSeq<span class="arrow">&#183;</span></i></a>(<var>i</var>))</sub>)&#160;&amp; .&#160;.&#160;.&#160;&amp; <a href="#f-digit" shape="rect"><i><span class="arrow">&#183;</span>digit<span class="arrow">&#183;</span></i></a>(<a href="#f-digitSeq" shape="rect"><i><span class="arrow">&#183;</span>digitSeq<span class="arrow">&#183;</span></i></a>(<var>i</var>)<sub>0</sub>)&#160;.&#160;&#160; (Note that the concatenation is in reverse order.)</div> <div class="deftop"><b><a name="f-noDecCanMap" id="f-noDecCanMap" shape="rect"><i><span class="arrow">&#183;</span>noDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>i</var>) &#8594; <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a> <div class="defindent">Maps an integer to a <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>i</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">'<code>-</code>'&#160;&amp;&#160;<a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(&#8722;<var>i</var>)&#160;&#160; when <var>i</var> is negative,</div></li><li><div class="p"><a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>i</var>)&#160;&#160; otherwise.</div></li></ul> </div> <div class="deftop"><b><a name="f-unsDecCanFragMap" id="f-unsDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>n</var>) &#8594; <a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a> <div class="defindent">Maps a nonnegative decimal number to a <a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>n</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative decimal number</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-unsDecNuml" shape="rect"><i>unsignedDecimalPtNumeral</i></a></div> <b>Algorithm:</b> <div class="defindent">Return&#160; <a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>n</var><a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>1)&#160;&amp; '<code>.</code>'&#160;&amp; <a href="#f-fracDigitsMap" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitsCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>n</var><a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>1)&#160;.</div> <div class="deftop"><b><a name="f-decCanFragMap" id="f-decCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>decimalPtCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>n</var>) &#8594; <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a> <div class="defindent">Maps a decimal number to a <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>n</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a decimal number</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">'<code>-</code>'&#160;&amp;&#160;<a href="#f-unsDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(&#8722;<var>i</var>)&#160;&#160; when <var>i</var> is negative,</div></li><li><div class="p"><a href="#f-unsDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>i</var>)&#160;&#160; otherwise.</div></li></ul> </div> <div class="deftop"><b><a name="f-unsSciCanFragMap" id="f-unsSciCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedScientificCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>n</var>) &#8594; <a href="#nt-unsSciNuml" shape="rect"><i>unsignedScientificNotationNumeral</i></a> <div class="defindent">Maps a nonnegative decimal number to a <a href="#nt-unsSciNuml" shape="rect"><i>unsignedScientificNotationNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>n</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative decimal number</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-unsSciNuml" shape="rect"><i>unsignedScientificNotationNumeral</i></a></div> <b>Algorithm:</b> <div class="defindent"> Return&#160; <a href="#f-unsDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>n</var>&#160;/&#160;10<sup>log(<var>n</var>)&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;1</sup>)&#160;&amp; '<code>E</code>'&#160;&amp; <a href="#f-noDecCanMap" shape="rect"><i><span class="arrow">&#183;</span>noDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(log(<var>n</var>)&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;1) </div> <div class="deftop"><b><a name="f-sciCanFragMap" id="f-sciCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>scientificCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>n</var>) &#8594; <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a> <div class="defindent">Maps a decimal number to a <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a>, its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>n</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a decimal number</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">'<code>-</code>'&#160;&amp;&#160;<a href="#f-unsSciCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedScientificCanonicalMap<span class="arrow">&#183;</span></i></a>(&#8722;<var>n</var>)&#160;&#160; when <var>n</var> is negative,</div></li><li><div class="p"><a href="#f-unsSciCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedScientificCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>i</var>)&#160;&#160; otherwise.</div></li></ul> </div> </div></div><p>For example: </p><ul><li><div class="p">123.4567&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;1&#160;=&#160;0.4567&#160; and&#160; 123.4567&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;1&#160;=&#160;123&#160;.</div></li><li><div class="p"><a href="#f-digitRemSeq" shape="rect"><i><span class="arrow">&#183;</span>digitRemainderSeq<span class="arrow">&#183;</span></i></a>(123)&#160; is&#160; 123&#160;,&#160;12&#160;,&#160;1&#160;,&#160;0&#160;,&#160;0&#160;,&#160;.&#160;.&#160;.&#160;.</div></li><li><div class="p"><a href="#f-digitSeq" shape="rect"><i><span class="arrow">&#183;</span>digitSeq<span class="arrow">&#183;</span></i></a>(123)&#160; is&#160; 3&#160;,&#160;2&#160;,&#160;1&#160;,&#160;0&#160;,&#160;0&#160;,&#160;.&#160;.&#160;.&#160;.</div></li><li><div class="p"><a href="#f-lastSigDigit" shape="rect"><i><span class="arrow">&#183;</span>lastSignificantDigit<span class="arrow">&#183;</span></i></a>(<a href="#f-digitRemSeq" shape="rect"><i><span class="arrow">&#183;</span>digitRemainderSeq<span class="arrow">&#183;</span></i></a>(123))&#160;=&#160;2&#160;&#160; (Sequences count from 0.)</div></li><li><div class="p"><a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(123)&#160;=&#160;'<code>123</code>'</div></li><li><div class="p"><a href="#f-fracDigitRemSeq" shape="rect"><i><span class="arrow">&#183;</span>FractionDigitRemainderSeq<span class="arrow">&#183;</span></i></a>(0.4567)&#160; is&#160; 4.567&#160;,&#160;5.67&#160;,&#160;6.7&#160;,&#160;7&#160;,&#160;0&#160;,&#160;0&#160;,&#160;.&#160;.&#160;.&#160;.</div></li><li><div class="p"><a href="#f-fracDigitSeq" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitSeq<span class="arrow">&#183;</span></i></a>(0.4567)&#160; is&#160; 4&#160;,&#160;5&#160;,&#160;6&#160;,&#160;7&#160;,&#160;0&#160;,&#160;0&#160;,&#160;.&#160;.&#160;.&#160;.</div></li><li><div class="p"><a href="#f-lastSigDigit" shape="rect"><i><span class="arrow">&#183;</span>lastSignificantDigit<span class="arrow">&#183;</span></i></a>(<a href="#f-fracDigitRemSeq" shape="rect"><i><span class="arrow">&#183;</span>FractionDigitRemainderSeq<span class="arrow">&#183;</span></i></a>(0.4567))&#160;=&#160;3</div></li><li><div class="p"><a href="#f-fracDigitsMap" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitsCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(0.4567)&#160;=&#160;'<code>4567</code>'</div></li><li><div class="p"><a href="#f-unsDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(123.4567)&#160;=&#160;'<code>123.4567</code>'</div></li></ul><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping for Non-numerical <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>Special Values<span class="arrow">&#183;</span></a> Used With Numerical Datatypes</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-specRepVal" id="f-specRepVal" shape="rect"><i><span class="arrow">&#183;</span>specialRepValue<span class="arrow">&#183;</span></i></a></b> (<var>S</var>) &#8594; a <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special value<span class="arrow">&#183;</span></a> <div class="defindent">Maps the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representations<span class="arrow">&#183;</span></a> of <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a> used with some numerical datatypes to those <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>S</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-numSpecReps" shape="rect"><i>numericalSpecialRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">one of <b><i>positiveInfinity</i></b>, <b><i>negativeInfinity</i></b>, or <b><i>notANumber</i></b>.</div> <b>Algorithm:</b> <div class="defindent"> Return <ul><li><div class="p"><b><i>positiveInfinity</i></b>&#160;&#160; when <var>S</var> is '<code>INF</code>' or '<code>+INF</code>',</div></li><li><div class="p"><b><i>negativeInfinity</i></b>&#160;&#160; when <var>S</var> is '<code>-INF</code>', and</div></li><li><div class="p"><b><i>notANumber</i></b>&#160;&#160; when <var>S</var> is '<code>NaN</code>' </div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping for Non-numerical <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>Special Values<span class="arrow">&#183;</span></a> Used with Numerical Datatypes</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-specValCanMap" id="f-specValCanMap" shape="rect"><i><span class="arrow">&#183;</span>specialRepCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>c</var>) &#8594; <a href="#nt-numSpecReps" shape="rect"><i>numericalSpecialRep</i></a> <div class="defindent">Maps the <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special values<span class="arrow">&#183;</span></a> used with some numerical datatypes to their <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representations<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>c</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">one of <b><i>positiveInfinity</i></b>, <b><i>negativeInfinity</i></b>, and <b><i>notANumber</i></b></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-numSpecReps" shape="rect"><i>numericalSpecialRep</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">'<code>INF</code>'&#160;&#160; when <var>c</var> is <b><i>positiveInfinity</i></b></div></li><li><div class="p">'<code>-INF</code>'&#160;&#160; when <var>c</var> is <b><i>negativeInfinity</i></b></div></li><li><div class="p">'<code>NaN</code>'&#160;&#160; when <var>c</var> is <b><i>notANumber</i></b></div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-decimalLexmap" id="f-decimalLexmap" shape="rect"><i><span class="arrow">&#183;</span>decimalLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#decimal" shape="rect">decimal</a> <div class="defindent">Maps a <a href="#nt-decimalRep" shape="rect"><i>decimalLexicalRep</i></a> onto a <a href="#decimal" shape="rect">decimal</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-decimalRep" shape="rect"><i>decimalLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#decimal" shape="rect">decimal</a> value</div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>d</var> be a <a href="#decimal" shape="rect">decimal</a> value.</td></tr></tbody></table></div> <div class="defindent"> <ol class="enumar"><li><div class="p">Set <var>d</var> to <ul><li><div class="p"><a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>LEX</var>)&#160;&#160; when <var>LEX</var> is an instance of <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a>, and</div></li><li><div class="p"><a href="#f-decVal" shape="rect"><i><span class="arrow">&#183;</span>decimalPtMap<span class="arrow">&#183;</span></i></a>(<var>LEX</var>)&#160;&#160; when <var>LEX</var> is an instance of <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a>,</div></li></ul> </div></li><li><div class="p">Return <var>d</var>.</div></li></ol> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-decimalCanmap" id="f-decimalCanmap" shape="rect"><i><span class="arrow">&#183;</span>decimalCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>d</var>) &#8594; <a href="#nt-decimalRep" shape="rect"><i>decimalLexicalRep</i></a> <div class="defindent">Maps a <a href="#decimal" shape="rect">decimal</a> to its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>, a <a href="#nt-decimalRep" shape="rect"><i>decimalLexicalRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>d</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#decimal" shape="rect">decimal</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-decimalRep" shape="rect"><i>decimalLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent"> <ol class="enumar"><li><div class="p">If <var>d</var> is an integer, then return <a href="#f-noDecCanMap" shape="rect"><i><span class="arrow">&#183;</span>noDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>d</var>).</div></li><li><div class="p">Otherwise, return <a href="#f-decCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>decimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>d</var>).</div></li></ol> </div> </div></div><div class="defset"> <div class="aux"> <div class="defset-head">Auxiliary Functions for Binary Floating-point Lexical/Canonical Mappings</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-floatPtRound" id="f-floatPtRound" shape="rect"><i><span class="arrow">&#183;</span>floatingPointRound<span class="arrow">&#183;</span></i></a></b> (<var>nV</var>,&#160;<var>cWidth</var>,&#160;<var>eMin</var>,&#160;<var>eMax</var>) &#8594; decimal number or <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special value<span class="arrow">&#183;</span></a> <div class="defindent">Rounds a non-zero decimal number to the nearest floating-point value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>nV</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an initially non-zero decimal number <em>(may be set to zero during calculations)</em></td></tr> <tr><td rowspan="1" colspan="1"><var>cWidth</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a positive integer</td></tr> <tr><td rowspan="1" colspan="1"><var>eMin</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>eMax</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer greater than <var>eMin</var></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a decimal number or <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special value<span class="arrow">&#183;</span></a> <em>(<b><i>INF</i></b> or &#8722;<b><i>INF</i></b>)</em></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>s</var> be an integer initially 1,</div></li><li><div class="p"><var>c</var> be a nonnegative integer, and</div></li><li><div class="p"><var>e</var> be an integer.</div></li></ul> </td></tr></tbody></table></div> <div class="defindent"> <ol class="enumar"><li><div class="p">Set <var>s</var> to &#8722;1&#160;&#160; when&#160; <var>nV</var>&#160;&lt;&#160;0&#160;.</div></li><li><div class="p">So select <var>e</var> that 2<sup><var>cWidth</var></sup>&#160;&#215;&#160;2<sup>(<var>e</var>&#8722;1)</sup> &#8804; |<var>nV</var>| &lt; 2<sup><var>cWidth</var></sup>&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;.</div></li><li><div class="p">So select <var>c</var> that&#160; (<var>c</var>&#160;&#8722;&#160;1)&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;&#8804;&#160;|<var>nV</var>&#160;|&#160;&lt;<var>c</var>&#160;&#215;&#160;2<sup><var>e</var></sup>&#160; &#160;.</div></li><li><div class="p"><ul><li><div class="p">when&#160; <var>eMax</var>&#160;&lt;&#160;<var>e</var>&#160; <em>(overflow)</em> return:<ul><li><div class="p"><b><i>positiveInfinity</i></b>&#160;&#160; when <var>s</var> is positive, and</div></li><li><div class="p"><b><i>negativeInfinity</i></b>&#160;&#160; otherwise.</div></li></ul> </div></li><li><div class="p">otherwise:<ol class="enumla"><li><div class="p">When <var>e</var>&#160;&lt;&#160;<var>eMin</var>&#160; <em>(underflow):</em><ul><li><div class="p">Set&#160; <var>e</var>&#160;=&#160;<var>eMin</var></div></li><li><div class="p">So select <var>c</var> that&#160; (<var>c</var>&#160;&#8722;&#160;1)&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;&#8804;&#160;|<var>nV</var>&#160;|&#160;&lt;<var>c</var>&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;. </div></li></ul></div></li><li><div class="p">Set <var>nV</var> to<ul><li><div class="p"><var>c</var>&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;&#160; when&#160; |<var>nV</var>&#160;|&#160;&gt;&#160;<var>c</var>&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;&#8722;&#160;2<sup>(<var>e</var>&#8722;1)</sup>&#160;;</div></li><li><div class="p">(<var>c</var>&#160;&#8722;&#160;1)&#160;&#215;&#160;2<sup>e</sup>&#160;&#160; when&#160; |<var>nV</var>&#160;|&#160;&lt;&#160;<var>c</var>&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;&#8722;&#160;2<sup>(<var>e</var>&#8722;1)</sup>&#160;;</div></li><li><div class="p"><var>c</var>&#160;&#215;&#160;2<sup><var>e</var></sup> or (<var>c</var>&#160;&#8722;&#160;1)&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;&#160; according to whether <var>c</var> is even or&#160; <var>c</var>&#160;&#8722;&#160;1&#160; is even, otherwise (i.e.,&#160; |<var>nV</var>&#160;|&#160;=&#160;<var>c</var>&#160;&#215;&#160;2<sup><var>e</var></sup>&#160;&#8722;&#160;2<sup>(<var>e</var>&#8722;1)</sup>&#160;, the midpoint between the two values).</div></li></ul></div></li><li><div class="p">Return&#160; <ul><li><div class="p"><var>s</var>&#160;&#215;&#160;<var>nV</var>&#160;&#160; when <var>nV</var>&#160;&lt;&#160;2<sup><var>cWidth</var></sup>&#160;&#215;&#160;2<sup><var>eMax</var></sup>,</div></li><li><div class="p"><b><i>positiveInfinity</i></b>&#160;&#160; when <var>s</var> is positive, and</div></li><li><div class="p"><b><i>negativeInfinity</i></b>&#160;&#160; otherwise.</div></li></ul> </div></li></ol></div></li></ul></div></li></ol> <div class="note"><div class="p"><b>Note:</b> Implementers will find the algorithms of <a href="#clinger1990" shape="rect">[Clinger, WD (1990)]</a> more efficient in memory than the simple abstract algorithm employed above.</div></div> </div> <div class="deftop"><b><a name="f-round" id="f-round" shape="rect"><i><span class="arrow">&#183;</span>round<span class="arrow">&#183;</span></i></a></b> (<var>n</var>,&#160;<var>k</var>) &#8594; decimal number <div class="defindent">Maps a decimal number to that value rounded by some power of 10.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>n</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a decimal number</td></tr> <tr><td rowspan="1" colspan="1"><var>k</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a decimal number</div> <b>Algorithm:</b> <div class="defindent">Return&#160; ((<var>n</var>&#160;/&#160;10<sup>k</sup>&#160;+&#160;0.5)&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>1)&#160;&#215;&#160;10<sup>k</sup>&#160;.</div> <div class="deftop"><b><a name="f-floatApprox" id="f-floatApprox" shape="rect"><i><span class="arrow">&#183;</span>floatApprox<span class="arrow">&#183;</span></i></a></b> (<var>c</var>,&#160;<var>e</var>,&#160;<var>j</var>) &#8594; decimal number <div class="defindent">Maps a decimal number (&#160;<var>c</var>&#160;&#215;&#160;10<sup>e</sup>&#160;) to successive approximations.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>c</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> <tr><td rowspan="1" colspan="1"><var>e</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>j</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a decimal number</div> <b>Algorithm:</b> <div class="defindent">Return&#160; <a href="#f-round" shape="rect"><i><span class="arrow">&#183;</span>round<span class="arrow">&#183;</span></i></a>(<var>c</var>,&#160;<var>j</var>&#160;)&#160;&#215;&#160;10<sup><var>e</var></sup></div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-floatLexmap" id="f-floatLexmap" shape="rect"><i><span class="arrow">&#183;</span>floatLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#float" shape="rect">float</a> <div class="defindent">Maps a <a href="#nt-floatRep" shape="rect"><i>floatRep</i></a> onto a <a href="#float" shape="rect">float</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-floatRep" shape="rect"><i>floatRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#float" shape="rect">float</a> value</div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <var>nV</var> be a decimal number or <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special value<span class="arrow">&#183;</span></a> (INF or &#8722;INF). </td></tr></tbody></table></div> <div class="defindent"> <ul><li><div class="p">Return <a href="#f-specRepVal" shape="rect"><i><span class="arrow">&#183;</span>specialRepValue<span class="arrow">&#183;</span></i></a>(<var>LEX</var>)&#160;&#160; when <var>LEX</var> is an instance of <a href="#nt-numSpecReps" shape="rect"><i>numericalSpecialRep</i></a>;</div></li><li><div class="p">otherwise (<var>LEX</var> is a numeral):<ol class="enumar"><li><div class="p">Set <var>nV</var> to<ul><li><div class="p"><a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>LEX</var>)&#160;&#160; when <var>LEX</var> is an instance of <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a>,</div></li><li><div class="p"><a href="#f-decVal" shape="rect"><i><span class="arrow">&#183;</span>decimalPtMap<span class="arrow">&#183;</span></i></a>(<var>LEX</var>)&#160;&#160; when <var>LEX</var> is an instance of <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a>, and</div></li><li><div class="p"><a href="#f-sciVal" shape="rect"><i><span class="arrow">&#183;</span>scientificMap<span class="arrow">&#183;</span></i></a>(<var>LEX</var>)&#160;&#160; otherwise (<var>LEX</var> is an instance of <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a>).</div></li></ul></div></li><li><div class="p">Set <var>nV</var> to <a href="#f-floatPtRound" shape="rect"><i><span class="arrow">&#183;</span>floatingPointRound<span class="arrow">&#183;</span></i></a>(<var>nV</var>,&#160;24,&#160;&#8722;149,&#160;104)&#160;&#160; when <var>nV</var> is not zero.&#160; <em>(<a href="#f-floatPtRound" shape="rect"><i><span class="arrow">&#183;</span>floatingPointRound<span class="arrow">&#183;</span></i></a> may nonetheless return zero, or INF or &#8722;INF.)</em></div></li><li><div class="p">Return:<ul><li><div class="p">When <var>nV</var> is zero:<ul><li><div class="p"><b><i>negativeZero</i></b>&#160;&#160; when the first character of <var>LEX</var> is '<code>-</code>', and</div></li><li><div class="p"><b><i>positiveZero</i></b>&#160;&#160; otherwise.</div></li></ul></div></li><li><div class="p"><var>nV</var>&#160;&#160; otherwise.</div></li></ul></div></li></ol></div></li></ul> <div class="note"><div class="p"><b>Note:</b> This specification permits the substitution of any other rounding algorithm which conforms to the requirements of <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>.</div></div> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-doubleLexmap" id="f-doubleLexmap" shape="rect"><i><span class="arrow">&#183;</span>doubleLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#double" shape="rect">double</a> <div class="defindent">Maps a <a href="#nt-doubleRep" shape="rect"><i>doubleRep</i></a> onto a <a href="#double" shape="rect">double</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-doubleRep" shape="rect"><i>doubleRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#double" shape="rect">double</a> value</div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <var>nV</var> be a decimal number or <a href="#dt-specialvalue" class="termref" shape="rect"><span class="arrow">&#183;</span>special value<span class="arrow">&#183;</span></a> (INF or &#8722;INF). </td></tr></tbody></table></div> <div class="defindent"> <ul><li><div class="p">Return <a href="#f-specRepVal" shape="rect"><i><span class="arrow">&#183;</span>specialRepValue<span class="arrow">&#183;</span></i></a>(<var>LEX</var>)&#160;&#160; when <var>LEX</var> is an instance of <a href="#nt-numSpecReps" shape="rect"><i>numericalSpecialRep</i></a>;</div></li><li><div class="p">otherwise (<var>LEX</var> is a numeral):<ol class="enumar"><li><div class="p">Set <var>nV</var> to<ul><li><div class="p"><a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>LEX</var>)&#160;&#160; when <var>LEX</var> is an instance of <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a>,</div></li><li><div class="p"><a href="#f-decVal" shape="rect"><i><span class="arrow">&#183;</span>decimalPtMap<span class="arrow">&#183;</span></i></a>(<var>LEX</var>)&#160;&#160; when <var>LEX</var> is an instance of <a href="#nt-decNuml" shape="rect"><i>decimalPtNumeral</i></a>, and</div></li><li><div class="p"><a href="#f-sciVal" shape="rect"><i><span class="arrow">&#183;</span>scientificMap<span class="arrow">&#183;</span></i></a>(<var>LEX</var>)&#160;&#160; otherwise (<var>LEX</var> is an instance of <a href="#nt-sciNuml" shape="rect"><i>scientificNotationNumeral</i></a>).</div></li></ul></div></li><li><div class="p">Set <var>nV</var> to <a href="#f-floatPtRound" shape="rect"><i><span class="arrow">&#183;</span>floatingPointRound<span class="arrow">&#183;</span></i></a>(<var>nV</var>,&#160;53,&#160;&#8722;1074,&#160;971)&#160;&#160; when <var>nV</var> is not zero.&#160; <em>(<a href="#f-floatPtRound" shape="rect"><i><span class="arrow">&#183;</span>floatingPointRound<span class="arrow">&#183;</span></i></a> may nonetheless return zero, or INF or &#8722;INF.)</em></div></li><li><div class="p">Return:<ul><li><div class="p">When <var>nV</var> is zero:<ul><li><div class="p"><b><i>negativeZero</i></b>&#160;&#160; when the first character of <var>LEX</var> is '<code>-</code>', and</div></li><li><div class="p"><b><i>positiveZero</i></b>&#160;&#160; otherwise.</div></li></ul></div></li><li><div class="p"><var>nV</var>&#160;&#160; otherwise.</div></li></ul></div></li></ol></div></li></ul> <div class="note"><div class="p"><b>Note:</b> This specification permits the substitution of any other rounding algorithm which conforms to the requirements of <a href="#ieee754-2008" shape="rect">[IEEE 754-2008]</a>.</div></div> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-floatCanmap" id="f-floatCanmap" shape="rect"><i><span class="arrow">&#183;</span>floatCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>f</var>) &#8594; <a href="#nt-floatRep" shape="rect"><i>floatRep</i></a> <div class="defindent">Maps a <a href="#float" shape="rect">float</a> to its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>, a <a href="#nt-floatRep" shape="rect"><i>floatRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>f</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#float" shape="rect">float</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-floatRep" shape="rect"><i>floatRep</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>l</var> be a nonnegative integer</div></li><li><div class="p"><var>s</var> be an integer intially 1,</div></li><li><div class="p"><var>c</var> be a positive integer, and</div></li><li><div class="p"><var>e</var> be an integer.</div></li></ul> </td></tr></tbody></table></div> <div class="defindent"> <ul><li><div class="p">Return <a href="#f-specValCanMap" shape="rect"><i><span class="arrow">&#183;</span>specialRepCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>f</var>&#160;)&#160;&#160; when <var>f</var> is one of <b><i>positiveInfinity</i></b>, <b><i>negativeInfinity</i></b>, or <b><i>notANumber</i></b>;</div></li><li><div class="p">return '<code>0.0E0</code>'&#160;&#160; when <var>f</var> is <b><i>positiveZero</i></b>;</div></li><li><div class="p">return '<code>-0.0E0</code>'&#160;&#160; when <var>f</var> is <b><i>negativeZero</i></b>;</div></li><li><div class="p">otherwise (<var>f</var> is numeric and non-zero):<ol class="enumar"><li><div class="p">Set <var>s</var> to &#8722;1&#160;&#160; when&#160; <var>f</var>&#160;&lt;&#160;0&#160;.</div></li><li><div class="p">Let <var>c</var> be the smallest integer for which there exists an integer <var>e</var> for which&#160; |<var>f</var>&#160;|&#160;=&#160;<var>c</var>&#160;&#215;&#160;10<sup><var>e</var></sup>&#160;.</div></li><li><div class="p">Let <var>e</var> be log<sub>10</sub>(|<var>f</var>&#160;|&#160;/&#160;<var>c</var>)&#160;&#160; (so that&#160; |<var>f</var>&#160;|&#160;=&#160;<var>c</var>&#160;&#215;&#160;10<sup><var>e</var></sup>&#160;).</div></li><li><div class="p">Let <var>l</var> be the largest nonnegative integer for which&#160; <var>c</var>&#160;&#215;&#160;10<sup><var>e</var></sup>&#160;= <a href="#f-floatPtRound" shape="rect"><i><span class="arrow">&#183;</span>floatingPointRound<span class="arrow">&#183;</span></i></a>(<a href="#f-floatApprox" shape="rect"><i><span class="arrow">&#183;</span>floatApprox<span class="arrow">&#183;</span></i></a>(<var>c</var>,&#160;<var>e</var>,&#160;<var>l</var>&#160;),&#160;24,&#160;&#8722;149,&#160;104)</div></li><li><div class="p">Return <a href="#f-sciCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>scientificCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>s</var>&#160;&#215; <a href="#f-floatApprox" shape="rect"><i><span class="arrow">&#183;</span>floatApprox<span class="arrow">&#183;</span></i></a>(<var>c</var>,&#160;<var>e</var>,&#160;<var>l</var>&#160;))&#160;.</div></li></ol></div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-doubleCanmap" id="f-doubleCanmap" shape="rect"><i><span class="arrow">&#183;</span>doubleCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>f</var>) &#8594; <a href="#nt-doubleRep" shape="rect"><i>doubleRep</i></a> <div class="defindent">Maps a <a href="#double" shape="rect">double</a> to its <a href="#dt-canonical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical representation<span class="arrow">&#183;</span></a>, a <a href="#nt-doubleRep" shape="rect"><i>doubleRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>f</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#double" shape="rect">double</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-doubleRep" shape="rect"><i>doubleRep</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>l</var> be a nonnegative integer</div></li><li><div class="p"><var>s</var> be an integer intially 1,</div></li><li><div class="p"><var>c</var> be a positive integer, and</div></li><li><div class="p"><var>e</var> be an integer.</div></li></ul> </td></tr></tbody></table></div> <div class="defindent"> <ul><li><div class="p">Return <a href="#f-specValCanMap" shape="rect"><i><span class="arrow">&#183;</span>specialRepCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>f</var>&#160;)&#160;&#160; when <var>f</var> is one of <b><i>positiveInfinity</i></b>, <b><i>negativeInfinity</i></b>, or <b><i>notANumber</i></b>;</div></li><li><div class="p">return '<code>0.0E0</code>'&#160;&#160; when <var>f</var> is <b><i>positiveZero</i></b>;</div></li><li><div class="p">return '<code>-0.0E0</code>'&#160;&#160; when <var>f</var> is <b><i>negativeZero</i></b>;</div></li><li><div class="p">otherwise (<var>f</var> is numeric and non-zero):<ol class="enumar"><li><div class="p">Set <var>s</var> to &#8722;1&#160;&#160; when&#160; <var>f</var>&#160;&lt;&#160;0&#160;.</div></li><li><div class="p">Let <var>c</var> be the smallest integer for which there exists an integer <var>e</var> for which&#160; |<var>f</var>&#160;|&#160;=&#160;<var>c</var>&#160;&#215;&#160;10<sup><var>e</var></sup>&#160;.</div></li><li><div class="p">Let <var>e</var> be log<sub>10</sub>(|<var>f</var>&#160;|&#160;/&#160;<var>c</var>)&#160;&#160; (so that&#160; |<var>f</var>&#160;|&#160;=&#160;<var>c</var>&#160;&#215;&#160;10<sup><var>e</var></sup>&#160;).</div></li><li><div class="p">Let <var>l</var> be the largest nonnegative integer for which&#160; <var>c</var>&#160;&#215;&#160;10<sup><var>e</var></sup>&#160;= <a href="#f-floatPtRound" shape="rect"><i><span class="arrow">&#183;</span>floatingPointRound<span class="arrow">&#183;</span></i></a>(<a href="#f-floatApprox" shape="rect"><i><span class="arrow">&#183;</span>floatApprox<span class="arrow">&#183;</span></i></a>(<var>c</var>,&#160;<var>e</var>,&#160;<var>l</var>&#160;),&#160;53,&#160;&#8722;1074,&#160;971)</div></li><li><div class="p">Return <a href="#f-sciCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>scientificCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>s</var>&#160;&#215; <a href="#f-floatApprox" shape="rect"><i><span class="arrow">&#183;</span>floatApprox<span class="arrow">&#183;</span></i></a>(<var>c</var>,&#160;<var>e</var>,&#160;<var>l</var>&#160;))&#160;.</div></li></ol></div></li></ul> </div> </div></div></div><div class="div2"> <h3><span class="nav"><a href="#sec-generic-number-functions" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#sec-dt-functions" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="sec-duration-functions" id="sec-duration-functions" shape="rect"></a>E.2 Duration-related Definitions</h3><div class="block">The following functions are primarily used with the <a href="#duration" shape="rect">duration</a> datatype and its derivatives. <div class="defset"> <div class="aux"> <div class="defset-head">Auxiliary <a href="#duration" shape="rect">duration</a>-related Functions Operating on Representation Fragments</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-duYrMap" id="f-duYrMap" shape="rect"><i><span class="arrow">&#183;</span>duYearFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>Y</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-duYrFrag" shape="rect"><i>duYearFrag</i></a> to an integer, intended as part of the value of the <a href="#vp-du-month" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> property of a <a href="#duration" shape="rect">duration</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>Y</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-duYrFrag" shape="rect"><i>duYearFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer</div> <b>Algorithm:</b> <div class="defindent"><var>Y</var> is necessarily the letter '<code>Y</code>' followed by a numeral <var>N</var>:</div> <div class="defindent">Return <a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>N</var>).</div> <div class="deftop"><b><a name="f-duMoMap" id="f-duMoMap" shape="rect"><i><span class="arrow">&#183;</span>duMonthFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>M</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-duMoFrag" shape="rect"><i>duMonthFrag</i></a> to an integer, intended as part of the value of the <a href="#vp-du-month" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> property of a <a href="#duration" shape="rect">duration</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>M</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-duYrFrag" shape="rect"><i>duYearFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer</div> <b>Algorithm:</b> <div class="defindent"><var>M</var> is necessarily the letter '<code>M</code>' followed by a numeral <var>N</var>:</div> <div class="defindent">Return <a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>N</var>).</div> <div class="deftop"><b><a name="f-duDaMap" id="f-duDaMap" shape="rect"><i><span class="arrow">&#183;</span>duDayFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>D</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-duDaFrag" shape="rect"><i>duDayFrag</i></a> to an integer, intended as part of the value of the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> property of a <a href="#duration" shape="rect">duration</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>D</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-duDaFrag" shape="rect"><i>duDayFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer</div> <b>Algorithm:</b> <div class="defindent"><var>D</var> is necessarily the letter '<code>D</code>' followed by a numeral <var>N</var>:</div> <div class="defindent">Return <a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>N</var>).</div> <div class="deftop"><b><a name="f-duHrMap" id="f-duHrMap" shape="rect"><i><span class="arrow">&#183;</span>duHourFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>H</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-duHrFrag" shape="rect"><i>duHourFrag</i></a> to an integer, intended as part of the value of the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> property of a <a href="#duration" shape="rect">duration</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>H</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-duHrFrag" shape="rect"><i>duHourFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer</div> <b>Algorithm:</b> <div class="defindent"><var>D</var> is necessarily the letter '<code>D</code>' followed by a numeral <var>N</var>:</div> <div class="defindent">Return <a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>N</var>).</div> <div class="deftop"><b><a name="f-duMiMap" id="f-duMiMap" shape="rect"><i><span class="arrow">&#183;</span>duMinuteFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>M</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-duMiFrag" shape="rect"><i>duMinuteFrag</i></a> to an integer, intended as part of the value of the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> property of a <a href="#duration" shape="rect">duration</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>M</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-duMiFrag" shape="rect"><i>duMinuteFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer</div> <b>Algorithm:</b> <div class="defindent"><var>M</var> is necessarily the letter '<code>M</code>' followed by a numeral <var>N</var>:</div> <div class="defindent">Return <a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>N</var>).</div> <div class="deftop"><b><a name="f-duSeMap" id="f-duSeMap" shape="rect"><i><span class="arrow">&#183;</span>duSecondFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>S</var>) &#8594; decimal number <div class="defindent">Maps a <a href="#nt-duSeFrag" shape="rect"><i>duSecondFrag</i></a> to a decimal number, intended as part of the value of the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> property of a <a href="#duration" shape="rect">duration</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>S</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-duSeFrag" shape="rect"><i>duSecondFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative decimal number</div> <b>Algorithm:</b> <div class="defindent"><var>S</var> is necessarily '<code>S</code>' followed by a numeral <var>N</var>:</div> <div class="defindent">Return <ul><li><div class="p"><a href="#f-decVal" shape="rect"><i><span class="arrow">&#183;</span>decimalPtMap<span class="arrow">&#183;</span></i></a>(<var>N</var>)&#160;&#160; when '<code>.</code>' occurs in <var>N</var>, and</div></li><li><div class="p"><a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>N</var>)&#160;&#160; otherwise.</div></li></ul> </div> <div class="deftop"><b><a name="f-duYMMap" id="f-duYMMap" shape="rect"><i><span class="arrow">&#183;</span>duYearMonthFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>YM</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-duYMFrag" shape="rect"><i>duYearMonthFrag</i></a> into an integer, intended as part of the <a href="#vp-du-month" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> property of a <a href="#duration" shape="rect">duration</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>YM</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-duYMFrag" shape="rect"><i>duYearMonthFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative integer</div> <b>Algorithm:</b> <div class="defindent"><var>YM</var> necessarily consists of an instance <var>Y</var> of <a href="#nt-duYrFrag" shape="rect"><i>duYearFrag</i></a> and/or an instance <var>M</var> of <a href="#nt-duMoFrag" shape="rect"><i>duMonthFrag</i></a>:</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>y</var> be <a href="#f-duYrMap" shape="rect"><i><span class="arrow">&#183;</span>duYearFragmentMap<span class="arrow">&#183;</span></i></a>(<var>Y</var>) (or 0 if <var>Y</var> is not present) and</div></li><li><div class="p"><var>m</var> be <a href="#f-duMoMap" shape="rect"><i><span class="arrow">&#183;</span>duMonthFragmentMap<span class="arrow">&#183;</span></i></a>(<var>M</var>) (or 0 if <var>M</var> is not present).</div></li></ul> </td></tr></tbody></table></div> <div class="defindent">Return&#160; 12&#160;&#215;&#160;<var>y</var>&#160;+ <var>m</var>&#160;.</div> <div class="deftop"><b><a name="f-duTMap" id="f-duTMap" shape="rect"><i><span class="arrow">&#183;</span>duTimeFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>T</var>) &#8594; decimal number <div class="defindent">Maps a <a href="#nt-duTFrag" shape="rect"><i>duTimeFrag</i></a> into a decimal number, intended as part of the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> property of a <a href="#duration" shape="rect">duration</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>T</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-duTFrag" shape="rect"><i>duTimeFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative decimal number</div> <b>Algorithm:</b> <div class="defindent"><var>T</var> necessarily consists of an instance <var>H</var> of <a href="#nt-duHrFrag" shape="rect"><i>duHourFrag</i></a>, and/or an instance <var>M</var> of <a href="#nt-duMiFrag" shape="rect"><i>duMinuteFrag</i></a>, and/or an instance <var>S</var> of <a href="#nt-duSeFrag" shape="rect"><i>duSecondFrag</i></a>.</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>h</var> be <a href="#f-duDaMap" shape="rect"><i><span class="arrow">&#183;</span>duDayFragmentMap<span class="arrow">&#183;</span></i></a>(<var>H</var>) (or 0 if <var>H</var> is not present),</div></li><li><div class="p"><var>m</var> be <a href="#f-duMiMap" shape="rect"><i><span class="arrow">&#183;</span>duMinuteFragmentMap<span class="arrow">&#183;</span></i></a>(<var>M</var>) (or 0 if <var>M</var> is not present), and</div></li><li><div class="p"><var>s</var> be <a href="#f-duSeMap" shape="rect"><i><span class="arrow">&#183;</span>duSecondFragmentMap<span class="arrow">&#183;</span></i></a>(<var>S</var>) (or 0 if <var>S</var> is not present).</div></li></ul> </td></tr></tbody></table></div> <div class="defindent">Return&#160; 3600&#160;&#215;&#160;<var>h</var>&#160;+&#160;60&#160;&#215;&#160;<var>m</var>&#160;+&#160;s&#160;.</div> <div class="deftop"><b><a name="f-duDTMap" id="f-duDTMap" shape="rect"><i><span class="arrow">&#183;</span>duDayTimeFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>DT</var>) &#8594; decimal number <div class="defindent">Maps a <a href="#nt-duDTFrag" shape="rect"><i>duDayTimeFrag</i></a> into a decimal number, which is the potential value of the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> property of a <a href="#duration" shape="rect">duration</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>DT</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-duDTFrag" shape="rect"><i>duDayTimeFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a nonnegative decimal number</div> <b>Algorithm:</b> <div class="defindent"><var>DT</var> necessarily consists of an instance <var>D</var> of <a href="#nt-duDaFrag" shape="rect"><i>duDayFrag</i></a> and/or an instance <var>T</var> of <a href="#nt-duTFrag" shape="rect"><i>duTimeFrag</i></a>.</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>d</var> be <a href="#f-duDaMap" shape="rect"><i><span class="arrow">&#183;</span>duDayFragmentMap<span class="arrow">&#183;</span></i></a>(<var>D</var>) (or 0 if <var>D</var> is not present) and</div></li><li><div class="p"><var>t</var> be <a href="#f-duTMap" shape="rect"><i><span class="arrow">&#183;</span>duTimeFragmentMap<span class="arrow">&#183;</span></i></a>(<var>T</var>) (or 0 if <var>T</var> is not present).</div></li></ul> </td></tr></tbody></table></div> <div class="defindent">Return&#160; 86400&#160;&#215;&#160;<var>d</var>&#160;+&#160;<var>t</var>&#160;.</div> </div></div> <div class="defset"> <div class="not_aux"> <div class="defset-head">The <a href="#duration" shape="rect">duration</a> Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-durationMap" id="f-durationMap" shape="rect"><i><span class="arrow">&#183;</span>durationMap<span class="arrow">&#183;</span></i></a></b> (<var>DUR</var>) &#8594; <a href="#duration" shape="rect">duration</a> <div class="defindent">Separates the <a href="#nt-durationRep" shape="rect"><i>durationLexicalRep</i></a> into the month part and the seconds part, then maps them into the <a href="#vp-du-month" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> and <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> of the <a href="#duration" shape="rect">duration</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>DUR</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-durationRep" shape="rect"><i>durationLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#duration" shape="rect">duration</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>DUR</var> consists of possibly a leading '<code>-</code>', followed by '<code>P</code>' and then an instance <var>Y</var> of <a href="#nt-duYMFrag" shape="rect"><i>duYearMonthFrag</i></a> and/or an instance <var>D</var> of <a href="#nt-duDTFrag" shape="rect"><i>duDayTimeFrag</i></a>:</div> <div class="defindent">Return a <a href="#duration" shape="rect">duration</a> whose <ul><li><div class="p"><a href="#vp-du-month" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> value is <ul><li><div class="p">0&#160;&#160; if <var>Y</var> is not present,</div></li><li><div class="p">&#8722;<a href="#f-duYMMap" shape="rect"><i><span class="arrow">&#183;</span>duYearMonthFragmentMap<span class="arrow">&#183;</span></i></a>(<var>Y</var>)&#160;&#160; if both '<code>-</code>' and <var>Y</var> are present, and</div></li><li><div class="p"><a href="#f-duYMMap" shape="rect"><i><span class="arrow">&#183;</span>duYearMonthFragmentMap<span class="arrow">&#183;</span></i></a>(<var>Y</var>)&#160;&#160; otherwise.</div></li></ul></div></li></ul> and whose <ul><li><div class="p"><a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> value is <ul><li><div class="p">0&#160;&#160; if <var>D</var> is not present,</div></li><li><div class="p">&#8722;<a href="#f-duDTMap" shape="rect"><i><span class="arrow">&#183;</span>duDayTimeFragmentMap<span class="arrow">&#183;</span></i></a>(<var>D</var>)&#160;&#160; if both '<code>-</code>' and <var>D</var> are present, and</div></li><li><div class="p"><a href="#f-duDTMap" shape="rect"><i><span class="arrow">&#183;</span>duDayTimeFragmentMap<span class="arrow">&#183;</span></i></a>(<var>D</var>)&#160;&#160; otherwise.</div></li></ul></div></li></ul> </div> </div></div> <div class="defset"> <div class="not_aux"> <div class="defset-head">The <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-yearMonthDurationMap" id="f-yearMonthDurationMap" shape="rect"><i><span class="arrow">&#183;</span>yearMonthDurationMap<span class="arrow">&#183;</span></i></a></b> (<var>YM</var>) &#8594; <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> <div class="defindent">Maps the lexical representation into the <a href="#vp-du-month" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> of a <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> value.&#160; (A <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a>'s <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> is always zero.)&#160; <a href="#f-yearMonthDurationMap" shape="rect"><i><span class="arrow">&#183;</span>yearMonthDurationMap<span class="arrow">&#183;</span></i></a> is a restriction of <a href="#f-durationMap" shape="rect"><i><span class="arrow">&#183;</span>durationMap<span class="arrow">&#183;</span></i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>YM</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-yearMonthDurationRep" shape="rect"><i>yearMonthDurationLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>YM</var> necessarily consists of an optional leading '<code>-</code>', followed by '<code>P</code>' and then an instance <var>Y</var> of <a href="#nt-duYMFrag" shape="rect"><i>duYearMonthFrag</i></a>:</div> <div class="defindent">Return a <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> whose <ul><li><div class="p"><a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> value is <ul><li><div class="p">&#8722;<a href="#f-duYMMap" shape="rect"><i><span class="arrow">&#183;</span>duYearMonthFragmentMap<span class="arrow">&#183;</span></i></a>(<var>Y</var>)&#160;&#160; if '<code>-</code>' is present in <var>YM</var> and</div></li><li><div class="p"><a href="#f-duYMMap" shape="rect"><i><span class="arrow">&#183;</span>duYearMonthFragmentMap<span class="arrow">&#183;</span></i></a>(<var>Y</var>)&#160;&#160; otherwise, and</div></li></ul> </div></li><li><div class="p"><a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> value is (necessarily) 0.</div></li></ul> </div> </div></div> <div class="defset"> <div class="not_aux"> <div class="defset-head">The <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-dayTimeDurationMap" id="f-dayTimeDurationMap" shape="rect"><i><span class="arrow">&#183;</span>dayTimeDurationMap<span class="arrow">&#183;</span></i></a></b> (<var>DT</var>) &#8594; <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> <div class="defindent">Maps the lexical representation into the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> of a <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> value.&#160; (A <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a>'s <a href="#vp-du-month" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> is always zero.)&#160; <a href="#f-dayTimeDurationMap" shape="rect"><i><span class="arrow">&#183;</span>dayTimeDurationMap<span class="arrow">&#183;</span></i></a> is a restriction of <a href="#f-durationMap" shape="rect"><i><span class="arrow">&#183;</span>durationMap<span class="arrow">&#183;</span></i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>DT</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>DT</var> necessarily consists of possibly a leading '<code>-</code>', followed by '<code>P</code>' and then an instance <var>D</var> of <a href="#nt-duDTFrag" shape="rect"><i>duDayTimeFrag</i></a>:</div> <div class="defindent">Return a <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> whose <ul><li><div class="p"><a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> value is (necessarily) 0, and</div></li><li><div class="p"><a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> value is <ul><li><div class="p">&#8722;<a href="#f-duDTMap" shape="rect"><i><span class="arrow">&#183;</span>duDayTimeFragmentMap<span class="arrow">&#183;</span></i></a>(<var>D</var>)&#160;&#160; if '<code>-</code>' is present in <var>DT</var> and</div></li><li><div class="p"><a href="#f-duDTMap" shape="rect"><i><span class="arrow">&#183;</span>duDayTimeFragmentMap<span class="arrow">&#183;</span></i></a>(<var>D</var>)&#160;&#160; otherwise.</div></li></ul></div></li></ul> </div> </div></div> <div class="defset"> <div class="aux"> <div class="defset-head">Auxiliary <a href="#duration" shape="rect">duration</a>-related Functions Producing Representation Fragments</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-duYMCan" id="f-duYMCan" shape="rect"><i><span class="arrow">&#183;</span>duYearMonthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>ym</var>) &#8594; <a href="#nt-duYMFrag" shape="rect"><i>duYearMonthFrag</i></a> <div class="defindent">Maps a nonnegative integer, presumably the absolute value of the <a href="#vp-du-month" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> of a <a href="#duration" shape="rect">duration</a> value, to a <a href="#nt-duYMFrag" shape="rect"><i>duYearMonthFrag</i></a>, a fragment of a <a href="#duration" shape="rect">duration</a> <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>ym</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-duYMFrag" shape="rect"><i>duYearMonthFrag</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>y</var> be&#160; <var>ym</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;12&#160;, and</div></li><li><div class="p"><var>m</var> be&#160; <var>ym</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;12&#160;,</div></li></ul> </td></tr></tbody></table></div> <div class="defindent">Return <ul><li><div class="p"><a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>y</var>)&#160;&amp; '<code>Y</code>'&#160;&amp; <a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>m</var>)&#160;&amp; '<code>M</code>'&#160;&#160; when neither <var>y</var> nor <var>m</var> is zero,</div></li><li><div class="p"><a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>y</var>)&#160;&amp; '<code>Y</code>'&#160;&#160; when <var>y</var> is not zero but <var>m</var> is, and</div></li><li><div class="p">&#160;<a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>m</var>)&#160;&amp; '<code>M</code>'&#160;&#160; when <var>y</var> is zero.</div></li></ul> </div> <div class="deftop"><b><a name="f-duDCan" id="f-duDCan" shape="rect"><i><span class="arrow">&#183;</span>duDayCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>d</var>) &#8594; <a href="#nt-duDaFrag" shape="rect"><i>duDayFrag</i></a> <div class="defindent">Maps a nonnegative integer, presumably the day normalized value from the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> of a <a href="#duration" shape="rect">duration</a> value, to a <a href="#nt-duDaFrag" shape="rect"><i>duDayFrag</i></a>, a fragment of a <a href="#duration" shape="rect">duration</a> <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>d</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-duDaFrag" shape="rect"><i>duDayFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p"><a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>d</var>)&#160;&amp; '<code>D</code>'&#160;&#160; when <var>d</var> is not zero, and</div></li><li><div class="p">the empty string ('')&#160;&#160; when <var>d</var> is zero.</div></li></ul> </div> <div class="deftop"><b><a name="f-duHCan" id="f-duHCan" shape="rect"><i><span class="arrow">&#183;</span>duHourCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>h</var>) &#8594; <a href="#nt-duHrFrag" shape="rect"><i>duHourFrag</i></a> <div class="defindent">Maps a nonnegative integer, presumably the hour normalized value from the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> of a <a href="#duration" shape="rect">duration</a> value, to a <a href="#nt-duHrFrag" shape="rect"><i>duHourFrag</i></a>, a fragment of a <a href="#duration" shape="rect">duration</a> <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>h</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-duHrFrag" shape="rect"><i>duHourFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p"><a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>h</var>)&#160;&amp; '<code>H</code>'&#160;&#160; when <var>h</var> is not zero, and</div></li><li><div class="p">the empty string ('')&#160;&#160; when <var>h</var> is zero.</div></li></ul> </div> <div class="deftop"><b><a name="f-duMCan" id="f-duMCan" shape="rect"><i><span class="arrow">&#183;</span>duMinuteCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>m</var>) &#8594; <a href="#nt-duMiFrag" shape="rect"><i>duMinuteFrag</i></a> <div class="defindent">Maps a nonnegative integer, presumably the minute normalized value from the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> of a <a href="#duration" shape="rect">duration</a> value, to a <a href="#nt-duMiFrag" shape="rect"><i>duMinuteFrag</i></a>, a fragment of a <a href="#duration" shape="rect">duration</a> <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>m</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-duMiFrag" shape="rect"><i>duMinuteFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p"><a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>m</var>)&#160;&amp; '<code>M</code>'&#160;&#160; when <var>m</var> is not zero, and</div></li><li><div class="p">the empty string ('')&#160;&#160; when <var>m</var> is zero.</div></li></ul> </div> <div class="deftop"><b><a name="f-duSCan" id="f-duSCan" shape="rect"><i><span class="arrow">&#183;</span>duSecondCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>s</var>) &#8594; <a href="#nt-duSeFrag" shape="rect"><i>duSecondFrag</i></a> <div class="defindent">Maps a nonnegative decimal number, presumably the second normalized value from the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> of a <a href="#duration" shape="rect">duration</a> value, to a <a href="#nt-duSeFrag" shape="rect"><i>duSecondFrag</i></a>, a fragment of a <a href="#duration" shape="rect">duration</a> <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>s</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative decimal number</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-duSeFrag" shape="rect"><i>duSecondFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p"><a href="#f-unsNoDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>s</var>)&#160;&amp; '<code>S</code>'&#160; when <var>s</var> is a non-zero integer,</div></li><li><div class="p"><a href="#f-unsDecCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>s</var>)&#160;&amp; '<code>S</code>'&#160; when <var>s</var> is not an integer, and</div></li><li><div class="p">the empty string ('') when <var>s</var> is zero.</div></li></ul> </div> <div class="deftop"><b><a name="f-duTCan" id="f-duTCan" shape="rect"><i><span class="arrow">&#183;</span>duTimeCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>h</var>,&#160;<var>m</var>,&#160;<var>s</var>) &#8594; <a href="#nt-duTFrag" shape="rect"><i>duTimeFrag</i></a> <div class="defindent">Maps three nonnegative numbers, presumably the hour, minute, and second normalized values from a <a href="#duration" shape="rect">duration</a>'s <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a>, to a <a href="#nt-duTFrag" shape="rect"><i>duTimeFrag</i></a>, a fragment of a <a href="#duration" shape="rect">duration</a> <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>h</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> <tr><td rowspan="1" colspan="1"><var>m</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer</td></tr> <tr><td rowspan="1" colspan="1"><var>s</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative decimal number</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-duTFrag" shape="rect"><i>duTimeFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">'<code>T</code>'&#160;&amp; <a href="#f-duHCan" shape="rect"><i><span class="arrow">&#183;</span>duHourCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>h</var>)&#160;&amp; <a href="#f-duMCan" shape="rect"><i><span class="arrow">&#183;</span>duMinuteCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>m</var>)&#160;&amp; <a href="#f-duSCan" shape="rect"><i><span class="arrow">&#183;</span>duSecondCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>s</var>)&#160;&#160; when <var>h</var>, <var>m</var>, and <var>s</var> are not all zero, and</div></li><li><div class="p">the empty string ('') when all arguments are zero.</div></li></ul> </div> <div class="deftop"><b><a name="f-duDTCan" id="f-duDTCan" shape="rect"><i><span class="arrow">&#183;</span>duDayTimeCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>ss</var>) &#8594; <a href="#nt-duDTFrag" shape="rect"><i>duDayTimeFrag</i></a> <div class="defindent">Maps a nonnegative decimal number, presumably the absolute value of the <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> of a <a href="#duration" shape="rect">duration</a> value, to a <a href="#nt-duDTFrag" shape="rect"><i>duDayTimeFrag</i></a>, a fragment of a <a href="#duration" shape="rect">duration</a> <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>ss</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative decimal number</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-duDTFrag" shape="rect"><i>duDayTimeFrag</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>d</var> is&#160; <var>ss</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;86400&#160;,</div></li><li><div class="p"><var>h</var> is&#160; (<var>ss</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;86400)&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;3600&#160;,</div></li><li><div class="p"><var>m</var> is&#160; (<var>ss</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;3600)&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;60&#160;, and</div></li><li><div class="p"><var>s</var> is&#160; <var>ss</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;60&#160;,</div></li></ul> </td></tr></tbody></table></div> <div class="defindent">Return <ul><li><div class="p"><a href="#f-duDCan" shape="rect"><i><span class="arrow">&#183;</span>duDayCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>d</var>)&#160;&amp; <a href="#f-duTCan" shape="rect"><i><span class="arrow">&#183;</span>duTimeCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>h</var>,&#160;<var>m</var>,&#160;<var>s</var>)&#160;&#160; when <var>ss</var> is not zero and</div></li><li><div class="p">'<code>T0S</code>'&#160;&#160; when <var>ss</var> is zero.</div></li></ul> </div> </div></div> <div class="defset"> <div class="not_aux"> <div class="defset-head">The <a href="#duration" shape="rect">duration</a> Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-durationCanMap" id="f-durationCanMap" shape="rect"><i><span class="arrow">&#183;</span>durationCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>v</var>) &#8594; <a href="#nt-durationRep" shape="rect"><i>durationLexicalRep</i></a> <div class="defindent">Maps a <a href="#duration" shape="rect">duration</a>'s property values to <a href="#nt-durationRep" shape="rect"><i>durationLexicalRep</i></a> fragments and combines the fragments into a complete <a href="#nt-durationRep" shape="rect"><i>durationLexicalRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>v</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#duration" shape="rect">duration</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-durationRep" shape="rect"><i>durationLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>m</var> be <var>v</var>'s <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a>,</div></li><li><div class="p"><var>s</var> be <var>v</var>'s <a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a>, and</div></li><li><div class="p"><var>sgn</var> be '<code>-</code>' if <var>m</var> or <var>s</var> is negative and the empty string ('') otherwise.</div></li></ul> </td></tr></tbody></table></div> <div class="defindent">Return <ul><li><div class="p"><var>sgn</var>&#160;&amp; '<code>P</code>'&#160;&amp; <a href="#f-duYMCan" shape="rect"><i><span class="arrow">&#183;</span>duYearMonthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(|&#160;<var>m</var>&#160;|)&#160;&amp; <a href="#f-duDTCan" shape="rect"><i><span class="arrow">&#183;</span>duDayTimeCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(|&#160;<var>s</var>&#160;|)&#160;&#160;&#160; when neither <var>m</var> nor <var>s</var> is zero,</div></li><li><div class="p"><var>sgn</var>&#160;&amp; '<code>P</code>'&#160;&amp; <a href="#f-duYMCan" shape="rect"><i><span class="arrow">&#183;</span>duYearMonthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(|&#160;<var>m</var>&#160;|)&#160;&#160;&#160; when <var>m</var> is not zero but <var>s</var> is, and</div></li><li><div class="p"><var>sgn</var>&#160;&amp; '<code>P</code>'&#160;&amp; <a href="#f-duDTCan" shape="rect"><i><span class="arrow">&#183;</span>duDayTimeCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(|&#160;<var>s</var>&#160;|)&#160;&#160;&#160; when <var>m</var> is zero.</div></li></ul> </div> </div></div> <div class="defset"> <div class="not_aux"> <div class="defset-head">The <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-yearMonthDurationCanMap" id="f-yearMonthDurationCanMap" shape="rect"><i><span class="arrow">&#183;</span>yearMonthDurationCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>ym</var>) &#8594; <a href="#nt-yearMonthDurationRep" shape="rect"><i>yearMonthDurationLexicalRep</i></a> <div class="defindent">Maps a <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a>'s <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> value to a <a href="#nt-yearMonthDurationRep" shape="rect"><i>yearMonthDurationLexicalRep</i></a>.&#160; (The <a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> value is necessarily zero and is ignored.)&#160; <a href="#f-yearMonthDurationCanMap" shape="rect"><i><span class="arrow">&#183;</span>yearMonthDurationCanonicalMap<span class="arrow">&#183;</span></i></a> is a restriction of <a href="#f-durationCanMap" shape="rect"><i><span class="arrow">&#183;</span>durationCanonicalMap<span class="arrow">&#183;</span></i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>ym</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-yearMonthDurationRep" shape="rect"><i>yearMonthDurationLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>m</var> be <var>ym</var>'s <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> and</div></li><li><div class="p"><var>sgn</var> be '<code>-</code>' if <var>m</var> is negative and the empty string ('') otherwise.</div></li></ul> </td></tr></tbody></table></div> <div class="defindent"> Return&#160; <var>sgn</var>&#160;&amp; '<code>P</code>'&#160;&amp; <a href="#f-duYMCan" shape="rect"><i><span class="arrow">&#183;</span>duYearMonthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(|&#160;<var>m</var>&#160;|)&#160;. </div> </div></div> <div class="defset"> <div class="not_aux"> <div class="defset-head">The <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-dayTimeDurationCanMap" id="f-dayTimeDurationCanMap" shape="rect"><i><span class="arrow">&#183;</span>dayTimeDurationCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>dt</var>) &#8594; <a href="#nt-dayTimeDurationRep" shape="rect"><i>dayTimeDurationLexicalRep</i></a> <div class="defindent">Maps a <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a>'s <a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> value to a <a href="#nt-dayTimeDurationRep" shape="rect"><i>dayTimeDurationLexicalRep</i></a>.&#160; (The <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> value is necessarily zero and is ignored.)&#160; <a href="#f-dayTimeDurationCanMap" shape="rect"><i><span class="arrow">&#183;</span>dayTimeDurationCanonicalMap<span class="arrow">&#183;</span></i></a> is a restriction of <a href="#f-durationCanMap" shape="rect"><i><span class="arrow">&#183;</span>durationCanonicalMap<span class="arrow">&#183;</span></i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>dt</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-dayTimeDurationRep" shape="rect"><i>dayTimeDurationLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>s</var> be <var>dt</var>'s <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> and</div></li><li><div class="p"><var>sgn</var> be '<code>-</code>' if <var>s</var> is negative and the empty string ('') otherwise.</div></li></ul> </td></tr></tbody></table></div> <div class="defindent">Return&#160;<var>sgn</var>&#160;&amp; '<code>P</code>'&#160;&amp; <a href="#f-duYMCan" shape="rect"><i><span class="arrow">&#183;</span>duYearMonthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(|&#160;<var>s</var>&#160;|)&#160;. </div> </div></div> </div></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#sec-duration-functions" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#sec-misc-lexmaps" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="sec-dt-functions" id="sec-dt-functions" shape="rect"></a>E.3 Date/time-related Definitions</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;E.3.1 <a href="#sec-normalization" shape="rect">Normalization of property values</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;E.3.2 <a href="#sec-aux-functions" shape="rect">Auxiliary Functions</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;E.3.3 <a href="#sec-dt-arith" shape="rect">Adding durations to dateTimes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;E.3.4 <a href="#sec-timeontimeline" shape="rect">Time on timeline</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;E.3.5 <a href="#sec-dt-lexmaps" shape="rect">Lexical mappings</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;E.3.6 <a href="#sec-dt-canmaps" shape="rect">Canonical Mappings</a><br clear="none" /> </div><div class="div3"> <h4><a name="sec-normalization" id="sec-normalization" shape="rect"></a>E.3.1 Normalization of property values</h4><div class="block">When adding and subtracting numbers from date/time properties, the immediate results may not conform to the limits specified.&#160; Accordingly, the following procedures are used to "normalize" potential property values to corresponding values that do conform to the appropriate limits.&#160; Normalization is required when dealing with time zone offset changes (as when converting to <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a> from "local" values) and when adding <a href="#duration" shape="rect">duration</a> values to or subtracting them from <a href="#dateTime" shape="rect">dateTime</a> values. <div class="defset"> <div class="aux"> <div class="defset-head">Date/time Datatype Normalizing Procedures</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-dt-normMo" id="f-dt-normMo" shape="rect"><i><span class="arrow">&#183;</span>normalizeMonth<span class="arrow">&#183;</span></i></a></b> (<var>yr</var>,&#160;<var>mo</var>) <div class="defindent">If month (<var>mo</var>) is out of range, adjust month and year (<var>yr</var>) accordingly; otherwise, make no change.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>yr</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>mo</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> </tbody></table></div> <b>Algorithm:</b> <div class="defindent"> <ol class="enumar"><li><div class="p"> Add&#160; (<var>mo</var>&#160;&#8722;&#160;1)&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;12&#160; to <var>yr</var>. </div></li><li><div class="p"> Set <var>mo</var> to&#160; (<var>mo</var>&#160;&#8722;&#160;1)&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;12&#160;+&#160;1&#160;. </div></li></ol> </div> <div class="deftop"><b><a name="f-dt-normDa" id="f-dt-normDa" shape="rect"><i><span class="arrow">&#183;</span>normalizeDay<span class="arrow">&#183;</span></i></a></b> (<var>yr</var>,&#160;<var>mo</var>,&#160;<var>da</var>) <div class="defindent">If month (<var>mo</var>) is out of range, or day (<var>da</var>) is out of range for the appropriate month, then adjust values accordingly, otherwise make no change.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>yr</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>mo</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>da</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> </tbody></table></div> <b>Algorithm:</b> <div class="defindent"> <ol class="enumar"><li><div class="p"><a href="#f-dt-normMo" shape="rect"><i><span class="arrow">&#183;</span>normalizeMonth<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>)</div></li><li><div class="p">Repeat until <var>da</var> is positive and not greater than <a href="#f-daysInMonth" shape="rect"><i><span class="arrow">&#183;</span>daysInMonth<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>): <ol class="enumla"><li><div class="p">If <var>da</var> exceeds <a href="#f-daysInMonth" shape="rect"><i><span class="arrow">&#183;</span>daysInMonth<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>) then: <ol class="enumlr"><li><div class="p">Subtract that limit from <var>da</var>.</div></li><li><div class="p">Add 1 to <var>mo</var>.</div></li><li><div class="p"><a href="#f-dt-normMo" shape="rect"><i><span class="arrow">&#183;</span>normalizeMonth<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>)</div></li></ol> </div></li><li><div class="p">If <var>da</var> is not positive then: <ol class="enumlr"><li><div class="p">Subtract 1 from <var>mo</var>.</div></li><li><div class="p"><a href="#f-dt-normMo" shape="rect"><i><span class="arrow">&#183;</span>normalizeMonth<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>)</div></li><li><div class="p">Add the new upper limit from the table to <var>da</var>.</div></li></ol> </div></li></ol> </div></li></ol> </div> <div class="deftop"><b><a name="f-dt-normMi" id="f-dt-normMi" shape="rect"><i><span class="arrow">&#183;</span>normalizeMinute<span class="arrow">&#183;</span></i></a></b> (<var>yr</var>,&#160;<var>mo</var>,&#160;<var>da</var>,&#160;<var>hr</var>,&#160;<var>mi</var>) <div class="defindent">Normalizes minute, hour, month, and year values to values that obey the appropriate constraints.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>yr</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>mo</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>da</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>hr</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>mi</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> </tbody></table></div> <b>Algorithm:</b> <div class="defindent"> <ol class="enumar"><li><div class="p">Add &#160; <var>mi</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;60&#160; to <var>hr</var>.</div></li><li><div class="p">Set <var>mi</var> to&#160; <var>mi</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;60&#160;.</div></li><li><div class="p">Add&#160; <var>hr</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;24&#160; to <var>da</var>.</div></li><li><div class="p">Set <var>hr</var> to&#160; <var>hr</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;24&#160;.</div></li><li><div class="p"><a href="#f-dt-normDa" shape="rect"><i><span class="arrow">&#183;</span>normalizeDay<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>,&#160;<var>da</var>).</div></li></ol> </div> <div class="deftop"><b><a name="f-dt-normSe" id="f-dt-normSe" shape="rect"><i><span class="arrow">&#183;</span>normalizeSecond<span class="arrow">&#183;</span></i></a></b> (<var>yr</var>,&#160;<var>mo</var>,&#160;<var>da</var>,&#160;<var>hr</var>,&#160;<var>mi</var>,&#160;<var>se</var>) <div class="defindent">Normalizes second, minute, hour, month, and year values to values that obey the appropriate constraints.&#160; (This algorithm ignores leap seconds.) </div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>yr</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>mo</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>da</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>hr</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>mi</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer</td></tr> <tr><td rowspan="1" colspan="1"><var>se</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a decimal number</td></tr> </tbody></table></div> <b>Algorithm:</b> <div class="defindent"> <ol class="enumar"><li><div class="p">Add&#160; <var>se</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;60&#160; to <var>mi</var>.</div></li><li><div class="p">Set <var>se</var> to <var>se</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;60&#160;.</div></li><li><div class="p"><a href="#f-dt-normMi" shape="rect"><i><span class="arrow">&#183;</span>normalizeMinute<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>,&#160;<var>da</var>,&#160;<var>hr</var>,&#160;<var>mi</var>).</div></li></ol> </div> </div></div> </div></div><div class="div3"> <h4><a name="sec-aux-functions" id="sec-aux-functions" shape="rect"></a>E.3.2 Auxiliary Functions</h4><div class="block"> <div class="defset"> <div class="not_aux"> <div class="defset-head">Date/time Auxiliary Functions</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-daysInMonth" id="f-daysInMonth" shape="rect"><i><span class="arrow">&#183;</span>daysInMonth<span class="arrow">&#183;</span></i></a></b> (<var>y</var>,&#160;<var>m</var>) &#8594; integer <div class="defindent">Returns the number of the last day of the month for any combination of year and month.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>y</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a> integer</td></tr> <tr><td rowspan="1" colspan="1"><var>m</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer between 1 and 12</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">between 28 and 31 inclusive</div> <b>Algorithm:</b> <div class="defindent"> Return: <ul><li><div class="p">28&#160;&#160; when <var>m</var> is 2 and <var>y</var> is not evenly divisible by 4, or is evenly divisible by 100 but not by 400, or is <b><i>absent</i></b>,</div></li><li><div class="p">29&#160;&#160; when <var>m</var> is 2 and <var>y</var> is evenly divisible by 400, or is evenly divisible by 4 but not by 100,</div></li><li><div class="p">30&#160;&#160; when <var>m</var> is 4, 6, 9, or 11,</div></li><li><div class="p">31&#160;&#160; otherwise (<var>m</var> is 1, 3, 5, 7, 8, 10, or 12)</div></li></ul> </div> <div class="deftop"><b><a name="p-setDTFromRaw" id="p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a></b> (<var>Yr</var>,&#160;<var>Mo</var>,&#160;<var>Da</var>,&#160;<var>Hr</var>,&#160;<var>Mi</var>,&#160;<var>Se</var>,&#160;<var>Tz</var>) &#8594; an instance of the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> <div class="defindent">Returns an instance of the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> with property values as specified in the arguments. If an argument is omitted, the corresponding property is set to <b><i>absent</i></b>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>Yr</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a> integer</td></tr> <tr><td rowspan="1" colspan="1"><var>Mo</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a> integer between 1 and 12 inclusive</td></tr> <tr><td rowspan="1" colspan="1"><var>Da</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a> integer between 1 and 31 inclusive</td></tr> <tr><td rowspan="1" colspan="1"><var>Hr</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a> integer between 0 and 24 inclusive</td></tr> <tr><td rowspan="1" colspan="1"><var>Mi</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a> integer between 0 and 59 inclusive</td></tr> <tr><td rowspan="1" colspan="1"><var>Se</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a> decimal number greater than or equal to 0 and less than 60</td></tr> <tr><td rowspan="1" colspan="1"><var>Tz</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an <a href="#dt-optional" class="termref" shape="rect"><span class="arrow">&#183;</span>optional<span class="arrow">&#183;</span></a> integer between &#8722;840 and 840 inclusive.</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent"> </div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>dt</var> be an instance of the <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a></div></li><li><div class="p"><var>yr</var> be <var>Yr</var> when <var>Yr</var> is not <b><i>absent</i></b>, otherwise 1</div></li><li><div class="p"><var>mo</var> be <var>Mo</var>when <var>Mo</var> is not <b><i>absent</i></b>, otherwise 1</div></li><li><div class="p"><var>da</var> be <var>Da</var>when <var>Da</var> is not <b><i>absent</i></b>, otherwise 1</div></li><li><div class="p"><var>hr</var> be <var>Hr</var>when <var>Hr</var> is not <b><i>absent</i></b>, otherwise 0</div></li><li><div class="p"><var>mi</var> be <var>Mi</var>when <var>Mi</var> is not <b><i>absent</i></b>, otherwise 0</div></li><li><div class="p"><var>se</var> be <var>Se</var>when <var>Se</var> is not <b><i>absent</i></b>, otherwise 0</div></li></ul> </td></tr></tbody></table></div> <div class="defindent"> <ol class="enumar"><li><div class="p"><a href="#f-dt-normSe" shape="rect"><i><span class="arrow">&#183;</span>normalizeSecond<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>,&#160;<var>da</var>,&#160;<var>hr</var>,&#160;<var>mi</var>,&#160;<var>se</var>)</div></li><li><div class="p">Set the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> property of <var>dt</var> to <b><i>absent</i></b> when <var>Yr</var> is <b><i>absent</i></b>, otherwise <var>yr</var>.</div></li><li><div class="p">Set the <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> property of <var>dt</var> to <b><i>absent</i></b> when <var>Mo</var> is <b><i>absent</i></b>, otherwise <var>mo</var>.</div></li><li><div class="p">Set the <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> property of <var>dt</var> to <b><i>absent</i></b> when <var>Da</var> is <b><i>absent</i></b>, otherwise <var>da</var>.</div></li><li><div class="p">Set the <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a> property of <var>dt</var> to <b><i>absent</i></b> when <var>Hr</var> is <b><i>absent</i></b>, otherwise <var>hr</var>.</div></li><li><div class="p">Set the <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a> property of <var>dt</var> to <b><i>absent</i></b> when <var>Mi</var> is <b><i>absent</i></b>, otherwise <var>mi</var>.</div></li><li><div class="p">Set the <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> property of <var>dt</var> to <b><i>absent</i></b> when <var>Se</var> is <b><i>absent</i></b>, otherwise <var>se</var>.</div></li><li><div class="p">Set the <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> property of <var>dt</var> to <var>Tz</var></div></li><li><div class="p">Return <var>dt</var>.</div></li></ol> </div> </div></div> </div></div><div class="div3"> <h4><a name="sec-dt-arith" id="sec-dt-arith" shape="rect"></a>E.3.3 Adding durations to dateTimes</h4><p id="new_g1"> Given a <a href="#dateTime" shape="rect">dateTime</a> <var>S</var> and a <a href="#duration" shape="rect">duration</a> <var>D</var>, function <a href="#vp-dt-dateTimePlusDuration" shape="rect"><i><span class="arrow">&#183;</span>dateTimePlusDuration<span class="arrow">&#183;</span></i></a> specifies how to compute a <a href="#dateTime" shape="rect">dateTime</a> <var>E</var>, where <var>E</var> is the end of the time period with start <var>S</var> and duration <var>D</var> i.e. <var>E</var> = <var>S</var> + <var>D</var>.&#160; Such computations are used, for example, to determine whether a <a href="#dateTime" shape="rect">dateTime</a> is within a specific time period.&#160; This algorithm can also be applied, when applications need the operation, to the addition of <a href="#duration" shape="rect">duration</a>s to the datatypes <a href="#date" shape="rect">date</a>, <a href="#gYearMonth" shape="rect">gYearMonth</a>, <a href="#gYear" shape="rect">gYear</a>, <a href="#gDay" shape="rect">gDay</a> and <a href="#gMonth" shape="rect">gMonth</a>, each of which can be viewed as denoting a set of <a href="#dateTime" shape="rect">dateTime</a>s. In such cases, the addition is made to the first or starting <a href="#dateTime" shape="rect">dateTime</a> in the set.&#160; Note that the extension of this algorithm to types other than <a href="#dateTime" shape="rect">dateTime</a> is not needed for schema-validity assessment. </p><p id="new_g5"> Essentially, this calculation adds the <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> and <a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> properties of the <a href="#duration" shape="rect">duration</a> value separately to the <a href="#dateTime" shape="rect">dateTime</a> value. The <a href="#vp-du-month" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> value is added to the starting <a href="#dateTime" shape="rect">dateTime</a> value first. If the day is out of range for the new month value, it is <em>pinned</em> to be within range. Thus April 31 turns into April 30. Then the <a href="#vp-du-second" class="vprop" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> value is added. This latter addition can cause the year, month, day, hour, and minute to change. </p><p id="new_g6"> Leap seconds are ignored by the computation. All calculations use 60 seconds per minute. </p><p id="new_g7"> Thus the addition of either PT1M or PT60S to any dateTime will always produce the same result. This is a special definition of addition which is designed to match common practice, and&#8212;most importantly&#8212;be stable over time. </p><p id="new_g8"> A definition that attempted to take leap-seconds into account would need to be constantly updated, and could not predict the results of future implementation's additions. The decision to introduce a leap second in <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a> is the responsibility of the <a href="#IERS" shape="rect">[International Earth Rotation Service (IERS)]</a>. They make periodic announcements as to when leap seconds are to be added, but this is not known more than a year in advance. For more information on leap seconds, see <a href="#USNavy" shape="rect">[U.S. Naval Observatory Time Service Department]</a>. </p><div class="defset"> <div class="not_aux"> <div class="defset-head">Adding <a href="#duration" shape="rect">duration</a> to <a href="#dateTime" shape="rect">dateTime</a></div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-dt-dateTimePlusDuration" id="vp-dt-dateTimePlusDuration" shape="rect"><i><span class="arrow">&#183;</span>dateTimePlusDuration<span class="arrow">&#183;</span></i></a></b> (<var>du</var>,&#160;<var>dt</var>) &#8594; <a href="#dateTime" shape="rect">dateTime</a> <div class="defindent">Adds a <a href="#duration" shape="rect">duration</a> to a <a href="#dateTime" shape="rect">dateTime</a> value, producing another <a href="#dateTime" shape="rect">dateTime</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>du</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#duration" shape="rect">duration</a> value</td></tr> <tr><td rowspan="1" colspan="1"><var>dt</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#dateTime" shape="rect">dateTime</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a <a href="#dateTime" shape="rect">dateTime</a> value</div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>yr</var> be <var>dt</var>'s <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>,</div></li><li><div class="p"><var>mo</var> be <var>dt</var>'s <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>,</div></li><li><div class="p"><var>da</var> be <var>dt</var>'s <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>,</div></li><li><div class="p"><var>hr</var> be <var>dt</var>'s <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>,</div></li><li><div class="p"><var>mi</var> be <var>dt</var>'s <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>, and</div></li><li><div class="p"><var>se</var> be <var>dt</var>'s <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a>.</div></li><li><div class="p"><var>tz</var> be <var>dt</var>'s <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>.</div></li></ul> </td></tr></tbody></table></div> <div class="defindent"> <ol class="enumar"><li><div class="p">Add <var>du</var>'s <a href="#vp-du-month" shape="rect"><i><span class="arrow">&#183;</span>months<span class="arrow">&#183;</span></i></a> to <var>mo</var>.</div></li><li><div class="p"><a href="#f-dt-normMo" shape="rect"><i><span class="arrow">&#183;</span>normalizeMonth<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>). (I.e., carry any over- or underflow, adjust month.)</div></li><li><div class="p">Set <var>da</var> to&#160; min(<var>da</var>,&#160;<a href="#f-daysInMonth" shape="rect"><i><span class="arrow">&#183;</span>daysInMonth<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>)). (I.e., <em>pin</em> the value if necessary.)</div></li><li><div class="p">Add <var>du</var>'s <a href="#vp-du-second" shape="rect"><i><span class="arrow">&#183;</span>seconds<span class="arrow">&#183;</span></i></a> to <var>se</var>.</div></li><li><div class="p"><a href="#f-dt-normSe" shape="rect"><i><span class="arrow">&#183;</span>normalizeSecond<span class="arrow">&#183;</span></i></a>(<var>yr</var>,&#160;<var>mo</var>,&#160;<var>da</var>,&#160;<var>hr</var>,&#160;<var>mi</var>,&#160;<var>se</var>). (I.e., carry over- or underflow of seconds up to minutes, hours, etc.) </div></li><li><div class="p">Return <a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<var>yr</var>, <var>mo</var>, <var>da</var>, <var>hr</var>, <var>mi</var>, <var>se</var>, <var>tz</var>) </div></li></ol> </div> </div></div><p>This algorithm may be applied to date/time types other than <a href="#dateTime" shape="rect">dateTime</a>, by</p><ol class="enumar"><li><div class="p">For each <b><i>absent</i></b> property, supply the minimum legal value for that property (1 for years, months, days, 0 for hours, minutes, seconds).</div></li><li><div class="p">Call the function.</div></li><li><div class="p">For each property <b><i>absent</i></b> in the initial value, set the corresponding property in the result value to <b><i>absent</i></b>.</div></li></ol><p id="new_g11"><em>Examples:</em></p><table id="new_g12" border="1" cellspacing="0" cellpadding="4"><tbody><tr><th align="center" style="background-color: #FFFF99" rowspan="1" colspan="1">dateTime</th><th align="center" style="background-color: #FFFF99" rowspan="1" colspan="1">duration</th><th align="center" style="background-color: #FFFF99" rowspan="1" colspan="1">result</th></tr><tr><td align="center" rowspan="1" colspan="1">2000-01-12T12:13:14Z</td><td align="center" rowspan="1" colspan="1">P1Y3M5DT7H10M3.3S</td><td align="center" rowspan="1" colspan="1">2001-04-17T19:23:17.3Z</td></tr><tr><td align="center" rowspan="1" colspan="1">2000-01</td><td align="center" rowspan="1" colspan="1">-P3M</td><td align="center" rowspan="1" colspan="1">1999-10</td></tr><tr><td align="center" rowspan="1" colspan="1">2000-01-12</td><td align="center" rowspan="1" colspan="1">PT33H</td><td align="center" rowspan="1" colspan="1">2000-01-13</td></tr></tbody></table><div class="block"> Note that the addition defined by <a href="#vp-dt-dateTimePlusDuration" shape="rect"><i><span class="arrow">&#183;</span>dateTimePlusDuration<span class="arrow">&#183;</span></i></a> differs from addition on integers or real numbers in not being commutative. The order of addition of durations to instants <em>is</em> significant. For example, there are cases where: <blockquote><blockquote><p>((dateTime + duration1) + duration2) != ((dateTime + duration2) + duration1)</p></blockquote></blockquote> </div><p id="new_g16"><em>Example:</em></p><ul><li><div class="p"> (2000-03-30 + P1D) + P1M = 2000-03-31 + P1M = 2000-<b>04-30</b></div></li><li><div class="p"> (2000-03-30 + P1M) + P1D = 2000-04-30 + P1D = 2000-<b>05-01</b></div></li></ul></div><div class="div3"> <h4><a name="sec-timeontimeline" id="sec-timeontimeline" shape="rect"></a>E.3.4 Time on timeline</h4><div class="defset"> <div class="not_aux"> <div class="defset-head">Time on Timeline for Date/time Seven-property Model Datatypes</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-dt-timeOnTimeline" id="vp-dt-timeOnTimeline" shape="rect"><i><span class="arrow">&#183;</span>timeOnTimeline<span class="arrow">&#183;</span></i></a></b> (<var>dt</var>) &#8594; decimal number <div class="defindent">Maps a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value to the decimal number representing its position on the "time line".</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>dt</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a decimal number</div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <ul><li><div class="p"><var>yr</var> be 1971 when <var>dt</var>'s <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b>, and&#160; <var>dt</var>'s <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>&#160;&#8722;&#160;1&#160; otherwise,</div></li><li><div class="p"><var>mo</var> be 12 or <var>dt</var>'s <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>&#160;, similarly,</div></li><li><div class="p"><var>da</var> be&#160; <a href="#f-daysInMonth" shape="rect"><i><span class="arrow">&#183;</span>daysInMonth<span class="arrow">&#183;</span></i></a>(<var>yr</var>+1,&#160;<var>mo</var>)&#160;&#8722;&#160;1&#160; or&#160; (<var>dt</var>'s <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>)&#160;&#8722;&#160;1&#160;, similarly,</div></li><li><div class="p"><var>hr</var> be 0 or <var>dt</var>'s <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>&#160;, similarly,</div></li><li><div class="p"><var>mi</var> be 0 or <var>dt</var>'s <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>&#160;, similarly, and</div></li><li><div class="p"><var>se</var> be 0 or <var>dt</var>'s <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a>&#160;, similarly.</div></li></ul> </td></tr></tbody></table></div> <div class="defindent"> <ol class="enumar"><li><div class="p">Subtract <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> from <var>mi</var>&#160;&#160; when <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is not <b><i>absent</i></b>.</div></li><li><div class="p">(<a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>) <ol class="enumla"><li><div class="p">Set <var>ToTl</var> to&#160; 31536000&#160;&#215;&#160;<var>yr</var>&#160;.</div></li></ol></div></li><li><div class="p">(Leap-year Days, <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>, and <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>) <ol class="enumla"><li><div class="p">Add&#160; 86400&#160;&#215; (<var>yr</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;400&#160;&#8722; <var>yr</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;100&#160;+ <var>yr</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;4)&#160; to <var>ToTl</var>.</div></li><li><div class="p">Add &#160; 86400&#160;&#215; Sum<sub><var>m</var>&#160;&lt;&#160;<var>mo</var></sub>&#160;<a href="#f-daysInMonth" shape="rect"><i><span class="arrow">&#183;</span>daysInMonth<span class="arrow">&#183;</span></i></a>(<var>yr</var>&#160;+&#160;1,&#160;<var>m</var>) to <var>ToTl</var></div></li><li><div class="p">Add &#160; 86400&#160;&#215;&#160;<var>da</var>&#160; to <var>ToTl</var>.</div></li></ol></div></li><li><div class="p">(<a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>, <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>, and <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a>) <ol class="enumla"><li><div class="p">Add&#160; 3600&#160;&#215;&#160;<var>hr</var>&#160;+ 60&#160;&#215;&#160;<var>mi</var>&#160;+ <var>se</var>&#160; to <var>ToTl</var>.</div></li></ol></div></li><li><div class="p">Return <var>ToTl</var>.</div></li></ol> </div> </div></div></div><div class="div3"> <h4><a name="sec-dt-lexmaps" id="sec-dt-lexmaps" shape="rect"></a>E.3.5 Lexical mappings</h4><div class="defset"> <div class="not_aux"> <div class="defset-head">Partial Date/time Lexical Mappings</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-dt-yrMap" id="f-dt-yrMap" shape="rect"><i><span class="arrow">&#183;</span>yearFragValue<span class="arrow">&#183;</span></i></a></b> (<var>YR</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>YR</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">an integer</div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-noDecVal" shape="rect"><i><span class="arrow">&#183;</span>noDecimalMap<span class="arrow">&#183;</span></i></a>(<var>YR</var>)</div> <div class="deftop"><b><a name="f-dt-moMap" id="f-dt-moMap" shape="rect"><i><span class="arrow">&#183;</span>monthFragValue<span class="arrow">&#183;</span></i></a></b> (<var>MO</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>MO</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">an integer</div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a>(<var>MO</var>)</div> <div class="deftop"><b><a name="f-dt-daMap" id="f-dt-daMap" shape="rect"><i><span class="arrow">&#183;</span>dayFragValue<span class="arrow">&#183;</span></i></a></b> (<var>DA</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>DA</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">an integer</div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a>(<var>DA</var>)</div> <div class="deftop"><b><a name="f-dt-hrMap" id="f-dt-hrMap" shape="rect"><i><span class="arrow">&#183;</span>hourFragValue<span class="arrow">&#183;</span></i></a></b> (<var>HR</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>HR</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">an integer</div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a>(<var>HR</var>)</div> <div class="deftop"><b><a name="f-dt-miMap" id="f-dt-miMap" shape="rect"><i><span class="arrow">&#183;</span>minuteFragValue<span class="arrow">&#183;</span></i></a></b> (<var>MI</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>MI</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">an integer</div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a>(<var>MI</var>)</div> <div class="deftop"><b><a name="f-dt-seMap" id="f-dt-seMap" shape="rect"><i><span class="arrow">&#183;</span>secondFragValue<span class="arrow">&#183;</span></i></a></b> (<var>SE</var>) &#8594; decimal number <div class="defindent">Maps a <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto a decimal number, presumably the <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>SE</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a decimal number</div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p"><a href="#f-unsNoDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedNoDecimalMap<span class="arrow">&#183;</span></i></a>(<var>SE</var>)&#160;&#160; when no decimal point occurs in <var>SE</var>, and</div></li><li><div class="p"><a href="#f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a>(<var>SE</var>)&#160;&#160; otherwise.</div></li></ul></div> <div class="deftop"><b><a name="f-dt-tzMap" id="f-dt-tzMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneFragValue<span class="arrow">&#183;</span></i></a></b> (<var>TZ</var>) &#8594; integer <div class="defindent">Maps a <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>, onto an integer, presumably the <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>TZ</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">an integer</div> <b>Algorithm:</b> <div class="defindent"><var>TZ</var> necessarily consists of either just '<code>Z</code>', or a sign ('<code>+</code>' or '<code>-</code>') followed by an instance <var>H</var> of <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>, a colon, and an instance <var>M</var> of <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a> </div> <div class="defindent">Return <ul><li><div class="p">0&#160;&#160; when <var>TZ</var> is '<code>Z</code>',</div></li><li><div class="p">&#8722;(<a href="#f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a>(<var>H</var>)&#160;&#215;&#160;60&#160;+ <a href="#f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a>(<var>M</var>))&#160;&#160; when the sign is '<code>-</code>', and</div></li><li><div class="p"><a href="#f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a>(<var>H</var>)&#160;&#215;&#160;60&#160;+ <a href="#f-unsDecVal" shape="rect"><i><span class="arrow">&#183;</span>unsignedDecimalPtMap<span class="arrow">&#183;</span></i></a>(<var>M</var>)&#160;&#160; otherwise.</div></li></ul></div> </div></div><div class="note"><div class="p"><b>Note:</b> There is no <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#nt-eodFrag" shape="rect"><i>endOfDayFrag</i></a>; it is handled specially by the relevant <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a>.&#160; See, e.g., <a href="#vp-dateTimeLexRep" shape="rect"><i><span class="arrow">&#183;</span>dateTimeLexicalMap<span class="arrow">&#183;</span></i></a>.</div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-dateTimeLexRep" id="vp-dateTimeLexRep" shape="rect"><i><span class="arrow">&#183;</span>dateTimeLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#dateTime" shape="rect">dateTime</a> <div class="defindent">Maps a <a href="#nt-dateTimeRep" shape="rect"><i>dateTimeLexicalRep</i></a> to a <a href="#dateTime" shape="rect">dateTime</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-dateTimeRep" shape="rect"><i>dateTimeLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#dateTime" shape="rect">dateTime</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>LEX</var> necessarily includes substrings that are instances of <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>, <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>, and <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a> (below referred to as <var>Y</var>, <var>MO</var>, and <var>D</var> respectively); it also contains either instances of <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>, <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>, and <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a>(<var>Y</var>, <var>MI</var>, and <var>S</var>), or else an instance of <a href="#nt-eodFrag" shape="rect"><i>endOfDayFrag</i></a>; finally, it may optionally contain an instance of<a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a> (<var>T</var>).</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>tz</var> be <a href="#f-dt-tzMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneFragValue<span class="arrow">&#183;</span></i></a>(<var>T</var>) when <var>T</var> is present, otherwise <b><i>absent</i></b>.</td></tr></tbody></table></div> <div class="defindent"> Return <ul><li><div class="p"><a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<a href="#f-dt-yrMap" shape="rect"><i><span class="arrow">&#183;</span>yearFragValue<span class="arrow">&#183;</span></i></a>(<var>Y</var>), <a href="#f-dt-moMap" shape="rect"><i><span class="arrow">&#183;</span>monthFragValue<span class="arrow">&#183;</span></i></a>(<var>MO</var>), <a href="#f-dt-daMap" shape="rect"><i><span class="arrow">&#183;</span>dayFragValue<span class="arrow">&#183;</span></i></a>(<var>D</var>), 24, 0, 0, <var>tz</var>) when <a href="#nt-eodFrag" shape="rect"><i>endOfDayFrag</i></a> is present, and</div></li><li><div class="p"> <a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<a href="#f-dt-yrMap" shape="rect"><i><span class="arrow">&#183;</span>yearFragValue<span class="arrow">&#183;</span></i></a>(<var>Y</var>), <a href="#f-dt-moMap" shape="rect"><i><span class="arrow">&#183;</span>monthFragValue<span class="arrow">&#183;</span></i></a>(<var>MO</var>), <a href="#f-dt-daMap" shape="rect"><i><span class="arrow">&#183;</span>dayFragValue<span class="arrow">&#183;</span></i></a>(<var>D</var>), <a href="#f-dt-hrMap" shape="rect"><i><span class="arrow">&#183;</span>hourFragValue<span class="arrow">&#183;</span></i></a>(<var>H</var>), <a href="#f-dt-miMap" shape="rect"><i><span class="arrow">&#183;</span>minuteFragValue<span class="arrow">&#183;</span></i></a>(<var>MI</var>), <a href="#f-dt-seMap" shape="rect"><i><span class="arrow">&#183;</span>secondFragValue<span class="arrow">&#183;</span></i></a>(<var>S</var>), <var>tz</var>) otherwise</div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-timeLexRep" id="vp-timeLexRep" shape="rect"><i><span class="arrow">&#183;</span>timeLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#time" shape="rect">time</a> <div class="defindent">Maps a <a href="#nt-timeRep" shape="rect"><i>timeLexicalRep</i></a> to a <a href="#time" shape="rect">time</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-timeRep" shape="rect"><i>timeLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#time" shape="rect">time</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>LEX</var> necessarily includes either substrings that are instances of <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>, <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>, and <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a>, (below referred to as <var>H</var>, <var>M</var>, and <var>S</var> respectively), or else an instance of <a href="#nt-eodFrag" shape="rect"><i>endOfDayFrag</i></a>; finally, it may optionally contain an instance of <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a> (<var>T</var>).</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>tz</var> be <a href="#f-dt-tzMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneFragValue<span class="arrow">&#183;</span></i></a>(<var>T</var>) when <var>T</var> is present, otherwise <b><i>absent</i></b></td></tr></tbody></table></div> <div class="defindent"> Return <ul><li><div class="p"><a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, 0, 0, 0, <var>tz</var>) when <a href="#nt-eodFrag" shape="rect"><i>endOfDayFrag</i></a> is present, and</div></li><li><div class="p"> <a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <a href="#f-dt-hrMap" shape="rect"><i><span class="arrow">&#183;</span>hourFragValue<span class="arrow">&#183;</span></i></a>(<var>H</var>), <a href="#f-dt-miMap" shape="rect"><i><span class="arrow">&#183;</span>minuteFragValue<span class="arrow">&#183;</span></i></a>(<var>MI</var>), <a href="#f-dt-seMap" shape="rect"><i><span class="arrow">&#183;</span>secondFragValue<span class="arrow">&#183;</span></i></a>(<var>S</var>), <var>tz</var>) otherwise.</div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-dateLexRep" id="vp-dateLexRep" shape="rect"><i><span class="arrow">&#183;</span>dateLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#date" shape="rect">date</a> <div class="defindent">Maps a <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a> to a <a href="#date" shape="rect">date</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#date" shape="rect">date</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>LEX</var> necessarily includes an instance <var>Y</var> of <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>, an instance <var>M</var> of <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>, and an instance <var>D</var> of <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>, hyphen-separated and optionally followed by an instance <var>T</var> of <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>.</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>tz</var> be <a href="#f-dt-tzMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneFragValue<span class="arrow">&#183;</span></i></a>(<var>T</var>) when <var>T</var> is present, otherwise <b><i>absent</i></b></td></tr></tbody></table></div> <div class="defindent"> Return <a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<a href="#f-dt-yrMap" shape="rect"><i><span class="arrow">&#183;</span>yearFragValue<span class="arrow">&#183;</span></i></a>(<var>Y</var>), <a href="#f-dt-moMap" shape="rect"><i><span class="arrow">&#183;</span>monthFragValue<span class="arrow">&#183;</span></i></a>(<var>M</var>), <a href="#f-dt-daMap" shape="rect"><i><span class="arrow">&#183;</span>dayFragValue<span class="arrow">&#183;</span></i></a>(<var>D</var>), <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <var>tz</var>.) </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-gYearMonthLexRep" id="vp-gYearMonthLexRep" shape="rect"><i><span class="arrow">&#183;</span>gYearMonthLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#gYearMonth" shape="rect">gYearMonth</a> <div class="defindent">Maps a <a href="#nt-gYearMonthRep" shape="rect"><i>gYearMonthLexicalRep</i></a> to a <a href="#gYearMonth" shape="rect">gYearMonth</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-gYearMonthRep" shape="rect"><i>gYearMonthLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#gYearMonth" shape="rect">gYearMonth</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>LEX</var> necessarily includes an instance <var>Y</var> of <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a> and an instance <var>M</var> of <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>, hyphen-separated and optionally followed by an instance <var>T</var> of <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>.</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>tz</var> be <a href="#f-dt-tzMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneFragValue<span class="arrow">&#183;</span></i></a>(<var>T</var>) when <var>T</var> is present, otherwise <b><i>absent</i></b>.</td></tr></tbody></table></div> <div class="defindent"> Return <a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<a href="#f-dt-yrMap" shape="rect"><i><span class="arrow">&#183;</span>yearFragValue<span class="arrow">&#183;</span></i></a>(<var>Y</var>), <a href="#f-dt-moMap" shape="rect"><i><span class="arrow">&#183;</span>monthFragValue<span class="arrow">&#183;</span></i></a>(<var>M</var>), <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <var>tz</var>). </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-gYearLexRep" id="vp-gYearLexRep" shape="rect"><i><span class="arrow">&#183;</span>gYearLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#gYear" shape="rect">gYear</a> <div class="defindent">Maps a <a href="#nt-gYearRep" shape="rect"><i>gYearLexicalRep</i></a> to a <a href="#gYear" shape="rect">gYear</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-gYearRep" shape="rect"><i>gYearLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#gYear" shape="rect">gYear</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>LEX</var> necessarily includes an instance <var>Y</var> of <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>, optionally followed by an instance <var>T</var> of <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>.</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>tz</var> be <a href="#f-dt-tzMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneFragValue<span class="arrow">&#183;</span></i></a>(<var>T</var>) when <var>T</var> is present, otherwise <b><i>absent</i></b>.</td></tr></tbody></table></div> <div class="defindent"> Return <a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<a href="#f-dt-yrMap" shape="rect"><i><span class="arrow">&#183;</span>yearFragValue<span class="arrow">&#183;</span></i></a>(<var>Y</var>), <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <var>tz</var>). </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-gMonthDayLexRep" id="vp-gMonthDayLexRep" shape="rect"><i><span class="arrow">&#183;</span>gMonthDayLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#gMonthDay" shape="rect">gMonthDay</a> <div class="defindent">Maps a <a href="#nt-gMonthDayRep" shape="rect"><i>gMonthDayLexicalRep</i></a> to a <a href="#gMonthDay" shape="rect">gMonthDay</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-gMonthDayRep" shape="rect"><i>gMonthDayLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#gMonthDay" shape="rect">gMonthDay</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>LEX</var> necessarily includes an instance <var>M</var> of <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a> and an instance <var>D</var> of <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>, hyphen-separated and optionally followed by an instance <var>T</var> of <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>.</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>tz</var> be <a href="#f-dt-tzMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneFragValue<span class="arrow">&#183;</span></i></a>(<var>T</var>) when <var>T</var> is present, otherwise <b><i>absent</i></b>.</td></tr></tbody></table></div> <div class="defindent"> Return <a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<b><i>absent</i></b>, <a href="#f-dt-moMap" shape="rect"><i><span class="arrow">&#183;</span>monthFragValue<span class="arrow">&#183;</span></i></a>(<var>M</var>), <a href="#f-dt-daMap" shape="rect"><i><span class="arrow">&#183;</span>dayFragValue<span class="arrow">&#183;</span></i></a>(<var>D</var>), <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <var>tz</var>. </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-gDayLexRep" id="vp-gDayLexRep" shape="rect"><i><span class="arrow">&#183;</span>gDayLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#gDay" shape="rect">gDay</a> <div class="defindent">Maps a <a href="#nt-gDayRep" shape="rect"><i>gDayLexicalRep</i></a> to a <a href="#gDay" shape="rect">gDay</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-gDayRep" shape="rect"><i>gDayLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#gDay" shape="rect">gDay</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>LEX</var> necessarily includes an instance <var>D</var> of <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>, optionally followed by an instance <var>T</var> of <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>.</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>tz</var> be <a href="#f-dt-tzMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneFragValue<span class="arrow">&#183;</span></i></a>(<var>T</var>) when <var>T</var> is present, otherwise <b><i>absent</i></b>.</td></tr></tbody></table></div> <div class="defindent"> <ol class="enumar"><li><div class="p">Return <a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<var>gD</var>, <b><i>absent</i></b>, <b><i>absent</i></b>, <a href="#f-dt-daMap" shape="rect"><i><span class="arrow">&#183;</span>dayFragValue<span class="arrow">&#183;</span></i></a>(<var>D</var>), <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <var>tz</var>).</div></li></ol> Return <a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<b><i>absent</i></b>, <b><i>absent</i></b>, <a href="#f-dt-daMap" shape="rect"><i><span class="arrow">&#183;</span>dayFragValue<span class="arrow">&#183;</span></i></a>(<var>D</var>), <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <var>tz</var>). </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-gMonthLexRep" id="vp-gMonthLexRep" shape="rect"><i><span class="arrow">&#183;</span>gMonthLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#gMonth" shape="rect">gMonth</a> <div class="defindent">Maps a <a href="#nt-gMonthRep" shape="rect"><i>gMonthLexicalRep</i></a> to a <a href="#gMonth" shape="rect">gMonth</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">matches <a href="#nt-gMonthRep" shape="rect"><i>gMonthLexicalRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a complete <a href="#gMonth" shape="rect">gMonth</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>LEX</var> necessarily includes an instance <var>M</var> of <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>, optionally followed by an instance <var>T</var> of <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>.</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>tz</var> be <a href="#f-dt-tzMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneFragValue<span class="arrow">&#183;</span></i></a>(<var>T</var>) when <var>T</var> is present, otherwise <b><i>absent</i></b>.</td></tr></tbody></table></div> <div class="defindent"> Return <a href="#p-setDTFromRaw" shape="rect"><i><span class="arrow">&#183;</span>newDateTime<span class="arrow">&#183;</span></i></a>(<b><i>absent</i></b>, <a href="#f-dt-moMap" shape="rect"><i><span class="arrow">&#183;</span>monthFragValue<span class="arrow">&#183;</span></i></a>(<var>M</var>), <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <b><i>absent</i></b>, <var>tz</var>) </div> </div></div></div><div class="div3"> <h4><a name="sec-dt-canmaps" id="sec-dt-canmaps" shape="rect"></a>E.3.6 Canonical Mappings</h4><div class="defset"> <div class="aux"> <div class="defset-head">Auxiliary Functions for Date/time Canonical Mappings</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-unsTwoDigCanFragMap" id="f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>i</var>) &#8594; <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a> <div class="defindent">Maps a nonnegative integer less than 100 onto an unsigned always-two-digit numeral.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>i</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative integer less than 100</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-unsNoDecNuml" shape="rect"><i>unsignedNoDecimalPtNumeral</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-digit" shape="rect"><i><span class="arrow">&#183;</span>digit<span class="arrow">&#183;</span></i></a>(<var>i</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;10)&#160;&amp; <a href="#f-digit" shape="rect"><i><span class="arrow">&#183;</span>digit<span class="arrow">&#183;</span></i></a>(<var>i</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;10)</div> <div class="deftop"><b><a name="f-fourDigCanFragMap" id="f-fourDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>fourDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>i</var>) &#8594; <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a> <div class="defindent">Maps an integer between -10000 and 10000 onto an always-four-digit numeral.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>i</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer whose absolute value is less than 10000</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-noDecNuml" shape="rect"><i>noDecimalPtNumeral</i></a></div> <b>Algorithm:</b> <div class="defindent">Return<ul><li><div class="p">'<code>-</code>'&#160;&amp;&#160;<a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(&#8722;<var>i</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;100)&#160;&amp; <a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(&#8722;<var>i</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;100)&#160;&#160; when <var>i</var> is negative,</div></li><li><div class="p"><a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>i</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;100)&#160;&amp; <a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>i</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;100)&#160;&#160; otherwise.</div></li></ul></div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Partial Date/time Canonical Mappings</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-yrCanFragMap" id="f-yrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>yearCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>y</var>) &#8594; <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>y</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer </td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-yrFrag" shape="rect"><i>yearFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p"><a href="#f-noDecCanMap" shape="rect"><i><span class="arrow">&#183;</span>noDecimalPtCanonicalMap<span class="arrow">&#183;</span></i></a>(<var>y</var>)&#160;&#160; when&#160; |<var>y</var>|&#160;&gt;&#160;9999&#160;.</div></li><li><div class="p"><a href="#f-fourDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>fourDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>y</var>)&#160;&#160; otherwise.</div></li></ul></div> <div class="deftop"><b><a name="f-moCanFragMap" id="f-moCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>monthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>m</var>) &#8594; <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>m</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer between 1 and 12 inclusive</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-moFrag" shape="rect"><i>monthFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>m</var>)</div> <div class="deftop"><b><a name="f-daCanFragMap" id="f-daCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>dayCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>d</var>) &#8594; <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>d</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer between 1 and 31 inclusive&#160; (may be limited further depending on associated <a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a> and <a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>)</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-daFrag" shape="rect"><i>dayFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>d</var>)</div> <div class="deftop"><b><a name="f-hrCanFragMap" id="f-hrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>hourCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>h</var>) &#8594; <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>h</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer between 0 and 23 inclusive.</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-hrFrag" shape="rect"><i>hourFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>h</var>)</div> <div class="deftop"><b><a name="f-miCanFragMap" id="f-miCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>minuteCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>m</var>) &#8594; <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>m</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer between 0 and 59 inclusive.</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-miFrag" shape="rect"><i>minuteFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>m</var>)</div> <div class="deftop"><b><a name="f-seCanFragMap" id="f-seCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>secondCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>s</var>) &#8594; <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a> <div class="defindent">Maps a decimal number, presumably the <a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>s</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a nonnegative decimal number less than 70</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-seFrag" shape="rect"><i>secondFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p"><a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>s</var>)&#160;&#160; when <var>s</var> is an integer, and</div></li><li><div class="p"><a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>s</var><a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>1)&#160;&amp; '<code>.</code>'&#160;&amp; <a href="#f-fracDigitsMap" shape="rect"><i><span class="arrow">&#183;</span>fractionDigitsCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>s</var><a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>1)&#160;&#160; otherwise.</div></li></ul></div> <div class="deftop"><b><a name="f-tzCanFragMap" id="f-tzCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneCanonicalFragmentMap<span class="arrow">&#183;</span></i></a></b> (<var>t</var>) &#8594; <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a> <div class="defindent">Maps an integer, presumably the <a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> property of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a> value, onto a <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a>, part of a <a href="#dt-dt-7PropMod" shape="rect">date/timeSevenPropertyModel</a>'s <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>t</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">an integer between &#8722;840 and 840 inclusive</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-tzFrag" shape="rect"><i>timezoneFrag</i></a></div> <b>Algorithm:</b> <div class="defindent">Return<ul><li><div class="p">'<code>Z</code>'&#160;&#160; when <var>t</var> is zero,</div></li><li><div class="p">'<code>-</code>'&#160;&amp;&#160;<a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(&#8722;<var>t</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;60)&#160;&amp; '<code>:</code>'&#160;&amp; <a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(&#8722;<var>t</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;60)&#160;&#160; when <var>t</var> is negative, and</div></li><li><div class="p">'<code>+</code>'&#160;&amp;&#160;<a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>t</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;60)&#160;&amp; '<code>:</code>'&#160;&amp; <a href="#f-unsTwoDigCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>unsTwoDigitCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>t</var>&#160;<a href="#dt-mod" class="termref" shape="rect"><span class="arrow">&#183;</span>mod<span class="arrow">&#183;</span></a>&#160;60)&#160;&#160; otherwise.</div></li></ul></div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-dateTimeCanRep" id="vp-dateTimeCanRep" shape="rect"><i><span class="arrow">&#183;</span>dateTimeCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>dt</var>) &#8594; <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a> <div class="defindent">Maps a <a href="#dateTime" shape="rect">dateTime</a> value to a <a href="#nt-dateTimeRep" shape="rect"><i>dateTimeLexicalRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>dt</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#dateTime" shape="rect">dateTime</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <var>DT</var> be&#160; <a href="#f-yrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>yearCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>dt</var>'s&#160;<a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>-</code>'&#160;&amp; <a href="#f-moCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>monthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>dt</var>'s&#160;<a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>-</code>'&#160;&amp; <a href="#f-daCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>dayCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>dt</var>'s&#160;<a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>T</code>'&#160;&amp; <a href="#f-hrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>hourCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>dt</var>'s&#160;<a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>:</code>'&#160;&amp; <a href="#f-miCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>minuteCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>dt</var>'s&#160;<a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>:</code>'&#160;&amp; <a href="#f-seCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>secondCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>dt</var>'s&#160;<a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a>)&#160;. </td></tr></tbody></table></div> <div class="defindent">Return <ul><li><div class="p"><var>DT</var>&#160;&#160; when <var>dt</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b>, and</div></li><li><div class="p"><var>DT</var>&#160;&amp; <a href="#f-tzCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>dt</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>)&#160;&#160; otherwise.</div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-timeCanRep" id="vp-timeCanRep" shape="rect"><i><span class="arrow">&#183;</span>timeCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>ti</var>) &#8594; <a href="#nt-timeRep" shape="rect"><i>timeLexicalRep</i></a> <div class="defindent">Maps a <a href="#time" shape="rect">time</a> value to a <a href="#nt-timeRep" shape="rect"><i>timeLexicalRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>ti</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#time" shape="rect">time</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-timeRep" shape="rect"><i>timeLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <var>T</var> be&#160; <a href="#f-hrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>hourCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>ti</var>'s&#160;<a href="#vp-dt-hour" shape="rect"><i><span class="arrow">&#183;</span>hour<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>:</code>'&#160;&amp; <a href="#f-miCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>minuteCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>ti</var>'s&#160;<a href="#vp-dt-minute" shape="rect"><i><span class="arrow">&#183;</span>minute<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>:</code>'&#160;&amp; <a href="#f-seCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>secondCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>ti</var>'s&#160;<a href="#vp-dt-second" shape="rect"><i><span class="arrow">&#183;</span>second<span class="arrow">&#183;</span></i></a>)&#160;. </td></tr></tbody></table></div> <div class="defindent">Return <ul><li><div class="p"><var>T</var>&#160;&#160; when <var>ti</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b>, and</div></li><li><div class="p"><var>T</var>&#160;&amp; <a href="#f-tzCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>ti</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>)&#160;&#160; otherwise.</div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-dateCanRep" id="vp-dateCanRep" shape="rect"><i><span class="arrow">&#183;</span>dateCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>da</var>) &#8594; <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a> <div class="defindent">Maps a <a href="#date" shape="rect">date</a> value to a <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>da</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#date" shape="rect">date</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-dateRep" shape="rect"><i>dateLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <var>D</var> be&#160; <a href="#f-yrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>yearCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>da</var>'s&#160;<a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>-</code>'&#160;&amp; <a href="#f-moCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>monthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>da</var>'s&#160;<a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>-</code>'&#160;&amp; <a href="#f-daCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>dayCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>da</var>'s&#160;<a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>)&#160;. </td></tr></tbody></table></div> <div class="defindent">Return <ul><li><div class="p"><var>D</var>&#160;&#160; when <var>da</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b>, and</div></li><li><div class="p"><var>D</var>&#160;&amp; <a href="#f-tzCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>da</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>)&#160;&#160; otherwise.</div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-gYearMonthCanRep" id="vp-gYearMonthCanRep" shape="rect"><i><span class="arrow">&#183;</span>gYearMonthCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>ym</var>) &#8594; <a href="#nt-gYearMonthRep" shape="rect"><i>gYearMonthLexicalRep</i></a> <div class="defindent">Maps a <a href="#gYearMonth" shape="rect">gYearMonth</a> value to a <a href="#nt-gYearMonthRep" shape="rect"><i>gYearMonthLexicalRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>ym</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#gYearMonth" shape="rect">gYearMonth</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-gYearMonthRep" shape="rect"><i>gYearMonthLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <var>YM</var> be&#160; <a href="#f-yrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>yearCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>ym</var>'s&#160;<a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>-</code>'&#160;&amp; <a href="#f-moCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>monthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>ym</var>'s&#160;<a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>)&#160;. </td></tr></tbody></table></div> <div class="defindent">Return <ul><li><div class="p"><var>YM</var>&#160;&#160; when <var>ym</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b>, and</div></li><li><div class="p"><var>YM</var>&#160;&amp; <a href="#f-tzCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>ym</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>)&#160;&#160; otherwise.</div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-gYearCanRep" id="vp-gYearCanRep" shape="rect"><i><span class="arrow">&#183;</span>gYearCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>gY</var>) &#8594; <a href="#nt-gYearRep" shape="rect"><i>gYearLexicalRep</i></a> <div class="defindent">Maps a <a href="#gYear" shape="rect">gYear</a> value to a <a href="#nt-gYearRep" shape="rect"><i>gYearLexicalRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>gY</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#gYear" shape="rect">gYear</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-gYearRep" shape="rect"><i>gYearLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p"><a href="#f-yrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>yearCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>gY</var>'s&#160;<a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>)&#160;&#160; when <var>gY</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b>, and</div></li><li><div class="p"><a href="#f-yrCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>yearCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>gY</var>'s&#160;<a href="#vp-dt-year" shape="rect"><i><span class="arrow">&#183;</span>year<span class="arrow">&#183;</span></i></a>)&#160;&amp; <a href="#f-tzCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>gY</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>)&#160;&#160; otherwise.</div></li></ul></div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-gMonthDayCanRep" id="vp-gMonthDayCanRep" shape="rect"><i><span class="arrow">&#183;</span>gMonthDayCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>md</var>) &#8594; <a href="#nt-gMonthDayRep" shape="rect"><i>gMonthDayLexicalRep</i></a> <div class="defindent">Maps a <a href="#gMonthDay" shape="rect">gMonthDay</a> value to a <a href="#nt-gMonthDayRep" shape="rect"><i>gMonthDayLexicalRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>md</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#gMonthDay" shape="rect">gMonthDay</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-gMonthDayRep" shape="rect"><i>gMonthDayLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"> <var>MD</var> be&#160; '<code>--</code>'&#160;&amp; <a href="#f-moCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>monthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>md</var>'s&#160;<a href="#vp-dt-month" shape="rect"><i><span class="arrow">&#183;</span>month<span class="arrow">&#183;</span></i></a>)&#160;&amp; '<code>-</code>'&#160;&amp; <a href="#f-daCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>dayCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>md</var>'s&#160;<a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>)&#160;. </td></tr></tbody></table></div> <div class="defindent">Return <ul><li><div class="p"><var>MD</var>&#160;&#160; when <var>md</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b>, and</div></li><li><div class="p"><var>MD</var>&#160;&amp; <a href="#f-tzCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>md</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>)&#160;&#160; otherwise.</div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-gDayCanRep" id="vp-gDayCanRep" shape="rect"><i><span class="arrow">&#183;</span>gDayCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>gD</var>) &#8594; <a href="#nt-gDayRep" shape="rect"><i>gDayLexicalRep</i></a> <div class="defindent">Maps a <a href="#gDay" shape="rect">gDay</a> value to a <a href="#nt-gDayRep" shape="rect"><i>gDayLexicalRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>gD</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#gDay" shape="rect">gDay</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-gDayRep" shape="rect"><i>gDayLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">'<code>---</code>'&#160;&amp; <a href="#f-daCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>dayCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>gD</var>'s&#160;<a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>)&#160;&#160; when <var>gD</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b>, and</div></li><li><div class="p">'<code>---</code>'&#160;&amp; <a href="#f-daCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>dayCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>gD</var>'s&#160;<a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>)&#160;&amp; <a href="#f-tzCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>gD</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>)&#160;&#160; otherwise.</div></li></ul></div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="vp-gMonthCanRep" id="vp-gMonthCanRep" shape="rect"><i><span class="arrow">&#183;</span>gMonthCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>gM</var>) &#8594; <a href="#nt-gMonthRep" shape="rect"><i>gMonthLexicalRep</i></a> <div class="defindent">Maps a <a href="#gMonth" shape="rect">gMonth</a> value to a <a href="#nt-gMonthRep" shape="rect"><i>gMonthLexicalRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>gM</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a complete <a href="#gMonth" shape="rect">gMonth</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-gMonthRep" shape="rect"><i>gMonthLexicalRep</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">'<code>--</code>'&#160;&amp; <a href="#f-moCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>monthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>gM</var>'s&#160;<a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>)&#160;&#160; when <var>gM</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a> is <b><i>absent</i></b>, and</div></li><li><div class="p">'<code>--</code>'&#160;&amp; <a href="#f-moCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>monthCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>gM</var>'s&#160;<a href="#vp-dt-day" shape="rect"><i><span class="arrow">&#183;</span>day<span class="arrow">&#183;</span></i></a>)&#160;&amp; <a href="#f-tzCanFragMap" shape="rect"><i><span class="arrow">&#183;</span>timezoneCanonicalFragmentMap<span class="arrow">&#183;</span></i></a>(<var>gM</var>'s&#160;<a href="#vp-dt-timezone" shape="rect"><i><span class="arrow">&#183;</span>timezoneOffset<span class="arrow">&#183;</span></i></a>)&#160;&#160; otherwise.</div></li></ul></div> </div></div></div></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#sec-dt-functions" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="sec-misc-lexmaps" id="sec-misc-lexmaps" shape="rect"></a>E.4 Lexical and Canonical Mappings for Other Datatypes</h3><p>The following functions are used with various datatypes neither numeric nor date/time related.</p><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-stringLexmap" id="f-stringLexmap" shape="rect"><i><span class="arrow">&#183;</span>stringLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#string" shape="rect">string</a> <div class="defindent">Maps a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching the <a href="#nt-stringRep" shape="rect"><i>stringRep</i></a> production to a <a href="#string" shape="rect">string</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-stringRep" shape="rect"><i>stringRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">A <a href="#string" shape="rect">string</a> value</div> <b>Algorithm:</b> <div class="defindent">Return <var>LEX</var>.&#160; (The function is the identity function on the domain.)</div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-booleanLexmap" id="f-booleanLexmap" shape="rect"><i><span class="arrow">&#183;</span>booleanLexicalMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#boolean" shape="rect">boolean</a> <div class="defindent">Maps a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching the <a href="#nt-booleanRep" shape="rect"><i>booleanRep</i></a> production to a <a href="#boolean" shape="rect">boolean</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-booleanRep" shape="rect"><i>booleanRep</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">A <a href="#boolean" shape="rect">boolean</a> value</div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p"><b><i>true</i></b>&#160;&#160; when <var>LEX</var> is '<code>true</code>' or '<code>1</code>'&#160;, and</div></li><li><div class="p"><b><i>false</i></b>&#160;&#160; otherwise (<var>LEX</var> is '<code>false</code>' or '<code>0</code>').</div></li></ul> </div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-stringCanmap" id="f-stringCanmap" shape="rect"><i><span class="arrow">&#183;</span>stringCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>s</var>) &#8594; <a href="#nt-stringRep" shape="rect"><i>stringRep</i></a> <div class="defindent">Maps a <a href="#string" shape="rect">string</a> value to a <a href="#nt-stringRep" shape="rect"><i>stringRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>s</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#string" shape="rect">string</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-stringRep" shape="rect"><i>stringRep</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <var>s</var>.&#160; (The function is the identity function on the domain.)</div> </div></div><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-booleanCanmap" id="f-booleanCanmap" shape="rect"><i><span class="arrow">&#183;</span>booleanCanonicalMap<span class="arrow">&#183;</span></i></a></b> (<var>b</var>) &#8594; <a href="#nt-booleanRep" shape="rect"><i>booleanRep</i></a> <div class="defindent">Maps a <a href="#boolean" shape="rect">boolean</a> value to a <a href="#nt-booleanRep" shape="rect"><i>booleanRep</i></a>.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>b</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#boolean" shape="rect">boolean</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-booleanRep" shape="rect"><i>booleanRep</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">'<code>true</code>'&#160;&#160; when <var>b</var> is <b><i>true</i></b>, and</div></li><li><div class="p">'<code>false</code>'&#160;&#160; otherwise (<var>b</var> is <b><i>false</i></b>).</div></li></ul> </div> </div></div><div class="div3"> <h4><a name="sec-hexbin-lexmaps" id="sec-hexbin-lexmaps" shape="rect"></a>E.4.1 Lexical and canonical mappings for <a href="#hexBinary" shape="rect">hexBinary</a></h4><p>The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> for <a href="#hexBinary" shape="rect">hexBinary</a> maps each pair of hexadecimal digits to an octet, in the conventional way:</p><div class="defset"> <div class="not_aux"> <div class="defset-head">Lexical Mapping for hexBinary</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-hexBinaryMap" id="f-hexBinaryMap" shape="rect"><i><span class="arrow">&#183;</span>hexBinaryMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; <a href="#hexBinary" shape="rect">hexBinary</a> <div class="defindent">Maps a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching the <a href="#nt-hexBinary" shape="rect"><i>hexBinary</i></a> production to a sequence of octets in the form of a <a href="#hexBinary" shape="rect">hexBinary</a> value.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-hexBinary" shape="rect"><i>hexBinary</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">A sequence of binary octets in the form of a <a href="#hexBinary" shape="rect">hexBinary</a> value</div> <b>Algorithm:</b> <div class="defindent"><var>LEX</var> necessarily includes a sequence of zero or more substrings matching the <a href="#nt-hexOctet" shape="rect"><i>hexOctet</i></a> production.</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>o</var> be the sequence of octets formed by applying <a href="#f-hexOctetMap" shape="rect"><i><span class="arrow">&#183;</span>hexOctetMap<span class="arrow">&#183;</span></i></a> to each <a href="#nt-hexOctet" shape="rect"><i>hexOctet</i></a> in <var>LEX</var>, in order, and concatenating the results.</td></tr></tbody></table></div> <div class="defindent">Return <var>o</var>. </div> </div></div><p>The auxiliary functions <a href="#f-hexOctetMap" shape="rect"><i><span class="arrow">&#183;</span>hexOctetMap<span class="arrow">&#183;</span></i></a> and <a href="#f-hexDigitMap" shape="rect"><i><span class="arrow">&#183;</span>hexDigitMap<span class="arrow">&#183;</span></i></a> are used by <a href="#f-hexBinaryMap" shape="rect"><i><span class="arrow">&#183;</span>hexBinaryMap<span class="arrow">&#183;</span></i></a>.</p><div class="defset"> <div class="aux"> <div class="defset-head">Mappings for hexadecimal digits</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-hexOctetMap" id="f-hexOctetMap" shape="rect"><i><span class="arrow">&#183;</span>hexOctetMap<span class="arrow">&#183;</span></i></a></b> (<var>LEX</var>) &#8594; octet <div class="defindent">Maps a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching the <a href="#nt-hexOctet" shape="rect"><i>hexOctet</i></a> production to a single octet.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>LEX</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> matching <a href="#nt-hexOctet" shape="rect"><i>hexOctet</i></a></td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">A single binary octet</div> <b>Algorithm:</b> <div class="defindent"><var>LEX</var> necessarily includes exactly two hexadecimal digits.</div> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>d0</var> be the first hexadecimal digit in <var>LEX</var>. Let <var>d1</var> be the second hexadecimal digit in <var>LEX</var>.</td></tr></tbody></table></div> <div class="defindent">Return the octet whose four high-order bits are <a href="#f-hexDigitMap" shape="rect"><i><span class="arrow">&#183;</span>hexDigitMap<span class="arrow">&#183;</span></i></a>(<var>d0</var>) and whose four low-order bits are <a href="#f-hexDigitMap" shape="rect"><i><span class="arrow">&#183;</span>hexDigitMap<span class="arrow">&#183;</span></i></a>(<var>d1</var>). </div> <div class="deftop"><b><a name="f-hexDigitMap" id="f-hexDigitMap" shape="rect"><i><span class="arrow">&#183;</span>hexDigitMap<span class="arrow">&#183;</span></i></a></b> (<var>d</var>) &#8594; a bit-sequence of length four <div class="defindent">Maps a hexadecimal digit (a character matching the <a href="#nt-hexDigit" shape="rect"><i>hexDigit</i></a> production) to a sequence of four binary digits.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>d</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a hexadecimal digit</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">a sequence of four binary digits</div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">0000 when <var>d</var> = '<code>0</code>',</div></li><li><div class="p">0001 when <var>d</var> = '<code>1</code>',</div></li><li><div class="p">0010 when <var>d</var> = '<code>2</code>',</div></li><li><div class="p">0011 when <var>d</var> = '<code>3</code>',</div></li><li><div class="p">...</div></li><li><div class="p">1110 when <var>d</var> = '<code>E</code>' or '<code>e</code>',</div></li><li><div class="p">1111 when <var>d</var> = '<code>F</code>' or '<code>f</code>'.</div></li></ul> </div> </div></div><p>The <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> for <a href="#hexBinary" shape="rect">hexBinary</a> uses only the uppercase forms of A-F.</p><div class="defset"> <div class="not_aux"> <div class="defset-head">Canonical Mapping for hexBinary</div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-hexBinaryCanonical" id="f-hexBinaryCanonical" shape="rect"><i><span class="arrow">&#183;</span>hexBinaryCanonical<span class="arrow">&#183;</span></i></a></b> (<var>o</var>) &#8594; <a href="#nt-hexBinary" shape="rect"><i>hexBinary</i></a> <div class="defindent">Maps a <a href="#hexBinary" shape="rect">hexBinary</a> value to a literal matching the <a href="#nt-hexBinary" shape="rect"><i>hexBinary</i></a> production.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>o</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a <a href="#hexBinary" shape="rect">hexBinary</a> value</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-hexBinary" shape="rect"><i>hexBinary</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>h</var> be the sequence of literals formed by applying <a href="#f-hexOctetCanonical" shape="rect"><i><span class="arrow">&#183;</span>hexOctetCanonical<span class="arrow">&#183;</span></i></a> to each octet in <var>o</var>, in order, and concatenating the results.</td></tr></tbody></table></div> <div class="defindent">Return <var>h</var>. </div> </div></div><div class="defset"> <div class="aux"> <div class="defset-head">Auxiliary procedures for canonical mapping of <a href="#hexBinary" shape="rect">hexBinary</a></div> <div class="deftop" style="margin-top: 0em;"><b><a name="f-hexOctetCanonical" id="f-hexOctetCanonical" shape="rect"><i><span class="arrow">&#183;</span>hexOctetCanonical<span class="arrow">&#183;</span></i></a></b> (<var>o</var>) &#8594; <a href="#nt-hexOctet" shape="rect"><i>hexOctet</i></a> <div class="defindent">Maps a binary octet to a literal matching the <a href="#nt-hexOctet" shape="rect"><i>hexOctet</i></a> production.</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>o</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a binary octet</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-hexOctet" shape="rect"><i>hexOctet</i></a></div> <b>Algorithm:</b> <div class="defindent"><table><tbody><tr><td valign="top" rowspan="1" colspan="1">Let </td><td rowspan="1" colspan="1"><var>lo</var> be the four low-order bits of <var>o</var>, and <var>hi</var> be the four high-order bits.</td></tr></tbody></table></div> <div class="defindent">Return <a href="#f-hexDigitCanonical" shape="rect"><i><span class="arrow">&#183;</span>hexDigitCanonical<span class="arrow">&#183;</span></i></a>(<var>hi</var>) &amp; <a href="#f-hexDigitCanonical" shape="rect"><i><span class="arrow">&#183;</span>hexDigitCanonical<span class="arrow">&#183;</span></i></a>(<var>lo</var>). </div> <div class="deftop"><b><a name="f-hexDigitCanonical" id="f-hexDigitCanonical" shape="rect"><i><span class="arrow">&#183;</span>hexDigitCanonical<span class="arrow">&#183;</span></i></a></b> (<var>d</var>) &#8594; <a href="#nt-hexDigit" shape="rect"><i>hexDigit</i></a> <div class="defindent">Maps a four-bit sequence to a hexadecimal digit (a literal matching the <a href="#nt-hexDigit" shape="rect"><i>hexDigit</i></a> production).</div> </div> <b>Arguments:</b><div class="defindent"><table><tbody> <tr><td rowspan="1" colspan="1"><var>d</var></td><td rowspan="1" colspan="1">:&#160;</td><td rowspan="1" colspan="1">a sequence of four binary digits</td></tr> </tbody></table></div> <b>Result:</b><div class="defindent">matches <a href="#nt-hexDigit" shape="rect"><i>hexDigit</i></a></div> <b>Algorithm:</b> <div class="defindent">Return <ul><li><div class="p">'<code>0</code>' when <var>d</var> = 0000,</div></li><li><div class="p">'<code>1</code>' when <var>d</var> = 0001,</div></li><li><div class="p">'<code>2</code>' when <var>d</var> = 0010,</div></li><li><div class="p">'<code>3</code>' when <var>d</var> = 0011,</div></li><li><div class="p">...</div></li><li><div class="p">'<code>E</code>' when <var>d</var> = 1110,</div></li><li><div class="p">'<code>F</code>' when <var>d</var> = 1111.</div></li></ul> </div> </div></div></div></div></div><div class="div1"> <h2><a name="sec-datatypes-and-facets" id="sec-datatypes-and-facets" shape="rect"></a>F Datatypes and Facets</h2><div class="div2"> <h3><span class="nav"> </span><a name="app-fundamental-facets" id="app-fundamental-facets" shape="rect"></a>F.1 Fundamental Facets</h3><p> The following table shows the values of the fundamental facets for each <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype. </p> <table border="1" bgcolor="#bedce6"> <tbody> <tr><th rowspan="1" colspan="1">&#160;</th><th rowspan="1" colspan="1">Datatype</th><th rowspan="1" colspan="1">ordered</th><th rowspan="1" colspan="1">bounded</th><th rowspan="1" colspan="1">cardinality</th><th rowspan="1" colspan="1">numeric</th></tr> <tr><td rowspan="19" colspan="1"><a href="#dt-primitive" shape="rect">primitive</a></td><td rowspan="1" colspan="1"><a href="#string" shape="rect">string</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#boolean" shape="rect">boolean</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#float" shape="rect">float</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">true</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#double" shape="rect">double</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">true</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#decimal" shape="rect">decimal</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#duration" shape="rect">duration</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#dateTime" shape="rect">dateTime</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#time" shape="rect">time</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#date" shape="rect">date</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#gYearMonth" shape="rect">gYearMonth</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#gYear" shape="rect">gYear</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#gMonthDay" shape="rect">gMonthDay</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#gDay" shape="rect">gDay</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#gMonth" shape="rect">gMonth</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#hexBinary" shape="rect">hexBinary</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#base64Binary" shape="rect">base64Binary</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#anyURI" shape="rect">anyURI</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#QName" shape="rect">QName</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#NOTATION" shape="rect">NOTATION</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td colspan="7" rowspan="1"></td></tr> <tr><td rowspan="28" colspan="1"><a href="#dt-constructed" shape="rect">non-primitive</a></td><td rowspan="1" colspan="1"><a href="#normalizedString" shape="rect">normalizedString</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#token" shape="rect">token</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#language" shape="rect">language</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#IDREFS" shape="rect">IDREFS</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#ENTITIES" shape="rect">ENTITIES</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#NMTOKEN" shape="rect">NMTOKEN</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#NMTOKENS" shape="rect">NMTOKENS</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#Name" shape="rect">Name</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#NCName" shape="rect">NCName</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#ID" shape="rect">ID</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#IDREF" shape="rect">IDREF</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#ENTITY" shape="rect">ENTITY</a></td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#integer" shape="rect">integer</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#nonPositiveInteger" shape="rect">nonPositiveInteger</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#negativeInteger" shape="rect">negativeInteger</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#long" shape="rect">long</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">true</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#int" shape="rect">int</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">true</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#short" shape="rect">short</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">true</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#byte" shape="rect">byte</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">true</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#nonNegativeInteger" shape="rect">nonNegativeInteger</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#unsignedLong" shape="rect">unsignedLong</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">true</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#unsignedInt" shape="rect">unsignedInt</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">true</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#unsignedShort" shape="rect">unsignedShort</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">true</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#unsignedByte" shape="rect">unsignedByte</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">true</td><td rowspan="1" colspan="1">finite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#positiveInteger" shape="rect">positiveInteger</a></td><td rowspan="1" colspan="1">total</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">true</td></tr> <tr><td rowspan="1" colspan="1"><a href="#yearMonthDuration" shape="rect">yearMonthDuration</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#dayTimeDuration" shape="rect">dayTimeDuration</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> <tr><td rowspan="1" colspan="1"><a href="#dateTimeStamp" shape="rect">dateTimeStamp</a></td><td rowspan="1" colspan="1">partial</td><td rowspan="1" colspan="1">false</td><td rowspan="1" colspan="1">countably infinite</td><td rowspan="1" colspan="1">false</td></tr> </tbody> </table> </div></div><div class="div1"> <h2><a name="regexs" id="regexs" shape="rect"></a>G Regular Expressions</h2><p>A <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expression<span class="arrow">&#183;</span></a>&#160;<var>R</var> is a sequence of characters that denote a set of strings <em>L</em>(<var>R</var>).&#160; When used to constrain a <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, a regular expression <var>R</var> asserts that only strings in <em>L</em>(<var>R</var>) are valid <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> for values of that type.</p><div class="note"><div class="p"><b>Note:</b> Unlike some popular regular expression languages (including those defined by Perl and standard Unix utilities), the regular expression language defined here implicitly anchors all regular expressions at the head and tail, as the most common use of regular expressions in <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> is to match entire <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a>. For example, a datatype <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from <a href="#string" shape="rect">string</a> such that all values must begin with the character '<code>A</code>' (#x41) and end with the character '<code>Z</code>' (#x5a) would be defined as follows: </div><pre xml:space="preserve">&lt;simpleType name='myString'&gt; &lt;restriction base='string'&gt; &lt;pattern value='A.*Z'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre><div class="p">In regular expression languages that are not implicitly anchored at the head and tail, it is customary to write the equivalent regular expression as: <blockquote><blockquote><p><code>^A.*Z$</code></p></blockquote></blockquote> where '<code>^</code>' anchors the pattern at the head and '<code>$</code>' anchors at the tail.</div><div class="p">In those rare cases where an unanchored match is desired, including '<code>.*</code>' at the beginning and ending of the regular expression will achieve the desired results.&#160; For example, a datatype <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from string such that all values must contain at least 3 consecutive '<code>A</code>' (#x41) characters somewhere within the value could be defined as follows:</div><pre xml:space="preserve">&lt;simpleType name='myString'&gt; &lt;restriction base='string'&gt; &lt;pattern value='.*AAA.*'/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;</pre></div><div class="div2"> <h3><span class="nav"> <a href="#regex-piece" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="regex-branch" id="regex-branch" shape="rect"></a>G.1 Regular expressions and branches</h3><p><span class="termdef"><a name="dt-regex" id="dt-regex" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>regular expression</b> is composed from zero or more <a href="#dt-branch" class="termref" shape="rect"><span class="arrow">&#183;</span>branches<span class="arrow">&#183;</span></a>, separated by '<code>|</code>' characters.</span> </p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Regular Expression</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="regex" id="regex" shape="rect"></a><a name="nt-regExp" id="nt-regExp" shape="rect"></a>[64]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>regExp</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code> <a href="#nt-branch" shape="rect"><i>branch</i></a> ( '|' <a href="#nt-branch" shape="rect"><i>branch</i></a> )* </code></td></tr></tbody></table></td></tr></tbody></table><p></p><table border="1"><col width="50%" span="1" /><col width="50%" span="1" /><thead><tr><th rowspan="1" colspan="1">For all <a href="#dt-branch" class="termref" shape="rect"><span class="arrow">&#183;</span>branches<span class="arrow">&#183;</span></a> <var>S</var>, and for all <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expressions<span class="arrow">&#183;</span></a> <var>T</var>, valid <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expressions<span class="arrow">&#183;</span></a> <var>R</var> are:</th><th rowspan="1" colspan="1">Denoting the set of strings <em>L</em>(<var>R</var>) containing:</th></tr></thead><tbody><tr><td align="center" rowspan="1" colspan="1">(empty string)</td><td align="center" rowspan="1" colspan="1">just the empty string</td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var></td><td align="center" rowspan="1" colspan="1">all strings in <em>L</em>(<var>S</var>)</td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var>&#160;<code>|</code><var>T</var></td><td align="center" rowspan="1" colspan="1">all strings in <em>L</em>(<var>S</var>) and all strings in <em>L</em>(<var>T</var>)</td></tr></tbody></table><p><span class="termdef"><a name="dt-branch" id="dt-branch" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>branch</b> consists of zero or more <a href="#dt-piece" class="termref" shape="rect"><span class="arrow">&#183;</span>pieces<span class="arrow">&#183;</span></a>, concatenated together.</span></p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Branch</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="branch" id="branch" shape="rect"></a><a name="nt-branch" id="nt-branch" shape="rect"></a>[65]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>branch</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code><a href="#nt-piece" shape="rect"><i>piece</i></a>*</code></td></tr></tbody></table></td></tr></tbody></table><p></p><table border="1"><col width="50%" span="1" /><col width="50%" span="1" /><thead><tr><th rowspan="1" colspan="1"> For all <a href="#dt-piece" class="termref" shape="rect"><span class="arrow">&#183;</span>pieces<span class="arrow">&#183;</span></a> <var>S</var>, and for all <a href="#dt-branch" class="termref" shape="rect"><span class="arrow">&#183;</span>branches<span class="arrow">&#183;</span></a> <var>T</var>, valid <a href="#dt-branch" class="termref" shape="rect"><span class="arrow">&#183;</span>branches<span class="arrow">&#183;</span></a> <var>R</var> are: </th><th rowspan="1" colspan="1">Denoting the set of strings <em>L</em>(<var>R</var>) containing:</th></tr></thead><tbody><tr><td align="center" rowspan="1" colspan="1"><var>S</var></td><td align="center" rowspan="1" colspan="1">all strings in <em>L</em>(<var>S</var>)</td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var><var>T</var></td><td align="center" rowspan="1" colspan="1">all strings <var>s</var><var>t</var> with <var>s</var> in <em>L</em>(<var>S</var>) and <var>t</var> in <em>L</em>(<var>T</var>)</td></tr></tbody></table></div><div class="div2"> <h3><span class="nav"><a href="#regex-branch" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#regex-char-metachar" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="regex-piece" id="regex-piece" shape="rect"></a>G.2 Pieces, atoms, quantifiers</h3><p><span class="termdef"><a name="dt-piece" id="dt-piece" title="" shape="rect">[Definition:]&#160;&#160;</a> A <b>piece</b> is an <a href="#dt-atom" class="termref" shape="rect"><span class="arrow">&#183;</span>atom<span class="arrow">&#183;</span></a>, possibly followed by a <a href="#dt-quantifier" class="termref" shape="rect"><span class="arrow">&#183;</span>quantifier<span class="arrow">&#183;</span></a>. </span></p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Piece</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="piece" id="piece" shape="rect"></a><a name="nt-piece" id="nt-piece" shape="rect"></a>[66]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>piece</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code><a href="#nt-atom" shape="rect"><i>atom</i></a>&#160;<a href="#nt-quantifier" shape="rect"><i>quantifier</i></a>?</code></td></tr></tbody></table></td></tr></tbody></table><p></p><table border="1"><col width="50%" span="1" /><col width="50%" span="1" /><thead><tr><th rowspan="1" colspan="1">For all <a href="#dt-atom" class="termref" shape="rect"><span class="arrow">&#183;</span>atoms<span class="arrow">&#183;</span></a> <var>S</var> and non-negative integers <var>n</var>, <var>m</var> such that <var>n</var> &#8804; <var>m</var>, valid <a href="#dt-piece" class="termref" shape="rect"><span class="arrow">&#183;</span>pieces<span class="arrow">&#183;</span></a> <var>R</var> are:</th><th rowspan="1" colspan="1">Denoting the set of strings <em>L</em>(<var>R</var>) containing:</th></tr></thead><tbody><tr><td align="center" rowspan="1" colspan="1"><var>S</var></td><td align="center" rowspan="1" colspan="1">all strings in <em>L</em>(<var>S</var>)</td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var>&#160;<code>?</code></td><td align="center" rowspan="1" colspan="1">the empty string, and all strings in <em>L</em>(<var>S</var>)</td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var>&#160;<code>*</code></td><td align="center" rowspan="1" colspan="1">all strings in <em>L</em>(<var>S</var>&#160;<code>?</code>) and all strings <var>s</var><var>t</var> with <var>s</var> in <em>L</em>(<var>S</var>&#160;<code>*</code>) and <var>t</var> in <em>L</em>(<var>S</var>)&#160;&#160; <em>(all concatenations of zero or more strings from <em>L</em>(<var>S</var>)&#160;)</em></td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var>&#160;<code>+</code></td><td align="center" rowspan="1" colspan="1">all strings <var>s</var><var>t</var> with <var>s</var> in <em>L</em>(<var>S</var>) and <var>t</var> in <em>L</em>(<var>S</var>&#160;<code>*</code>)&#160;&#160; <em>(all concatenations of one or more strings from <em>L</em>(<var>S</var>)&#160;)</em></td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var>&#160;<code>{</code><var>n</var><code>,</code><var>m</var><code>}</code></td><td align="center" rowspan="1" colspan="1">all strings <var>s</var><var>t</var> with <var>s</var> in <em>L</em>(<var>S</var>) and <var>t</var> in <em>L</em>(<var>S</var>&#160;<code>{</code><var>n</var>&#8722;1<code>,</code><var>m</var>&#8722;1<code>}</code>) <em>(all concatenations of at least <var>n</var>, and at most <var>m</var>, strings from <em>L</em>(<var>S</var>)&#160;)</em></td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var>&#160;<code>{</code><var>n</var><code>}</code></td><td align="center" rowspan="1" colspan="1">all strings in <em>L</em>(<var>S</var><code>{</code><var>n</var><code>,</code><var>n</var><code>}</code>)&#160; <em>(all concatenations of exactly <var>n</var> strings from <em>L</em>(<var>S</var>)&#160;)</em></td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var>&#160;<code>{</code><var>n</var><code>,}</code></td><td align="center" rowspan="1" colspan="1">all strings in <em>L</em>(<var>S</var><code>{</code><var>n</var><code>}</code>&#160;<var>S</var>&#160;<code>*</code>)&#160; <em>(all concatenations of at least <var>n</var> strings from <em>L</em>(<var>S</var>)&#160;)</em></td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var><code>&#160;{0,</code><var>m</var><code>}</code></td><td align="center" rowspan="1" colspan="1">all strings <var>s</var><var>t</var> with <var>s</var> in <em>L</em>(<var>S</var>&#160;<code>?</code>) and <var>t</var> in <em>L</em>(<var>S</var>&#160;<code>{</code>0<code>,</code><var>m</var>&#8722;1<code>}</code>).&#160; <em>(all concatenations of at most <var>m</var> strings from <em>L</em>(<var>S</var>)&#160;)</em></td></tr><tr><td align="center" rowspan="1" colspan="1"><var>S</var>&#160;<code>{0,0}</code></td><td align="center" rowspan="1" colspan="1">only the empty string</td></tr></tbody></table><div class="note"><div class="p"><b>Note:</b> The regular expression language in the Perl Programming Language <a href="#Perl" shape="rect">[Perl]</a> does not include a quantifier of the form&#160; <var>S</var>&#160;<code>{,</code><var>m</var><code>}</code>&#160;, since it is logically equivalent to <var>S</var>&#160;<code>{0,</code><var>m</var><code>}</code>&#160;.&#160; We have, therefore, left this logical possibility out of the regular expression language defined by this specification.</div></div><p><span class="termdef"><a name="dt-quantifier" id="dt-quantifier" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>quantifier</b> is one of '<code>?</code>', '<code>*</code>', or '<code>+</code>', or a string of the form&#160; <code>{</code><var>n</var><code>,</code><var>m</var><code>}</code>&#160; or&#160; <code>{</code><var>n</var><code>,}</code>&#160;, which have the meanings defined in the table above. </span> </p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Quantifier</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="quant" id="quant" shape="rect"></a><a name="nt-quantifier" id="nt-quantifier" shape="rect"></a>[67]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>quantifier</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>[?*+] | ( '{' <a href="#nt-quantity" shape="rect"><i>quantity</i></a> '}' )</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="quantity" id="quantity" shape="rect"></a><a name="nt-quantity" id="nt-quantity" shape="rect"></a>[68]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>quantity</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code><a href="#nt-quantRange" shape="rect"><i>quantRange</i></a> | <a href="#nt-quantMin" shape="rect"><i>quantMin</i></a> | <a href="#nt-QuantExact" shape="rect"><i>QuantExact</i></a></code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="quantRange" id="quantRange" shape="rect"></a><a name="nt-quantRange" id="nt-quantRange" shape="rect"></a>[69]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>quantRange</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code><a href="#nt-QuantExact" shape="rect"><i>QuantExact</i></a> ',' <a href="#nt-QuantExact" shape="rect"><i>QuantExact</i></a></code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="quantMin" id="quantMin" shape="rect"></a><a name="nt-quantMin" id="nt-quantMin" shape="rect"></a>[70]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>quantMin</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code><a href="#nt-QuantExact" shape="rect"><i>QuantExact</i></a> ','</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="quantExact" id="quantExact" shape="rect"></a><a name="nt-QuantExact" id="nt-QuantExact" shape="rect"></a>[71]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>QuantExact</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>[0-9]+</code></td></tr></tbody></table></td></tr></tbody></table><p> <span class="termdef"><a name="dt-atom" id="dt-atom" title="" shape="rect">[Definition:]&#160;&#160;</a> An <b>atom</b> is either a <a href="#dt-normalc" class="termref" shape="rect"><span class="arrow">&#183;</span>normal character<span class="arrow">&#183;</span></a>, a <a href="#dt-charclass" class="termref" shape="rect"><span class="arrow">&#183;</span>character class<span class="arrow">&#183;</span></a>, or a parenthesized <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expression<span class="arrow">&#183;</span></a>.</span> </p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Atom</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="atom" id="atom" shape="rect"></a><a name="nt-atom" id="nt-atom" shape="rect"></a>[72]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>atom</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code><a href="#nt-NormalChar" shape="rect"><i>NormalChar</i></a> | <a href="#nt-charClass" shape="rect"><i>charClass</i></a> | ( '(' <a href="#nt-regExp" shape="rect"><i>regExp</i></a> ')' )</code></td></tr></tbody></table></td></tr></tbody></table><p></p><table border="1"><col width="50%" span="1" /><col width="50%" span="1" /><thead><tr><th rowspan="1" colspan="1"> For all <a href="#dt-normalc" class="termref" shape="rect"><span class="arrow">&#183;</span>normal characters<span class="arrow">&#183;</span></a> <var>c</var>, <a href="#dt-charclass" class="termref" shape="rect"><span class="arrow">&#183;</span>character classes<span class="arrow">&#183;</span></a> <var>C</var>, and <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expressions<span class="arrow">&#183;</span></a> <var>S</var>, valid <a href="#dt-atom" class="termref" shape="rect"><span class="arrow">&#183;</span>atoms<span class="arrow">&#183;</span></a> <var>R</var> are: </th><th rowspan="1" colspan="1">Denoting the set of strings <em>L</em>(<var>R</var>) containing:</th></tr></thead><tbody><tr><td align="center" rowspan="1" colspan="1"><var>c</var></td><td align="center" rowspan="1" colspan="1">the single string consisting only of <var>c</var></td></tr><tr><td align="center" rowspan="1" colspan="1"><var>C</var></td><td align="center" rowspan="1" colspan="1">all strings in <em>L</em>(<var>C</var>)</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>(</code>&#160;<var>S</var>&#160;<code>)</code></td><td align="center" rowspan="1" colspan="1"><em>L</em>(<var>S</var>)</td></tr></tbody></table></div><div class="div2"> <h3><span class="nav"><a href="#regex-piece" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#charcter-classes" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="regex-char-metachar" id="regex-char-metachar" shape="rect"></a>G.3 Characters and metacharacters</h3><p><span class="termdef"><a name="dt-metac" id="dt-metac" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>metacharacter</b> is either '<code>.</code>', '<code>\</code>', '<code>?</code>', '<code>*</code>', '<code>+</code>', '<code>{</code>', '<code>}</code>', '<code>(</code>', '<code>)</code>', '<code>|</code>', '<code>[</code>', or '<code>]</code>'.&#160; These characters have special meanings in <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expressions<span class="arrow">&#183;</span></a>, but can be escaped to form <a href="#dt-atom" class="termref" shape="rect"><span class="arrow">&#183;</span>atoms<span class="arrow">&#183;</span></a> that denote the sets of strings containing only themselves, i.e., an escaped <b>metacharacter</b> behaves like a <a href="#dt-normalc" class="termref" shape="rect"><span class="arrow">&#183;</span>normal character<span class="arrow">&#183;</span></a>.</span></p><p><span class="termdef"><a name="dt-normalc" id="dt-normalc" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>normal character</b> is any XML character that is not a <a href="#dt-metac" class="termref" shape="rect"><span class="arrow">&#183;</span>metacharacter<span class="arrow">&#183;</span></a>.&#160; In <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expressions<span class="arrow">&#183;</span></a>, a <b>normal character</b> is an <a href="#dt-atom" class="termref" shape="rect"><span class="arrow">&#183;</span>atom<span class="arrow">&#183;</span></a> that denotes the singleton set of strings containing only itself.</span></p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Normal Character</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="char" id="char" shape="rect"></a><a name="nt-NormalChar" id="nt-NormalChar" shape="rect"></a>[73]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>NormalChar</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>[^.\?*+{}()|#x5B#x5D]</code></td><td rowspan="1" colspan="1"><i>/* &#160;N.B.:&#160; #x5B = '<code>[</code>', #x5D = '<code>]</code>'&#160; */</i></td></tr></tbody></table></td></tr></tbody></table></div><div class="div2"> <h3 class="withToc"><span class="nav"><a href="#regex-char-metachar" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="charcter-classes" id="charcter-classes" shape="rect"></a>G.4 Character Classes</h3><div class="localToc">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;G.4.1 <a href="#charclassexps" shape="rect">Character class expressions</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;G.4.2 <a href="#cces" shape="rect">Character Class Escapes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;G.4.2.1 <a href="#cces-sce" shape="rect">Single-character escapes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;G.4.2.2 <a href="#cces-catesc" shape="rect">Category escapes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;G.4.2.3 <a href="#cces-blockesc" shape="rect">Block escapes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;G.4.2.4 <a href="#sec-unrecognized-catesc" shape="rect">Unrecognized category escapes</a><br clear="none" /> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;G.4.2.5 <a href="#cces-mce" shape="rect">Multi-character escapes</a><br clear="none" /> </div><p><span class="termdef"><a name="dt-charclass" id="dt-charclass" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>character class</b> is an <a href="#dt-atom" class="termref" shape="rect"><span class="arrow">&#183;</span>atom<span class="arrow">&#183;</span></a> <var>R</var> that identifies a set of characters <em>C</em>(<var>R</var>).&#160; The set of strings <em>L</em>(<var>R</var>).&#160; denoted by a character class <var>R</var> contains one single-character string "<var>c</var>" for each character <var>c</var> in <em>C</em>(<var>R</var>).</span> <a name="anchor11125c" id="anchor11125c" shape="rect"></a> </p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Character Class</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="charClass" id="charClass" shape="rect"></a><a name="nt-charClass" id="nt-charClass" shape="rect"></a>[74]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>charClass</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code> <a href="#nt-SingleCharEsc" shape="rect"><i>SingleCharEsc</i></a> | <a href="#nt-charClassEsc" shape="rect"><i>charClassEsc</i></a> | <a href="#nt-charClassExpr" shape="rect"><i>charClassExpr</i></a> | <a href="#nt-WildcardEsc" shape="rect"><i>WildcardEsc</i></a> </code></td></tr></tbody></table></td></tr></tbody></table><p>A character class is either a <a href="#dt-cces1" class="termref" shape="rect"><span class="arrow">&#183;</span>single-character escape<span class="arrow">&#183;</span></a> or a <a href="#dt-cces" class="termref" shape="rect"><span class="arrow">&#183;</span>character class escape<span class="arrow">&#183;</span></a> or a <a href="#dt-charexpr" class="termref" shape="rect"><span class="arrow">&#183;</span>character class expression<span class="arrow">&#183;</span></a> or a <a href="#dt-wcchar" class="termref" shape="rect"><span class="arrow">&#183;</span>wildcard character<span class="arrow">&#183;</span></a>.</p><div class="note"><div class="p"><b>Note:</b> The rules for which characters must be escaped and which can represent themselves are different when inside a <a href="#dt-charexpr" class="termref" shape="rect"><span class="arrow">&#183;</span>character class expression<span class="arrow">&#183;</span></a>; some <a href="#dt-normalc" class="termref" shape="rect"><span class="arrow">&#183;</span>normal characters<span class="arrow">&#183;</span></a> must be escaped and some <a href="#dt-metac" class="termref" shape="rect"><span class="arrow">&#183;</span>metacharacters<span class="arrow">&#183;</span></a> need not be.</div></div><div class="div3"> <h4><a name="charclassexps" id="charclassexps" shape="rect"></a>G.4.1 Character class expressions</h4><p><span class="termdef"><a name="dt-charexpr" id="dt-charexpr" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>character class expression</b> (<a href="#nt-charClassExpr" shape="rect"><i>charClassExpr</i></a>) is a <a href="#dt-chargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>character group<span class="arrow">&#183;</span></a> surrounded by '<code>[</code>' and '<code>]</code>' characters.&#160; For all character groups <var>G</var>,&#160; <code>[</code>&#160;<var>G</var>&#160;<code>]</code>&#160; is a valid <b>character class expression</b>, identifying the set of characters <em>C</em>(<code>[</code><var>G</var><code>]</code>) = <em>C</em>(<var>G</var>).</span></p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Character Class Expression</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="charClassExpr" id="charClassExpr" shape="rect"></a><a name="nt-charClassExpr" id="nt-charClassExpr" shape="rect"></a>[75]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>charClassExpr</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'[' <a href="#nt-charGroup" shape="rect"><i>charGroup</i></a> ']'</code></td></tr></tbody></table></td></tr></tbody></table><p> <span class="termdef"><a name="dt-chargroup" id="dt-chargroup" title="" shape="rect">[Definition:]&#160;&#160;</a> A <b>character group</b> (<a href="#nt-charGroup" shape="rect"><i>charGroup</i></a>) starts with either a <a href="#dt-poschargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>positive character group<span class="arrow">&#183;</span></a> or a <a href="#dt-negchargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>negative character group<span class="arrow">&#183;</span></a>, and is optionally followed by a subtraction operator '<code>-</code>' and a further <a href="#dt-charexpr" class="termref" shape="rect"><span class="arrow">&#183;</span>character class expression<span class="arrow">&#183;</span></a>.</span>&#160; <span class="termdef"><a name="dt-ccsub" id="dt-ccsub" title="" shape="rect">[Definition:]&#160;&#160;</a>A <a href="#dt-chargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>character group<span class="arrow">&#183;</span></a> that contains a subtraction operator is referred to as a <b>character class subtraction</b>.</span> </p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Character Group</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="chargroup" id="chargroup" shape="rect"></a><a name="nt-charGroup" id="nt-charGroup" shape="rect"></a>[76]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>charGroup</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>( <a href="#nt-posCharGroup" shape="rect"><i>posCharGroup</i></a> | <a href="#nt-negCharGroup" shape="rect"><i>negCharGroup</i></a> ) ( '-' <a href="#nt-charClassExpr" shape="rect"><i>charClassExpr</i></a> )? </code></td></tr></tbody></table></td></tr></tbody></table><p>If the first character in a <a href="#nt-charGroup" shape="rect"><i>charGroup</i></a> is '<code>^</code>', this is taken as indicating that the <a href="#nt-charGroup" shape="rect"><i>charGroup</i></a> starts with a <a href="#nt-negCharGroup" shape="rect"><i>negCharGroup</i></a>.&#160; A <a href="#nt-posCharGroup" shape="rect"><i>posCharGroup</i></a> can itself start with '<code>^</code>' but only when it appears within a <a href="#nt-negCharGroup" shape="rect"><i>negCharGroup</i></a>, that is, when the '<code>^</code>' is preceded by another '<code>^</code>'.</p><div class="note"><div class="p"><b>Note:</b> For example, the string '<code>[^X]</code>' is ambiguous according the grammar rules, denoting either a character class consisting of a negative character group with '<code>X</code>' as a member, or a positive character class with '<code>X</code>' and '<code>^</code>' as members.&#160; The normative prose rule just given requires that the first interpretation be taken.</div><div class="p">The string '<code>[^]</code>' is unambiguous: the grammar recognizes it as a character class expression containing a positive character group containing just the character '<code>^</code>'.&#160; But the grammatical derivation of the string violates the rule just given, so the string '<code>[^]</code>' <span class="rfc2119">must not</span> be accepted as a regular expression.</div></div><p>A '<code>-</code>' character is recognized as a subtraction operator (and hence, as terminating the <a href="#nt-posCharGroup" shape="rect"><i>posCharGroup</i></a> or <a href="#nt-negCharGroup" shape="rect"><i>negCharGroup</i></a>) if it is immediately followed by a '<code>[</code>' character.</p><p> For any <a href="#dt-poschargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>positive character group<span class="arrow">&#183;</span></a> or <a href="#dt-negchargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>negative character group<span class="arrow">&#183;</span></a> <var>G</var>, and any <a href="#dt-charexpr" class="termref" shape="rect"><span class="arrow">&#183;</span>character class expression<span class="arrow">&#183;</span></a> <var>C</var>,&#160; <var>G</var>&#160;<code>-</code>&#160;<var>C</var>&#160; is a valid <a href="#dt-chargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>character group<span class="arrow">&#183;</span></a>, identifying the set of all characters in <em>C</em>(<var>G</var>) that are not in <em>C</em>(<var>C</var>).</p><p><span class="termdef"><a name="dt-poschargroup" id="dt-poschargroup" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>positive character group</b> consists of one or more <a href="#dt-cgpart" class="termref" shape="rect"><span class="arrow">&#183;</span>character group parts<span class="arrow">&#183;</span></a>, concatenated together. The set of characters identified by a <b>positive character group</b> is the union of all of the sets identified by its constituent <a href="#dt-cgpart" class="termref" shape="rect"><span class="arrow">&#183;</span>character group parts<span class="arrow">&#183;</span></a>.</span></p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Positive Character Group</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="poschargroup" id="poschargroup" shape="rect"></a><a name="nt-posCharGroup" id="nt-posCharGroup" shape="rect"></a>[77]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>posCharGroup</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code> ( <a href="#nt-charGroupPart" shape="rect"><i>charGroupPart</i></a> )+ </code></td></tr></tbody></table></td></tr></tbody></table><p></p><table border="1"><col width="50%" span="1" /><col width="50%" span="1" /><thead><tr><th rowspan="1" colspan="1"> For all <a href="#dt-charrange" class="termref" shape="rect"><span class="arrow">&#183;</span>character ranges<span class="arrow">&#183;</span></a> <var>R</var>, all <a href="#dt-cces" class="termref" shape="rect"><span class="arrow">&#183;</span>character class escapes<span class="arrow">&#183;</span></a> <var>E</var>, and all <a href="#dt-poschargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>positive character groups<span class="arrow">&#183;</span></a> <var>P</var>, valid <a href="#dt-poschargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>positive charater groups<span class="arrow">&#183;</span></a> <var>G</var> are: </th><th rowspan="1" colspan="1"> Identifying the set of characters <em>C</em>(<var>G</var>) containing: </th></tr></thead><tbody><tr><td align="center" rowspan="1" colspan="1"><var>R</var></td><td align="center" rowspan="1" colspan="1">all characters in <em>C</em>(<var>R</var>)</td></tr><tr><td align="center" rowspan="1" colspan="1"><var>E</var></td><td align="center" rowspan="1" colspan="1">all characters in <em>C</em>(<var>E</var>)</td></tr><tr><td align="center" rowspan="1" colspan="1"><var>R</var><var>P</var></td><td align="center" rowspan="1" colspan="1">all characters in <em>C</em>(<var>R</var>) and all characters in <em>C</em>(<var>P</var>)</td></tr><tr><td align="center" rowspan="1" colspan="1"><var>E</var><var>P</var></td><td align="center" rowspan="1" colspan="1">all characters in <em>C</em>(<var>E</var>) and all characters in <em>C</em>(<var>P</var>)</td></tr></tbody></table><p><span class="termdef"><a name="dt-negchargroup" id="dt-negchargroup" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>negative character group</b> (<a href="#nt-negCharGroup" shape="rect"><i>negCharGroup</i></a>) consists of a '<code>^</code>' character followed by a <a href="#dt-poschargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>positive character group<span class="arrow">&#183;</span></a>. The set of characters identified by a negative character group <em>C</em>(<code>^</code><var>P</var>) is the set of all characters that are <em>not</em> in <em>C</em>(<var>P</var>).</span></p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Negative Character Group</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="negchargroup" id="negchargroup" shape="rect"></a><a name="nt-negCharGroup" id="nt-negCharGroup" shape="rect"></a>[78]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>negCharGroup</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'^' <a href="#nt-posCharGroup" shape="rect"><i>posCharGroup</i></a></code></td></tr></tbody></table></td></tr></tbody></table><p><span class="termdef"><a name="dt-cgpart" id="dt-cgpart" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>character group part</b> (<a href="#nt-charGroupPart" shape="rect"><i>charGroupPart</i></a>) is any of: a single unescaped character (<a href="#nt-SingleCharNoEsc" shape="rect"><i>SingleCharNoEsc</i></a>), a single escaped character (<a href="#nt-SingleCharEsc" shape="rect"><i>SingleCharEsc</i></a>), a character class escape (<a href="#nt-charClassEsc" shape="rect"><i>charClassEsc</i></a>), or a character range (<a href="#nt-charRange" shape="rect"><i>charRange</i></a>).</span> <a name="anchor11125a" id="anchor11125a" shape="rect"></a> </p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Character Group Part</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="charGroupPart" id="charGroupPart" shape="rect"></a><a name="nt-charGroupPart" id="nt-charGroupPart" shape="rect"></a>[79]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>charGroupPart</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code><a href="#nt-singleChar" shape="rect"><i>singleChar</i></a> | <a href="#nt-charRange" shape="rect"><i>charRange</i></a> | <a href="#nt-charClassEsc" shape="rect"><i>charClassEsc</i></a> </code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="singleChar" id="singleChar" shape="rect"></a><a name="nt-singleChar" id="nt-singleChar" shape="rect"></a>[80]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>singleChar</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code><a href="#nt-SingleCharEsc" shape="rect"><i>SingleCharEsc</i></a> | <a href="#nt-SingleCharNoEsc" shape="rect"><i>SingleCharNoEsc</i></a></code></td></tr></tbody></table></td></tr></tbody></table><div class="block">If a <a href="#nt-charGroupPart" shape="rect"><i>charGroupPart</i></a> starts with a <a href="#nt-singleChar" shape="rect"><i>singleChar</i></a> and this is immediately followed by a hyphen, then the following rules apply. <ol class="enumar"><li><div class="p">If the hyphen is immediately followed by '<code>[</code>', then the hyphen is not part of the <a href="#nt-charGroupPart" shape="rect"><i>charGroupPart</i></a>: instead, it is recognized as a character-class subtraction operator.</div></li><li><div class="p"> If the hyphen is immediately followed by '<code>]</code>', then the hyphen is recognized as a <a href="#nt-singleChar" shape="rect"><i>singleChar</i></a> and is part of the <a href="#nt-charGroupPart" shape="rect"><i>charGroupPart</i></a>. </div></li><li><div class="p"> If the hyphen is immediately followed by '<code>-[</code>', then the hyphen is recognized as a <a href="#nt-singleChar" shape="rect"><i>singleChar</i></a> and is part of the <a href="#nt-charGroupPart" shape="rect"><i>charGroupPart</i></a>. </div></li><li><div class="p"> Otherwise, the hyphen <span class="rfc2119">must</span> be immediately followed by some <a href="#nt-singleChar" shape="rect"><i>singleChar</i></a> other than a hyphen. In this case the hyphen is not part of the <a href="#nt-charGroupPart" shape="rect"><i>charGroupPart</i></a>; instead it is recognized, together with the immediately preceding and following instances of <a href="#nt-singleChar" shape="rect"><i>singleChar</i></a>, as a <a href="#nt-charRange" shape="rect"><i>charRange</i></a>.</div></li><li><div class="p"> If the hyphen is followed by any other character sequence, then the string in which it occurs is not recognized as a regular expression. </div></li></ol> It is an error if either of the two <a href="#nt-singleChar" shape="rect"><i>singleChar</i></a>s in a <a href="#nt-charRange" shape="rect"><i>charRange</i></a> is a <a href="#nt-SingleCharNoEsc" shape="rect"><i>SingleCharNoEsc</i></a> comprising an unescaped hyphen. </div><div class="note"><div class="p"><b>Note:</b> The rule just given resolves what would otherwise be the ambiguous interpretation of some strings, e.g. '<code>[a-k-z]</code>'; it also constrains regular expressions in ways not expressed in the grammar. For example, the rule (not the grammar) excludes the string '<code>[--z]</code>' from the regular expression language defined here.</div></div><p><span class="termdef"><a name="dt-charrange" id="dt-charrange" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>character range</b>&#160;<var>R</var> identifies a set of characters <em>C</em>(<var>R</var>) with UCS code points in a specified range. </span> </p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Character Range</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="charrange" id="charrange" shape="rect"></a><a name="nt-charRange" id="nt-charRange" shape="rect"></a>[81]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>charRange</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code> <a href="#nt-singleChar" shape="rect"><i>singleChar</i></a> '-' <a href="#nt-singleChar" shape="rect"><i>singleChar</i></a> </code></td></tr></tbody></table></td></tr></tbody></table><p> A <a href="#dt-charrange" class="termref" shape="rect"><span class="arrow">&#183;</span>character range<span class="arrow">&#183;</span></a> in the form&#160; <var>s</var><code>-</code><var>e</var>&#160; identifies the set of characters with UCS code points greater than or equal to the code point of <var>s</var>, but not greater than the code point of <var>e</var>.</p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Single Unescaped Character</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="SingleCharNoEsc" id="SingleCharNoEsc" shape="rect"></a><a name="nt-SingleCharNoEsc" id="nt-SingleCharNoEsc" shape="rect"></a>[82]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>SingleCharNoEsc</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>[^\#x5B#x5D] </code></td><td rowspan="1" colspan="1"><i>/* &#160;N.B.:&#160; #x5B = '<code>[</code>', #x5D = '<code>]</code>'&#160; */</i></td></tr></tbody></table></td></tr></tbody></table><p>A single unescaped character (<a href="#nt-SingleCharNoEsc" shape="rect"><i>SingleCharNoEsc</i></a>) is any character except '<code>[</code>' or '<code>]</code>'. There are special rules, described earlier, that constrain the use of the characters '<code>-</code>' and '<code>^</code>' in order to disambiguate the syntax.</p><p>A single unescaped character identifies the singleton set of characters containing that character alone.</p><p>A single escaped character (<a href="#nt-SingleCharEsc" shape="rect"><i>SingleCharEsc</i></a>), when used within a character group, identifies the singleton set of characters containing the character denoted by the escape (see <a href="#cces" shape="rect">Character Class Escapes (&#167;G.4.2)</a>).</p></div><div class="div3"> <h4><a name="cces" id="cces" shape="rect"></a>G.4.2 Character Class Escapes</h4><p><span class="termdef"><a name="dt-cces" id="dt-cces" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>character class escape</b> is a short sequence of characters that identifies a predefined character class.&#160; The valid character class escapes are the <a href="#dt-ccesN" class="termref" shape="rect"><span class="arrow">&#183;</span>multi-character escapes<span class="arrow">&#183;</span></a>, and the <a href="#dt-ccescat" class="termref" shape="rect"><span class="arrow">&#183;</span>category escapes<span class="arrow">&#183;</span></a> (including the <a href="#dt-ccesblock" class="termref" shape="rect"><span class="arrow">&#183;</span>block escapes<span class="arrow">&#183;</span></a>).</span> </p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Character Class Escape</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="charclassesc" id="charclassesc" shape="rect"></a><a name="nt-charClassEsc" id="nt-charClassEsc" shape="rect"></a>[83]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>charClassEsc</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code> ( <a href="#nt-MultiCharEsc" shape="rect"><i>MultiCharEsc</i></a> | <a href="#nt-catEsc" shape="rect"><i>catEsc</i></a> | <a href="#nt-complEsc" shape="rect"><i>complEsc</i></a> ) </code></td></tr></tbody></table></td></tr></tbody></table><div class="div4"> <h5><a name="cces-sce" id="cces-sce" shape="rect"></a>G.4.2.1 Single-character escapes</h5><p>Closely related to the character-class escapes are the single-character escapes. <span class="termdef"><a name="dt-cces1" id="dt-cces1" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>single-character escape</b> identifies a set containing only one character&#8212;usually because that character is difficult or impossible to write directly into a <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expression<span class="arrow">&#183;</span></a>.</span></p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Single Character Escape</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="singlecharesc" id="singlecharesc" shape="rect"></a><a name="nt-SingleCharEsc" id="nt-SingleCharEsc" shape="rect"></a>[84]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>SingleCharEsc</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'\' [nrt\|.?*+(){}#x2D#x5B#x5D#x5E]</code></td><td rowspan="1" colspan="1"><i>/* N.B.:&#160; #x2D = '<code>-</code>', #x5B = '<code>[</code>', #x5D = '<code>]</code>', #x5E = '<code>^</code>' */</i></td></tr></tbody></table></td></tr></tbody></table><p></p><table border="1"><col width="50%" span="1" /><col width="50%" span="1" /><thead><tr><th rowspan="1" colspan="1">The valid <a href="#dt-cces1" class="termref" shape="rect"><span class="arrow">&#183;</span>single character escapes<span class="arrow">&#183;</span></a> <var>R</var> are:</th><th rowspan="1" colspan="1">Identifying the set of characters containing:</th></tr></thead><tbody><tr><td align="center" rowspan="1" colspan="1"><code>\n</code></td><td align="center" rowspan="1" colspan="1">the newline character (#xA)</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\r</code></td><td align="center" rowspan="1" colspan="1">the return character (#xD)</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\t</code></td><td align="center" rowspan="1" colspan="1">the tab character (#x9)</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\\</code></td><td align="center" rowspan="1" colspan="1"><code>\</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\|</code></td><td align="center" rowspan="1" colspan="1"><code>|</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\.</code></td><td align="center" rowspan="1" colspan="1"><code>.</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\-</code></td><td align="center" rowspan="1" colspan="1"><code>-</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\^</code></td><td align="center" rowspan="1" colspan="1"><code>^</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\?</code></td><td align="center" rowspan="1" colspan="1"><code>?</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\*</code></td><td align="center" rowspan="1" colspan="1"><code>*</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\+</code></td><td align="center" rowspan="1" colspan="1"><code>+</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\{</code></td><td align="center" rowspan="1" colspan="1"><code>{</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\}</code></td><td align="center" rowspan="1" colspan="1"><code>}</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\(</code></td><td align="center" rowspan="1" colspan="1"><code>(</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\)</code></td><td align="center" rowspan="1" colspan="1"><code>)</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\[</code></td><td align="center" rowspan="1" colspan="1"><code>[</code></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\]</code></td><td align="center" rowspan="1" colspan="1"><code>]</code></td></tr></tbody></table></div><div class="div4"> <h5><a name="cces-catesc" id="cces-catesc" shape="rect"></a>G.4.2.2 Category escapes</h5><p><span class="termdef"><a name="dt-ccescat" id="dt-ccescat" title="" shape="rect">[Definition:]&#160;&#160;</a> <a href="#UnicodeDB" shape="rect">[Unicode Database]</a> specifies a number of possible values for the "General Category" property and provides mappings from code points to specific character properties.&#160; The set containing all characters that have property <var>X</var> can be identified with a <b>category escape</b>&#160;<code>\p{</code><var>X</var><code>}</code> (using a lower-case 'p').&#160; The complement of this set is specified with the <b>category escape</b>&#160; <code>\P{</code><var>X</var><code>}</code> (using an upper-case 'P').&#160; For all <var>X</var>, if <var>X</var> is a recognized character-property code, then <code>[\P{<var>X</var>}]</code> = <code>[^\p{<var>X</var>}]</code>. </span></p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Category Escape</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="catesc" id="catesc" shape="rect"></a><a name="nt-catEsc" id="nt-catEsc" shape="rect"></a>[85]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>catEsc</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'\p{' <a href="#nt-charProp" shape="rect"><i>charProp</i></a> '}'</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="complesc" id="complesc" shape="rect"></a><a name="nt-complEsc" id="nt-complEsc" shape="rect"></a>[86]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>complEsc</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'\P{' <a href="#nt-charProp" shape="rect"><i>charProp</i></a> '}'</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="charprop" id="charprop" shape="rect"></a><a name="nt-charProp" id="nt-charProp" shape="rect"></a>[87]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>charProp</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code><a href="#nt-IsCategory" shape="rect"><i>IsCategory</i></a> | <a href="#nt-IsBlock" shape="rect"><i>IsBlock</i></a></code></td></tr></tbody></table></td></tr></tbody></table><p> <a href="#UnicodeDB" shape="rect">[Unicode Database]</a> is subject to future revision.&#160; For example, the mapping from code points to character properties might be updated. All <a href="#dt-minimally-conforming" class="termref" shape="rect"><span class="arrow">&#183;</span>minimally conforming<span class="arrow">&#183;</span></a> processors <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> support the character properties defined in the version of <a href="#UnicodeDB" shape="rect">[Unicode Database]</a> cited in the normative references (<a href="#normative-biblio" shape="rect">Normative (&#167;K.1)</a>) or in some later version of the Unicode database.&#160; Implementors are encouraged to support the character properties defined in any later versions. When the implementation supports multiple versions of the Unicode database, and they differ in salient respects (e.g. different properties are assigned to the same character in different versions of the database), then it is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> which set of property definitions is used for any given assessment episode. </p><div class="note"><div class="p"><b>Note:</b> In order to benefit from continuing work on the Unicode database, a conforming implementation might by default use the latest supported version of the character properties. In order to maximize consistency with other implementations of this specification, however, an implementation might choose to provide <a href="#dt-useroption" class="termref" shape="rect"><span class="arrow">&#183;</span>user options<span class="arrow">&#183;</span></a> to specify the use of the version of the database cited in the normative references. The <code>PropertyAliases.txt</code> and <code>PropertyValueAliases.txt</code> files of the Unicode database may be helpful to implementors in this connection. </div></div><p> For convenience, the following table lists the values of the "General Category" property in the version of <a href="#UnicodeDB" shape="rect">[Unicode Database]</a> cited in the normative references (<a href="#normative-biblio" shape="rect">Normative (&#167;K.1)</a>).&#160; The properties with single-character names are not defined in <a href="#UnicodeDB" shape="rect">[Unicode Database]</a>.&#160; The value of a single-character property is the union of the values of all the two-character properties whose first character is the character in question.&#160; For example, for <code>N</code>, the union of <code>Nd</code>, <code>Nl</code> and <code>No</code>.</p><div class="note"><div class="p"><b>Note:</b> As of this publication the Java regex library does <em>not</em> include <code>Cn</code> in its definition of <code>C</code>, so that definition cannot be used without modification in conformant implementations.</div></div><table border="1" align="center"><tbody><tr><th rowspan="1" colspan="1">Category</th><th rowspan="1" colspan="1">Property</th><th rowspan="1" colspan="1">Meaning</th></tr><tr><td rowspan="6" colspan="1">Letters</td><td align="center" rowspan="1" colspan="1">L</td><td rowspan="1" colspan="1">All Letters</td></tr><tr><td align="center" rowspan="1" colspan="1">Lu</td><td rowspan="1" colspan="1">uppercase</td></tr><tr><td align="center" rowspan="1" colspan="1">Ll</td><td rowspan="1" colspan="1">lowercase</td></tr><tr><td align="center" rowspan="1" colspan="1">Lt</td><td rowspan="1" colspan="1">titlecase</td></tr><tr><td align="center" rowspan="1" colspan="1">Lm</td><td rowspan="1" colspan="1">modifier</td></tr><tr><td align="center" rowspan="1" colspan="1">Lo</td><td rowspan="1" colspan="1">other</td></tr><tr><td colspan="3" rowspan="1">&#160;</td></tr><tr><td rowspan="4" colspan="1">Marks</td><td align="center" rowspan="1" colspan="1">M</td><td rowspan="1" colspan="1">All Marks</td></tr><tr><td align="center" rowspan="1" colspan="1">Mn</td><td rowspan="1" colspan="1">nonspacing</td></tr><tr><td align="center" rowspan="1" colspan="1">Mc</td><td rowspan="1" colspan="1">spacing combining</td></tr><tr><td align="center" rowspan="1" colspan="1">Me</td><td rowspan="1" colspan="1">enclosing</td></tr><tr><td colspan="3" rowspan="1">&#160;</td></tr><tr><td rowspan="4" colspan="1">Numbers</td><td align="center" rowspan="1" colspan="1">N</td><td rowspan="1" colspan="1">All Numbers</td></tr><tr><td align="center" rowspan="1" colspan="1">Nd</td><td rowspan="1" colspan="1">decimal digit</td></tr><tr><td align="center" rowspan="1" colspan="1">Nl</td><td rowspan="1" colspan="1">letter</td></tr><tr><td align="center" rowspan="1" colspan="1">No</td><td rowspan="1" colspan="1">other</td></tr><tr><td colspan="3" rowspan="1">&#160;</td></tr><tr><td rowspan="8" colspan="1">Punctuation</td><td align="center" rowspan="1" colspan="1">P</td><td rowspan="1" colspan="1">All Punctuation</td></tr><tr><td align="center" rowspan="1" colspan="1">Pc</td><td rowspan="1" colspan="1">connector</td></tr><tr><td align="center" rowspan="1" colspan="1">Pd</td><td rowspan="1" colspan="1">dash</td></tr><tr><td align="center" rowspan="1" colspan="1">Ps</td><td rowspan="1" colspan="1">open</td></tr><tr><td align="center" rowspan="1" colspan="1">Pe</td><td rowspan="1" colspan="1">close</td></tr><tr><td align="center" rowspan="1" colspan="1">Pi</td><td rowspan="1" colspan="1">initial quote (may behave like Ps or Pe depending on usage)</td></tr><tr><td align="center" rowspan="1" colspan="1">Pf</td><td rowspan="1" colspan="1">final quote (may behave like Ps or Pe depending on usage)</td></tr><tr><td align="center" rowspan="1" colspan="1">Po</td><td rowspan="1" colspan="1">other</td></tr><tr><td colspan="3" rowspan="1">&#160;</td></tr><tr><td rowspan="4" colspan="1">Separators</td><td align="center" rowspan="1" colspan="1">Z</td><td rowspan="1" colspan="1">All Separators</td></tr><tr><td align="center" rowspan="1" colspan="1">Zs</td><td rowspan="1" colspan="1">space</td></tr><tr><td align="center" rowspan="1" colspan="1">Zl</td><td rowspan="1" colspan="1">line</td></tr><tr><td align="center" rowspan="1" colspan="1">Zp</td><td rowspan="1" colspan="1">paragraph</td></tr><tr><td colspan="3" rowspan="1">&#160;</td></tr><tr><td rowspan="5" colspan="1">Symbols</td><td align="center" rowspan="1" colspan="1">S</td><td rowspan="1" colspan="1">All Symbols</td></tr><tr><td align="center" rowspan="1" colspan="1">Sm</td><td rowspan="1" colspan="1">math</td></tr><tr><td align="center" rowspan="1" colspan="1">Sc</td><td rowspan="1" colspan="1">currency</td></tr><tr><td align="center" rowspan="1" colspan="1">Sk</td><td rowspan="1" colspan="1">modifier</td></tr><tr><td align="center" rowspan="1" colspan="1">So</td><td rowspan="1" colspan="1">other</td></tr><tr><td colspan="3" rowspan="1">&#160;</td></tr><tr><td rowspan="5" colspan="1">Other</td><td align="center" rowspan="1" colspan="1">C</td><td rowspan="1" colspan="1">All Others</td></tr><tr><td align="center" rowspan="1" colspan="1">Cc</td><td rowspan="1" colspan="1">control</td></tr><tr><td align="center" rowspan="1" colspan="1">Cf</td><td rowspan="1" colspan="1">format</td></tr><tr><td align="center" rowspan="1" colspan="1">Co</td><td rowspan="1" colspan="1">private use</td></tr><tr><td align="center" rowspan="1" colspan="1">Cn</td><td rowspan="1" colspan="1">not assigned</td></tr></tbody></table><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Categories</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="cats" id="cats" shape="rect"></a><a name="nt-IsCategory" id="nt-IsCategory" shape="rect"></a>[88]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>IsCategory</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code> <a href="#nt-Letters" shape="rect"><i>Letters</i></a> | <a href="#nt-Marks" shape="rect"><i>Marks</i></a> | <a href="#nt-Numbers" shape="rect"><i>Numbers</i></a> | <a href="#nt-Punctuation" shape="rect"><i>Punctuation</i></a> | <a href="#nt-Separators" shape="rect"><i>Separators</i></a> | <a href="#nt-Symbols" shape="rect"><i>Symbols</i></a> | <a href="#nt-Others" shape="rect"><i>Others</i></a> </code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="lets" id="lets" shape="rect"></a><a name="nt-Letters" id="nt-Letters" shape="rect"></a>[89]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>Letters</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'L' [ultmo]?</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="marks" id="marks" shape="rect"></a><a name="nt-Marks" id="nt-Marks" shape="rect"></a>[90]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>Marks</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'M' [nce]?</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="nums" id="nums" shape="rect"></a><a name="nt-Numbers" id="nt-Numbers" shape="rect"></a>[91]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>Numbers</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'N' [dlo]?</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="punc" id="punc" shape="rect"></a><a name="nt-Punctuation" id="nt-Punctuation" shape="rect"></a>[92]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>Punctuation</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'P' [cdseifo]?</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="seps" id="seps" shape="rect"></a><a name="nt-Separators" id="nt-Separators" shape="rect"></a>[93]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>Separators</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'Z' [slp]?</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="syms" id="syms" shape="rect"></a><a name="nt-Symbols" id="nt-Symbols" shape="rect"></a>[94]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>Symbols</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'S' [mcko]?</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="others" id="others" shape="rect"></a><a name="nt-Others" id="nt-Others" shape="rect"></a>[95]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>Others</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'C' [cfon]?</code></td></tr></tbody></table></td></tr></tbody></table><div class="note"><div class="p"><b>Note:</b> The properties mentioned above exclude the Cs property.&#160; The Cs property identifies "surrogate" characters, which do not occur at the level of the "character abstraction" that XML instance documents operate on.</div></div></div><div class="div4"> <h5><a name="cces-blockesc" id="cces-blockesc" shape="rect"></a>G.4.2.3 Block escapes</h5><p> <a href="#UnicodeDB" shape="rect">[Unicode Database]</a> groups the code points of the Universal Character Set (UCS) into a number of blocks such as Basic Latin (i.e., ASCII), Latin-1 Supplement, Hangul Jamo, CJK Compatibility, etc.&#160; The block-escape construct allows regular expressions to refer to sets of characters by the name of the block in which they appear, using a <a href="#dt-normalized-block-name" class="termref" shape="rect"><span class="arrow">&#183;</span>normalized block name<span class="arrow">&#183;</span></a>. </p><p> <span class="termdef"><a name="dt-normalized-block-name" id="dt-normalized-block-name" title="" shape="rect">[Definition:]&#160;&#160;</a> For any Unicode block, the <b>normalized block name</b> of that block is the string of characters formed by stripping out white space and underbar characters from the block name as given in <a href="#UnicodeDB" shape="rect">[Unicode Database]</a>, while retaining hyphens and preserving case distinctions.</span> </p><p> <span class="termdef"><a name="dt-ccesblock" id="dt-ccesblock" title="" shape="rect">[Definition:]&#160;&#160;</a> A <b>block escape</b> expression denotes the set of characters in a given Unicode block. For any Unicode block <var>B</var>, with <a href="#dt-normalized-block-name" class="termref" shape="rect"><span class="arrow">&#183;</span>normalized block name<span class="arrow">&#183;</span></a> <var>X</var>, the set containing all characters defined in block <var>B</var> can be identified with the <b>block escape</b> <code>\p{Is<var>X</var>}</code> (using lower-case 'p'). The complement of this set is denoted by the <b>block escape</b> <code>\P{Is<var>X</var>}</code> (using upper-case 'P'). For all <var>X</var>, if <var>X</var> is a normalized block name recognized by the processor, then <code>[\P{Is</code><var>X</var><code>}]</code> = <code>[^\p{Is</code><var>X</var><code>}]</code>. </span> </p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Block Escape</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="blockesc" id="blockesc" shape="rect"></a><a name="nt-IsBlock" id="nt-IsBlock" shape="rect"></a>[96]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>IsBlock</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'Is' [a-zA-Z0-9#x2D]+</code></td><td rowspan="1" colspan="1"><i>/* &#160;N.B.:&#160; #x2D = '<code>-</code>' */</i></td></tr></tbody></table></td></tr></tbody></table><p id="eg-isbasiclatin"><a href="#dt-ccesblock" class="termref" shape="rect"><span class="arrow">&#183;</span>block escape<span class="arrow">&#183;</span></a><code>\p{IsBasicLatin}</code></p><div class="note"><div class="p"><b>Note:</b> Current versions of the Unicode database recommend that whenever block names are being matched hyphens, underbars, and white space should be dropped and letters folded to a single case, so both the string '<code>BasicLatin</code>' and the string '<code>-- basic LATIN --</code>' will match the block name "Basic Latin". </div><div class="p">The handling of block names in block escapes differs from this behavior in two ways. First, the normalized block names defined in this specification do not suppress hyphens in the Unicode block names and do not level case distinctions. The normalized form of the block name '<code>Latin-1 Supplement</code>', for example, is thus '<code>Latin-1Supplement</code>', not '<code>latin1supplement</code>' or '<code>LATIN1SUPPLEMENT</code>'. Second, XSD processors are not required to perform any normalization at all upon the block name as given in the <a href="#dt-ccesblock" class="termref" shape="rect"><span class="arrow">&#183;</span>block escape<span class="arrow">&#183;</span></a>, so '<code>\p{Latin-1Supplement}</code>' will be recognized as a reference to the Latin-1 Supplement block, but '<code>\p{Is Latin-1 supplement}</code>' will not. </div></div><p> <a href="#UnicodeDB" shape="rect">[Unicode Database]</a> has been revised since XSD 1.0 was published, and is subject to future revision. In particular, the grouping of code points into blocks has changed, and may change again. All <a href="#dt-minimally-conforming" class="termref" shape="rect"><span class="arrow">&#183;</span>minimally conforming<span class="arrow">&#183;</span></a> processors <span class="rfc2119">must</span> support the blocks defined in the version of <a href="#UnicodeDB" shape="rect">[Unicode Database]</a> cited in the normative references (<a href="#normative-biblio" shape="rect">Normative (&#167;K.1)</a>) or in some later version of the Unicode database. Implementors are encouraged to support the blocks defined in earlier and/or later versions of the Unicode Standard. When the implementation supports multiple versions of the Unicode database, and they differ in salient respects (e.g. different characters are assigned to a given block in different versions of the database), then it is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> which set of block definitions is used for any given assessment episode. </p><div class="block">In particular, the version of <a href="#UnicodeDB" shape="rect">[Unicode Database]</a> referenced in XSD 1.0 (namely, Unicode 3.1) contained a number of blocks which have been renamed in later versions of the database Since the older block names may appear in regular expressions within XSD 1.0 schemas, implementors are encouraged to support the superseded block names in XSD 1.1 processors for compatibility, either by default or <a href="#dt-useroption" class="termref" shape="rect"><span class="arrow">&#183;</span>at user option<span class="arrow">&#183;</span></a>. At the time this document was prepared, block names from Unicode 3.1 known to have been superseded in this way included: <ul><li><div class="p">#x0370 - #x03FF: Greek</div></li><li><div class="p">#x20D0 - #x20FF: CombiningMarksforSymbols</div></li><li><div class="p">#xE000 - #xF8FF: PrivateUse</div></li><li><div class="p">#xF0000 - #xFFFFD: PrivateUse</div></li><li><div class="p">#x100000 - #x10FFFD: PrivateUse</div></li></ul> </div><p> A tabulation of normalized block names for Unicode 2.0.0 and later is given in <a href="#unicode-escapes" shape="rect">[Unicode block names]</a>. </p><p>For the treatment of regular expressions containing unrecognized Unicode block names, see <a href="#sec-unrecognized-catesc" shape="rect">Unrecognized category escapes (&#167;G.4.2.4)</a>.</p></div><div class="div4"> <h5><a name="sec-unrecognized-catesc" id="sec-unrecognized-catesc" shape="rect"></a>G.4.2.4 Unrecognized category escapes</h5><p>A string of the form "<code>\p{<var>S</var>}</code>" constitutes a <a href="#nt-catEsc" shape="rect"><i>catEsc</i></a> (category escape), and similarly a string of the form "<code>\P{<var>S</var>}</code>" constitutes a <a href="#nt-complEsc" shape="rect"><i>complEsc</i></a> (category-complement escape) only if the string <var>S</var> matches either <a href="#nt-IsCategory" shape="rect"><i>IsCategory</i></a> or <a href="#nt-IsBlock" shape="rect"><i>IsBlock</i></a>.</p><div class="note"><div class="p"><b>Note:</b> If an unknown string of characters is used in a category escape instead of a known character category code or a string matching the <a href="#nt-IsBlock" shape="rect"><i>IsBlock</i></a> production, the resulting string will (normally) not match the <a href="#nt-regExp" shape="rect"><i>regExp</i></a> production and thus not be a regular expression as defined in this specification. If the non-<a href="#nt-regExp" shape="rect"><i>regExp</i></a> string occurs where a regular expression is required, the schema document will be in <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a>.</div></div><p>Any string of hyphens, digits, and Basic Latin characters beginning with '<code>Is</code>' will match the non-terminal <a href="#nt-IsBlock" shape="rect"><i>IsBlock</i></a> and thus be allowed in a regular expression. Most of these strings, however, will not denote any Unicode block. Processors <span class="rfc2119">should</span> issue a warning if they encounter a regular expression using a block name they do not recognize. Processors <span class="rfc2119">may</span> <a href="#dt-useroption" class="termref" shape="rect"><span class="arrow">&#183;</span>at user option<span class="arrow">&#183;</span></a> treat unrecognized block names as <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>errors<span class="arrow">&#183;</span></a> in the schema. </p><div class="note"><div class="p"><b>Note:</b> Treating unrecognized block names as errors increases the likelihood that errors in spelling the block name will be detected and can be helpful in checking the correctness of schema documents. However, it also decreases the portability of schema documents among processors supporting different versions of <a href="#UnicodeDB" shape="rect">[Unicode Database]</a>; it is for this reason that processors are allowed to treat unrecognized block names as errors only when the user has explicitly requested this behavior. </div></div><p>If a string "<code>Is<var>X</var></code>" matches the non-terminal <a href="#nt-IsBlock" shape="rect"><i>IsBlock</i></a> but <var>X</var> is not a recognized block name, then the expressions "<code>\p{Is<var>X</var>}</code>" and "<code>\P{Is<var>X</var>}</code>" each denote the set of all characters. Processors <span class="rfc2119">may</span> <a href="#dt-useroption" class="termref" shape="rect"><span class="arrow">&#183;</span>at user option<span class="arrow">&#183;</span></a> treat both "<code>\p{Is<var>X</var>}</code>" and "<code>\P{Is<var>X</var>}</code>" as denoting the empty set, instead of the set of all characters. </p><div class="note"><div class="p"><b>Note:</b> The meaning defined for a block escape with an unrecognized block name makes it synonymous with the regular expression '<code>.|[\n\r]</code>'. A processor which does not recognize the block name will thus not enforce the constraint that the characters matched are in, or are not in, the block in question. Any string which satisfies the regular expression as written will be accepted, but not all strings accepted will actually satisfy the expression as written: some strings which do not satisfy the expression as written will also be accepted. So some invalid input will be wrongly identified as valid.</div><div class="p">If (at <a href="#dt-useroption" class="termref" shape="rect"><span class="arrow">&#183;</span>user option<span class="arrow">&#183;</span></a>) the expressions are treated as denoting the empty set, then the converse is true: any string which fails to satisfy the expression as written will be rejected, but not all strings rejected by the processor will actually have failed to satisfy the expression as written. So some valid input will be wrongly identified as invalid.</div><div class="p">Which behavior is preferable in concrete circumstances depends on the relative cost of failure to accept valid input (false negatives) and failure to reject invalid input (false positives). It is for this reason that processors are allowed to provide <a href="#dt-useroption" class="termref" shape="rect"><span class="arrow">&#183;</span>user options<span class="arrow">&#183;</span></a> to control the behavior. The principle of being liberal in accepting input (often called Postel's Law) suggests that the default behavior should be to accept strings not known to be invalid, rather than the converse; it is for this reason that block escapes with unknown block names should be treated as matching any character unless the user explicitly requests the alternative behavior. </div></div></div><div class="div4"> <h5><a name="cces-mce" id="cces-mce" shape="rect"></a>G.4.2.5 Multi-character escapes</h5><p><span class="termdef"><a name="dt-ccesN" id="dt-ccesN" title="" shape="rect">[Definition:]&#160;&#160;</a>A <b>multi-character escape</b> provides a simple way to identify any of a commonly used set of characters:</span>&#160; <span class="termdef"><a name="dt-wcchar" id="dt-wcchar" title="" shape="rect">[Definition:]&#160;&#160;</a> The <b>wildcard character</b> is a metacharacter which matches almost any single character:</span></p><table class="scrap" cellpadding="5" border="1" width="100%"><tbody><tr align="left"><td rowspan="1" colspan="1"><strong><font color="red">Multi-Character Escape</font></strong></td></tr><tr><td rowspan="1" colspan="1"><table border="0"><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="multicharesc" id="multicharesc" shape="rect"></a><a name="nt-MultiCharEsc" id="nt-MultiCharEsc" shape="rect"></a>[97]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>MultiCharEsc</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'\' [sSiIcCdDwW]</code></td></tr></tbody><tbody><tr valign="baseline"><td rowspan="1" colspan="1"><a name="wildcardesc" id="wildcardesc" shape="rect"></a><a name="nt-WildcardEsc" id="nt-WildcardEsc" shape="rect"></a>[98]&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>WildcardEsc</code></td><td rowspan="1" colspan="1">&#160;&#160;&#160;::=&#160;&#160;&#160;</td><td rowspan="1" colspan="1"><code>'.'</code></td></tr></tbody></table></td></tr></tbody></table><p></p><table border="1" align="center" cellpadding="5"><col width="33%" span="1" /><col width="33%" span="1" /><col width="33%" span="1" /><thead><tr><th rowspan="1" colspan="1">Character sequence</th><th rowspan="1" colspan="1">Equivalent <a href="#dt-charclass" class="termref" shape="rect"><span class="arrow">&#183;</span>character class<span class="arrow">&#183;</span></a></th></tr></thead><tbody><tr><td align="center" rowspan="1" colspan="1"><code>.</code></td><td align="center" rowspan="1" colspan="1">[^\n\r]</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\s</code></td><td align="center" rowspan="1" colspan="1">[#x20\t\n\r]</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\S</code></td><td align="center" rowspan="1" colspan="1">[^\s]</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\i</code></td><td align="center" rowspan="1" colspan="1"> the set of initial name characters, those <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>matched<span class="arrow">&#183;</span></a> by <a href="https://www.w3.org/TR/xml11/#NT-NameStartChar" shape="rect">NameStartChar</a> in <a href="#XML" shape="rect">[XML]</a> </td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\I</code></td><td align="center" rowspan="1" colspan="1">[^\i]</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\c</code></td><td align="center" rowspan="1" colspan="1"> the set of name characters, those <a href="#dt-match" class="termref" shape="rect"><span class="arrow">&#183;</span>matched<span class="arrow">&#183;</span></a> by <a href="https://www.w3.org/TR/xml11/#NT-NameChar" shape="rect">NameChar</a></td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\C</code></td><td align="center" rowspan="1" colspan="1">[^\c]</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\d</code></td><td align="center" rowspan="1" colspan="1">\p{Nd}</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\D</code></td><td align="center" rowspan="1" colspan="1">[^\d]</td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\w</code></td><td align="center" rowspan="1" colspan="1"> [#x0000-#x10FFFF]-[\p{P}\p{Z}\p{C}] (<em>all characters except the set of "punctuation", "separator" and "other" characters</em>) </td></tr><tr><td align="center" rowspan="1" colspan="1"><code>\W</code></td><td align="center" rowspan="1" colspan="1">[^\w]</td></tr></tbody></table><div class="note"><div class="p"><b>Note:</b> The <a href="#dt-regex" class="termref" shape="rect"><span class="arrow">&#183;</span>regular expression<span class="arrow">&#183;</span></a> language defined here does not attempt to provide a general solution to "regular expressions" over UCS character sequences.&#160; In particular, it does not easily provide for matching sequences of base characters and combining marks. The language is targeted at support of "Level 1" features as defined in <a href="#unicodeRegEx" shape="rect">[Unicode Regular Expression Guidelines]</a>.&#160; It is hoped that future versions of this specification will provide support for "Level 2" features. </div></div></div></div></div></div><div class="div1"> <h2><a name="idef-idep" id="idef-idep" shape="rect"></a>H Implementation-defined and implementation-dependent features (normative)</h2><div class="div2"> <h3><span class="nav"> <a href="#impl-dep" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="impl-def" id="impl-def" shape="rect"></a>H.1 Implementation-defined features</h3><p>The following features in this specification are <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a>. Any software which claims to conform to this specification (or to the specification of any host language which embeds <em>XSD 1.1: Datatypes</em>) <span class="rfc2119">must</span> describe how these choices have been exercised, in documentation which accompanies any conformance claim. </p><ol class="enumar"><li><div class="p">For the datatypes which depend on <a href="#XML" shape="rect">[XML]</a> or <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>, it is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether a conforming processor takes the relevant definitions from <a href="#XML" shape="rect">[XML]</a> and <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>, or from <a href="#XML1.0" shape="rect">[XML 1.0]</a> and <a href="#XMLNS1.0" shape="rect">[Namespaces in XML 1.0]</a>. Implementations <span class="rfc2119">may</span> support either the form of these datatypes based on version 1.0 of those specifications, or the form based on version 1.1, or both. </div></li><li><div class="p">For the datatypes with infinite <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a>, it is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether conforming processors set a limit on the size of the values supported. If such limits are set, they <span class="rfc2119">must</span> be documented, and the limits <span class="rfc2119">must</span> be equal to, or exceed, the minimal limits specified in <a href="#partial-implementation" shape="rect">Partial Implementation of Infinite Datatypes (&#167;5.4)</a>. .</div></li><li><div class="p">It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes other than those defined in this specification are supported.</div><div class="p">For each <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> datatype, a <a href="#std" class="compref" shape="rect">Simple Type Definition</a> <span class="rfc2119">must</span> be specified which conforms to the rules given in <a href="#builtin-stds" shape="rect">Built-in Simple Type Definitions (&#167;4.1.6)</a>. </div><div class="p"> In addition, the following information <span class="rfc2119">must</span> be provided:<ol class="enumla"><li><div class="p">The nature of the datatype's <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, and <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a>.</div></li><li><div class="p">The nature of the equality relation; in particular, how to determine whether two values which are not identical are equal.</div><div class="note"><div class="p"><b>Note:</b> There is no requirement that equality be distinct from identity, but it <span class="rfc2119">may</span> be.</div></div></li><li><div class="p">The values of the <a href="#dt-fundamental-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>fundamental facets<span class="arrow">&#183;</span></a>.</div></li><li><div class="p">Which of the <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> defined in this specification are applicable to the datatype (and <span class="rfc2119">may</span> thus be used in <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> from it), and what they mean when applied to it.</div></li><li><div class="p">If <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> are supported, which of those <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> are applicable to the datatype, and what they mean when applied to it.</div></li><li><div class="p">What URI reference (more precisely, what <a href="#anyURI" shape="rect">anyURI</a> value) is to be used to refer to the datatype, analogous to those provided for the datatypes defined here in section <a href="#built-in-datatypes" shape="rect">Built-in Datatypes and Their Definitions (&#167;3)</a>.</div><div class="note"><div class="p"><b>Note:</b> It is convenient if the URI for a datatype and the <a href="https://www.w3.org/TR/2004/REC-xml-names11-20040204/#dt-expname" shape="rect">expanded name</a> of its simple type definition are related by a simple mapping, like the URIs given for the <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes in <a href="#built-in-datatypes" shape="rect">Built-in Datatypes and Their Definitions (&#167;3)</a>. However, this is not a requirement.</div></div></li><li><div class="p">For each <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facet<span class="arrow">&#183;</span></a> given a value for the new <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, what URI reference (more precisely, what <a href="#anyURI" shape="rect">anyURI</a> value) is to be used to refer to the usage of that facet on the datatype, analogous to those provided, for the <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes, in section <a href="#built-in-datatypes" shape="rect">Built-in Datatypes and Their Definitions (&#167;3)</a>.</div><div class="note"><div class="p"><b>Note:</b> As specified normatively elsewhere, the set of facets given values will at the very least include the <a href="#f-w" class="compref" shape="rect">whiteSpace</a> facet.</div></div></li></ol> </div><div class="p">The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype <span class="rfc2119">must</span> be disjoint from those of the other <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes.</div><div class="p">The <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> defined for an <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> primitive <span class="rfc2119">must</span> be a total function from the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> onto the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>. That is, (1) each <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> in the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> <span class="rfc2119">must</span> map to exactly one value, and (2) each value <span class="rfc2119">must</span> be the image of at least one member of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, and <span class="rfc2119">may</span> be the image of more than one.</div><div class="p">For consistency with the <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> defined here, implementors who define new <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes <span class="rfc2119">should</span> allow the <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> and <a href="#dt-enumeration" class="termref" shape="rect"><span class="arrow">&#183;</span>enumeration<span class="arrow">&#183;</span></a> facets to apply. </div><div class="p">The implementor <span class="rfc2119">should</span> specify a <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a> for the datatype if practicable.</div></li><li><div class="p">It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> other than those defined in this specification are supported.</div><div class="p">For each <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> facet, the following information <span class="rfc2119">must</span> be provided:<ol class="enumla"><li><div class="p">What properties the facet has, viewed as a schema component.</div><div class="note"><div class="p"><b>Note:</b> For most <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> facets, the structural pattern used for most <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> defined in this specification is expected to be satisfactory, but other structures <span class="rfc2119">may</span> be specified.</div></div></li><li><div class="p">Whether the facet is a <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a>, <a href="#dt-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical<span class="arrow">&#183;</span></a>, or <a href="#dt-value-based" class="termref" shape="rect"><span class="arrow">&#183;</span>value-based<span class="arrow">&#183;</span></a> facet.</div></li><li><div class="p">Whether restriction of the facet takes the form of replacing a less restrictive facet value with a more restrictive value (as in the <a href="#dt-minInclusive" class="termref" shape="rect"><span class="arrow">&#183;</span>minInclusive<span class="arrow">&#183;</span></a> and most other <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> defined in this specification) or of adding new values to a set of facet values (as for the <a href="#dt-pattern" class="termref" shape="rect"><span class="arrow">&#183;</span>pattern<span class="arrow">&#183;</span></a> facet). In the former case, the information provided <span class="rfc2119">must</span> also specify how to determine which of two given values is more restrictive (and thus can be used to restrict the other).</div><div class="p">When an <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> facet is used in <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a>, the new value <span class="rfc2119">must</span> be at least as restrictive as the existing value, if any.</div><div class="note"><div class="p"><b>Note:</b> The effect of the preceding paragraph is to ensure that a type derived by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> using an <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> facet does not allow, or appear to allow, values not present in the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>.</div></div></li><li><div class="p">What <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes the new <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facet<span class="arrow">&#183;</span></a> applies to, and what it means when applied to them.</div><div class="p">For a <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facet, how to compute the result of applying the facet value to any given <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a>.</div><div class="p">For a <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facet, the order in which it is applied to <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a>, relative to other <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facets. </div><div class="p">For a <a href="#dt-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical<span class="arrow">&#183;</span></a> facet, how to tell whether any given <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> is facet-valid with respect to it.</div><div class="p">For a <a href="#dt-value-based" class="termref" shape="rect"><span class="arrow">&#183;</span>value-based<span class="arrow">&#183;</span></a> facet, how to tell whether any given value in the relevant <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes is facet-valid with respect to it.</div><div class="note"><div class="p"><b>Note:</b> The host language <span class="rfc2119">may</span> choose to specify that <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> are applicable to <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes; this information is necessary to make the <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> facet usable in such host languages. </div></div></li><li><div class="p">What URI reference (more precisely, what <a href="#anyURI" shape="rect">anyURI</a> value) is to be used to refer to the facet, analogous to those provided for the datatypes defined here in section <a href="#built-in-datatypes" shape="rect">Built-in Datatypes and Their Definitions (&#167;3)</a>.</div></li><li><div class="p">What element is to be used in XSD schema documents to apply the facet in the course of <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a>. A schema document <span class="rfc2119">must</span> be provided with an element declaration for each <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> facet; the element declarations <span class="rfc2119">should</span> specify <code>xs:facet</code> as their substitution-group head.</div><div class="note"><div class="p"><b>Note:</b> The elements' <a href="https://www.w3.org/TR/2004/REC-xml-names11-20040204/#dt-expname" shape="rect">expanded names</a> are used by the condition-inclusion mechanism of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a> to allow schema authors to test whether a particular facet is supported and adjust the schema document's contents accordingly.</div></div></li></ol> </div><div class="p"><a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>Implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-pre-lexical" class="termref" shape="rect"><span class="arrow">&#183;</span>pre-lexical<span class="arrow">&#183;</span></a> facets <span class="rfc2119">must not</span>, when applied to <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> which have been whitespace-normalized by the <a href="#f-w" class="compref" shape="rect">whiteSpace</a> facet, produce <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> which are no longer whitespace-normalized. </div></li><li><div class="p">It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation of this specification supports other versions of the Unicode database <a href="#UnicodeDB" shape="rect">[Unicode Database]</a> in addition to the version cited normatively in the normative references (<a href="#normative-biblio" shape="rect">Normative (&#167;K.1)</a>). If an implementation supports additional versions of the Unicode database, it is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> which character properties and which block name definitions are used in a given validity assessment. </div><div class="p">It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation is capable, <a href="#dt-useroption" class="termref" shape="rect"><span class="arrow">&#183;</span>at user option<span class="arrow">&#183;</span></a>, of treating unrecognized block names as errors in a schema.</div><div class="p">It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether an implementation is capable, <a href="#dt-useroption" class="termref" shape="rect"><span class="arrow">&#183;</span>at user option<span class="arrow">&#183;</span></a>, of treating unrecognized category escapes as denoting the empty set instead of the set of all characters.</div></li></ol><div class="note"><div class="p"><b>Note:</b> It follows from the above that each <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype and each <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> constraining facet has an <a href="https://www.w3.org/TR/2004/REC-xml-names11-20040204/#dt-expname" shape="rect">expanded name</a>. These <a href="https://www.w3.org/TR/2004/REC-xml-names11-20040204/#dt-expname" shape="rect">expanded names</a> are used by the condition-inclusion mechanism of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a> to allow schema authors to test whether a particular datatype or facet is supported and adjust the schema document's contents accordingly. </div></div></div><div class="div2"> <h3><span class="nav"><a href="#impl-def" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="impl-dep" id="impl-dep" shape="rect"></a>H.2 Implementation-dependent features</h3><p>The following features in this specification are <a href="#key-impl-dep" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-dependent<span class="arrow">&#183;</span></a>. Software which claims to conform to this specification (or to the specification of any host language which embeds <em>XSD 1.1: Datatypes</em>) <span class="rfc2119">may</span> describe how these choices have been exercised, in documentation which accompanies any conformance claim. </p><ol class="enumar"><li><div class="p">When multiple errors are encountered in type definitions or elsewhere, it is <a href="#key-impl-dep" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-dependent<span class="arrow">&#183;</span></a> how many of the errors are reported (as long as at least one error is reported), and which, what form the report of errors takes, and how much detail is included.</div></li></ol></div></div><div class="div1"> <h2><a name="changes" id="changes" shape="rect"></a>I Changes since version 1.0</h2><div class="div2"> <h3><span class="nav"> <a href="#sec-chnum" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="sec-chdtfacets" id="sec-chdtfacets" shape="rect"></a>I.1 Datatypes and Facets</h3><p>In order to align this specification with those being prepared by the XSL and XML Query Working Groups, a new datatype named <a href="#anyAtomicType" shape="rect">anyAtomicType</a> has been introduced; it serves as the base type definition for all <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatypes.</p><p>The treatment of datatypes has been made more precise and explicit; most of these changes affect the section on <a href="#typesystem" shape="rect">Datatype System (&#167;2)</a>. Definitions have been revised thoroughly and technical terms are used more consistently.</p><p>The (numeric) equality of values is now distinguished from the identity of the values themselves; this allows <a href="#float" shape="rect">float</a> and <a href="#double" shape="rect">double</a> to treat positive and negative zero as distinct values, but nevertheless to treat them as equal for purposes of bounds checking. This allows a better alignment with the expectations of users working with IEEE floating-point binary numbers.</p><p>The <a href="#ff-b-value" class="propref" shape="rect">{value}</a> of the <a href="#ff-b" class="compref" shape="rect">bounded</a> component for <b><i>list</i></b> datatypes is now always <b><i>false</i></b>, reflecting the fact that no ordering is prescribed for <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatypes, and so they cannot be bounded using the facets defined by this specification.</p><p>Units of length have been specified for all datatypes that are permitted the length constraining facet.</p><p>The use of the namespace <code>http://www.w3.org/2001/XMLSchema-datatypes</code> has been deprecated. The definition of a namespace separate from the main namespace defined by this specification proved not to be necessary or helpful in facilitating the use, by other specifications, of the datatypes defined here, and its use raises a number of difficult unsolved practical questions. </p><p> An <a href="#f-a" class="compref" shape="rect">assertions</a> facet has been added, to allow schema authors to associated assertions with simple type definitions, analogous to those allowed by <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a> for complex type definitions. </p><p>The discussion of whitespace handling in <a href="#rf-whiteSpace" shape="rect">whiteSpace (&#167;4.3.6)</a> makes clearer that when the value is <b>collapse</b>, <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> consisting solely of whitespace characters are reduced to the empty string; the earlier formulation has been misunderstood by some implementors.</p><p> Conforming implementations <span class="rfc2119">may</span> now support <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes and facets in addition to those defined here. </p></div><div class="div2"> <h3><span class="nav"><a href="#sec-chdtfacets" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#sec-chdt" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="sec-chnum" id="sec-chnum" shape="rect"></a>I.2 Numerical Datatypes</h3><p>As noted above, positive and negative zero, <a href="#float" shape="rect">float</a> and <a href="#double" shape="rect">double</a> are now treated as distinct but arithmetically equal values.</p><p>The description of the lexical spaces of <a href="#unsignedLong" shape="rect">unsignedLong</a>, <a href="#unsignedInt" shape="rect">unsignedInt</a>, <a href="#unsignedShort" shape="rect">unsignedShort</a>, and <a href="#unsignedByte" shape="rect">unsignedByte</a> has been revised to agree with the schema for schemas by allowing for the possibility of a leading sign.</p><p>The <a href="#float" shape="rect">float</a> and <a href="#double" shape="rect">double</a> datatypes now follow IEEE 754 implementation practice more closely; in particular, negative and positive zero are now distinct values, although arithmetically equal. Conversely, NaN is identical but not arithmetically equal to itself.</p><p> The character sequence '<code>+INF</code>' has been added to the lexical spaces of <a href="#float" shape="rect">float</a> and <a href="#double" shape="rect">double</a>. </p></div><div class="div2"> <h3><span class="nav"><a href="#sec-chnum" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> <a href="#sec-chother" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="sec-chdt" id="sec-chdt" shape="rect"></a>I.3 Date/time Datatypes</h3><p>The treatment of <a href="#dateTime" shape="rect">dateTime</a> and related datatypes has been changed to provide a more explicit account of the value space in terms of seven numeric properties. The most important substantive change is that values now explicitly retain information about the time zone offset indicated in the lexical form; this allows better alignment with the treatment of such values in <a href="#F_O" shape="rect">[XQuery 1.0 and XPath 2.0 Functions and Operators]</a>.</p><p>At the suggestion of the <a href="https://www.w3.org/2007/OWL/wiki/OWL_Working_Group" shape="rect">W3C OWL Working Group</a>, a <a href="#f-tz" class="compref" shape="rect">explicitTimezone</a> facet has been added to allow date/time datatypes to be restricted by requiring or forbidding an explicit time zone offset from UTC, instead of making it optional. The <a href="#dateTimeStamp" shape="rect">dateTimeStamp</a> datatype has been defined using this facet.</p><p>The treatment of the date/time datatype includes a carefully revised definition of order that ensures that for repeating datatypes (<a href="#time" shape="rect">time</a>, <a href="#gDay" shape="rect">gDay</a>, 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 the local midnight and end just before local midnight.&#160; Days do not run from 00:00:00Z to 24:00:00Z in timezones other than Z. </p><p>The lexical representation '<code>0000</code>' for years is recognized and maps to the year 1 BCE; '<code>-0001</code>' maps to 2 BCE, etc. This is a change from version 1.0 of this specification, in order to align with established practice (the so-called "astronomical year numbering") and <a href="#ISO8601" shape="rect">[ISO 8601]</a>.</p><p> Algorithms for arithmetic involving <a href="#dateTime" shape="rect">dateTime</a> and <a href="#duration" shape="rect">duration</a> values have been provided, and corrections made to the <a href="#vp-dt-timeOnTimeline" shape="rect"><i><span class="arrow">&#183;</span>timeOnTimeline<span class="arrow">&#183;</span></i></a> function. </p><p>The treatment of leap seconds is no longer <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a>: the date/time types described here do not include leap-second values. </p><p> At the suggestion of the <a href="https://www.w3.org/International/core/" shape="rect">W3C Internationalization Core Working Group</a>, most references to "time zone" have been replaced with references to "time zone offset"; this resolves issue <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=4642" shape="rect">4642 Terminology: zone offset versus time zone</a>. </p><p> A number of syntactic and semantic errors in some of the regular expressions given to describe the lexical spaces of the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes (most notably the date/time datatypes) have been corrected. </p><p>The lexical mapping for times of the form '<code>24:00:00</code>' (with or without a trailing decimal point and zeroes) has been specified explicitly.</p></div><div class="div2"> <h3><span class="nav"><a href="#sec-chdt" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="sec-chother" id="sec-chother" shape="rect"></a>I.4 Other changes</h3><p>Support has been added for <a href="#XML" shape="rect">[XML]</a> version 1.1 and <a href="#XMLNS" shape="rect">[Namespaces in XML]</a> version 1.1. The datatypes which depend on <a href="#XML" shape="rect">[XML]</a> and <a href="#XMLNS" shape="rect">[Namespaces in XML]</a> may now be used with the definitions provided by the 1.1 versions of those specifications, as well as with the definitions in the 1.0 versions. It is <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> whether software conforming to this specification supports the definitions given in version 1.0, or in version 1.1, of <a href="#XML" shape="rect">[XML]</a> and <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>.</p><p>To reduce confusion and avert a widespread misunderstanding, the normative references to various W3C specifications now state explicitly that while the reference describes the particular edition of a specification current at the time this specification is published, conforming implementations of this specification are not required to ignore later editions of the other specification but instead <span class="rfc2119">may</span> support later editions, thus allowing users of this specification to benefit from corrections to other specifications on which this one depends. </p><p> The reference to the Unicode Database <a href="#UnicodeDB" shape="rect">[Unicode Database]</a> has been updated from version 4.1.0 to version 5.1.0, at the suggestion of the <a href="https://www.w3.org/International/core/" shape="rect">W3C Internationalization Core Working Group</a> </p><p> References to various other specifications have also been updated. </p><p>The account of the value space of <a href="#duration" shape="rect">duration</a> has been changed to specify that values consist only of two numbers (the number of months and the number of seconds) rather than six (years, months, days, hours, minutes, seconds). This allows clearly equivalent durations like P2Y and P24M to have the same value.</p><p>Two new totally ordered restrictions of <a href="#duration" shape="rect">duration</a> have been defined: <a href="#yearMonthDuration" shape="rect">yearMonthDuration</a>, defined in <a href="#yearMonthDuration" shape="rect">yearMonthDuration (&#167;3.4.26)</a>, and <a href="#dayTimeDuration" shape="rect">dayTimeDuration</a>, defined in <a href="#dayTimeDuration" shape="rect">dayTimeDuration (&#167;3.4.27)</a>. This allows better alignment with the treatment of durations in <a href="#F_O" shape="rect">[XQuery 1.0 and XPath 2.0 Functions and Operators]</a>.</p><p>The XML representations of the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> and <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> built-in datatypes have been moved out of the schema document for schema documents in <a href="#schema" shape="rect">Schema for Schema Documents (Datatypes) (normative) (&#167;A)</a> and into a different appendix (<a href="#prim.nxsd" shape="rect">Illustrative XML representations for the built-in simple type definitions (&#167;C)</a>).</p><p>Numerous minor corrections have been made in response to comments on earlier working drafts.</p><p>The treatment of topics handled both in this specification and in <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a> has been revised to align the two specifications more closely.</p><p>Several references to other specifications have been updated to refer to current versions of those specifications, including <a href="#XML" shape="rect">[XML]</a>, <a href="#XMLNS" shape="rect">[Namespaces in XML]</a>, <a href="#RFC3986" shape="rect">[RFC 3986]</a>, <a href="#RFC3987" shape="rect">[RFC 3987]</a>, and <a href="#RFC3548" shape="rect">[RFC 3548]</a>. </p><p>Requirements for the datatype-validity of values of type <a href="#language" shape="rect">language</a> have been clarified.</p><p>Explicit definitions have been provided for the lexical and <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mappings<span class="arrow">&#183;</span></a> of most of the primitive datatypes. </p><p>Schema Component Constraint <a href="#enumeration-required-notation" shape="rect">enumeration facet value required for NOTATION (&#167;3.3.19)</a>, which restricts the use of <a href="#NOTATION" shape="rect">NOTATION</a> to validate <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> without first enumerating a set of values, has been clarified. </p><p>Some errors in the definition of regular-expression metacharacters have been corrected.</p><p>The descriptions of the <a href="#f-p" class="compref" shape="rect">pattern</a> and <a href="#f-e" class="compref" shape="rect">enumeration</a> facets have been revised to make clearer how values from different derivation steps are combined.</p><p>A warning against using the whitespace facet for tokenizing natural-language data has been added on the request of the W3C Internationalization Working Group.</p><p>In order to correct an error in version 1 of this specification and of <a href="#structural-schemas" shape="rect">[XSD 1.1 Part 1: Structures]</a>, <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>unions<span class="arrow">&#183;</span></a> are no longer forbidden to be members of other <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>unions<span class="arrow">&#183;</span></a>. Descriptions of <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> types have also been changed to reflect the fact that <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>unions<span class="arrow">&#183;</span></a> can be derived by restricting other <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>unions<span class="arrow">&#183;</span></a>. The concepts of <a href="#dt-transitivemembership" class="termref" shape="rect"><span class="arrow">&#183;</span>transitive membership<span class="arrow">&#183;</span></a> (the members of all members, recursively) and <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic member<span class="arrow">&#183;</span></a> (those datatypes in the transitive membership which are not <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>unions<span class="arrow">&#183;</span></a>) have been introduced and are used. </p><p> The requirements of conformance have been clarified in various ways. A distinction is now made between <a href="#key-impl-def" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-defined<span class="arrow">&#183;</span></a> and <a href="#key-impl-dep" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-dependent<span class="arrow">&#183;</span></a> features, and a list of such features is provided in <a href="#idef-idep" shape="rect">Implementation-defined and implementation-dependent features (normative) (&#167;H)</a>. Requirements imposed on host languages which use or incorporate the datatypes defined by this specification are defined.</p><p>The definitions of <span class="rfc2119">must</span>, <span class="rfc2119">must not</span>, and <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a> have been changed to specify that processors <span class="rfc2119">must</span> detect and report errors in schemas and schema documents (although the quality and level of detail in the error report is not constrained).</p><p> The lexical mapping of the <a href="#QName" shape="rect">QName</a> datatype, in particular its dependence on the namespace bindings in scope at the place where the <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> appears, has been clarified. </p><p> The characterization of <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> has been revised to say more clearly when they are functions and when they are not, and when (in the <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> datatypes) there are values in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> not mapped to by any members of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>. </p><p>The nature of equality and identity of lists has been clarified.</p><p> Enumerations, identity constraints, and value constraints now treat both identical values and equal values as being the same for purposes of validation. This affects primitive datatypes in which identity and equality are not the same. Positive and negative zero, for example, are not treated as different for purposes of keys, keyrefs, or uniqueness constraints, and an enumeration which includes either zero will accept either zero. </p><p> The mutual relations of lists and unions have been clarified, in particular the restrictions on what kinds of datatypes <span class="rfc2119">may</span> appear as the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> of a list or among the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of a union. </p><p> Unions with no member types (and thus with empty <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>) are now explicitly allowed. </p><p> Cycles in the definitions of <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>unions<span class="arrow">&#183;</span></a> and in the derivation of simple types are now explicitly forbidden. </p><p> A number of minor errors and obscurities have been fixed. </p></div></div><div class="div1"> <h2><a name="normative-glossary" id="normative-glossary" shape="rect"></a>J Glossary (non-normative)</h2><p>The listing below is for the benefit of readers of a printed version of this document: it collects together all the definitions which appear in the document above.</p><dl><dt><a href="#dt-cos" shape="rect">Constraint on Schemas</a></dt> <dd><div class="giDef"><div class="p"> Constraints on the schema components themselves, i.e. conditions components <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> satisfy to be components at all. Largely to be found in <a href="#datatype-components" shape="rect">Datatype components (&#167;4)</a>. </div></div></dd> <dt><a href="#dt-src" shape="rect">Schema Representation Constraint</a></dt> <dd><div class="giDef"><div class="p"> Constraints on the representation of schema components in XML.&#160; Some but not all of these are expressed in <a href="#schema" shape="rect">Schema for Schema Documents (Datatypes) (normative) (&#167;A)</a> and <a href="#dtd-for-datatypeDefs" shape="rect">DTD for Datatype Definitions (non-normative) (&#167;B)</a>. </div></div></dd> <dt><a href="#dt-utc" shape="rect">UTC</a></dt> <dd><b>Universal Coordinated Time</b> (<b>UTC</b>) is an adaptation of TAI which closely approximates UT1 by adding <a href="#dt-leapsec" class="termref" shape="rect"><span class="arrow">&#183;</span>leap-seconds<span class="arrow">&#183;</span></a> to selected <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a> days.</dd> <dt><a href="#dt-cvc" shape="rect">Validation Rule</a></dt> <dd><div class="giDef"><div class="p"> Constraints expressed by schema components which information items <a href="#dt-must" class="termref" shape="rect"><span class="rfc2119">must</span></a> satisfy to be schema-valid.&#160; Largely to be found in <a href="#datatype-components" shape="rect">Datatype components (&#167;4)</a>. </div></div></dd> <dt><a href="#dt-xdmrep" shape="rect">XDM representation</a></dt> <dd>For any value <var>V</var> and any datatype <var>T</var>, the <b>XDM representation of <var>V</var> under <var>T</var></b> is defined recursively as follows. Call the XDM representation <var>X</var>. Then<div class="constraintlist"><div class="clnumber">1 <span class="p">If <var>T</var> = <a href="#dt-anySimpleType" class="termref" shape="rect"><span class="arrow">&#183;</span><code>xs:anySimpleType</code><span class="arrow">&#183;</span></a> or <a href="#dt-anyAtomicType" class="termref" shape="rect"><span class="arrow">&#183;</span><code>xs:anyAtomicType</code><span class="arrow">&#183;</span></a> then <var>X</var> is <var>V</var>, and the <a href="https://www.w3.org/TR/xpath20/#dt-dynamic-type" shape="rect">dynamic type</a> of <var>X</var> is <code>xs:untypedAtomic</code>. </span></div> <div class="clnumber">2 <span class="p">If <var>T</var> . <a href="#std-variety" class="propref" shape="rect">{variety}</a> = <b><i>atomic</i></b>, then let <var>T2</var> be the <a href="#dt-optype" class="termref" shape="rect"><span class="arrow">&#183;</span>nearest built-in datatype<span class="arrow">&#183;</span></a> to <var>T</var>. If <var>V</var> is a member of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <var>T2</var>, then <var>X</var> is <var>V</var> and the <a href="https://www.w3.org/TR/xpath20/#dt-dynamic-type" shape="rect">dynamic type</a> of <var>X</var> is <var>T2</var>. Otherwise (i.e. if <var>V</var> is not a member of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of <var>T2</var>), <var>X</var> is the <a href="#dt-xdmrep" class="termref" shape="rect"><span class="arrow">&#183;</span>XDM representation<span class="arrow">&#183;</span></a> of <var>V</var> under <var>T2</var> . <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>. </span></div> <div class="clnumber">3 <span class="p">If <var>T</var> . <a href="#std-variety" class="propref" shape="rect">{variety}</a> = <b><i>list</i></b>, then <var>X</var> is a sequence of atomic values, each atomic value being the <a href="#dt-xdmrep" class="termref" shape="rect"><span class="arrow">&#183;</span>XDM representation<span class="arrow">&#183;</span></a> of the corresponding item in the list <var>V</var> under <var>T</var> . <a href="#std-item_type_definition" class="propref" shape="rect">{item type definition}</a>. </span></div> <div class="clnumber">4 <span class="p">If <var>T</var> . <a href="#std-variety" class="propref" shape="rect">{variety}</a> = <b><i>union</i></b>, then <var>X</var> is the <a href="#dt-xdmrep" class="termref" shape="rect"><span class="arrow">&#183;</span>XDM representation<span class="arrow">&#183;</span></a> of <var>V</var> under the <a href="#dt-active-basic-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active basic member<span class="arrow">&#183;</span></a> of <var>V</var> when validated against <var>T</var>. If there is no <a href="#dt-active-basic-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active basic member<span class="arrow">&#183;</span></a>, then <var>V</var> has no <a href="#dt-xdmrep" class="termref" shape="rect"><span class="arrow">&#183;</span>XDM representation<span class="arrow">&#183;</span></a> under <var>T</var>.</span></div> </div> </dd> <dt><a href="#key-null" shape="rect">absent</a></dt> <dd>Throughout this specification, the value <b><b><i>absent</i></b></b> is used as a distinguished value to indicate that a given instance of a property "has no value" or "is absent".</dd> <dt><a href="#dt-active-basic-member" shape="rect">active basic member</a></dt> <dd>If the <a href="#dt-active-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active member type<span class="arrow">&#183;</span></a> is itself a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, one of <em>its</em> members will be <em>its</em> <a href="#dt-active-member" class="termref" shape="rect"><span class="arrow">&#183;</span>active member type<span class="arrow">&#183;</span></a>, and so on, until finally a <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic (non-union) member<span class="arrow">&#183;</span></a> is reached. That <a href="#dt-basicmember" class="termref" shape="rect"><span class="arrow">&#183;</span>basic member<span class="arrow">&#183;</span></a> is the <b>active basic member</b> of the union.</dd> <dt><a href="#dt-active-member" shape="rect">active member type</a></dt> <dd>In a valid instance of any <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, the first of its members in order which accepts the instance as valid is the <b>active member type</b>.</dd> <dt><a href="#std-ancestor" shape="rect">ancestor</a></dt> <dd>The <b>ancestors</b> of a <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html#td" shape="rect">type definition</a> are its <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a> and the <a href="#std-ancestor" class="termref" shape="rect"><span class="arrow">&#183;</span>ancestors<span class="arrow">&#183;</span></a> of its <a href="#std-base_type_definition" class="propref" shape="rect">{base type definition}</a>.</dd> <dt><a href="#dt-anyAtomicType" shape="rect">anyAtomicType</a></dt> <dd> <b>anyAtomicType</b> is a special <a href="#dt-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restriction<span class="arrow">&#183;</span></a> of <a href="#anySimpleType" shape="rect">anySimpleType</a>. The <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a> of <b>anyAtomicType</b> are the unions of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value<span class="arrow">&#183;</span></a> and <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a> of all the <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes, and <b>anyAtomicType</b> is their <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. </dd> <dt><a href="#dt-anySimpleType" shape="rect">anySimpleType</a></dt> <dd> The definition of <b>anySimpleType</b> is a special <a href="#dt-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restriction<span class="arrow">&#183;</span></a> of <b><i>anyType</i></b>.&#160; The <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of <b>anySimpleType</b> is the set of all sequences of Unicode characters, and its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> includes all <a href="#dt-atomic-value" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic values<span class="arrow">&#183;</span></a> and all finite-length lists of zero or more <a href="#dt-atomic-value" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic values<span class="arrow">&#183;</span></a>.</dd> <dt><a href="#dt-atomic" shape="rect">atomic</a></dt> <dd><b>Atomic</b> datatypes are those whose <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a> contain only <a href="#dt-atomic-value" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic values<span class="arrow">&#183;</span></a>.&#160; <b>Atomic</b> datatypes are <a href="#anyAtomicType" shape="rect">anyAtomicType</a> and all datatypes <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derived<span class="arrow">&#183;</span></a> from it.</dd> <dt><a href="#dt-atomic-value" shape="rect">atomic value</a></dt> <dd>An <b>atomic value</b> is an elementary value, not constructed from simpler values by any user-accessible means defined by this specification.</dd> <dt><a href="#dt-basetype" shape="rect">base type</a></dt> <dd>Every datatype other than <a href="#anySimpleType" shape="rect">anySimpleType</a> is associated with another datatype, its <b>base type</b>. <b>Base types</b> can be <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a>, <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, or <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a>. </dd> <dt><a href="#dt-basicmember" shape="rect">basic member</a></dt> <dd>Those members of the <a href="#dt-transitivemembership" class="termref" shape="rect"><span class="arrow">&#183;</span>transitive membership<span class="arrow">&#183;</span></a> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype <var>U</var> which are themselves not <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatypes are the <b>basic members</b> of <var>U</var>.</dd> <dt><a href="#dt-built-in" shape="rect">built-in</a></dt> <dd><b>Built-in</b> datatypes are those which are defined in this specification; they can be <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a>, <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a>, or <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes . </dd> <dt><a href="#dt-canonical-mapping" shape="rect">canonical mapping</a></dt> <dd>The <b>canonical mapping</b> is a prescribed subset of the inverse of a <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> which is one-to-one and whose domain (where possible) is the entire range of the <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a> (the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>).</dd> <dt><a href="#dt-canonical-representation" shape="rect">canonical representation</a></dt> <dd>The <b>canonical representation</b> of a value in the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of a datatype is the <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> associated with that value by the datatype's <a href="#dt-canonical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>canonical mapping<span class="arrow">&#183;</span></a></dd> <dt><a href="#dt-ccsub" shape="rect">character class subtraction</a></dt> <dd>A <a href="#dt-chargroup" class="termref" shape="rect"><span class="arrow">&#183;</span>character group<span class="arrow">&#183;</span></a> that contains a subtraction operator is referred to as a <b>character class subtraction</b>.</dd> <dt><a href="#dt-cgpart" shape="rect">character group part</a></dt> <dd>A <b>character group part</b> (<a href="#nt-charGroupPart" shape="rect"><i>charGroupPart</i></a>) is any of: a single unescaped character (<a href="#nt-SingleCharNoEsc" shape="rect"><i>SingleCharNoEsc</i></a>), a single escaped character (<a href="#nt-SingleCharEsc" shape="rect"><i>SingleCharEsc</i></a>), a character class escape (<a href="#nt-charClassEsc" shape="rect"><i>charClassEsc</i></a>), or a character range (<a href="#nt-charRange" shape="rect"><i>charRange</i></a>).</dd> <dt><a href="#dt-constraining-facet" shape="rect">constraining facet</a></dt> <dd><b>Constraining facets</b> are schema components whose values may be set or changed during <a href="#dt-derived" class="termref" shape="rect"><span class="arrow">&#183;</span>derivation<span class="arrow">&#183;</span></a> (subject to facet-specific controls) to control various aspects of the derived datatype.</dd> <dt><a href="#dt-constructed" shape="rect">constructed</a></dt> <dd>All <a href="#dt-ordinary" class="termref" shape="rect"><span class="arrow">&#183;</span>ordinary<span class="arrow">&#183;</span></a> datatypes are defined in terms of, or <b>constructed</b> from, other datatypes, either by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>restricting<span class="arrow">&#183;</span></a> the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> or <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of a <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> using zero or more <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> or by specifying the new datatype as a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> of items of some <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a>, or by defining it as a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> of some specified sequence of <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a>.</dd> <dt><a href="#dt-datatype" shape="rect">datatype</a></dt> <dd>In this specification, a <b>datatype</b> has three properties: <ul><li><div class="p">A <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, which is a set of values. </div></li><li><div class="p">A <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a>, which is a set of <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literals<span class="arrow">&#183;</span></a> used to denote the values.</div></li><li><div class="p">A small collection of <em>functions, relations, and procedures</em> associated with the datatype.&#160; Included are equality and (for some datatypes) order relations on the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, and a <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mapping<span class="arrow">&#183;</span></a>, which is a mapping from the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> into the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.</div></li></ul> </dd> <dt><a href="#dt-immediately-derived" shape="rect">derived</a></dt> <dd>A datatype <var>T</var> is <b>immediately derived</b> from another datatype <var>X</var> if and only if <var>X</var> is the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <var>T</var>.</dd> <dt><a href="#dt-derived" shape="rect">derived</a></dt> <dd>A datatype <var>R</var> is <b>derived</b> from another datatype <var>B</var> if and only if one of the following is true: <ul><li><div class="p"><var>B</var> is the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <var>R</var>. </div></li><li><div class="p">There is some datatype <var>X</var> such that <var>X</var> is the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a> of <var>R</var>, and <var>X</var> is derived from <var>B</var>.</div></li></ul> </dd> <dt><a href="#dt-div" shape="rect">div</a></dt> <dd>If <var>m</var> and <var>n</var> are numbers, then <var>m</var>&#160;<b>div</b> <var>n</var> is the greatest integer less than or equal to <var>m</var>&#160;/&#160;<var>n</var>&#160;.</dd> <dt><a href="#dt-error" shape="rect">error</a></dt> <dd><div class="giDef"><div class="p">A failure of a schema or schema document to conform to the rules of this specification.</div><div class="p"> Except as otherwise specified, processors <span class="rfc2119">must</span> distinguish error-free (conforming) schemas and schema documents from those with errors; if a schema used in type-validation or a schema document used in constructing a schema is in error, processors <span class="rfc2119">must</span> report the fact; if more than one is in error, it is <a href="#key-impl-dep" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-dependent<span class="arrow">&#183;</span></a> 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 <a href="#key-impl-dep" class="termref" shape="rect"><span class="arrow">&#183;</span>implementation-dependent<span class="arrow">&#183;</span></a> how many of the violations, and which, are reported. </div><div class="note"><div class="p"><b>Note:</b> 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. </div></div></div></dd> <dt><a href="#dt-fb-restriction" shape="rect">facet-based restriction</a></dt> <dd>A datatype is defined by <b>facet-based restriction</b> of another datatype (its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>), when values for zero or more <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facets<span class="arrow">&#183;</span></a> are specified that serve to constrain its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> and/or its <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> to a subset of those of the <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>.</dd> <dt><a href="#dt-compatibility" shape="rect">for compatibility</a></dt> <dd><div class="giDef"><div class="p"> A feature of this specification included solely to ensure that schemas which use this feature remain compatible with <a href="#XML" shape="rect">[XML]</a>. </div></div></dd> <dt><a href="#dt-fundamental-facet" shape="rect">fundamental facet</a></dt> <dd> Each <b>fundamental facet</b> is a schema component that provides a limited piece of information about some aspect of each datatype.</dd> <dt><a href="#key-impl-def" shape="rect">implementation-defined</a></dt> <dd>Something which <span class="rfc2119">may</span> vary among conforming implementations, but which <span class="rfc2119">must</span> be specified by the implementor for each particular implementation, is <b>implementation-defined</b>.</dd> <dt><a href="#key-impl-dep" shape="rect">implementation-dependent</a></dt> <dd>Something which <span class="rfc2119">may</span> vary among conforming implementations, is not specified by this or any W3C specification, and is not required to be specified by the implementor for any particular implementation, is <b>implementation-dependent</b>.</dd> <dt><a href="#dt-incomparable" shape="rect">incomparable</a></dt> <dd>Two values that are neither equal, less-than, nor greater-than are <b>incomparable</b>. Two values that are not <a href="#dt-incomparable" class="termref" shape="rect"><span class="arrow">&#183;</span>incomparable<span class="arrow">&#183;</span></a> are <b>comparable</b>.</dd> <dt><a href="#dt-interveningunion" shape="rect">intervening union</a></dt> <dd>If a datatype <var>M</var> is in the <a href="#dt-transitivemembership" class="termref" shape="rect"><span class="arrow">&#183;</span>transitive membership<span class="arrow">&#183;</span></a> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype <var>U</var>, but not one of <var>U</var>'s <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a>, then a sequence of one or more <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatypes necessarily exists, such that the first is one of the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of <var>U</var>, each is one of the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of its predecessor in the sequence, and <var>M</var> is one of the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of the last in the sequence. The <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatypes in this sequence are said to <b>intervene</b> 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 <b>intervening unions</b>. When <var>M</var> is one of the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of <var>U</var>, the set of <b>intervening unions</b> is the empty set. </dd> <dt><a href="#dt-itemType" shape="rect">item type</a></dt> <dd> The <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> or <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype that participates in the definition of a <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype is the <b>item type</b> of that <a href="#dt-list" class="termref" shape="rect"><span class="arrow">&#183;</span>list<span class="arrow">&#183;</span></a> datatype.</dd> <dt><a href="#dt-leapsec" shape="rect">leap-second</a></dt> <dd>A <b>leap-second</b> is an additional second added to the last day of December, June, October, or March, when such an adjustment is deemed necessary by the International Earth Rotation and Reference Systems Service in order to keep <a href="#dt-utc" class="termref" shape="rect"><span class="arrow">&#183;</span>UTC<span class="arrow">&#183;</span></a> within 0.9 seconds of observed astronomical time.&#160; When leap seconds are introduced, the last minute in the day has more than sixty seconds.&#160; In theory leap seconds can also be removed from a day, but this has not yet occurred. (See <a href="#IERS" shape="rect">[International Earth Rotation Service (IERS)]</a>, <a href="#itu-r-460-6" shape="rect">[ITU-R TF.460-6]</a>.) Leap seconds are <em>not</em> supported by the types defined here.</dd> <dt><a href="#dt-lexical" shape="rect">lexical</a></dt> <dd>A constraining facet which directly restricts the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of a datatype is a <b>lexical</b> facet.</dd> <dt><a href="#dt-lexical-mapping" shape="rect">lexical mapping</a></dt> <dd>The <b>lexical mapping</b> for a datatype is a prescribed relation which maps from the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of the datatype into its <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>.</dd> <dt><a href="#dt-lexical-representation" shape="rect">lexical representation</a></dt> <dd>The members of the <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> are <b>lexical representations</b> of the values to which they are mapped.</dd> <dt><a href="#dt-lexical-space" shape="rect">lexical space</a></dt> <dd>The <b>lexical space</b> of a datatype is the prescribed set of strings which <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>the lexical mapping<span class="arrow">&#183;</span></a> for that datatype maps to values of that datatype.</dd> <dt><a href="#dt-list" shape="rect">list</a></dt> <dd><b>List</b> datatypes are those having values each of which consists of a finite-length (possibly empty) sequence of <a href="#dt-atomic-value" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic values<span class="arrow">&#183;</span></a>. The values in a list are drawn from some <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatype (or from a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> of <a href="#dt-atomic" class="termref" shape="rect"><span class="arrow">&#183;</span>atomic<span class="arrow">&#183;</span></a> datatypes), which is the <a href="#dt-itemType" class="termref" shape="rect"><span class="arrow">&#183;</span>item type<span class="arrow">&#183;</span></a> of the <b>list</b>. </dd> <dt><a href="#dt-literal" shape="rect">literal</a></dt> <dd>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 <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> of a given datatype and thus a <a href="#dt-lexical-representation" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical representation<span class="arrow">&#183;</span></a> of a given value in that datatype's <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, is referred to as a <b>literal</b>.</dd> <dt><a href="#dt-match" shape="rect">match</a></dt> <dd><div class="giDef"><div class="p"> <em>(Of strings or names:)</em> 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. </div><div class="p"><em>(Of strings and rules in the grammar:)</em> A string matches a grammatical production if and only if it belongs to the language generated by that production. </div></div></dd> <dt><a href="#dt-may" shape="rect">may</a></dt> <dd><div class="giDef"><div class="p"> Schemas, schema documents, and processors are permitted to but need not behave as described. </div></div></dd> <dt><a href="#dt-memberTypes" shape="rect">member types</a></dt> <dd> The datatypes that participate in the definition of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype are known as the <b>member types</b> of that <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> datatype.</dd> <dt><a href="#dt-minimally-conforming" shape="rect">minimally conforming</a></dt> <dd>Implementations claiming <b>minimal conformance</b> to this specification independent of any host language <span class="rfc2119">must</span> do <b>all</b> of the following:<div class="constraintlist"><div class="clnumber">1<a id="gl-support-all-primitives" name="gl-support-all-primitives" shape="rect"> </a><span class="p">Support all the <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatypes defined in this specification.</span></div> <div class="clnumber">2<a id="gl-implement-all-cos" name="gl-implement-all-cos" shape="rect"> </a><span class="p">Completely and correctly implement all of the <a href="#dt-cos" class="termref" shape="rect"><span class="arrow">&#183;</span>constraints on schemas<span class="arrow">&#183;</span></a> defined in this specification.</span></div> <div class="clnumber">3<a id="gl-implement-all-vr" name="gl-implement-all-vr" shape="rect"> </a><span class="p">Completely and correctly implement all of the <a href="#dt-cvc" class="termref" shape="rect"><span class="arrow">&#183;</span>Validation Rules<span class="arrow">&#183;</span></a> defined in this specification, when checking the datatype validity of literals against datatypes.</span></div> </div> </dd> <dt><a href="#dt-mod" shape="rect">mod</a></dt> <dd>If <var>m</var> and <var>n</var> are numbers, then <var>m</var> <b>mod</b> <var>n</var> is&#160; <var>m</var>&#160;&#8722;&#160;<var>n</var>&#160;&#215;&#160;(&#160;<var>m</var>&#160;<a href="#dt-div" class="termref" shape="rect"><span class="arrow">&#183;</span>div<span class="arrow">&#183;</span></a>&#160;<var>n</var>)&#160;.</dd> <dt><a href="#dt-must" shape="rect">must</a></dt> <dd><div class="giDef"><div class="p"> <em>(Of schemas and schema documents:)</em> Schemas and documents are required to behave as described; otherwise they are in <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a>. </div><div class="p"><em>(Of processors:)</em> Processors are required to behave as described. </div></div></dd> <dt><a href="#dt-mustnot" shape="rect">must not</a></dt> <dd><div class="giDef"><div class="p">Schemas, schema documents and processors are forbidden to behave as described; schemas and documents which nevertheless do so are in <a href="#dt-error" class="termref" shape="rect"><span class="arrow">&#183;</span>error<span class="arrow">&#183;</span></a>.</div></div></dd> <dt><a href="#dt-optype" shape="rect">nearest built-in datatype</a></dt> <dd>For any datatype <var>T</var>, the <b>nearest built-in datatype</b> to <var>T</var> is the first <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype encountered in following the chain of links connecting each datatype to its <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>. If <var>T</var> is a <a href="#dt-built-in" class="termref" shape="rect"><span class="arrow">&#183;</span>built-in<span class="arrow">&#183;</span></a> datatype, then the nearest built-in datatype of <var>T</var> is <var>T</var> itself; otherwise, it is the nearest built-in datatype of <var>T</var>'s <a href="#dt-basetype" class="termref" shape="rect"><span class="arrow">&#183;</span>base type<span class="arrow">&#183;</span></a>.</dd> <dt><a href="#dt-normalized-block-name" shape="rect">normalized block name</a></dt> <dd> For any Unicode block, the <b>normalized block name</b> of that block is the string of characters formed by stripping out white space and underbar characters from the block name as given in <a href="#UnicodeDB" shape="rect">[Unicode Database]</a>, while retaining hyphens and preserving case distinctions.</dd> <dt><a href="#dt-optional" shape="rect">optional</a></dt> <dd>An <b>optional</b> property is <em>permitted</em> but not <em>required</em> to have the distinguished value <b><i>absent</i></b>.</dd> <dt><a href="#dt-ordered" shape="rect">ordered</a></dt> <dd>A <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a>, and hence a datatype, is said to be <b>ordered</b> if some members of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> are drawn from a <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatype for which the table in <a href="#app-fundamental-facets" shape="rect">Fundamental Facets (&#167;F.1)</a> specifies the value <b><i>total</i></b> or <b><i>partial</i></b> for the <em>ordered</em> facet.</dd> <dt><a href="#dt-ordinary" shape="rect">ordinary</a></dt> <dd><b>Ordinary</b> datatypes are all datatypes other than the <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> and <a href="#dt-primitive" class="termref" shape="rect"><span class="arrow">&#183;</span>primitive<span class="arrow">&#183;</span></a> datatypes.</dd> <dt><a href="#dt-owner" shape="rect">owner</a></dt> <dd>A component may be referred to as the <b>owner</b> of its properties, and of the values of those properties.</dd> <dt><a href="#dt-pre-lexical" shape="rect">pre-lexical</a></dt> <dd>A constraining facet which is used to normalize an initial <a href="#dt-literal" class="termref" shape="rect"><span class="arrow">&#183;</span>literal<span class="arrow">&#183;</span></a> before checking to see whether the resulting character sequence is a member of a datatype's <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical space<span class="arrow">&#183;</span></a> is a <b>pre-lexical</b> facet.</dd> <dt><a href="#dt-primitive" shape="rect">primitive</a></dt> <dd><b>Primitive</b> datatypes are those datatypes that are not <a href="#dt-special" class="termref" shape="rect"><span class="arrow">&#183;</span>special<span class="arrow">&#183;</span></a> and are not defined in terms of other datatypes; they exist <em>ab initio</em>.</dd> <dt><a href="#dt-regex" shape="rect">regular expression</a></dt> <dd>A <b>regular expression</b> is composed from zero or more <a href="#dt-branch" class="termref" shape="rect"><span class="arrow">&#183;</span>branches<span class="arrow">&#183;</span></a>, separated by '<code>|</code>' characters.</dd> <dt><a href="#dt-restriction" shape="rect">restriction</a></dt> <dd>A datatype <var>R</var> is a <b>restriction</b> of another datatype <var>B</var> when</dd> <dt><a href="#dt-should" shape="rect">should</a></dt> <dd><div class="giDef"><div class="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.</div></div></dd> <dt><a href="#dt-special" shape="rect">special</a></dt> <dd>The <b>special</b> datatypes are <a href="#anySimpleType" shape="rect">anySimpleType</a> and <a href="#anyAtomicType" shape="rect">anyAtomicType</a>.</dd> <dt><a href="#dt-specialvalue" shape="rect">special value</a></dt> <dd>A <b>special value</b> is an object whose only relevant properties for purposes of this specification are that it is distinct from, and unequal to, any other values (special or otherwise).</dd> <dt><a href="#dt-transitivemembership" shape="rect">transitive membership</a></dt> <dd>The <b>transitive membership</b> of a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a> is the set of its own <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a>, and the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of its members, and so on. More formally, if <var>U</var> is a <a href="#dt-union" class="termref" shape="rect"><span class="arrow">&#183;</span>union<span class="arrow">&#183;</span></a>, then (a) its <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> 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 <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of <var>T1</var>, then <var>T2</var> is also in the transitive membership of <var>U</var>.</dd> <dt><a href="#dt-union" shape="rect">union</a></dt> <dd><b>Union</b> datatypes are (a) those whose <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a>, and <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> are the union of the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value spaces<span class="arrow">&#183;</span></a>, <a href="#dt-lexical-space" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical spaces<span class="arrow">&#183;</span></a>, and <a href="#dt-lexical-mapping" class="termref" shape="rect"><span class="arrow">&#183;</span>lexical mappings<span class="arrow">&#183;</span></a> of one or more other datatypes, which are the <a href="#dt-memberTypes" class="termref" shape="rect"><span class="arrow">&#183;</span>member types<span class="arrow">&#183;</span></a> of the union, or (b) those derived by <a href="#dt-fb-restriction" class="termref" shape="rect"><span class="arrow">&#183;</span>facet-based restriction<span class="arrow">&#183;</span></a> of another union datatype. </dd> <dt><a href="#dt-unknown-dt" shape="rect">unknown</a></dt> <dd>A datatype which is not available for use is said to be <b>unknown</b>.</dd> <dt><a href="#dt-unknown-f" shape="rect">unknown</a></dt> <dd>An <a href="#dt-constraining-facet" class="termref" shape="rect"><span class="arrow">&#183;</span>constraining facet<span class="arrow">&#183;</span></a> which is not supported by the processor in use is <b>unknown</b>.</dd> <dt><a href="#dt-useroption" shape="rect">user option</a></dt> <dd><div class="giDef"><div class="p">A choice left under the control of the user of a processor, rather than being fixed for all users or uses of the processor. </div><div class="p">Statements in this specification that "Processors <span class="rfc2119">may</span> at user option" behave in a certain way mean that processors <span class="rfc2119">may</span> provide mechanisms to allow users (i.e. invokers of the processor) to enable or disable the behavior indicated. Processors which do not provide such user-operable controls <span class="rfc2119">must not</span> behave in the way indicated. Processors which do provide such user-operable controls <span class="rfc2119">must</span> make it possible for the user to disable the optional behavior. </div><div class="note"><div class="p"><b>Note:</b> The normal expectation is that the default setting for such options will be to disable the optional behavior in question, enabling it only when the user explicitly requests it. This is not, however, a requirement of conformance: if the processor's documentation makes clear that the user can disable the optional behavior, then invoking the processor without requesting that it be disabled can be taken as equivalent to a request that it be enabled. It is required, however, that it in fact be possible for the user to disable the optional behavior. </div></div><div class="note"><div class="p"><b>Note:</b> Nothing in this specification constrains the manner in which processors allow users to control user options. Command-line options, menu choices in a graphical user interface, environment variables, alternative call patterns in an application programming interface, and other mechanisms may all be taken as providing user options. </div></div></div></dd> <dt><a href="#dt-user-defined" shape="rect">user-defined</a></dt> <dd> <b>User-defined</b> datatypes are those datatypes that are defined by individual schema designers. </dd> <dt><a href="#dt-value-space" shape="rect">value space</a></dt> <dd>The <b>value space</b> <em>of a datatype</em> is the set of values for that datatype.</dd> <dt><a href="#dt-value-based" shape="rect">value-based</a></dt> <dd>A constraining facet which directly restricts the <a href="#dt-value-space" class="termref" shape="rect"><span class="arrow">&#183;</span>value space<span class="arrow">&#183;</span></a> of a datatype is a <b>value-based</b> facet.</dd> <dt><a href="#dt-wcchar" shape="rect">wildcard character</a></dt> <dd> The <b>wildcard character</b> is a metacharacter which matches almost any single character:</dd> </dl></div><div class="div1"> <h2><a name="biblio" id="biblio" shape="rect"></a>K References</h2><div class="div2"> <h3><span class="nav"> <a href="#non-normative-biblio" class="nav" shape="rect"><img alt="next sub-section" src="next.jpg" /></a></span><a name="normative-biblio" id="normative-biblio" shape="rect"></a>K.1 Normative</h3><dl><dt class="label"><a name="ieee754-2008" id="ieee754-2008" shape="rect"></a>IEEE 754-2008</dt><dd> IEEE. <em>IEEE Standard for Floating-Point Arithmetic</em>. 29 August 2008. <a href="http://ieeexplore.ieee.org/servlet/opac?punumber=4610933" shape="rect">http://ieeexplore.ieee.org/servlet/opac?punumber=4610933</a> </dd><dt class="label"><a name="XMLNS" id="XMLNS" shape="rect"></a>Namespaces in XML</dt><dd> World Wide Web Consortium.&#160; <em>Namespaces in XML 1.1 (Second Edition)</em>, ed. Tim Bray et al. W3C Recommendation 16 August 2006. Available at: <a href="https://www.w3.org/TR/xml-names11/" shape="rect">http://www.w3.org/TR/xml-names11/</a> <span class="annotation"> The edition cited is the one current at the date of publication of this specification. Implementations <span class="rfc2119">may</span> follow the edition cited and/or any later edition(s); it is implementation-defined which. For details of the dependency of this specification on Namespaces in XML 1.1, see <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </span></dd><dt class="label"><a name="XMLNS1.0" id="XMLNS1.0" shape="rect"></a>Namespaces in XML 1.0</dt><dd> World Wide Web Consortium.&#160; <em>Namespaces in XML 1.0 (Third Edition)</em>, ed. Tim Bray et al. W3C Recommendation 8 December 2009. Available at: <a href="https://www.w3.org/TR/xml-names/" shape="rect">http://www.w3.org/TR/xml-names/</a> <span class="annotation"> The edition cited is the one current at the date of publication of this specification. Implementations <span class="rfc2119">may</span> follow the edition cited and/or any later edition(s); it is implementation-defined which. For details of the dependency of this specification on Namespaces in XML 1.0, see <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </span></dd><dt class="label"><a name="RFC3548" id="RFC3548" shape="rect"></a>RFC 3548</dt><dd> S. Josefsson, ed. <em>RFC 3548: The Base16, Base32, and Base64 Data Encodings</em>. July 2003.&#160; Available at: <a href="http://www.ietf.org/rfc/rfc3548.txt" shape="rect"> http://www.ietf.org/rfc/rfc3548.txt</a> </dd><dt class="label"><a name="UnicodeDB" id="UnicodeDB" shape="rect"></a>Unicode Database</dt><dd> The Unicode Consortium. <em>Unicode Character Database</em>. Revision 3.1.0, ed. Mark Davis and Ken Whistler. 2001-02-28. Available at: <a href="http://www.unicode.org/Public/3.1-Update/UnicodeCharacterDatabase-3.1.0.html" shape="rect"> http://www.unicode.org/Public/3.1-Update/UnicodeCharacterDatabase-3.1.0.html</a>. For later versions, see <a href="http://www.unicode.org/versions/" shape="rect">http://www.unicode.org/versions/</a>. The edition cited is the one current at the date of publication of XSD 1.0. Implementations <span class="rfc2119">may</span> follow the edition cited and/or any later edition(s); it is implementation-defined which. </dd><dt class="label"><a name="XDM" id="XDM" shape="rect"></a>XDM</dt><dd> World Wide Web Consortium. <em>XQuery 1.0 and XPath 2.0 Data Model (XDM) (Second Edition)</em>, ed. Mary Fern&#225;ndez et al. W3C Recommendation 14 December 2010. Available at: <a href="https://www.w3.org/TR/xpath-datamodel/" shape="rect">http://www.w3.org/TR/xpath-datamodel/</a>. </dd><dt class="label"><a name="XML" id="XML" shape="rect"></a>XML</dt><dd> World Wide Web Consortium. <em>Extensible Markup Language (XML) 1.1 (Second Edition)</em>, ed. Tim Bray et al. W3C Recommendation 16 August 2006, edited in place 29 September 2006. Available at <a href="https://www.w3.org/TR/xml11/" shape="rect">http://www.w3.org/TR/xml11/</a> <span class="annotation"> The edition cited is the one current at the date of publication of this specification. Implementations <span class="rfc2119">may</span> follow the edition cited and/or any later edition(s); it is implementation-defined which. For details of the dependency of this specification on XML 1.1, see <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </span></dd><dt class="label"><a name="XML1.0" id="XML1.0" shape="rect"></a>XML 1.0</dt><dd> World Wide Web Consortium. <em>Extensible Markup Language (XML) 1.0 (Fifth Edition)</em>, ed. Tim Bray et al. W3C Recommendation 26 November 2008. Available at <a href="https://www.w3.org/TR/xml/" shape="rect">http://www.w3.org/TR/xml/</a>. <span class="annotation"> The edition cited is the one current at the date of publication of this specification. Implementations <span class="rfc2119">may</span> follow the edition cited and/or any later edition(s); it is implementation-defined which. For details of the dependency of this specification on XML, see <a href="#intro-relatedWork" shape="rect">Dependencies on Other Specifications (&#167;1.3)</a>. </span> </dd><dt class="label"><a name="XPATH2" id="XPATH2" shape="rect"></a>XPath 2.0</dt><dd> World Wide Web Consortium. <em>XML Path Language (XPath) 2.0 (Second Edition)</em>, ed. Anders Berglund et al. W3C Recommendation 14 December 2010 <em>(Link errors corrected 3 January 2011)</em>. Available at: <a href="https://www.w3.org/TR/xpath20/" shape="rect">http://www.w3.org/TR/xpath20/</a>. </dd><dt class="label"><a name="F_O" id="F_O" shape="rect"></a>XQuery 1.0 and XPath 2.0 Functions and Operators</dt><dd> World Wide Web Consortium. <em>XQuery 1.0 and XPath 2.0 Functions and Operators (Second Edition)</em>, ed. Ashok Malhotra et al. W3C Recommendation 14 December 2010. Available at: <a href="https://www.w3.org/TR/xpath-functions/" shape="rect">http://www.w3.org/TR/xpath-functions/</a>. </dd><dt class="label"><a name="structural-schemas" id="structural-schemas" shape="rect"></a>XSD 1.1 Part 1: Structures</dt><dd> World Wide Web Consortium. <em>W3C XML Schema Definition Language (XSD) 1.1 Part 1: Structures</em>, ed. Shudi (Sandy) Gao &#39640;&#27530;&#38237;, C. M. Sperberg-McQueen, and Henry S. Thompson. W3C Recommendation 5 April 2012. Available at: <a href="https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html" shape="rect">http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/structures.html</a> <span class="annotation"> The edition cited is the one current at the date of publication of this specification. Implementations <span class="rfc2119">may</span> follow the edition cited and/or any later edition(s); it is implementation-defined which. </span> </dd></dl></div><div class="div2"> <h3><span class="nav"><a href="#normative-biblio" class="nav" shape="rect"><img alt="previous sub-section" src="previous.jpg" /></a> </span><a name="non-normative-biblio" id="non-normative-biblio" shape="rect"></a>K.2 Non-normative</h3><dl><dt class="label"><a name="BCP47" id="BCP47" shape="rect"></a>BCP 47</dt><dd> Internet Engineering Task Force (IETF). Best Current Practices 47. 2006. Available at: <a href="http://tools.ietf.org/rfc/bcp/bcp47" shape="rect">http://tools.ietf.org/rfc/bcp/bcp47</a>. Concatenation of <em>RFC 4646: Tags for Identifying Languages</em>, ed. A. Phillips and M. Davis, September 2006, <a href="http://www.ietf.org/rfc/bcp/bcp47.txt" shape="rect">http://www.ietf.org/rfc/bcp/bcp47.txt</a>, and <em>RFC 4647: Matching of Language Tags</em>, ed. A Phillips and M. Davis, September 2006, <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt" shape="rect">http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>. </dd><dt class="label"><a name="clinger1990" id="clinger1990" shape="rect"></a>Clinger, WD (1990)</dt><dd> William D Clinger. <em>How to Read Floating Point Numbers Accurately.</em> In <em>Proceedings of Conference on Programming Language Design and Implementation</em>, pages 92-101. Available at: <a href="ftp://ftp.ccs.neu.edu/pub/people/will/howtoread.ps" shape="rect"> ftp://ftp.ccs.neu.edu/pub/people/will/howtoread.ps</a> </dd><dt class="label"><a name="html4" id="html4" shape="rect"></a>HTML 4.01</dt><dd> World Wide Web Consortium.&#160; <em>HTML 4.01 Specification</em>, ed. Dave Raggett, Arnaud Le Hors, and Ian Jacobs. W3C Recommendation 24 December 1999. Available at: <a href="https://www.w3.org/TR/html401/" shape="rect">http://www.w3.org/TR/html401/</a> </dd><dt class="label"><a name="ISO11404" id="ISO11404" shape="rect"></a>ISO 11404</dt><dd> ISO (International Organization for Standardization). <em>Language-independent Datatypes.</em> ISO/IEC 11404:2007. See <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=39479" shape="rect">http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=39479</a> </dd><dt class="label"><a name="ISO8601" id="ISO8601" shape="rect"></a>ISO 8601</dt><dd> ISO (International Organization for Standardization). <em>Representations of dates and times, 1988-06-15.</em> </dd><dt class="label"><a name="ISO8601-2000" id="ISO8601-2000" shape="rect"></a>ISO 8601:2000 Second Edition</dt><dd> ISO (International Organization for Standardization). <em>Representations of dates and times, second edition, 2000-12-15.</em> </dd><dt class="label"><a name="itu-r-460-6" id="itu-r-460-6" shape="rect"></a>ITU-R TF.460-6</dt><dd> International Telecommunication Union (ITU). <em>Recommendation ITU-R TF.460-6: Standard-frequency and time-signal emissions</em>. [Geneva: ITU, February 2002.]</dd><dt class="label"><a name="IERS" id="IERS" shape="rect"></a>International Earth Rotation Service (IERS)</dt><dd> International Earth Rotation Service (IERS). See <a href="http://maia.usno.navy.mil" shape="rect">http://maia.usno.navy.mil</a> </dd><dt class="label"><a name="LEIRIs" id="LEIRIs" shape="rect"></a>LEIRI</dt><dd> <em>Legacy extended IRIs for XML resource identification</em>, ed. Henry S. Thompson, Richard Tobin, and Norman Walsh. W3C Working Group Note 3 November 2008 (BNF comment style corrected in place 2009-07-09). See <a href="https://www.w3.org/TR/leiri/" shape="rect">http://www.w3.org/TR/leiri/</a></dd><dt class="label"><a name="Perl" id="Perl" shape="rect"></a>Perl</dt><dd> The Perl Programming Language.&#160; See <a href="http://www.perl.org/get.html" shape="rect"> http://www.perl.org/get.html</a> </dd><dt class="label"><a name="pd-note" id="pd-note" shape="rect"></a>Precision Decimal</dt><dd> World Wide Web Consortium. <em>An XSD datatype for IEEE floating-point decimal</em>, ed. David Peterson and C. M. Sperberg-McQueen. W3C Working Group Note 9 June 2011. Available at <a href="https://www.w3.org/TR/xsd-precisionDecimal/" shape="rect">http://www.w3.org/TR/xsd-precisionDecimal/</a> </dd><dt class="label"><a name="RDFSchema" id="RDFSchema" shape="rect"></a>RDF Schema</dt><dd> World Wide Web Consortium. <em>RDF Vocabulary Description Language 1.0: RDF Schema</em>, ed. Dan Brickley and R. V. Guha. W3C Recommendation 10 February 2004. Available at: <a href="https://www.w3.org/TR/rdf-schema/" shape="rect">http://www.w3.org/TR/rdf-schema/</a> </dd><dt class="label"><a name="RFC2045" id="RFC2045" shape="rect"></a>RFC 2045</dt><dd> N. Freed and N. Borenstein. <em>RFC 2045: Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</em>. 1996.&#160; Available at: <a href="http://www.ietf.org/rfc/rfc2045.txt" shape="rect"> http://www.ietf.org/rfc/rfc2045.txt</a> </dd><dt class="label"><a name="RFC3066" id="RFC3066" shape="rect"></a>RFC 3066</dt><dd> H. Alvestrand, ed. <em>RFC 3066: Tags for the Identification of Languages</em> 1995. Available at: <a href="http://www.ietf.org/rfc/rfc3066.txt" shape="rect"> http://www.ietf.org/rfc/rfc3066.txt</a> </dd><dt class="label"><a name="RFC3986" id="RFC3986" shape="rect"></a>RFC 3986</dt><dd> T. Berners-Lee, R. Fielding, and L. Masinter, <em>RFC 3986: Uniform Resource Identifier (URI): Generic Syntax</em>. January 2005.&#160; Available at: <a href="http://www.ietf.org/rfc/rfc3986.txt" shape="rect"> http://www.ietf.org/rfc/rfc3986.txt</a> </dd><dt class="label"><a name="RFC3987" id="RFC3987" shape="rect"></a>RFC 3987</dt><dd> M. Duerst and M. Suignard. <em>RFC 3987: Internationalized Resource Identifiers (IRIs) </em>. January 2005.&#160; Available at: <a href="http://www.ietf.org/rfc/rfc3987.txt" shape="rect"> http://www.ietf.org/rfc/rfc3987.txt</a> </dd><dt class="label"><a name="RFC4646" id="RFC4646" shape="rect"></a>RFC 4646</dt><dd> A. Phillips and M. Davis, ed. <em>RFC 4646: Tags for Identifying Languages</em> 2006. Available at: <a href="http://www.ietf.org/rfc/rfc4646.txt" shape="rect"> http://www.ietf.org/rfc/rfc4646.txt</a> </dd><dt class="label"><a name="RFC4647" id="RFC4647" shape="rect"></a>RFC 4647</dt><dd> A. Phillips and M. Davis, ed. <em>RFC 4647: Matching of Language Tags</em> 2006. Available at: <a href="http://www.ietf.org/rfc/rfc4647.txt" shape="rect"> http://www.ietf.org/rfc/rfc4647.txt</a> </dd><dt class="label"><a name="ruby" id="ruby" shape="rect"></a>Ruby</dt><dd> World Wide Web Consortium. <em>Ruby Annotation</em>, ed. Marcin Sawicki et al. W3C Recommendation 31 May 2001 (Markup errors corrected 25 June 2008). Available at: <a href="https://www.w3.org/TR/ruby/" shape="rect">http://www.w3.org/TR/ruby/</a> </dd><dt class="label"><a name="SQL" id="SQL" shape="rect"></a>SQL</dt><dd> ISO (International Organization for Standardization).&#160; <em>ISO/IEC 9075-2:1999, Information technology --- Database languages --- SQL --- Part 2: Foundation (SQL/Foundation)</em>. [Geneva]: International Organization for Standardization, 1999. See <a href="http://www.iso.org/iso/home.htm" shape="rect"> http://www.iso.org/iso/home.htm</a> </dd><dt class="label"><a name="ref-timezones" id="ref-timezones" shape="rect"></a>Timezones</dt><dd> World Wide Web Consortium. <em>Working with Time Zones</em>, ed. Addison Phillips et al. W3C Working Group Note 5 July 2011. Available at <a href="https://www.w3.org/TR/timezone/" shape="rect">http://www.w3.org/TR/timezone/</a> </dd><dt class="label"><a name="USNavy" id="USNavy" shape="rect"></a>U.S. Naval Observatory Time Service Department</dt><dd> <em>Information about Leap Seconds</em> Available at: <a href="http://tycho.usno.navy.mil/leapsec.html" shape="rect">http://tycho.usno.navy.mil/leapsec.html</a> </dd><dt class="label"><a name="USNavy_leaps" id="USNavy_leaps" shape="rect"></a>USNO Historical List</dt><dd> U.S. Naval Observatory Time Service Department, <em>Historical list of leap seconds</em> Available at: <a href="ftp://maia.usno.navy.mil/ser7/tai-utc.dat" shape="rect">ftp://maia.usno.navy.mil/ser7/tai-utc.dat</a> </dd><dt class="label"><a name="unicodeRegEx" id="unicodeRegEx" shape="rect"></a>Unicode Regular Expression Guidelines</dt><dd> Mark Davis.&#160; <em>Unicode Regular Expression Guidelines</em>, 1988. Available at: <a href="http://www.unicode.org/reports/tr18/" shape="rect"> http://www.unicode.org/unicode/reports/tr18/</a> </dd><dt class="label"><a name="unicode-escapes" id="unicode-escapes" shape="rect"></a>Unicode block names</dt><dd> World Wide Web Consortium. <em>Unicode block names for use in XSD regular expressions</em>, ed. C. M. Sperberg-McQueen. W3C Working Group Note 9 June 2011. Available at: <a href="https://www.w3.org/TR/xsd-unicode-blocknames/" shape="rect">http://www.w3.org/TR/xsd-unicode-blocknames/</a> </dd><dt class="label"><a name="schema-primer" id="schema-primer" shape="rect"></a>XML Schema Language: Part 0 Primer</dt><dd> World Wide Web Consortium. XML Schema Language: Part 0 Primer Second Edition, ed. David C. Fallside and Priscilla Walmsley. W3C Recommendation 28 October 2004. Available at: <a href="https://www.w3.org/TR/xmlschema-0/" shape="rect"> http://www.w3.org/TR/xmlschema-0/</a> </dd><dt class="label"><a name="schema-requirements" id="schema-requirements" shape="rect"></a>XML Schema Requirements</dt><dd> <em>XML Schema Requirements </em>, ed. Ashok Malhotra and Murray Maloney. W3C Note 15 February 1999. Available at: <a href="https://www.w3.org/TR/NOTE-xml-schema-req" shape="rect">http://www.w3.org/TR/NOTE-xml-schema-req</a> </dd><dt class="label"><a name="XSL" id="XSL" shape="rect"></a>XSL</dt><dd> World Wide Web Consortium.&#160; <em>Extensible Stylesheet Language (XSL)</em>, ed. Anders Berglund. W3C Recommendation 05 December 2006. Available at:&#160; <a href="https://www.w3.org/TR/xsl11/" shape="rect">http://www.w3.org/TR/xsl11/</a> </dd></dl></div></div><div class="div1"> <h2><a name="acknowledgments" id="acknowledgments" shape="rect"></a>L Acknowledgements (non-normative)</h2><p>Along with the editors thereof, the following contributed material to the first version of this specification:</p><blockquote><p>Asir S. Vedamuthu, webMethods, Inc<br clear="none" />Mark Davis, IBM</p></blockquote><p>Co-editor Ashok Malhotra's work on this specification from March 1999 until February 2001 was supported by IBM, and from then until May 2004 by Microsoft.&#160; Since July 2004 his work on this specification has been supported by Oracle Corporation.</p><p>The work of Dave Peterson as a co-editor of this specification was supported by IDEAlliance (formerly GCA) through March 2004, and beginning in April 2004 by SGML<em>Works!</em>.</p><p>The work of C. M. Sperberg-McQueen as a co-editor of this specification was supported by the World Wide Web Consortium through January 2009 and again from June 2010 through May 2011, and beginning in February 2009 by Black Mesa Technologies LLC. </p><p>The XML Schema Working Group acknowledges with thanks the members of other W3C Working Groups and industry experts in other forums who have contributed directly or indirectly to the creation of this document and its predecessor.</p><p>At the time this document is published, the members in good standing of the XML Schema Working Group are:</p><ul><li>David Ezell, National Association of Convenience Stores (NACS) (<i>chair</i>) </li><li>Shudi (Sandy) Gao &#39640;&#27530;&#38237;, IBM</li><li>Mary Holstege, Mark Logic</li><li>Sam Idicula, Oracle Corporation</li><li>Michael Kay, Invited expert</li><li>Jim Melton, Oracle Corporation</li><li>Dave Peterson, Invited expert</li><li>Liam Quin, W3C (<i>staff contact</i>) </li><li>C. M. Sperberg-McQueen, invited expert</li><li>Henry S. Thompson, University of Edinburgh</li><li>Kongyi Zhou, Oracle Corporation</li></ul><p>The XML Schema Working Group has benefited in its work from the participation and contributions of a number of people who are no longer members of the Working Group in good standing at the time of publication of this Working Draft. Their names are given below. In particular we note with sadness the accidental death of Mario Jeckle shortly before publication of the first Working Draft of XML Schema 1.1. Affiliations given are (among) those current at the time of the individuals' work with the WG. </p><ul><li>Paula Angerstein, Vignette Corporation</li><li>Leonid Arbouzov, Sun Microsystems</li><li>Jim Barnette, Defense Information Systems Agency (DISA)</li><li>David Beech, Oracle Corp.</li><li>Gabe Beged-Dov, Rogue Wave Software</li><li>Laila Benhlima, Ecole Mohammadia d'Ingenieurs Rabat (EMI)</li><li>Doris Bernardini, Defense Information Systems Agency (DISA)</li><li>Paul V. Biron, HL7; later Invited expert</li><li>Don Box, DevelopMentor</li><li>Allen Brown, Microsoft</li><li>Lee Buck, TIBCO Extensibility</li><li>Greg Bumgardner, Rogue Wave Software</li><li>Dean Burson, Lotus Development Corporation</li><li>Charles E. Campbell, Invited expert</li><li>Oriol Carbo, University of Edinburgh</li><li>Wayne Carr, Intel</li><li>Peter Chen, Bootstrap Alliance and LSU</li><li>Tyng-Ruey Chuang, Academia Sinica</li><li>Tony Cincotta, NIST</li><li>David Cleary, Progress Software</li><li>Mike Cokus, MITRE</li><li>Dan Connolly, W3C (<i>staff contact</i>) </li><li>Ugo Corda, Xerox</li><li>Roger L. Costello, MITRE</li><li>Joey Coyle, Health Level Seven</li><li>Haavard Danielson, Progress Software</li><li>Josef Dietl, Mozquito Technologies</li><li>Kenneth Dolson, Defense Information Systems Agency (DISA)</li><li>Andrew Eisenberg, Progress Software</li><li>Rob Ellman, Calico Commerce</li><li>Tim Ewald, Developmentor</li><li>Alexander Falk, Altova GmbH</li><li>David Fallside, IBM</li><li>George Feinberg, Object Design</li><li>Dan Fox, Defense Logistics Information Service (DLIS)</li><li>Charles Frankston, Microsoft</li><li>Matthew Fuchs, Commerce One</li><li>Andrew Goodchild, Distributed Systems Technology Centre (DSTC Pty Ltd)</li><li>Xan Gregg, TIBCO Extensibility</li><li>Paul Grosso, Arbortext, Inc</li><li>Martin Gudgin, DevelopMentor</li><li>Ernesto Guerrieri, Inso</li><li>Dave Hollander, Hewlett-Packard Company (<i>co-chair</i>) </li><li>Nelson Hung, Corel</li><li>Jane Hunter, Distributed Systems Technology Centre (DSTC Pty Ltd)</li><li>Michael Hyman, Microsoft</li><li>Renato Iannella, Distributed Systems Technology Centre (DSTC Pty Ltd)</li><li>Mario Jeckle, DaimlerChrysler</li><li>Rick Jelliffe, Academia Sinica</li><li>Marcel Jemio, Data Interchange Standards Association</li><li>Simon Johnston, Rational Software</li><li>Kohsuke Kawaguchi, Sun Microsystems</li><li>Dianne Kennedy, Graphic Communications Association</li><li>Janet Koenig, Sun Microsystems</li><li>Setrag Khoshafian, Technology Deployment International (TDI)</li><li>Melanie Kudela, Uniform Code Council</li><li>Ara Kullukian, Technology Deployment International (TDI)</li><li>Andrew Layman, Microsoft</li><li>Dmitry Lenkov, Hewlett-Packard Company</li><li>Bob Lojek, Mozquito Technologies</li><li>John McCarthy, Lawrence Berkeley National Laboratory</li><li>Matthew MacKenzie, XML Global</li><li>Nan Ma, China Electronics Standardization Institute</li><li>Eve Maler, Sun Microsystems</li><li>Ashok Malhotra, IBM, Microsoft, Oracle</li><li>Murray Maloney, Muzmo Communication, acting for Commerce One</li><li>Paolo Marinelli, University of Bologna</li><li>Lisa Martin, IBM</li><li>Noah Mendelsohn, Lotus; IBM; invited expert</li><li>Adrian Michel, Commerce One</li><li>Alex Milowski, Invited expert</li><li>Don Mullen, TIBCO Extensibility</li><li>Murata Makoto, Xerox</li><li>Ravi Murthy, Oracle</li><li>Chris Olds, Wall Data</li><li>Frank Olken, Lawrence Berkeley National Laboratory</li><li>David Orchard, BEA Systems, Inc.</li><li>Paul Pedersen, Mark Logic Corporation</li><li>Shriram Revankar, Xerox</li><li>Mark Reinhold, Sun Microsystems</li><li>Jonathan Robie, Software AG</li><li>Cliff Schmidt, Microsoft</li><li>John C. Schneider, MITRE</li><li>Eric Sedlar, Oracle Corp.</li><li>Lew Shannon, NCR</li><li>Anli Shundi, TIBCO Extensibility</li><li>William Shea, Merrill Lynch</li><li>Jerry L. Smith, Defense Information Systems Agency (DISA)</li><li>John Stanton, Defense Information Systems Agency (DISA)</li><li>Tony Stewart, Rivcom</li><li>Bob Streich, Calico Commerce</li><li>William K. Stumbo, Xerox</li><li>Hoylen Sue, Distributed Systems Technology Centre (DSTC Pty Ltd)</li><li>Ralph Swick, W3C</li><li>John Tebbutt, NIST</li><li>Ross Thompson, Contivo</li><li>Matt Timmermans, Microstar</li><li>Jim Trezzo, Oracle Corp.</li><li>Steph Tryphonas, Microstar</li><li>Scott Tsao, The Boeing Company</li><li>Mark Tucker, Health Level Seven</li><li>Asir S. Vedamuthu, webMethods, Inc</li><li>Fabio Vitali, University of Bologna</li><li>Scott Vorthmann, TIBCO Extensibility</li><li>Priscilla Walmsley, XMLSolutions</li><li>Norm Walsh, Sun Microsystems</li><li>Cherry Washington, Defense Information Systems Agency (DISA)</li><li>Aki Yoshida, SAP AG</li><li>Stefano Zacchiroli, University of Bologna</li><li>Mohamed Zergaoui, Innovimax</li></ul></div></div><script type="application/javascript" src="https://www.w3.org/scripts/TR/fixup.js"></script></body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10