[This local archive copy is from the official and canonical URL, http://www.w3.org/TR/1999/WD-xmlschema-2-19991217/; please refer to the canonical source document if possible.]


W3C

XML Schema Part 2: Datatypes

W3C Working Draft 17 December 1999

This version:
http://www.w3.org/TR/1999/WD-xmlschema-2-19991217/
(in XML and HTML, with accompanying schema and DTD)
Latest version:
http://www.w3.org/TR/xmlschema-2/
Previous versions:
http://www.w3.org/TR/1999/WD-xmlschema-2-19991105/
http://www.w3.org/TR/1999/WD-xmlschema-2-19990924/
http://www.w3.org/1999/05/06-xmlschema-2/
Editors:
Paul V. Biron (Kaiser Permanente, for Health Level Seven) <Paul.V.Biron@kp.org>
Ashok Malhotra (IBM) <petsa@us.ibm.com>

Copyright ©1999 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.


Abstract

XML Schema: Datatypes is part 2 of a two-part draft of the specification for the XML Schema definition language. This document proposes facilities for defining datatypes to be used in XML Schemas and other XML specifications. The datatype language, which is itself represented in XML 1.0, provides a superset of the capabilities found in XML 1.0 document type definitions (DTDs) for specifying datatypes on elements and attributes.

Status of this document

This is a public working draft of XML Schema 1.0 for review by the public and by members of the World Wide Web Consortium.

It has been reviewed by the XML Schema Working Group, and the Working Group has agreed to its publication. The WG believes this draft to be `feature-complete': the functionality included here is substantially complete and is expected to be stable. We do not expect to add major new functionality, or to make major changes to the functionality described in this draft. Some sections of the draft (in particular those on conformance), and some aspects of the design (in particular details of the transfer syntax for schemas), on the other hand, are still rough and are expected to be revised.

The WG expects to spend January, 2000, working out details, clarifying points of uncertainty that arise in the review of this draft, cleaning up inconsistencies, reviewing the design of the concrete transfer syntax, and making editorial improvements.

Following that period of review and polishing, it is the WG's intent to issue a Last Call for Review by other W3C working groups sometime during February, 2000, and to submit this specification in March, 2000, for publication as a Candidate Recommendation. This schedule may vary, depending on the comments of the public and of other W3C working groups on this draft. Such comments are instrumental in the WG's deliberations, and we encourage readers to review the draft and send comments to www-xml-schema-comments@w3.org (archive).

Although the Working Group does not anticipate further substantial changes to the functionality described here, this is still a working draft, subject to change based on experience and on comment by the public and other W3C working groups. The present version should be implemented only by those interested in providing a check on its design or by those preparing for an implementation of the Candidate Recommendation. The Schema WG will not allow early implementation to constrain its ability to make changes to this specification prior to final release.

A list of current W3C working drafts can be found at http://www.w3.org/TR/. They may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress".

Ed. Note: Several "note types" are used throughout this draft:
issue [Issue (issue-name): ]
something on which the editors are seeking comment.
editorial note [Ed. Note: ]
something the editors wish to call to the attention of the reader. To be removed prior to the recommendation becoming final.
note [Note: ]
something the editors wish to call to the attention of the reader. To remain in the final recommendation.

Table of contents

1 Introduction
    1.1 Purpose
    1.2 Requirements
    1.3 Scope
    1.4 Terminology
2 Type System
    2.1 Datatype
    2.2 Value space
    2.3 Lexical space
    2.4 Datatype dichotomies
        2.4.1 Atomic vs. aggregate datatypes
        2.4.2 Primitive vs. generated datatypes
        2.4.3 Built-in vs. user-generated datatypes
    2.5 Facets
        2.5.1 Fundamental facets
        2.5.2 Constraining or Non-fundamental facets
3 Built-in datatypes
    3.1 Namespace considerations
    3.2 Primitive datatypes
        3.2.1 string
        3.2.2 boolean
        3.2.3 float
        3.2.4 double
        3.2.5 decimal
        3.2.6 timeInstant
        3.2.7 timeDuration
        3.2.8 recurringInstant
        3.2.9 binary
        3.2.10 uri
    3.3 Generated datatypes
        3.3.1 language
        3.3.2 NMTOKEN
        3.3.3 NMTOKENS
        3.3.4 Name
        3.3.5 QName
        3.3.6 NCName
        3.3.7 ID
        3.3.8 IDREF
        3.3.9 IDREFS
        3.3.10 ENTITY
        3.3.11 ENTITIES
        3.3.12 NOTATION
        3.3.13 integer
        3.3.14 non-negative-integer
        3.3.15 positive-integer
        3.3.16 non-positive-integer
        3.3.17 negative-integer
        3.3.18 date
        3.3.19 time
4 Defining Generated Datatypes
5 Conformance

Appendices

A Schema for Datatype Definitions (normative)
B DTD for Datatype Definitions (normative)
C Datatypes and Facets
    C.1 Fundamental Facets
    C.2 Constraining Facets
D ISO 8601 Date and Time Formats
    D.1 ISO 8601 Conventions
    D.2 Truncated Formats
    D.3 Deviations from ISO 8601 Formats
        D.3.1 Sign Allowed
        D.3.2 More Than 9999 Years
E Regular Expressions
F References
    F.1 Normative
    F.2 Non-normative
G Acknowledgments (non-normative)
H Open Issues
I Revisions from Previous Draft

1 Introduction

1.1 Purpose

The [XML 1.0 Recommendation] 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 documents and those transporting data in XML, often require a higher degree of type checking to ensure robustness in document understanding and data interchange.

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.

Data oriented Document oriented
<invoice>
   <orderDate>1999-01-21</orderDate>
   <shipDate>1999-01-25</shipDate>
   <billingAddress>
      <name>Ashok Malhotra</name>
      <street>123 IBM Ave.</street>
      <city>Hawthorne</city>
      <state>NY</state>
      <zip>10532-0000</zip>
   </billingAddress>
   <voice>555-1234</voice>
   <fax>555-4321</fax>
</invoice>
<memo importance="high"
      date="1999-03-23">
   <from>Paul V. Biron</from>
   <to>Ashok Malhotra</to>
   <subject>Latest draft</subject>
   <body>
      We need to discuss the latest
      draft <emph>immediately</emph>.
      Either email me at <email>
      mailto:paul.v.biron@kp.org</email>
      or call <phone>555-9876</phone>
   </body>
</memo>

The invoice contains several dates and telephone numbers, the postal abbreviation for a state (which comes from an enumerated list of sanctioned values), and a ZIP code (which takes a definable regular form). The memo contains many of the same types of information: a date, telephone number, email address and an "importance" value (from an enumerated list, such as "low", "medium" or "high"). Applications which process invoices and memos need to raise exceptions if something that was supposed to be a date or telephone number does not conform to the rules for valid dates or telephone numbers.

In both cases, validity constraints exist on the content of the instances that are not expressible in XML DTDs. The limited datatyping facilities in XML have prevented validating XML processors from supplying the rigorous type checking required in these situations. The result has been that individual applications writers have had to implement type checking in an ad hoc manner. This specification addresses the need of both document authors and applications writers for a robust, extensible datatype system for XML which could be incorporated into XML processors. As discussed below, these datatypes could be used in other XML-related standards as well.

1.2 Requirements

The [XML Schema Requirements] document spells out concrete requirements to be fulfilled by this specification, which state that the XML Schema Language must:

  1. provide for primitive data typing, including byte, date, integer, sequence, SQL & Java primitive data types, etc.;
  2. define a type system that is adequate for import/export from database systems (e.g., relational, object, OLAP);
  3. distinguish requirements relating to lexical data representation vs. those governing an underlying information set;
  4. 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).

1.3 Scope

This portion of the XML Schema Language discusses datatypes that can be used in a XML Schema. These datatypes can be specified for element content that would be specified as #PCDATA and attribute values of various types in a DTD. It is the intension 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 [XSL] and [RDF Schema].

For the most part, this specification discusses what are sometimes referred to as atomic datatypes in that they constrain the lexical representation of a single literal. In some cases, as for example in IDREFS (§3.3.9), ENTITIES (§3.3.11) and NMTOKENS (§3.3.3), the value may consist of a list or set of literals separated by spaces. This is an example of what is called an aggregate datatype. Future versions of this specification may contain a more general mechanism for aggregate (collection) datatypes such as sets, bags and records.

Ed. Note: The WG has voted to have a simple list aggregate construct. A list will be whitespace separated list of some atomic datatype. There was not time to incorporate that vote into this draft. This vote will affect the IDREFS (§3.3.9), ENTITIES (§3.3.11), and NMTOKENS (§3.3.3) types. The list generator will be available to all schema authors.

1.4 Terminology

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:

For compatibility
A feature of this specification included solely to ensure that schemas which use this feature remain compatible with [XML 1.0 Recommendation]

2 Type System

This section describes the conceptual framework behind the type system defined in this specification. The framework has been influenced by the [ISO 11404] standard on language-independent datatypes as well as the datatypes for [SQL] and for programming languages such as Java.

The datatypes discussed in this specification are computer representations of well known abstract concepts such as integer and date. It is not the place of this specification to define these abstract concepts; many other publications provide excellent definitions.

2.1 Datatype

[Definition:]  In this specification, a datatype is defined as a 3-tuple, consisting of a) a set of distinct values, called its value space, b) a set of lexical representations, called its lexical space, and c) a set of facets that characterize properties of the value space, individual values or lexical items.

2.2 Value space

[Definition:]  A value space is the set of permitted values for a given datatype.

The value space of a given datatype can be defined in one of the following ways:

value spaces have certain properties. For example, they always have the property of cardinality, some definition of equality and may be ordered by which individual values within the value space can be compared to one another.

2.3 Lexical space

In addition to its value space, each datatype also has a lexical space.

[Definition:]  A lexical space is a set of valid literals for a datatype. Each value in the datatype's value space is denoted by one or more literals in its lexical space.

For example, "100" and "1.0E2" are two different literals from the lexical space of float (§3.2.3) which both denote the same value. The type system defined in this specification provides a mechanism for schema designers to control the set of values and the corresponding set of acceptable literals of those values for a datatype.

2.4 Datatype dichotomies

It is useful to categorize the datatypes defined in this specification along various dimensions, forming a set of characterization dichotomies.

2.4.1 Atomic vs. aggregate datatypes

The first distinction to be made is that between atomic and aggregate datatypes.

  • [Definition:]  Atomic datatypes are those having values which are intrinsically indivisible.
  • [Definition:]  Aggregate datatypes are those having values which can be decomposed into two or more component values.

For example, a date that is represented as a single character string could be the value of an atomic date datatype; while another date represented as separate "month", "day" and "year" elements would be the value of an aggregate date datatype. Not surprisingly, the distinction is analogous to that between an XML element whose content model is #PCDATA and one with element content.

As discussed above, this specification focuses mainly on atomic datatypes. Later versions of this specification may address aggregate datatypes in more detail. Note that the legacy XML attribute types IDREFS (§3.3.9), ENTITIES (§3.3.11) and NMTOKENS (§3.3.3) are conceptually aggregate types (lists), although at present they are defined in this specification as atomic.

A datatype which is atomic in this specification need not be an "atomic" datatype in any programming language used to implement this specification.

2.4.2 Primitive vs. generated datatypes

Next, we distinquish between primitive and generated datatypes.

  • [Definition:]  Primitive datatypes are those that are not defined in terms of other datatypes; they exist ab initio.
  • [Definition:]  Generated datatypes are those that are defined in terms of other datatypes.

For example, a float (§3.2.3) is a well defined mathematical concept that cannot be defined in terms of other datatypes while a date (§3.3.18) is a special case of the more general datatype recurringInstant (§3.2.8).

The datatypes defined by this specification fall into both the primitive and generated categories. It is felt that a judiciously chosen set of primitive datatypes will serve the widest possible audience by providing a set of convenient datatypes that can be used as is, as well as providing a rich enough base from which the variety of datatypes needed by schema designers can be generated.

A datatype which is primitive in this specification need not be a "primitive" datatype in any programming language used to implement this specification. Likewise, a datatype which is generated in this specification need not be a "generated" datatype in any programming language used to implement this specification.

[Definition:]  Every generated datatype is defined in terms of an existing datatype, referred to as the basetype. basetypes may be either primitive or generated.

[Definition:]  If type a is the basetype of type b, then b is said to be a subtype of a. The value space of a subtype is a subset of the value space of the basetype.

In the example above, date (§3.3.18) is a subtype of the basetype recurringInstant (§3.2.8).

2.4.3 Built-in vs. user-generated datatypes

Conceptually there is no difference between the built-in generated datatypes included in this specification and the user-generated datatypes which will be created by individual schema designers. The built-in generated 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. Furthermore, including these generated datatypes in this specification serves to demonstrate the mechanics and utility of the datatype generation facilities of this specification.

A datatype which is built-in in this specification need not be a "built-in" datatype in any programming language used to implement this specification. Likewise, a datatype which is user-generated in this specification need not be a "user-generated" datatype in any programming language used to implement this specification.

2.5 Facets

[Definition:]  A facet is a single defining aspect of a concept or an object. Generally speaking, each facet characterizes a concept or object along independent aspects or dimensions.

The facets of a datatype serve to distinguish those aspects of one datatype which differ from other datatypes. Rather than being defined solely in terms of a prose description the datatypes in this specification are defined in terms of the synthesis of facet values which together determine the value space and properties of the datatype.

Facets are of two types: fundamental facets that define the datatype and non-fundamental or constraining facets that constrain the permitted values of a datatype.

2.5.1 Fundamental facets

Datatypes are characterized by properties of their value space. Each of these properties give rise to a facet that serves to characterize the datatype. These properties are discussed in this section.

2.5.1.1 Order

[Definition:]  A value space, and hence a datatype, is said to be ordered if there exists an order relation defined for that value space.

order relations have the following rules:

  • for every pair (a, b) from the value space, either a < b or b < a, or a = b;
  • for every triple (a, b, c) from the value space, if a < b and b < c, then a < c.

There may exist several possible order relations for a given value space. Additionally, there may exist multiple datatypes with the same value space. In such cases, each datatype will define a different order relation on the value space.

Ed. Note: Currently, no order relations are defined on the built-in datatypes provided by this specification; additionally, there is no means to specify an order relation on user-generated datatypes. This will be addressed in a future draft.
2.5.1.2 Bounds

[Definition:]   A value space is bounded above if there exists a unique value U in the value space such that, for all values v in the value space, vU. [Definition:]   The value U is said to be an upper bound of the value space.

[Definition:]  A value space is bounded below if there exists a unique value L in the space such that, for all values v in the value space, Lv. [Definition:]   The value L is then said to be a lower bound of the value space.

[Definition:]  A datatype is bounded if its value space has both an upper bound and a lower bound.

2.5.1.3 Cardinality

[Definition:]  Every value space has associated with it the concept of cardinality. Some value spaces are finite, some are countably infinite while still others are uncountably infinite. A datatype is said to have the cardinality of its value space.

It is sometimes useful to categorize value spaces (and hence, datatypes) as to their cardinality, there are three significant cases:

Every finite value space is necessarily exact. No computational datatype has a value space that is is uncountably infinite.

2.5.1.4 Exact and Approximate

The computational representation of a datatype may limit the degree to which values of the datatype can be distinguished.

[Definition:]   If every value in the value space of the conceptual datatype is distinguishable in the computational representation from every other value in the value space, then the datatype is said to be exact. [Definition:]   If a datatype is not exact then it is approximate.

Certain mathematical datatypes with very large or infinite value spaces have representations which are said to be approximate in that multiple values in the conceptual value space map to single values in the value space of the representation. In this specification, all approximate datatypes have computational models which specify, via parametric values, a degree of approximation, that is, they require a certain minimum set of values of the mathematical datatype to be distinguishable in the computational datatype. Further, each value in the conceptual value space must be capable of being represented in the representational value space within a certain distance i.e. the difference between the conceptual value and the representational value must not exceed some agreed upon value.

2.5.1.5 Numeric

[Definition:]  A datatype is said to be numeric if its values are conceptually quantities (in some mathematical number system). [Definition:]  A datatype whose values are not numeric is said to be non-numeric .

2.5.2 Constraining or Non-fundamental facets

[Definition:]  Constraining facets are optional properties that can be applied to a datatype to constrain its value space.

Constraining the value space consequently constrains the lexical space. Adding constraining facets to a basetype is used in Defining Generated Datatypes (§4).

In this section we define all constraining facets that are available for use when generating subtypes.

2.5.2.1 length

[Definition:]  length is the number of units of length, where units of length varies depending on the basetype. The value of length must be a positive-integer (§3.3.15).

For subtypes of string (§3.2.1), length is measured in units of characters. For subtypes of binary (§3.2.9), length is measured in bits.

Ed. Note: We need to ultimately reconcile the notion of string length with the resolution of the i18n issues around character, indexing, etc. I18N recommends that length and maxlength be a "character count" and do not indicate storage requirements.
2.5.2.2 minlength

[Definition:]  minlength is the minimum number of units of length, where units of length varies depending on the basetype. The value of minlength must be a positive-integer (§3.3.15).

For subtypes of string (§3.2.1), minlength is measured in units of characters. For subtypes of binary (§3.2.9), minlength is measured in bits.

Constraint on Schemas: length and minlength
It is an error for both length and minlength to be specified for the same datatype.

2.5.2.3 maxlength

[Definition:]  maxlength is the maximum number of units of length, where units of length varies depending on the basetype. The value of maxlength must be a positive-integer (§3.3.15).

For subtypes of string (§3.2.1), maxlength is measured in units of characters. For subtypes of binary (§3.2.9), maxlength is measured in bits.

Constraint on Schemas: length and maxlength
It is an error for both length and maxlength to be specified for the same datatype.

2.5.2.4 pattern

[Definition:]   For subtypes of string (§3.2.1), pattern can be used to constrain the allowable values using Regular Expressions (§E). For subtypes of the date and time related types (timeInstant (§3.2.6), timeDuration (§3.2.7), recurringInstant (§3.2.8), date (§3.3.18) and time (§3.3.19)), pattern can be used to constrain the allowable values using IS0 8601 "pictures" (ISO 8601 Conventions (§D.1)).

2.5.2.5 enumeration

[Definition:]   enumeration constrains the value space of the datatype to the specified list. No order or any other relationship is implied between the elements of the enumeration list.

enumeration can be applied to all datatypes exception for the following: boolean (§3.2.2) and binary (§3.2.9).

2.5.2.6 maxInclusive

[Definition:]   maxInclusive is the upper bound of the value space for a datatype with the ordered property. The value is inclusive in the sense that the value is itself included in the value space. The value of maxInclusive must be of the same type as the basetype.

2.5.2.7 maxExclusive

[Definition:]   maxExclusive is the upper bound of the value space for a datatype with the ordered property. The value is exclusive in the sense that the value is itself excluded from the value space. The value of maxExclusive must be of the same type as the basetype.

Constraint on Schemas: maxInclusive and maxExclusive
It is an error for both maxInclusive and maxExclusive to be specified for the same datatype.

2.5.2.8 minInclusive

[Definition:]   minInclusive is the lower bound of the value space for a datatype with the ordered property. The value is inclusive in the sense that the value is itself included in the value space. The value of minInclusive must be of the same type as the basetype.

2.5.2.9 minExclusive

[Definition:]   minExclusive is the lower bound of the value space for a datatype with the ordered property. The value is exclusive in the sense that the value is itself excluded from the value space for the datatype. The value of minExclusive must be of the same type as the basetype.

Constraint on Schemas: minInclusive and minExclusive
It is an error for both minInclusive and minExclusive to be specified for the same datatype.

2.5.2.10 precision

[Definition:]  precision is the total number of decimal digits in values of subtypes of decimal (§3.2.5). The value of precision must be a positive-integer (§3.3.15).

2.5.2.11 scale

[Definition:]  scale is the total number of decimal digits to the right of the decimal point in values of subtypes of decimal (§3.2.5). The value of scale must be a positive-integer (§3.3.15) .

Constraint on Schemas: scale less or equal to precision
It is an error for scale to be greater than precision.

2.5.2.12 encoding

[Definition:]  encoding is the encoded form of the lexical space of binary (§3.2.9). The value of encoding must be one of {hex, base64} [RFC 2045].

2.5.2.13 period

[Definition:]  period is the frequency of recurrence for values of subtypes of recurringInstant (§3.2.8). The value of period must be timeDuration (§3.2.7).

3 Built-in datatypes

3.1 Namespace considerations

The built-in datatypes defined by this specification are designed so that systems other than the XML Schema Definition Language may use them. To facilitate such usage, the built-in datatypes in this specification come from the XML Datatype Language namespace, the specific namespace defined by this specification. This applies to both built-in primitive and built-in generated datatypes.

Ed. Note: The exact URIs for the namespace(s) defined by this W3C specification is still an open issue. This issue has been raised with the XML Coordination Group (issue 1999-0201-07 Standardizing W3C namespace URIs) for general coordination and resolution. On August 11, Dan Connolly recommended we make up our own URI for datatypes. See http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/1999Aug/0060.html (Member only).

Each user-generated datatype is also associated with a unique namespace. However, user-generated datatypes do not come from the XML Datatype Language namespace; rather, they come from the namespace of the schema in which they are defined Association of components with a target namespace in [XML Schema Part 1: Structures].

As described in more detail in Defining Generated Datatypes (§4), each user-generated datatype must be defined in terms of another datatype, by assigning facets which serve to constrain the value set of the user-generated datatype to a subset of the basetype.

3.2 Primitive datatypes

The primitive datatypes defined by this specification are described below. For each datatype, the value space and lexical space are specified, all constraining facets which apply to the datatype are enumerated and subtype, if any, defined by this specification are listed.

primitive datatypes can only be added by revisions to this specification.

3.2.1 string

[Definition:]  The string datatype represents character strings in XML. The value space of string is the set of finite sequences of UCS characters ([ISO 10646] and [Unicode]). A UCS character (or just character, for short) is an atomic unit of communication; it is not further specified except to note that every UCS character has a corresponding UCS code point, which is an integer. The ordered property of string is the [Unicode] character number sequence.

Ed. Note: We need to harmonize this definition with the I18N character model.
3.2.1.1 Constraining facets of string

string has the following constraining facets:

3.2.1.2 Subtypes of string

string has the following subtypes:

3.2.2 boolean

[Definition:]  boolean has the value space required to support the mathematical concept of binary-valued logic: {true, false}.

3.2.2.1 Lexical Representation

An instance of a datatype that is defined as boolean can have the following legal lexical values {true, false}.

3.2.3 float

[Definition:]  float corresponds to the IEEE single-precision 32-bit floating point type [IEEE 754-1985]. The basic value space of float consists of the values m × 2^e, where m is an integer (§3.3.13) whose absolute value is less than 2^24, and e is an integer (§3.3.13) between -149 and 104, inclusive. In addition to the basic value space described above, the value space of float also contains the following special values: positive and negative zero, positive negative infinity and not-a-number.

The mapping from a literal in the lexical space to a value in the value space of float follows IEEE round to nearest behavior [IEEE 754-1985]. For further information on mapping literals to values in the value space, see [Clinger, WD (1990)].

3.2.3.1 Lexical representation

float values have a single standard lexical representation consisting of a mantissa followed, optionally, by the character "E" followed by an exponent. The exponent must be an integer. The mantissa must be a decimal number. The representations for exponent and mantissa must follow the default lexical rules for integer (§3.3.13) and decimal (§3.2.5). If the "E" and the the following exponent are omitted, an exponent value of 1 is assumed.

The specical values positive and negative zero, positive and negative infinity and not-a-number have 0, -0, INF, -INF and NAN, respectively.

For example, -1E4, 1267.43233E12, 12.78E-2, 12 and INF are all legal literals for float.

3.2.3.2 Constraining facets of float

float has the following constraining facets:

3.2.4 double

[Definition:]  The double datatype corresponds to IEEE double-precision 64-bit floating point type [IEEE 754-1985]. The basic value space of double consists of the values m × 2^e, where m is an integer (§3.3.13) whose absolute value is less than 2^53, and e is an integer (§3.3.13) between -1075 and 970, inclusive. In addition to the basic value space described above, the value space of double also contains the following special values: positive and negative zero, positive negative infinity and not-a-number.

The mapping from a literal in the lexical space to a value in the value space of double follows IEEE round to nearest behavior [IEEE 754-1985]. For further information on mapping literals to values in the value space, see [Clinger, WD (1990)].

3.2.4.1 Lexical representation

double values have a single standard lexical representation consisting of a mantissa followed, optionally, by the character "E" followed by an exponent. The exponent must be an integer. The mantissa must be a decimal number. The representations for exponent and mantissa must follow the default lexical rules for integer and decimal numbers discussed above. If the "E" and the the following exponent are omitted, an exponent value of 1 is assumed.

The specical values positive and negative zero, positive and negative infinity and not-a-number have 0, -0, INF, -INF and NAN, respectively.

For example, -1E4, 1267.43233E12, 12.78E-2, 12 and INF are all legal literals for double.

3.2.4.2 Constraining facets of double

double has the following constraining facets:

3.2.5 decimal

[Definition:]  decimal represents arbitrary precision decimal numbers. The value space of decimal consists of the values i × 10^n, where i is an integer (§3.3.13) and n is an integer (§3.3.13).

3.2.5.1 Lexical representation

decimal has a single standard lexical representation. This consists of a finite sequence of decimal digits separated by a period as a decimal indicator, in accordance with the scale and precision facets, with an optional leading sign. If the sign is omitted, "+" is assumed. Leading and trailing zeroes are optional. For example: -1.23, 12678967.543233, +100000.00.

3.2.5.2 Constraining facets of decimal

decimal has the following constraining facets:

3.2.5.3 Subtypes of decimal

decimal has the following subtypes:

3.2.6 timeInstant

[Definition:]  timeInstant represents a combination of date and time values representing a single instant in time. The value space of timeInstant is the space of Gregorian dates and legal time values as defined in § 5.4 of [ISO 8601].

3.2.6.1 Lexical Representation

A single lexical representation, which is a subset of the lexical representations allowed by [ISO 8601], is allowed for timeInstant. This lexical representation is the [ISO 8601] extended format CCYY-MM-DDThh:mm:ss.sss where "CC" represents the century, "YY" the year, "MM" the month and "DD" the day, preceded by an optional leading sign to indicate a negative number. If the sign is omitted, "+" is assumed. The letter "T" is the date/time separator and "hh", "mm", "ss.sss" represent hour, minute and second respectively. Additional digits can be used to increase the precision of fractional seconds if desired. To accomodate year values greater than 9999 additional digits can be added to the left of this representation.

This representation can be immediately followed by a "Z" to indicate Coordinated Universal Time. To indicate the time zone, i.e. the difference between the local time and Coordinated Universal Time, the difference immediately follows the time and consists of a sign, + or -, followed by hh:mm. See also ISO 8601 Date and Time Formats (§D).

For example, to indicate 1:20 pm on May the 31st, 1999 for Eastern Standard Time which is 5 hours behind Coordinated Universal Time, one would write: 1999-05-31T13:20:00-05:00.

3.2.6.2 Constraining facets of timeInstant

timeInstant has the following constraining facets:

3.2.7 timeDuration

[Definition:]  timeDuration represents a duration of time. The value space of timeDuration is the space of time durations as defined in § 5.5.3.2 of [ISO 8601].

3.2.7.1 Lexical Representation

A single lexical representation, conforming to a subset of the representations allowed by [ISO 8601], is allowed for timeDuration. This lexical representation is the [ISO 8601] extended format PnYnMnDTnHnMnnS, where Y represents the number of years, M the number of months, D the number of days, T is the date/time separator, H the number of hours, M the number of minutes and S the number of seconds. The number of seconds can include decimal digits to arbitrary precision. An optional preceding minus sign is allowed to indicate a negative duration. If the sign is omitted a positive duration is indicated. See also ISO 8601 Date and Time Formats (§D).

For example, to indicate a duration of 1 year, 2 months, 3 days, 10 hours, and 30 minutes, one would write: 1Y2M3DT10H30M.

Right truncated forms of the above representation are allowed. For example, P1347Y and P1347M are both allowed; P0Y1347M is also allowed. P0Y1347M0D is not allowed and P-1347M is not allowed although -P1347M is allowed.

Time periods, i.e. specific durations of time, can be represented by supplying two items of information: a start instant and a duration or a start instant and an end instant or an end instant and a duration.

3.2.7.2 Constraining facets of timeDuration

timeDuration also has the following constraining facets:

3.2.8 recurringInstant

[Definition:]  recurringInstant represents an instant of time that recurs with a specific timeDuration (§3.2.7).

Note that we do not attempt to support general recurring instants of time, just those that needed to support date (§3.3.18) and time (§3.3.19) and those that arise from truncated and reduced lexical representations of timeInstant (§3.2.6). See also ISO 8601 Date and Time Formats (§D).

3.2.8.1 Lexical Representation

The lexical representation for recurringInstant is the left truncated [ISO 8601] representation for timeInstant (§3.2.6). For example, if the century "CC" is omitted from the timeInstant representation it means a timeInstant that recurs every hundred years. Similarly, if "CCYY" is omitted it designates a time instant that recurs every year.

Every two character "unit" of the representation that is omitted is indicated by a single hyphen "-". For example, to indicate 1:20 pm on May the 31st every year, one would write write: --05-31T13:20:00-05:00.

3.2.8.2 Constraining facets of recurringInstant

recurringInstant has the following constraining facets:

3.2.8.3 Subtypes of recurringInstant

recurringInstant has the following subtypes:

3.2.9 binary

[Definition:]  binary represents binary data. The value space of binary is the set of finite sequences of binary bits.

3.2.9.1 Constraining facets of binary

binary has the following constraining facets:

3.2.10 uri

[Definition:]  uri represents a Uniform Resource Identifier (URI) Reference as defined in [RFC 2396].

3.2.10.1 Constraining facets of uri

uri has the following constraining facets:

3.3 Generated datatypes

This section gives conceptual definitions for all built-in generated datatypes defined by this specification. The abstract syntax used to define generated datatypes (whether built-in or user-generated) is given in section Defining Generated Datatypes (§4) and the complete definitions of the built-in generated datatypes (written in the concrete syntax based on that abstract syntax given in Appendix Schema for Datatype Definitions (normative) (§A)) are provided in Appendix Schema for Datatype Definitions (normative) (§A).

3.3.1 language

[Definition:]  language represents natural language identifiers as defined by [RFC 1766]. The value space of language is the set of all strings that match the LanguageID production in [XML 1.0 Recommendation]. The lexical space of language is the set of all strings that match the LanguageID production in [XML 1.0 Recommendation]. The basetype of language is string (§3.2.1).

3.3.1.1 Constraining facets of language

language has the following constraining facets:

3.3.2 NMTOKEN

[Definition:]  NMTOKEN represents the NMTOKEN attribute type from [XML 1.0 Recommendation]. The value space of NMTOKEN is the set of all strings that match the Nmtoken production in [XML 1.0 Recommendation]. The lexical space of NMTOKEN is the set of all strings that match the Nmtoken production in [XML 1.0 Recommendation]. The basetype of NMTOKEN is NMTOKENS (§3.3.3).

For compatibility (see Terminology (§1.4)) NMTOKEN should be used only on attributes.

3.3.2.1 Constraining facets of NMTOKEN

NMTOKEN has the following constraining facets:

3.3.2.2 Subtypes of NMTOKEN

NMTOKEN has the following subtypes:

3.3.3 NMTOKENS

[Definition:]  NMTOKENS represents the NMTOKENS attribute type from [XML 1.0 Recommendation]. It consists of a whitepsace-separated list of NMTOKENs. The value space of NMTOKENS is the set of all strings that match the Nmtokens production in [XML 1.0 Recommendation]. The lexical space of ID is the set of all strings that match the Nmtokens production in [XML 1.0 Recommendation]. The basetype of NMTOKENS is string (§3.2.1).

For compatibility (see Terminology (§1.4)) NMTOKENS should be used only on attributes.

3.3.3.1 Constraining facets of NMTOKENS

NMTOKENS has the following constraining facets:

3.3.3.2 Subtypes of NMTOKENS

NMTOKENS has the following subtypes:

3.3.4 Name

[Definition:]  Name represents XML Names. The value space of Name the set of all strings which match the Name production of [XML 1.0 Recommendation]. The lexical space of Name is the set of all strings which match the Name production of [XML 1.0 Recommendation]. The basetype of Name is NMTOKEN (§3.3.2).

3.3.4.1 Constraining facets of Name

Name has the following constraining facets:

3.3.4.2 Subtypes of Name

Name has the following subtypes:

3.3.5 QName

[Definition:]  QName represents XML qualified names. The value space of QName is the set of all strings which match the QName production of [Namespaces in XML]. The lexical space of QName is the set of all strings which match the QName production of [Namespaces in XML]. The basetype of QName is Name (§3.3.4).

3.3.5.1 Constraining facets of QName

QName has the following constraining facets:

3.3.6 NCName

[Definition:]  NCName represents XML "non-colonized" Names. The value space of NCName is the set of all strings which match the NCName production of [Namespaces in XML]. The lexical space of NCName is the set of all strings which match the NCName production of [Namespaces in XML]. The basetype of NCName is Name (§3.3.4).

3.3.6.1 Constraining facets of NCName

NCName has the following constraining facets:

3.3.6.2 Subtypes of NCName

NCName has the following subtypes:

3.3.7 ID

[Definition:]  ID represents the ID attribute type from [XML 1.0 Recommendation]. The value space of ID is the set of all strings that match the NCName production in [Namespaces in XML] and have been used in an XML document. The lexical space of ID is the set of all strings that match the Name production in [Namespaces in XML]. The basetype of ID is NCName (§3.3.6).

3.3.7.1 Constraining facets of ID

ID has the following constraining facets:

For compatibility (see Terminology (§1.4)) ID should be used only on attributes.

Schema-validity Constraint: ID Unique
An ID must not appear more than once in an XML document as a value of this type; i.e., ID values must uniquely identify the elements which bear them.

3.3.8 IDREF

[Definition:]  IDREF represents the IDREF attribute type from [XML 1.0 Recommendation]. The value space of IDREF is the set of all strings that match the NCName production in [Namespaces in XML] and have been used in an XML document as the value of an element or attribute of type ID. The lexical space of IDREF is the set of all strings that match the NCName production in [Namespaces in XML]. The basetype of IDREF is IDREFS (§3.3.9).

For compatibility (see Terminology (§1.4)) this datatype should be used only on attributes.

3.3.8.1 Constraining facets of IDREF

IDREF has the following constraining facets:

Schema-validity Constraint: IDREF
each Name must match the value of an ID (§3.3.7) in the XML document; i.e. IDREF values must match the value of some ID (§3.3.7).

3.3.9 IDREFS

[Definition:]  IDREFS represents the IDREFS attribute type from [XML 1.0 Recommendation]. It consists of a whitespace-separated list of IDREF (§3.3.8)s. The value space of IDREFS is the set of all strings that match the Names production in [XML 1.0 Recommendation] (modified as required by Conformance in [Namespaces in XML]) and have been used in an XML document as the value of an element or attribute of type ID. The lexical space of IDREFS is the set of all strings that match the Names production in [XML 1.0 Recommendation] (modified as required by Conformance in [Namespaces in XML]). The basetype of IDREFS is string (§3.2.1).

For compatibility (see Terminology (§1.4)) IDREFS should be used only on attributes.

3.3.9.1 Constraining facets of IDREFS

IDREFS has the following constraining facets:

3.3.9.2 Subtypes of IDREFS

IDREFS has the following subtypes:

3.3.10 ENTITY

[Definition:]  ENTITY represents the ENTITY attribute type from [XML 1.0 Recommendation]. The value space of ENTITY is the set of all strings that match the NCName production in [Namespaces in XML] and have been declared as an Unparsed Entity in a schema. The lexical space of ENTITY is the set of all strings that match the NCName production in [Namespaces in XML]. The basetype of ENTITY is ENTITIES (§3.3.11).

For compatibility (see Terminology (§1.4)) ENTITY should be used only on attributes.

3.3.10.1 Constraining facets of ENTITY

ENTITY has the following constraining facets:

3.3.11 ENTITIES

[Definition:]  ENTITIES represents the ENTITIES attribute type from [XML 1.0 Recommendation]. It consists of a whitespace-separated list of ENTITY (§3.3.10)s. The value space of ENTITIES is the set of all strings that match the Names production in [XML 1.0 Recommendation] (modified as required by Conformance in [Namespaces in XML]) and have been declared as an Unparsed Entity in a schema. The lexical space of ENTITIES is the set of all strings that match the Names production in [XML 1.0 Recommendation] (modified as required by Conformance in [Namespaces in XML]). The basetype of ENTITIES is string (§3.2.1).

For compatibility (see Terminology (§1.4)) ENTITIES should be used only on attributes.

3.3.11.1 Constraining facets of ENTITIES

ENTITIES has the following constraining facets:

3.3.11.2 Subtypes of ENTITIES

ENTITIES has the following subtypes:

3.3.12 NOTATION

[Definition:]  NOTATION represents the NOTATION attribute type from [XML 1.0 Recommendation] and allows the identification of the format of unparsed entities by name. The value space of NOTATION is the set of all notations declared in a schema. The lexical space of NOTATION is the set of all strings that match the NCName production in [Namespaces in XML]. The basetype of NOTATION is NCName (§3.3.6).

For compatibility (see Terminology (§1.4)) NOTATION should be used only on attributes.

3.3.12.1 Constraining facets of NOTATION

NOTATION has the following constraining facets:

3.3.13 integer

[Definition:]  integer is the standard mathematical concept of the integer numbers. The value space of integer is the infinite set {...,-2,-1,0,1,2,...} The basetype of integer is decimal (§3.2.5).

3.3.13.1 Lexical representation

integer values have a single, standard lexical representation. This consists of a string of digits with an optional leading sign. If the sign is omitted, "+" is assumed. For example: -1, 0, 12678967543233, +100000.

3.3.13.2 Constraining facets of integer

integer has the following constraining facets:

3.3.13.3 Subtypes of integer

integer has the following subtypes:

3.3.14 non-negative-integer

[Definition:]   non-negative-integer is the standard mathematical concept of the non-negative integers. The value space of non-negative-integer is the infinite set {0,1,2,...} . The basetype of non-negative-integer is integer (§3.3.13).

3.3.14.1 Lexical representation

non-negative-integer values have a single, standard lexical representation. This consists of a string of digits with an optional leading "+" sign. If the sign is omitted, "+" is assumed. For example: 1, 0, 12678967543233, +100000.

3.3.14.2 Constraining facets of non-negative-integer

non-negative-integer has the following constraining facets:

3.3.14.3 Subtypes of non-negative-integer

non-negative-integer has the following subtypes:

3.3.15 positive-integer

[Definition:]   positive-integer is the standard mathematical concept of the positive integers. The value space of positive-integer is the infinite set {1,2,...}. The basetype of positive-integer is non-negative-integer (§3.3.14).

3.3.15.1 Lexical representation

positive-integer values have a single, standard lexical representation. This consists of a string of digits with an optional leading "+" sign. For example: 1, 12678967543233, +100000.

3.3.15.2 Constraining facets of positive-integer

positive-integer has the following constraining facets:

3.3.16 non-positive-integer

[Definition:]   non-positive-integer is the standard mathematical concept of the non-positive integers. The value space of non-positive-integer is the infinite set {...,-2,-1,0}. The basetype of non-positive-integer is integer (§3.3.13).

3.3.16.1 Lexical representation

non-positive-integer values have a single, standard lexical representation. This consists of a string of digits with a leading "-" sign. For example: -1, 0, -12678967543233, -100000.

3.3.16.2 Constraining facets of non-positive-integer

non-positive-integer has the following constraining facets:

3.3.16.3 Subtypes of non-positive-integer

non-positive-integer has the following subtypes:

3.3.17 negative-integer

[Definition:]   negative-integer is the standard mathematical concept of the negative integers. The value space of negative-integer is the infinite set {...,-2,-1}. The basetype of negative-integer is non-positive-integer (§3.3.16).

3.3.17.1 Lexical representation

negative-integer values have a single, standard lexical representation. This consists of a string of digits with a leading "-" sign. For example: -1, -12678967543233, -100000.

3.3.17.2 Constraining facets of negative integer

negative-integer has the following constraining facets:

3.3.18 date

[Definition:]  date represents a timeDuration (§3.2.7) that starts at midnight of a specified day and lasts for 24 hours. The value space of date is the set of Gregorian calendar dates as defined in § 5.2.1 of [ISO 8601]. The basetype of date is recurringInstant (§3.2.8).

3.3.18.1 Lexical Representation

The lexical representation for date is the reduced (right truncated) lexical representation for recurringInstant (§3.2.8): CCYY-MM-DD. To accomodate year values greater than 9999 additional digits can be added to the left of this representation. For example, to indicate May the 31st, 1999, one would write: 1999-05-31. See also ISO 8601 Date and Time Formats (§D).

Left truncated representations can be used to represent recurring dates. If the CC is omitted it signifies a date that occurs every century. If the YY is also omitted it signifies a date every year and so on. Every two character "unit" of the representation that is omitted is indicated by a single hyphen "-". For example, ---05 signifies the fifth day of every month.

Right truncated, or reduced precision, date representations can be used to represent a specific month (CCYY-MM), a specific year (CCYY), or a specific century (YY).

3.3.18.2 Constraining facets of date

date has the following constraining facets:

3.3.19 time

[Definition:]  time represents a recurring instant of time that recurs every day. The value space of time is the space of time of day values as defined in § 5.3 of [ISO 8601]. The basetype of time is recurringInstant (§3.2.8).

time can be considered to be a shorthand to designate a specific truncated representation for recurringInstant (§3.2.8).

3.3.19.1 Lexical Representation

The lexical representation for time is the left truncated lexical representation for timeInstant (§3.2.6): hh:mm:ss.sss. For example, to indicate 1:20 pm for Eastern Standard Time which is 5 hours behind Coordinated Universal Time, one would write: 13:20:00-05:00. See also ISO 8601 Date and Time Formats (§D).

3.3.19.2 Constraining facets of time

time has the following constraining facets:

4 Defining Generated Datatypes

A generated datatype can be defined from a primitive datatype (or another generated datatype) by adding optional constraining facets. For example, it may be useful to define a datatype called i4 (signed 4-byte integer) from the built-in datatype integer (§3.3.13) by supplying maxInclusive and minInclusive facets. In this case, i4 is the name of the new user-generated datatype, integer (§3.3.13) is its basetype and maxInclusive and minInclusive are the constraining facets.

Example
<datatype name="i4" source="integer">
	<minInclusive value='-2147483648'/>
	<maxInclusive value='2147483648'/>
</datatype>

This section defines the abstract syntax used for defining generated datatypes. This abstract syntax is used for defining both built-in generated and user-generated datatypes; the only difference between the built-in and user-generated datatypes being that the datatype definitions for built-in generated datatypes are included in the Schema for Datatype Definitions (normative) (§A) while the datatype definitions for user-generated datatypes appear in schemas written by users.

[Definition:]   An abstract syntax provides a formal specification of the information provided for each generated datatype definition. The abstract syntax is presented using a simplified BNF. Defined terms are to the left. Their components are to the right, with a small amount of meta-syntax: ()s for grouping, | to separate alternatives, ? for optionality, * and + for iteration.

[Definition:]  The concrete syntax for generated datatype definitions is the exact element and attribute names used in definitions.. The concrete syntax is a key feature of its proposed design. The concrete syntax is the form in which the schema language is used by datatype designers. Though its elements and attributes are often different from the terms of the abstract syntax bnf, the features and expressive power of the two are congruent.

We include a preliminary concrete syntax in this draft, via examples, as well as in Schema for Datatype Definitions (normative) (§A) (defined using the schema language of [XML Schema Part 1: Structures]) and DTD for Datatype Definitions (normative) (§B). The emphasis in this version has been to stay quite close to the abstract syntax.

Ed. Note: The abstract syntax proposed here (and hence, the concrete syntax) are preliminary, as they allow datatype definitions which are logically inconsistent (e.g., they allow numeric facets on non-numeric datatypes). This will be corrected in future drafts, as the XML Schema language comes to allow the specification of tighter constraints.
Ed. Note: This section needs more explanatory text describing the productions and their relationship to the conceptual framework described in sections Type System (§2) and Built-in datatypes (§3).
Datatype definitions
[1]   datatypeDefn   ::=    NCName basetype facets [ Constraint: Unique datatype definitions ]
[2]   basetype   ::=    datatypename
[3]   facets   ::=    ordered? unordered? [ Constraint: Appropriate facets ]

The following is the definition for a possible built-in generated datatype "currency". This datatype definition would appear in the schema which defines datatypes for XML Schemas and shows that a generated datatype can have the same value space as its basetype, which might mean that it is just an "alias" or "renaming" of basetype. In this case, the specification would probably also define some "semantics" for currency which went beyond those of decimal.

Example
<datatype name="currency" source="decimal"/>

Constraint on Schemas: Unique datatype definitions
The name of the datatype being defined must be unique among the datatypes defined in the containing schema.

Constraint on Schemas: Appropriate facets
If the value space of the basetype is ordered, then only ordered facets may appear in a datatype definition.

Datatype names
[4]   datatypename   ::=    builtinname | usergenname
[5]   builtinname   ::=   Name | QName | NCName |
ID | IDREF |IDREFS |
NMTOKEN | NMTOKENS |
ENTITY | ENTITIES |
string | uri |
timeInstant | timeDuration | recurringInstant
binary |
float | double | decimal |integer |
non-negative-integer | positive-integer |
non-positive-integer | negative-integer |
date | time | language
[6]   usergenname   ::=    datatypeRef
NOTE: The datatypename production above is not to be confused with that labeled datatypeName in [XML Schema Part 1: Structures].
Facets
[7]   ordered   ::=    bounds? numeric? dateTime?
[8]   unordered   ::=    pattern? enumeration? length? minlength? maxlength? encoding?
Ordered facets
[9]   bounds   ::=    (minInclusive | maxInclusive)? (minExclusive | maxExclusive)?
[10]   maxInclusive   ::=    literalValue [ Constraint: Literal type ]
[11]   minInclusive   ::=    literalValue [ Constraint: Literal type ]
[12]   minExclusive   ::=    literalValue [ Constraint: Literal type ]
[13]   maxExclusive   ::=    literalValue [ Constraint: Literal type ]

Constraint on Schemas: Literal type
The literal value give must be of the same type as the datatype as the basetype given in the datatype definition in which this facet appears.

Numeric facets
[14]   numeric   ::=    precision? scale?
[15]   precision   ::=    integerLiteral
[16]   scale   ::=    integerLiteral
dateTime facets
[17]   dateTime   ::=    period?
[18]   period   ::=    timeDurationLiteral
Example
The following is the definition of a user-generated datatype which could be used to represent monetary amounts, such as in a financial management application which does not have figures above $1M and only allow whole cents. 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 basetype in a manner specific to the basetype (different than specifying max/min values as before)
<datatype name="amount" source="decimal">
	<precision value='8'/>
	<scale value='2'/>
</datatype>
This type could just as well have been defined with the potential built-in generated type "currency" (defined above) as its basetype.
Unordered facets
[19]   length   ::=    integerLiteral
[20]   minlength   ::=    integerLiteral
[21]   maxlength   ::=    integerLiteral
[22]   enumeration   ::=    literal+
[23]   pattern   ::=    regularExpression | IS08601picture
[24]   encoding   ::=    'hex' | 'base64'
Example
The following example is a datatype definition for a user-generated datatype which limits the values of dates to the three US holidays enumerated. This datatype definition would appear in a schema authored by an "end-user" and shows how to define a datatype by enumerating the values in its value space. The enumerated values must be type-valid literals for the basetype.
<datatype name="holidays" source="date">
	<annotation>
		<info>some US holidays</info>
	</annotation>
	<enumeration value='--01-01'>
		<annotation>
			<info>New Year's day</info>
		</annotation>
	</enumeration>
	<enumeration value='--07-04'/>
		<annotation>
			<info>4th of July</info>
		</annotation>
	</enumeration>
	<enumeration value='--12-25'/>
		<annotation>
			<info>Christmas</info>
		</annotation>
	</enumeration>
</datatype>
Literals
[25]   literal   ::=    literalValue
[26]   literalValue   ::=    stringLiteral | numericLiteral | dateTimeLiteral | uriLiteral | languageLiteral
[27]   stringLiteral   ::=    (see string (§3.2.1))
[28]   uriLiteral   ::=    (see uri (§3.2.10))
[29]   languageLiteral   ::=    (see language (§3.3.1))
Numeric Literals
[30]   numericLiteral   ::=    floatLiteral | doubleLiteral | decimalLiteral | integerLiteral
[31]   floatLiteral   ::=    (mantissa exponent?) | NaN | INF | -INF
[32]   doubleLiteral   ::=    (mantissa exponent?) | NaN | INF | -INF
[33]   mantissa   ::=    decimalLiteral
[34]   exponent   ::=    ('E' | 'e') integerLiteral
[35]   decimalLiteral   ::=    (('+' | '-')? digit* '.' digit+)?)
[36]   integerLiteral   ::=    (('+' | '-')? digit+)
[37]   digit   ::=    '0' | '1' | '2' | '3' | '4' |
'5' | '6' | '7' | '8' | '9'
Date and Time Literals
[38]   dateTimeLiteral   ::=    timeInstantLiteral | timeDurationLiteral | recurringInstantLiteral | dateLiteral | timeLiteral
[39]   timeInstantLiteral   ::=    dateLiteral 'T' timeLiteral
[40]   timeDurationLiteral   ::=    ('-')? PnYnMnDTnHnMnS
[41]   recurringInstantLiteral   ::=    dateLiteral 'T' timeLiteral
[42]   dateLiteral   ::=    ('-')? CCYY-MM-DD
[43]   timeLiteral   ::=    hh:mm:ss (.sss)? timeZoneOffset?
[44]   timeZoneOffset   ::=    'Z' | (('+' | '-') hh:mm:ss (.sss)?)
Issue (definition-overriding): In some cases it may be desirable to specify datatype constraints in instance documents rather than in a schema. Should this be allowed? If the document does not have a schema then, clearly, the only possibility of adding datatype constraints is in the document instance. Even if the document has a schema the document instance may want to further restrict the content. For example, the schema may specify a value to be a string but the instance may want to impose a particular regex constraint on it. If we decide to allow datatype specification or specialization in instance document what syntax should be used? This needs to be coordinated with the structural schema editorial team.
Issue (non-positive-integer-literal): Do we need productions for the literals of non-negative-integer, positive-integer, non-positive-integer and negative-integer?

5 Conformance

Ed. Note: This section (both its abstract content and its concrete wording) has not yet garnered consensus among WG members.

The XML specification [XML 1.0 Recommendation] defines two levels of conformance. Well-formed documents conform to valid XML syntax but may or may not obey the constraints defined by a DTD. Valid XML documents conform to the structure laid down in a DTD. Thus, if a DTD defines an attribute as an ID (§3.3.7), instances of XML documents conforming to the DTD can only be valid if the values of such attributes are valid XML names and are unique in the document. By introducing additional datatypes to XML, this specification extends the notion of validity in the sense that values defined to have a certain datatype in the schema must conform to the lexical representations allowed for that datatype. Values that do not conform to the datatype defined for them in the schema raise a conformance error. As, for example, the appearance of a letter in a value defined as integer (§3.3.13). Similarly, for a value defined as a subtype of string (§3.2.1) with length equal to 5, a value of "ABC" would raise an error -- length too short -- as would a value of "abcdefgh" -- length too long.

For conformance it is not enough that the representation conform to a legal literal in the lexical space of the datatype; it must also represent a legal value in the value space. For example, the timeInstant (§3.2.6), timeDuration (§3.2.7), recurringInstant (§3.2.8), date (§3.3.18) and time (§3.3.19) values must conform to legal Gregorian dates and legal time values as specified in the descriptions of these datatypes.

user-generated datatypes are defined by giving values to certain constraining facets. For example, a subtype of integer (§3.3.13) within a certain range could be defined by giving values to maxInclusive and minInclusive facets. A switch on the datatypes processor could be used to turn validation off for these facets. This could be used by a processor that used the datatypes processor to eliminate validation of user-generated datatypes.

It also needs to be said that there are no expressions on datatypes; neither are there operations on datatypes.

If we decide to allow datatype specification or specialization in instance documents (see issue "definition-overriding" above) then validating XML processors should be able to validate the format of values in XML documents in these cases as well by using the datatypes processor.


A Schema for Datatype Definitions (normative)

<?xml version='1.0'?>
<!-- XML Schema schema for XML Schemas: Part 2: Datatypes -->
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 19991216//EN" "../WD-xmlschema-1-19991217/structures.dtd" >
<schema xmlns="<http://www.w3.org/1999/XMLSchema" targetNamespace="<http://www.w3.org/1999/XMLSchema" version="Id: datatypes.xsd,v 1.19 1999/12/17 10:33:15 ht Exp ">

  <type name="datatype" source="annotated" derivedBy="extension"
        abstract="true">
    <element ref="facet" minOccurs="0" maxOccurs="*"/>
    <attribute name="name" type="NCName" minOccurs="0">
      <annotation>
       <info>Will be restricted to required or forbidden</info>
      </annotation>
    </attribute>
    <attribute name="source" type="QName" minOccurs="1"/>
    <attribute name="final" type="derivationSet"/>
    <attribute name="abstract" type="boolean"/>
  </type>

  <type name="namedDatatype" source="datatype">
   <annotation>
    <info>This is for the top-level datatype element,
          as ref'ed in &lt;schema</info>
   </annotation>
   <attribute name="name" minOccurs="1">
    <annotation><info>Required at the top level</info></annotation>
   </attribute>   
  </type>

  <type name="anonDatatype" source="datatype">
   <annotation>
    <info>This is for the nested datatype element,
          as used in &lt;element</info>
   </annotation>
   <attribute name="name" maxOccurs="0">
    <annotation><info>Forbidden when nested</info></annotation>
   </attribute>   
  </type>

  <element name="datatype" equivClass="schemaTop" type="namedDatatype"/>

  <key name="datatype">
   <selector>schema/datatype</selector>
   <field>@name</field>
  </key>

  <type name="facet" source="annotated" derivedBy="extension">
    <attribute name="value" minOccurs="1"/>
  </type>

  <element name="facet" type="facet" abstract="true"/>

  <element name="minBound" abstract="true" equivClass="facet"/>

  <element name="minExclusive" equivClass="minBound"/>
  <element name="minInclusive" equivClass="minBound"/>

  <element name="maxBound" abstract="true" equivClass="facet"/>

  <element name="maxExclusive" equivClass="maxBound"/>
  <element name="maxInclusive" equivClass="maxBound"/>

  <type name="numFacet" source="facet" derivedBy="restriction">
   <attribute name="value" type="non-negative-integer"/>
  </type>

  <element name="precision" type="numFacet" equivClass="facet"/>
  <element name="scale" type="numFacet" equivClass="facet"/>

  <element name="length" type="numFacet" equivClass="facet"/>
  <element name="minlength" type="numFacet" equivClass="facet"/>
  <element name="maxlength" type="numFacet" equivClass="facet"/>

  <!-- the following datatype is used to limit the
       possible values for the encoding facet on
           the binary datatype -->
  <datatype name="encodings" source="NMTOKEN">
    <enumeration value="hex">
      <annotation>
        <info>each (8-bit) byte is encoded as a sequence
              of 2 hexidecimal digits</info>
      </annotation>
    </enumeration>
    <enumeration value="base64">
      <annotation>
        <info>value is encoded in Base64 as defined in the MIME RFC</info>
      </annotation>
    </enumeration>
  </datatype>

  <element name="encoding" equivClass="facet">
   <type source="facet" derivedBy="restriction">
    <attribute name="value" type="encodings"/>
   </type>
  </element>

  <element name="period" equivClass="facet">
   <type source="facet" derivedBy="restriction">
    <attribute name="value" type="timeDuration"/>
   </type>
  </element>

  <element name="enumeration" equivClass="facet"/>

  <element name="pattern" equivClass="facet"/>

<!-- built-in generated datatypes -->
<!-- only has a few for now, eventually needs to have all of them -->

  <datatype name="integer" source="decimal">
    <scale value="0"/>
  </datatype>
        
  <datatype name="non-negative-integer" source="integer">
    <minInclusive value="0"/>
  </datatype>

  <datatype name="positive-integer" source="non-negative-integer">
    <minInclusive value="1"/>
  </datatype>

  <datatype name="non-positive-integer" source="integer">
    <maxInclusive value="0"/>
  </datatype>

  <datatype name="negative-integer" source="non-positive-integer">
    <maxInclusive value="-1"/>
  </datatype>

  <datatype name="date" source="recurringInstant">
    <period value="000000T2400"/>
  </datatype>

  <datatype name="time" source="recurringInstant">
    <period value="000000T2400"/>
  </datatype>
 

	<datatype name="NMTOKENS" source="string">
		<pattern value="\c+(\s\c+)*">
			<annotation>
				<info source="http://www.w3.org/TR/REC-xml#NT-Nmtokens">
					pattern matches production 8 from the XML spec
				</info>
			</annotation>
		</pattern>
	</datatype>

	<datatype name="NMTOKEN" source="NMTOKENS">
		<pattern value="\c+">
			<annotation>
				<info source="http://www.w3.org/TR/REC-xml#NT-Nmtoken">
					pattern matches production 7 from the XML spec
				</info>
			</annotation>
		</pattern>
	</datatype>

	<datatype name="Name" source="NMTOKEN">
		<pattern value="\i\c*">
			<annotation>
				<info source="http://www.w3.org/TR/REC-xml#NT-Name">
					pattern matches production 5 from the XML spec
				</info>
			</annotation>
		</pattern>
	</datatype>

	<datatype name="ID" source="NCName">
		<annotation>
			<info source="http://www.w3.org/TR/REC-xml#id">
				values of this datatype must be unique within
				a document
			</info>
		</annotation>
	</datatype>

	<datatype name="IDREFS" source="string">
		<pattern value="[\i-[:]][\c-[:]]*(\s[\i-[:]][\c-[:]]*)*">
			<annotation>
				<info source="http://www.w3.org/TR/REC-xml#NT-Names">
     			pattern matches production 6 from the XML spec
     			(modified as required by the
     			Conformance section in
     			Namespaces in XML
                        (http://www.w3.org/TR/REC-xml-names#conformance))
				</info>
				<info source="http://www.w3.org/TR/REC-xml#idref">
					values of this datatype must have occured within
					a document as the value of some component
					of type ID
				</info>
			</annotation>
		</pattern>
	</datatype>

	<datatype name="IDREF" source="IDREFS">
		<pattern value="[\i-[:]][\c-[:]]*">
			<annotation>
				<info source="http://www.w3.org/TR/REC-xml-names#NT-NCName">
					pattern matches production 4 from the Namespaces in XML spec
				</info>
				<info source="http://www.w3.org/TR/REC-xml#idref">
					values of this datatype must have occured within
					a document as the value of some component
					of type ID
				</info>
			</annotation>
		</pattern>
	</datatype>


	<datatype name="ENTITIES" source="string">
		<pattern value="[\i-[:]][\c-[:]]*(\s[\i-[:]][\c-[:]]*)*">
			<annotation>
				<info source="http://www.w3.org/TR/REC-xml#NT-Names">
     			pattern matches production 6 from the XML spec
     			(modified as required by the
     			Conformance section in
     			Namespaces in XML
                        (http://www.w3.org/TR/REC-xml-names#conformance))
				</info>
				<info source="http://www.w3.org/TR/REC-xml#entname">
					values of this datatype must match the name of
					an unparsed entity declared in the schema
				</info>
			</annotation>
		</pattern>
	</datatype>

	<datatype name="ENTITY" source="ENTITIES">
		<pattern value="[\i-[:]][\c-[:]]*">
			<annotation>
				<info source="http://www.w3.org/TR/REC-xml-names#NT-NCName">
					pattern matches production 4 from the Namespaces in XML spec
				</info>
				<info source="http://www.w3.org/TR/REC-xml#entname">
					values of this datatype must match the name of
					an unparsed entity declared in the schema
				</info>
			</annotation>
		</pattern>
	</datatype>

	<datatype name="NCName" source="Name">
		<pattern value="[\i-[:]][\c-[:]]*">
			<annotation>
				<info source="http://www.w3.org/TR/REC-xml-names/#NT-NCName">
					pattern matches production 4 from the
					Namespaces in	XML spec
				</info>
			</annotation>
		</pattern>
	</datatype>

	<datatype name="QName" source="Name">
		<pattern value="([\i-[:]][\c-[:]]*:)?[\i-[:]][\c-[:]]*">
			<annotation>
				<info source="http://www.w3.org/TR/REC-xml-names/#NT-QName">
					pattern matches production 6 from the
					Namespaces in XML spec
				</info>
			</annotation>
		</pattern>
	</datatype>

</schema>

B DTD for Datatype Definitions (normative)

<!-- DTD for XML Schemas: Part 2: Datatypes -->
<!-- Id: datatypes.dtd,v 1.16 1999/12/10 17:48:39 ht Exp  -->
<!ENTITY % p ''> <!-- can be overriden in the internal subset of a
                      schema document to establish a namespace prefix -->

<!-- Define all the element names, with optional prefix -->
<!ENTITY % datatype "%p;datatype">
<!ENTITY % maxExclusive "%p;maxExclusive">
<!ENTITY % minExclusive "%p;minExclusive">
<!ENTITY % maxInclusive "%p;maxInclusive">
<!ENTITY % minInclusive "%p;minInclusive">
<!ENTITY % precision "%p;precision">
<!ENTITY % scale "%p;scale">
<!ENTITY % length "%p;length">
<!ENTITY % minlength "%p;minlength">
<!ENTITY % maxlength "%p;maxlength">
<!ENTITY % enumeration "%p;enumeration">
<!ENTITY % pattern "%p;pattern">
<!ENTITY % encoding "%p;encoding">
<!ENTITY % period "%p;period">

<!-- annotation elements -->
<!ENTITY % annotation "%p;annotation">
<!ENTITY % appinfo "%p;appinfo">
<!ENTITY % info "%p;info">


<!-- Define some entities for informative use as attribute types -->
<!ENTITY % URI "CDATA">
<!ENTITY % URIList "CDATA">
<!ENTITY % QName "CDATA">
<!ENTITY % NCName "NMTOKEN">
<!ENTITY % non-negative-integer "NMTOKEN">
<!ENTITY % boolean "(true|false)">
<!ENTITY % derivationChoice "(restriction|extension)">
<!ENTITY % derivationSet "CDATA">
      <!-- #all or space-separated list drawn from derivationChoice -->
<!ENTITY % exactSet "CDATA">
      <!-- #all or space-separated list drawn from
                                        derivationChoice + 'equivClass' -->

<!-- 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,
     precision, scale,
     length, maxlength, minlength, encoding, period within datatype,
     and the min- and max- variants of Inclusive and Exclusive are
     mutually exclusive.
     On the other hand,  pattern and enumeration may repeat -->
<!ENTITY % minBound '(%minInclusive; | %minExclusive;)'>
<!ENTITY % maxBound '(%maxInclusive; | %maxExclusive;)'>
<!ENTITY % bounds '%minBound; | %maxBound;'>
<!ENTITY % numeric '%precision; | %scale;'>
<!ENTITY % ordered '%bounds; | %numeric;'>
<!ENTITY % unordered
   '%pattern; | %enumeration; | %length; | %maxlength; | %minlength;
    | %encoding; | %period;'>
<!ENTITY % facet '%ordered; | %unordered;'>
<!ENTITY % facetAttr 'value CDATA #REQUIRED'>
<!ENTITY % facetModel '(%annotation;)?'>
<!ELEMENT %datatype; ((%annotation;)?,(%facet;)*)>
<!ATTLIST %datatype;
    name     %NCName;        #IMPLIED
    source   %QName;         #REQUIRED
    final    %derivationSet; ''
    abstract %boolean;       'false'>
<!-- name is required at top level -->

<!ELEMENT %maxExclusive; %facetModel;>
<!ATTLIST %maxExclusive; %facetAttr;>
<!ELEMENT %minExclusive; %facetModel;>
<!ATTLIST %minExclusive; %facetAttr;>

<!ELEMENT %maxInclusive; %facetModel;>
<!ATTLIST %maxInclusive; %facetAttr;>
<!ELEMENT %minInclusive; %facetModel;>
<!ATTLIST %minInclusive; %facetAttr;>

<!ELEMENT %precision; %facetModel;>
<!ATTLIST %precision; %facetAttr;>
<!ELEMENT %scale; %facetModel;>
<!ATTLIST %scale; %facetAttr;>

<!ELEMENT %length; %facetModel;>
<!ATTLIST %length; %facetAttr;>
<!ELEMENT %minlength; %facetModel;>
<!ATTLIST %minlength; %facetAttr;>
<!ELEMENT %maxlength; %facetModel;>
<!ATTLIST %maxlength; %facetAttr;>

<!-- This one can be repeated -->
<!ELEMENT %enumeration; %facetModel;>
<!ATTLIST %enumeration; %facetAttr;>

<!-- This one can be repeated -->
<!ELEMENT %pattern; %facetModel;>
<!ATTLIST %pattern; %facetAttr;>

<!ELEMENT %encoding; %facetModel;>
<!ATTLIST %encoding; %facetAttr;>
<!ELEMENT %period; %facetModel;>
<!ATTLIST %period; %facetAttr;>

<!-- Annotation is either application information or documentation -->
<!-- By having these here they are available for datatypes as well
     as all the structures elements -->

<!ELEMENT %annotation; (%appinfo; | %info;)*>

<!-- User must define annotation elements in internal subset for this
     to work -->
<!ELEMENT %appinfo; ANY>   <!-- too restrictive -->
<!ATTLIST %appinfo;
          source     %URI;      #IMPLIED>
<!ELEMENT %info; ANY>   <!-- too restrictive -->
<!ATTLIST %info;
          source     %URI;      #IMPLIED
          xml:lang   CDATA      #IMPLIED>

C Datatypes and Facets

Ed. Note: This section (both its abstract content and its concrete wording) has not yet garnered consensus among WG members.

C.1 Fundamental Facets

The following table shows the values of the fundamental facets for each built-in datatype.

Ed. Note: (PVB 1999-07-09) Some entries in this table might conflict with what it says elsewhere in this draft, as creating this table pointed out to me some problems with the way some of the fundamental facets are defined (not to mention any transcription errors on my part in creating the table).

We obviously need more introductory text here explaining this table to the reader

  Datatype ordered bounded cardinality exact and approximate numeric
Primitive string (§3.2.1) yes none countably infinite exact no
boolean (§3.2.2) no none finite exact no
float (§3.2.3) yes yes finite approximate? yes
double (§3.2.4) yes yes finite approximate? yes
decimal (§3.2.5) yes no countably infinite exact yes
timeInstant (§3.2.6) yes no countably infinite exact? no
timeDuration (§3.2.7) yes no countably infinite exact? no
recurringInstant (§3.2.8) yes no countably infinite exact? no
binary (§3.2.9) no no countable infinite exact no
uri (§3.2.10) no no countably infinite exact no
Generated
language (§3.3.1) no no countably infinite exact no
NMTOKEN (§3.3.2) no none countably infinite exact no
NMTOKENS (§3.3.3) no no countably infinite exact no
Name (§3.3.4) no no countably infinite exact no
QName (§3.3.5) no no countably infinite exact no
NCName (§3.3.6) no no countably infinite exact no
ID (§3.3.7) no no countably infinite exact no
IDREF (§3.3.8) no no countably infinite exact no
IDREFS (§3.3.9) no no countably infinite exact no
ENTITY (§3.3.10) no no countably infinite exact no
ENTITIES (§3.3.11) no no countably infinite exact no
NOTATION (§3.3.12) no no countably infinite exact no
integer (§3.3.13) yes no countably infinite exact yes
non-negative-integer (§3.3.14) yes yes countably infinite exact yes
positive-integer (§3.3.15) yes yes countably infinite exact yes
non-positive-integer (§3.3.16) yes yes countably infinite exact yes
negative-integer (§3.3.17) yes yes countably infinite exact yes
date (§3.3.18) yes no countably infinite exact no
time (§3.3.19) yes no countably infinite exact? no

C.2 Constraining Facets

The constraining facets are listed below with all the primitive and genrated datatypes that they apply to.

Ed. Note: Some entries in this table might conflict with what it says elsewhere in this draft, as creating this table pointed out to me some problems with the way some of the constraining facets and datatypes are defined (not to mention any transcription errors on my part in creating the table).

The constraining facet length applies to:

The constraining facet minlength applies to:

The constraining facet maxlength applies to:

The constraining facet pattern applies to:

The constraining facet enumeration applies to:

The constraining facet maxInclusive applies to:

The constraining facet maxExclusive applies to:

The constraining facet minInclusive applies to:

The constraining facet minExclusive applies to:

The constraining facet precision applies to:

The constraining facet scale applies to:

The constraining facet encoding applies to:

The constraining facet period applies to:

D ISO 8601 Date and Time Formats

Ed. Note: This section (both its abstract content and its concrete wording) has not yet garnered consensus among WG members.

D.1 ISO 8601 Conventions

Three primitive datatypes described above, timeInstant (§3.2.6), timeDuration (§3.2.7), and recurringInstant (§3.2.8), and two generated dataypes, date (§3.3.18) and time (§3.3.19) use lexical formats inspired by [ISO 8601]. This appendix provides more detail on the ISO formats and discusses some deviations from them for the datatypes we have defined.

[ISO 8601] "specifies the representation of dates in the Gregorian calendar and times and representations of periods of time". It should be pointed out that the datatypes described in this specification do not cover all the types of data covered by [ISO 8601], nor do they support all the lexical representations for those types of data. Specifically, we permit only a single lexical representation for each datatype.

[ISO 8601] lexical formats are described using "pictures" in which characters are used in place of digits. These characters have the following meanings:

  • C -- represents a digit used in the thousands and hundreds components, the "century" component, of the time element "year".
  • Y -- represents a digit used in the tens and units components of the time element "year".
  • M -- represents a digit used in the time element "month".
  • D -- represents a digit used in the time element "day".
  • h -- represents a digit used in the time element "hour".
  • m -- represents a digit used in the time element "minute".
  • s -- represents a digit used in the time element "second". In the formats described in this specification the whole number of seconds may be followed by decimal seconds to an arbitrary level of precision. This is represented in the picture by "ss.sss"

For all the information items indicated by the above characters, leading zeros are required where indicated.

In addition to the above, certain characters are used as designators and appear as themselves in lexical formats.

D.2 Truncated Formats

[ISO 8601] supports a variety of "truncated" formats in which some of the characters on the left of specific formats, such as, for example, the century, can be omitted. Truncated formats are, in general, not permitted for the datatypes defined in this specification with two exceptions. The recurringInstant (§3.2.8) datatype uses a truncated format for timeInstant (§3.2.6) to indicate recurring instants of time. In fact, only recurring instants that can be represented truncated representations of timeInstant (§3.2.6) are permitted.

Left truncated representations are also allowed for the date (§3.3.18) datatype and can be used to represent recurring dates i.e. the same date every century, every year or every month. Right truncated, or reduced precision, representations are also allowed for date (§3.3.18) and can be used to represent a specific month, a specific year, or a specific century.

D.3 Deviations from ISO 8601 Formats

D.3.1 Sign Allowed

An optional minus sign is allowed immediately preceding, without a space, the lexical representations for timeInstant (§3.2.6) and timeDuration (§3.2.7).

D.3.2 More Than 9999 Years

To accomodate year values greater than 9999, more than four digits are allowed in the year representations of timeInstant (§3.2.6), timeDuration (§3.2.7) and time (§3.3.19). This follows the [ISO 8601 Draft Revision].

E Regular Expressions

Ed. Note: This section (both its abstract content and its concrete wording) has not yet garnered consensus among WG members.

The following represents a summary of the Unicode regular expression support which has been proposed for pattern. The next draft of this specification will contain a full description of the proposal.

Concerning point #1: patterns match against the value space and not against the lexical space of string (§3.2.1)...

We (or maybe it's just me, I can't remember how extensively the PTF discussed this issue) are proposing that the value space of string (§3.2.1) be a normalized form of the lexical space, where normalization occurs as per the CharModel WD [8] (which amounts to Unicode Normalization Form C [9]).

Any comments appreciated. We are especially requesting input on alternate syntax for specifying character class subtraction (point #9 above). The sytnax proposed here is from [2] but its not ideal in our opinion.

F References

Ed. Note: This section (both its abstract content and its concrete wording) has not yet garnered consensus among WG members.

F.1 Normative

IEEE 754-1985
IEEE. IEEE Standard for Binary Floating-Point Arithmetic. See http://standards.ieee.org/reading/ieee/std_public/description/busarch/754-1985_desc.html
ISO 10646
ISO (International Organization for Standardization). ISO/IEC 10646-1993 (E). Information technology — Universal Multiple-Octet Coded Character Set (UCS) — Part 1: Architecture and Basic Multilingual Plane. [Geneva]: International Organization for Standardization, 1993 (plus amendments AM 1 through AM 7).
Namespaces in XML
World Wide Web Consortium. Namespaces in XML. Available at: http://www.w3.org/TR/REC-xml-names/
RFC 1766
H. Alvestrand, ed. RFC 1766: Tags for the Identification of Languages 1995. Available at: http://www.ietf.org/rfc/rfc1766.txt
RFC 2045
N. Freed and N. Borenstein. RFC 2045: Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies. 1996 Available at: http://www.ietf.org/rfc/rfc2045.txt
RFC 2396
Tim Berners-Lee, et. al. RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax.. 1998 Available at: http://www.ietf.org/rfc/rfc2396.txt
Unicode
The Unicode Consortium. The Unicode Standard, Version 2.0. Reading, Mass.: Addison-Wesley Developers Press, 1996.
Unicode Database
The Unicode Consortium. The Unicode Character Database. Available at: ftp://ftp.unicode.org/Public/3.0-Update/UnicodeCharacterDatabase-3.0.0.html
XML 1.0 Recommendation
World Wide Web Consortium. Extensible Markup Language (XML) 1.0. Available at: http://www.w3.org/TR/REC-xml
XML Schema Part 1: Structures
XML Schema Part 1: Structures. Available at: ../WD-xmlschema-1-19991217/structures.html
XML Schema Requirements
XML Schema Requirements. Available at: http://www.w3.org/TR/NOTE-xml-schema-req

F.2 Non-normative

Clinger, WD (1990)
William D Clinger. How to Read Floating Point Numbers Accurately. In Proceedings of the 1990 ACM Conference on Principles of Programming Languages, pages 92-101. Available at: ftp://ftp.ccs.neu.edu/pub/people/will/howtoread.ps
ISO 11404
ISO (International Organization for Standardization). Language-independent Datatypes. See http://www.iso.ch/cate/d19346.html
ISO 8601
ISO (International Organization for Standardization). Representations of dates and times, 1988-06-15. Available at: http://www.iso.ch/markete/8601.pdf
ISO 8601 Draft Revision
ISO (International Organization for Standardization). Representations of dates and times, draft revision, 1998.
Perl
The Perl Programming Language. See http://www.perl.com
Perl 5.6
The Perl Programming Language, Version 5.6. See http://www.perl.com/language/misc/ann58/index.html
RDF Schema
World Wide Web Consortium. RDF Schema Specification. Available at: http://www.w3.org/TR/PR-rdf-schema/
SQL
SQL Standard. See http://www.jcc.com/SQLPages/jccs_sql.htm
Unicode Regular Expression Guidelines
Mark Davis. Unicode Regular Expression Guidelines, 1988. Available at: http://www.unicode.org/unicode/reports/tr18/
XSL
World Wide Web Consortium. Extensible Stylesheet Language (XSL). Available at: http://www.w3.org/TR/WD-xsl/

G Acknowledgments (non-normative)

The editors acknowledge the members of the XML Schema Working Group, the members of other W3C Working Groups, and industry experts in other forums who have contributed directly or indirectly to the process or content of creating this document. The Working Group is particularly grateful to Lotu Development Corp. and IBM for providing teleconferencing facilities.

The current members of the XML Schema Working Group are:

Paula Angerstein, Vignette Corporation; David Beech, Oracle Corp.; Paul V. Biron, Health Level Seven; Allen Brown, Microsoft; Greg Bumgardner, Rogue Wave Software; Lee Buck, Extensibility; Dean Burson, Lotus Development Corporation; Peter Chen, Bootstrap Alliance and LSU; David Cleary, Progress Software; Dan Connolly, W3C (staff contact); Andrew Eisenberg, Progress Software; Rob Ellman, Calico Commerce; David Ezell, Hewlett Packard Company; David Fallside, IBM; Matthew Fuchs, Commerce One; Paul Grosso, ArborText, Inc.; Dave Hollander, CommerceNet (co-chair); Mary Holstege, Calico Commerce; Jane Hunter, Distributed Systems Technology Centre (DSTC Pty Ltd); Renato Iannella, Distributed Systems Technology Centre (DSTC Pty Ltd); Rick Jelliffe, Academia Sinica; Dianne Kennedy, Graphic Communications Association; Setrag Khoshafian, Technology Deployment International (TDI); Janet Koenig, Sun Microsystems; Ara Kullukian, Technology Deployment International (TDI); Andrew Layman, Microsoft; Dmitry Lenkov, Hewlett Packard Company; Eve Maler, ArborText, Inc.; Ashok Malhotra, IBM; Murray Maloney, Commerce One; John McCarthy, Lawrence Berkeley National Laboratory; Noah Mendelsohn, Lotus Development Corporation; Don Mullen, Extensibility; Murata Makoto, Xerox; Frank Olken, Lawrence Berkeley National Laboratory; Dave Peterson, Graphic Communications Association; Mark Reinhold, Sun Microsystems; Shriram Revankar, Xerox; Jonathan Robie, Software AG; Lew Shannon, NCR; C. M. Sperberg-McQueen, W3C (co-chair); Henry S. Thompson, University of Edinburgh; Matt Timmermans, Microstar; Jim Trezzo, Oracle Corp.; Steph Tryphonas, Microstar; Mark Tucker, Health Level Seven; Priscilla Walmsley, XMLSolutions; Aki Yoshida, SAP AG

The XML Schema Working Group has benefited in its work from the participation and contributions of a number of people not currently members of the Working Group, including in particular those named below. Affiliations given are those current at the time of their work with the WG.

Gabe Beged-Dov, Rogue Wave Software; George Feinberg, Object Design; Charles Frankston, Microsoft; Ernesto Guerrieri, Inso; Michael Hyman, Microsoft; Chris Olds, Wall Data; William Shea, Merrill Lynch; Ralph Swick, W3C; Tony Stewart, Rivcom

I Revisions from Previous Draft

  1. 1999-11-08: PVB: removed real datatype and all references to it
  2. 1999-11-08: PVB: added inital definitions for float and double datatypes. This initial definition is not intended to be complete, we need a more complete description of the round-to-nearest behavior of mapping literals into the value space (i.e., a more readable description of "best approximation" from the Clinger paper in the non-normative references section).
  3. 1999-11-08: PVB: corrected typos in the definitions of datatypes generated from integer to corrected identify the generated type
  4. 1999-11-08: PVB: added specref elements to all mentions of constraining facets
  5. 1999-11-08: PVB: added term elements to all mentions of a datatype name in the definition of that datatype
  6. 1999-11-12: PVB: changed lexical space of timeDuration to be more consistent with ISO 8601, nYnMnDTnHnMnS (minus the 'P' designator).
  7. 1999-11-12: PVB fixed productions for decimalLiteral to allow forms such as -.12 and -23.
  8. 19991122: AM: Added some more explanation to timeDuration format. Fixed Appendix D to reflect changes.
  9. 19991122: AM: Added "uncountable infinite and exact" value space to 2.4.1.3
  10. 19991122: AM: Removed issue "Better Reference Mechanisms".
  11. 19991122: AM: Added "collation sequence for strings is Unicode characater number".
  12. 19991122: AM: Added min/max facets to date/time dataypes.
  13. 19991122: AM: Removed issues on URI and binary datatypes.
  14. 19991122: AM: Added value space validation to conformance section.
  15. 19991122: AM: Added values space definitions to date/time datatypes.
  16. 1999-12-08: pvb: Added QName datatype
  17. 1999-12-08: pvb: changed language to be a subtype of string
  18. 1999-12-10: pvb: many small editorial changes for consistency
  19. 1999-12-10: pvb: Added pattern facet to all date/time types (should have been there all along)
  20. 1999-12-10: pvb: Added full list of facets and subtypes to each type definition
  21. 1999-12-10: pvb: replaced regex appendix with a brief summary of proposed Unicode support, complete proposal coming shortly
  22. 1999-12-10: pvb: moved some references from normative to non-normative
  23. 1999-12-10: pvb: changed concrete syntax for datatype defns to more closely match the structures draft: in particular, to allow annotations on the datatype element and all facet elements.
  24. 1999-12-15: pvb: added normaitive reference to RTC 2045 for def of base64
  25. 1999-12-15: pvb: many more small editorial changes, for consistency in style and presentation
  26. 1999-12-15: pvb: corrected small errors in table in appendix C.1, Fundamental facets
  27. 1999-12-15: pvb: filled out list of datatypes for each facet in appendix C.2, Constraining facets
  28. 1999-12-15: expanded abstract
  29. 1999-12-15: pvb: updated description of lexical space for float/double to include literals for +- inf, +- 0, nan.
  30. 1999-12-16: pvb: modified defns of ID, IDREF, IDREFS, ENTITY, ENTITIES and NOTATION to match NCName instead of Name as required by the Namespaces in XML spec
  31. 1999-12-16: pvb: fully specified value space for decimal

H Open Issues

definition-overriding
non-positive-integer-literal